]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td
Update ELF Tool Chain to upstream r3520
[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++1z">, InGroup<DeprecatedRegister>;
215 def ext_register_storage_class : ExtWarn<
216   "ISO C++1z 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_mips_interrupt_attribute : Warning<
263    "MIPS 'interrupt' attribute only applies to functions that have "
264    "%select{no parameters|a 'void' return type}0">,
265    InGroup<IgnoredAttributes>;
266 def warn_unused_parameter : Warning<"unused parameter %0">,
267   InGroup<UnusedParameter>, DefaultIgnore;
268 def warn_unused_variable : Warning<"unused variable %0">,
269   InGroup<UnusedVariable>, DefaultIgnore;
270 def warn_unused_local_typedef : Warning<
271   "unused %select{typedef|type alias}0 %1">,
272   InGroup<UnusedLocalTypedef>, DefaultIgnore;
273 def warn_unused_property_backing_ivar : 
274   Warning<"ivar %0 which backs the property is not "
275   "referenced in this property's accessor">,
276   InGroup<UnusedPropertyIvar>, DefaultIgnore;
277 def warn_unused_const_variable : Warning<"unused variable %0">,
278   InGroup<UnusedConstVariable>, DefaultIgnore;
279 def warn_unused_exception_param : Warning<"unused exception parameter %0">,
280   InGroup<UnusedExceptionParameter>, DefaultIgnore;
281 def warn_decl_in_param_list : Warning<
282   "declaration of %0 will not be visible outside of this function">,
283   InGroup<Visibility>;
284 def warn_redefinition_in_param_list : Warning<
285   "redefinition of %0 will not be visible outside of this function">,
286   InGroup<Visibility>;
287 def warn_empty_parens_are_function_decl : Warning<
288   "empty parentheses interpreted as a function declaration">,
289   InGroup<VexingParse>;
290 def warn_parens_disambiguated_as_function_declaration : Warning<
291   "parentheses were disambiguated as a function declaration">,
292   InGroup<VexingParse>;
293 def note_additional_parens_for_variable_declaration : Note<
294   "add a pair of parentheses to declare a variable">;
295 def note_empty_parens_function_call : Note<
296   "change this ',' to a ';' to call %0">;
297 def note_empty_parens_default_ctor : Note<
298   "remove parentheses to declare a variable">;
299 def note_empty_parens_zero_initialize : Note<
300   "replace parentheses with an initializer to declare a variable">;
301 def warn_unused_function : Warning<"unused function %0">,
302   InGroup<UnusedFunction>, DefaultIgnore;
303 def warn_unused_member_function : Warning<"unused member function %0">,
304   InGroup<UnusedMemberFunction>, DefaultIgnore;
305 def warn_used_but_marked_unused: Warning<"%0 was marked unused but was used">,
306   InGroup<UsedButMarkedUnused>, DefaultIgnore;
307 def warn_unneeded_internal_decl : Warning<
308   "%select{function|variable}0 %1 is not needed and will not be emitted">,
309   InGroup<UnneededInternalDecl>, DefaultIgnore;
310 def warn_unneeded_static_internal_decl : Warning<
311   "'static' function %0 declared in header file "
312   "should be declared 'static inline'">,
313   InGroup<UnneededInternalDecl>, DefaultIgnore;
314 def warn_unneeded_member_function : Warning<
315   "member function %0 is not needed and will not be emitted">,
316   InGroup<UnneededMemberFunction>, DefaultIgnore;
317 def warn_unused_private_field: Warning<"private field %0 is not used">,
318   InGroup<UnusedPrivateField>, DefaultIgnore;
319
320 def warn_parameter_size: Warning<
321   "%0 is a large (%1 bytes) pass-by-value argument; "
322   "pass it by reference instead ?">, InGroup<LargeByValueCopy>;
323 def warn_return_value_size: Warning<
324   "return value of %0 is a large (%1 bytes) pass-by-value object; "
325   "pass it by reference instead ?">, InGroup<LargeByValueCopy>;
326 def warn_return_value_udt: Warning<
327   "%0 has C-linkage specified, but returns user-defined type %1 which is "
328   "incompatible with C">, InGroup<ReturnTypeCLinkage>;
329 def warn_return_value_udt_incomplete: Warning<
330   "%0 has C-linkage specified, but returns incomplete type %1 which could be "
331   "incompatible with C">, InGroup<ReturnTypeCLinkage>;
332 def warn_implicit_function_decl : Warning<
333   "implicit declaration of function %0">,
334   InGroup<ImplicitFunctionDeclare>, DefaultIgnore;
335 def ext_implicit_function_decl : ExtWarn<
336   "implicit declaration of function %0 is invalid in C99">,
337   InGroup<ImplicitFunctionDeclare>;
338 def note_function_suggestion : Note<"did you mean %0?">;
339
340 def err_ellipsis_first_param : Error<
341   "ISO C requires a named parameter before '...'">;
342 def err_declarator_need_ident : Error<"declarator requires an identifier">;
343 def err_language_linkage_spec_unknown : Error<"unknown linkage language">;
344 def err_language_linkage_spec_not_ascii : Error<
345   "string literal in language linkage specifier cannot have an "
346   "encoding-prefix">;
347 def warn_use_out_of_scope_declaration : Warning<
348   "use of out-of-scope declaration of %0">;
349 def err_inline_non_function : Error<
350   "'inline' can only appear on functions%select{| and non-local variables}0">;
351 def err_noreturn_non_function : Error<
352   "'_Noreturn' can only appear on functions">;
353 def warn_qual_return_type : Warning< 
354   "'%0' type qualifier%s1 on return type %plural{1:has|:have}1 no effect">,
355   InGroup<IgnoredQualifiers>, DefaultIgnore;
356 def warn_deprecated_redundant_constexpr_static_def : Warning<
357   "out-of-line definition of constexpr static data member is redundant "
358   "in C++17 and is deprecated">,
359   InGroup<Deprecated>, DefaultIgnore;
360
361 def warn_decl_shadow :
362   Warning<"declaration shadows a %select{"
363           "local variable|"
364           "variable in %2|"
365           "static data member of %2|"
366           "field of %2}1">,
367   InGroup<Shadow>, DefaultIgnore;
368 def warn_decl_shadow_uncaptured_local :
369   Warning<warn_decl_shadow.Text>,
370   InGroup<ShadowUncapturedLocal>, DefaultIgnore;
371 def warn_ctor_parm_shadows_field:
372   Warning<"constructor parameter %0 shadows the field %1 of %2">,
373   InGroup<ShadowFieldInConstructor>, DefaultIgnore;
374 def warn_modifying_shadowing_decl :
375   Warning<"modifying constructor parameter %0 that shadows a "
376           "field of %1">,
377   InGroup<ShadowFieldInConstructorModified>, DefaultIgnore;
378
379 // C++ decomposition declarations
380 def err_decomp_decl_context : Error<
381   "decomposition declaration not permitted in this context">;
382 def warn_cxx14_compat_decomp_decl : Warning<
383   "decomposition declarations are incompatible with "
384   "C++ standards before C++1z">, DefaultIgnore, InGroup<CXXPre1zCompat>;
385 def ext_decomp_decl : ExtWarn<
386   "decomposition declarations are a C++1z extension">, InGroup<CXX1z>;
387 def err_decomp_decl_spec : Error<
388   "decomposition declaration cannot be declared "
389   "%plural{1:'%1'|:with '%1' specifiers}0">;
390 def err_decomp_decl_type : Error<
391   "decomposition declaration cannot be declared with type %0; "
392   "declared type must be 'auto' or reference to 'auto'">;
393 def err_decomp_decl_parens : Error<
394   "decomposition declaration cannot be declared with parentheses">;
395 def err_decomp_decl_template : Error<
396   "decomposition declaration template not supported">;
397 def err_decomp_decl_not_alone : Error<
398   "decomposition declaration must be the only declaration in its group">;
399 def err_decomp_decl_requires_init : Error<
400   "decomposition declaration %0 requires an initializer">;
401 def err_decomp_decl_wrong_number_bindings : Error<
402   "type %0 decomposes into %2 elements, but %select{only |}3%1 "
403   "names were provided">;
404 def err_decomp_decl_unbindable_type : Error<
405   "cannot decompose %select{union|non-class, non-array}1 type %2">;
406 def err_decomp_decl_multiple_bases_with_members : Error<
407   "cannot decompose class type %1: "
408   "%select{its base classes %2 and|both it and its base class}0 %3 "
409   "have non-static data members">;
410 def err_decomp_decl_ambiguous_base : Error<
411   "cannot decompose members of ambiguous base class %1 of %0:%2">;
412 def err_decomp_decl_non_public_base : Error<
413   "cannot decompose members of non-public base class %1 of %0">;
414 def err_decomp_decl_non_public_member : Error<
415   "cannot decompose non-public member %0 of %1">;
416 def err_decomp_decl_anon_union_member : Error<
417   "cannot decompose class type %0 because it has an anonymous "
418   "%select{struct|union}1 member">;
419 def err_decomp_decl_std_tuple_element_not_specialized : Error<
420   "cannot decompose this type; 'std::tuple_element<%0>::type' "
421   "does not name a type">;
422 def err_decomp_decl_std_tuple_size_not_constant : Error<
423   "cannot decompose this type; 'std::tuple_size<%0>::value' "
424   "is not a valid integral constant expression">;
425 def note_in_binding_decl_init : Note<
426   "in implicit initialization of binding declaration %0">;
427
428 def err_std_type_trait_not_class_template : Error<
429   "unsupported standard library implementation: "
430   "'std::%0' is not a class template">;
431
432 // C++ using declarations
433 def err_using_requires_qualname : Error<
434   "using declaration requires a qualified name">;
435 def err_using_typename_non_type : Error<
436   "'typename' keyword used on a non-type">;
437 def err_using_dependent_value_is_type : Error<
438   "dependent using declaration resolved to type without 'typename'">;
439 def err_using_decl_nested_name_specifier_is_not_class : Error<
440   "using declaration in class refers into '%0', which is not a class">;
441 def err_using_decl_nested_name_specifier_is_current_class : Error<
442   "using declaration refers to its own class">;
443 def err_using_decl_nested_name_specifier_is_not_base_class : Error<
444   "using declaration refers into '%0', which is not a base class of %1">;
445 def err_using_decl_constructor_not_in_direct_base : Error<
446   "%0 is not a direct base of %1, cannot inherit constructors">;
447 def err_using_decl_can_not_refer_to_class_member : Error<
448   "using declaration cannot refer to class member">;
449 def err_ambiguous_inherited_constructor : Error<
450   "constructor of %0 inherited from multiple base class subobjects">;
451 def note_ambiguous_inherited_constructor_using : Note<
452   "inherited from base class %0 here">;
453 def note_using_decl_class_member_workaround : Note<
454   "use %select{an alias declaration|a typedef declaration|a reference|"
455   "a const variable|a constexpr variable}0 instead">;
456 def err_using_decl_can_not_refer_to_namespace : Error<
457   "using declaration cannot refer to a namespace">;
458 def err_using_decl_can_not_refer_to_scoped_enum : Error<
459   "using declaration cannot refer to a scoped enumerator">;
460 def err_using_decl_constructor : Error<
461   "using declaration cannot refer to a constructor">;
462 def warn_cxx98_compat_using_decl_constructor : Warning<
463   "inheriting constructors are incompatible with C++98">,
464   InGroup<CXX98Compat>, DefaultIgnore;
465 def err_using_decl_destructor : Error<
466   "using declaration cannot refer to a destructor">;
467 def err_using_decl_template_id : Error<
468   "using declaration cannot refer to a template specialization">;
469 def note_using_decl_target : Note<"target of using declaration">;
470 def note_using_decl_conflict : Note<"conflicting declaration">;
471 def err_using_decl_redeclaration : Error<"redeclaration of using declaration">;
472 def err_using_decl_conflict : Error<
473   "target of using declaration conflicts with declaration already in scope">;
474 def err_using_decl_conflict_reverse : Error<
475   "declaration conflicts with target of using declaration already in scope">;
476 def note_using_decl : Note<"%select{|previous }0using declaration">;
477 def err_using_decl_redeclaration_expansion : Error<
478   "using declaration pack expansion at block scope produces multiple values">;
479
480 def warn_access_decl_deprecated : Warning<
481   "access declarations are deprecated; use using declarations instead">,
482   InGroup<Deprecated>;
483 def err_access_decl : Error<
484   "ISO C++11 does not allow access declarations; "
485   "use using declarations instead">;
486 def ext_dynamic_exception_spec : ExtWarn<
487   "ISO C++1z does not allow dynamic exception specifications">,
488   InGroup<DynamicExceptionSpec>, DefaultError;
489 def warn_exception_spec_deprecated : Warning<
490   "dynamic exception specifications are deprecated">,
491   InGroup<DeprecatedDynamicExceptionSpec>, DefaultIgnore;
492 def note_exception_spec_deprecated : Note<"use '%0' instead">;
493 def warn_deprecated_copy_operation : Warning<
494   "definition of implicit copy %select{constructor|assignment operator}1 "
495   "for %0 is deprecated because it has a user-declared "
496   "%select{copy %select{assignment operator|constructor}1|destructor}2">,
497   InGroup<Deprecated>, DefaultIgnore;
498 def warn_cxx1z_compat_exception_spec_in_signature : Warning<
499   "mangled name of %0 will change in C++17 due to non-throwing exception "
500   "specification in function signature">, InGroup<CXX1zCompat>;
501
502 def warn_global_constructor : Warning<
503   "declaration requires a global constructor">,
504   InGroup<GlobalConstructors>, DefaultIgnore;
505 def warn_global_destructor : Warning<
506   "declaration requires a global destructor">,
507    InGroup<GlobalConstructors>, DefaultIgnore;
508 def warn_exit_time_destructor : Warning<
509   "declaration requires an exit-time destructor">,
510   InGroup<ExitTimeDestructors>, DefaultIgnore;
511
512 def err_invalid_thread : Error<
513   "'%0' is only allowed on variable declarations">;
514 def err_thread_non_global : Error<
515   "'%0' variables must have global storage">;
516 def err_thread_unsupported : Error<
517   "thread-local storage is not supported for the current target">;
518
519 def warn_maybe_falloff_nonvoid_function : Warning<
520   "control may reach end of non-void function">,
521   InGroup<ReturnType>;
522 def warn_falloff_nonvoid_function : Warning<
523   "control reaches end of non-void function">,
524   InGroup<ReturnType>;
525 def err_maybe_falloff_nonvoid_block : Error<
526   "control may reach end of non-void block">;
527 def err_falloff_nonvoid_block : Error<
528   "control reaches end of non-void block">;
529 def warn_maybe_falloff_nonvoid_coroutine : Warning<
530   "control may reach end of non-void coroutine">,
531   InGroup<ReturnType>;
532 def warn_falloff_nonvoid_coroutine : Warning<
533   "control reaches end of non-void coroutine">,
534   InGroup<ReturnType>;
535 def warn_suggest_noreturn_function : Warning<
536   "%select{function|method}0 %1 could be declared with attribute 'noreturn'">,
537   InGroup<MissingNoreturn>, DefaultIgnore;
538 def warn_suggest_noreturn_block : Warning<
539   "block could be declared with attribute 'noreturn'">,
540   InGroup<MissingNoreturn>, DefaultIgnore;
541
542 // Unreachable code.
543 def warn_unreachable : Warning<
544   "code will never be executed">,
545   InGroup<UnreachableCode>, DefaultIgnore;
546 def warn_unreachable_break : Warning<
547   "'break' will never be executed">,
548   InGroup<UnreachableCodeBreak>, DefaultIgnore;
549 def warn_unreachable_return : Warning<
550   "'return' will never be executed">,
551   InGroup<UnreachableCodeReturn>, DefaultIgnore;
552 def warn_unreachable_loop_increment : Warning<
553   "loop will run at most once (loop increment never executed)">,
554   InGroup<UnreachableCodeLoopIncrement>, DefaultIgnore;
555 def note_unreachable_silence : Note<
556   "silence by adding parentheses to mark code as explicitly dead">;
557
558 /// Built-in functions.
559 def ext_implicit_lib_function_decl : ExtWarn<
560   "implicitly declaring library function '%0' with type %1">,
561   InGroup<ImplicitFunctionDeclare>;
562 def note_include_header_or_declare : Note<
563   "include the header <%0> or explicitly provide a declaration for '%1'">;
564 def note_previous_builtin_declaration : Note<"%0 is a builtin with type %1">;
565 def warn_implicit_decl_requires_sysheader : Warning<
566   "declaration of built-in function '%1' requires inclusion of the header <%0>">,
567   InGroup<BuiltinRequiresHeader>;
568 def warn_redecl_library_builtin : Warning<
569   "incompatible redeclaration of library function %0">,
570   InGroup<DiagGroup<"incompatible-library-redeclaration">>;
571 def err_builtin_definition : Error<"definition of builtin function %0">;
572 def err_arm_invalid_specialreg : Error<"invalid special register for builtin">;
573 def err_invalid_cpu_supports : Error<"invalid cpu feature string for builtin">;
574 def err_builtin_needs_feature : Error<"%0 needs target feature %1">;
575 def err_function_needs_feature
576     : Error<"always_inline function %1 requires target feature '%2', but would "
577             "be inlined into function %0 that is compiled without support for "
578             "'%2'">;
579 def warn_builtin_unknown : Warning<"use of unknown builtin %0">,
580   InGroup<ImplicitFunctionDeclare>, DefaultError;
581 def warn_dyn_class_memaccess : Warning<
582   "%select{destination for|source of|first operand of|second operand of}0 this "
583   "%1 call is a pointer to %select{|class containing a }2dynamic class %3; "
584   "vtable pointer will be %select{overwritten|copied|moved|compared}4">,
585   InGroup<DiagGroup<"dynamic-class-memaccess">>;
586 def note_bad_memaccess_silence : Note<
587   "explicitly cast the pointer to silence this warning">;
588 def warn_sizeof_pointer_expr_memaccess : Warning<
589   "'%0' call operates on objects of type %1 while the size is based on a " 
590   "different type %2">, 
591   InGroup<SizeofPointerMemaccess>;
592 def warn_sizeof_pointer_expr_memaccess_note : Note<
593   "did you mean to %select{dereference the argument to 'sizeof' (and multiply "
594   "it by the number of elements)|remove the addressof in the argument to "
595   "'sizeof' (and multiply it by the number of elements)|provide an explicit "
596   "length}0?">;
597 def warn_sizeof_pointer_type_memaccess : Warning<
598   "argument to 'sizeof' in %0 call is the same pointer type %1 as the "
599   "%select{destination|source}2; expected %3 or an explicit length">,
600   InGroup<SizeofPointerMemaccess>;
601 def warn_strlcpycat_wrong_size : Warning<
602   "size argument in %0 call appears to be size of the source; "
603   "expected the size of the destination">,
604   InGroup<DiagGroup<"strlcpy-strlcat-size">>;
605 def note_strlcpycat_wrong_size : Note<
606   "change size argument to be the size of the destination">;
607 def warn_memsize_comparison : Warning<
608   "size argument in %0 call is a comparison">,
609   InGroup<DiagGroup<"memsize-comparison">>;
610 def note_memsize_comparison_paren : Note<
611   "did you mean to compare the result of %0 instead?">;
612 def note_memsize_comparison_cast_silence : Note<
613   "explicitly cast the argument to size_t to silence this warning">;
614   
615 def warn_strncat_large_size : Warning<
616   "the value of the size argument in 'strncat' is too large, might lead to a " 
617   "buffer overflow">, InGroup<StrncatSize>;
618 def warn_strncat_src_size : Warning<"size argument in 'strncat' call appears " 
619   "to be size of the source">, InGroup<StrncatSize>;
620 def warn_strncat_wrong_size : Warning<
621   "the value of the size argument to 'strncat' is wrong">, InGroup<StrncatSize>;
622 def note_strncat_wrong_size : Note<
623   "change the argument to be the free space in the destination buffer minus " 
624   "the terminating null byte">;
625
626 def warn_assume_side_effects : Warning<
627   "the argument to %0 has side effects that will be discarded">,
628   InGroup<DiagGroup<"assume">>;
629
630 def warn_memcpy_chk_overflow : Warning<
631   "%0 will always overflow destination buffer">,
632   InGroup<DiagGroup<"builtin-memcpy-chk-size">>;
633
634 /// main()
635 // static main() is not an error in C, just in C++.
636 def warn_static_main : Warning<"'main' should not be declared static">,
637     InGroup<Main>;
638 def err_static_main : Error<"'main' is not allowed to be declared static">;
639 def err_inline_main : Error<"'main' is not allowed to be declared inline">;
640 def ext_variadic_main : ExtWarn<
641   "'main' is not allowed to be declared variadic">, InGroup<Main>;
642 def ext_noreturn_main : ExtWarn<
643   "'main' is not allowed to be declared _Noreturn">, InGroup<Main>;
644 def note_main_remove_noreturn : Note<"remove '_Noreturn'">;
645 def err_constexpr_main : Error<
646   "'main' is not allowed to be declared constexpr">;
647 def err_deleted_main : Error<"'main' is not allowed to be deleted">;
648 def err_mainlike_template_decl : Error<"%0 cannot be a template">;
649 def err_main_returns_nonint : Error<"'main' must return 'int'">;
650 def ext_main_returns_nonint : ExtWarn<"return type of 'main' is not 'int'">,
651     InGroup<MainReturnType>;
652 def note_main_change_return_type : Note<"change return type to 'int'">;
653 def err_main_surplus_args : Error<"too many parameters (%0) for 'main': "
654     "must be 0, 2, or 3">;
655 def warn_main_one_arg : Warning<"only one parameter on 'main' declaration">,
656     InGroup<Main>;
657 def err_main_arg_wrong : Error<"%select{first|second|third|fourth}0 "
658     "parameter of 'main' (%select{argument count|argument array|environment|"
659     "platform-specific data}0) must be of type %1">;
660 def warn_main_returns_bool_literal : Warning<"bool literal returned from "
661     "'main'">, InGroup<Main>;
662 def err_main_global_variable :
663     Error<"main cannot be declared as global variable">;
664 def warn_main_redefined : Warning<"variable named 'main' with external linkage "
665     "has undefined behavior">, InGroup<Main>;
666 def ext_main_used : Extension<
667   "ISO C++ does not allow 'main' to be used by a program">, InGroup<Main>;
668
669 /// parser diagnostics
670 def ext_no_declarators : ExtWarn<"declaration does not declare anything">,
671   InGroup<MissingDeclarations>;
672 def ext_typedef_without_a_name : ExtWarn<"typedef requires a name">,
673   InGroup<MissingDeclarations>;
674 def err_typedef_not_identifier : Error<"typedef name must be an identifier">;
675 def err_typedef_changes_linkage : Error<"unsupported: typedef changes linkage"
676   " of anonymous type, but linkage was already computed">;
677 def note_typedef_changes_linkage : Note<"use a tag name here to establish "
678   "linkage prior to definition">;
679 def err_statically_allocated_object : Error<
680   "interface type cannot be statically allocated">;
681 def err_object_cannot_be_passed_returned_by_value : Error<
682   "interface type %1 cannot be %select{returned|passed}0 by value"
683   "; did you forget * in %1?">;
684 def err_parameters_retval_cannot_have_fp16_type : Error<
685   "%select{parameters|function return value}0 cannot have __fp16 type; did you forget * ?">;
686 def err_opencl_half_load_store : Error<
687   "%select{loading directly from|assigning directly to}0 pointer to type %1 requires "
688   "cl_khr_fp16. Use vector data %select{load|store}0 builtin functions instead">;
689 def err_opencl_cast_to_half : Error<"casting to type %0 is not allowed">;
690 def err_opencl_half_declaration : Error<
691   "declaring variable of type %0 is not allowed">;
692 def err_opencl_half_param : Error<
693   "declaring function parameter of type %0 is not allowed; did you forget * ?">;
694 def err_opencl_invalid_return : Error<
695   "declaring function return value of type %0 is not allowed %select{; did you forget * ?|}1">;
696 def warn_enum_value_overflow : Warning<"overflow in enumeration value">;
697 def warn_pragma_options_align_reset_failed : Warning<
698   "#pragma options align=reset failed: %0">,
699   InGroup<IgnoredPragmas>;
700 def err_pragma_options_align_mac68k_target_unsupported : Error<
701   "mac68k alignment pragma is not supported on this target">;
702 def warn_pragma_pack_invalid_alignment : Warning<
703   "expected #pragma pack parameter to be '1', '2', '4', '8', or '16'">,
704   InGroup<IgnoredPragmas>;
705 // Follow the Microsoft implementation.
706 def warn_pragma_pack_show : Warning<"value of #pragma pack(show) == %0">;
707 def warn_pragma_pack_pop_identifer_and_alignment : Warning<
708   "specifying both a name and alignment to 'pop' is undefined">;
709 def warn_pragma_pop_failed : Warning<"#pragma %0(pop, ...) failed: %1">,
710   InGroup<IgnoredPragmas>;
711 def warn_cxx_ms_struct :
712   Warning<"ms_struct may not produce Microsoft-compatible layouts for classes "
713           "with base classes or virtual functions">,
714   DefaultError, InGroup<IncompatibleMSStruct>;
715 def err_section_conflict : Error<"%0 causes a section type conflict with %1">;
716 def err_no_base_classes : Error<"invalid use of '__super', %0 has no base classes">;
717 def err_invalid_super_scope : Error<"invalid use of '__super', "
718   "this keyword can only be used inside class or member function scope">;
719 def err_super_in_lambda_unsupported : Error<
720   "use of '__super' inside a lambda is unsupported">;
721
722 def warn_pragma_unused_undeclared_var : Warning<
723   "undeclared variable %0 used as an argument for '#pragma unused'">,
724   InGroup<IgnoredPragmas>;
725 def warn_pragma_unused_expected_var_arg : Warning<
726   "only variables can be arguments to '#pragma unused'">,
727   InGroup<IgnoredPragmas>;
728 def err_pragma_push_visibility_mismatch : Error<
729   "#pragma visibility push with no matching #pragma visibility pop">;
730 def note_surrounding_namespace_ends_here : Note<
731   "surrounding namespace with visibility attribute ends here">;
732 def err_pragma_pop_visibility_mismatch : Error<
733   "#pragma visibility pop with no matching #pragma visibility push">;
734 def note_surrounding_namespace_starts_here : Note<
735   "surrounding namespace with visibility attribute starts here">;
736 def err_pragma_loop_invalid_argument_type : Error<
737   "invalid argument of type %0; expected an integer type">;
738 def err_pragma_loop_invalid_argument_value : Error<
739   "%select{invalid value '%0'; must be positive|value '%0' is too large}1">;
740 def err_pragma_loop_compatibility : Error<
741   "%select{incompatible|duplicate}0 directives '%1' and '%2'">;
742 def err_pragma_loop_precedes_nonloop : Error<
743   "expected a for, while, or do-while loop to follow '%0'">;
744
745 /// Objective-C parser diagnostics
746 def err_duplicate_class_def : Error<
747   "duplicate interface definition for class %0">;
748 def err_undef_superclass : Error<
749   "cannot find interface declaration for %0, superclass of %1">;
750 def err_forward_superclass : Error<
751   "attempting to use the forward class %0 as superclass of %1">;
752 def err_no_nsconstant_string_class : Error<
753   "cannot find interface declaration for %0">;
754 def err_recursive_superclass : Error<
755   "trying to recursively use %0 as superclass of %1">;
756 def err_conflicting_aliasing_type : Error<"conflicting types for alias %0">;
757 def warn_undef_interface : Warning<"cannot find interface declaration for %0">;
758 def warn_duplicate_protocol_def : Warning<
759   "duplicate protocol definition of %0 is ignored">,
760   InGroup<DiagGroup<"duplicate-protocol">>;
761 def err_protocol_has_circular_dependency : Error<
762   "protocol has circular dependency">;
763 def err_undeclared_protocol : Error<"cannot find protocol declaration for %0">;
764 def warn_undef_protocolref : Warning<"cannot find protocol definition for %0">;
765 def warn_atprotocol_protocol : Warning<
766   "@protocol is using a forward protocol declaration of %0">, InGroup<AtProtocol>;
767 def warn_readonly_property : Warning<
768   "attribute 'readonly' of property %0 restricts attribute "
769   "'readwrite' of property inherited from %1">,
770   InGroup<PropertyAttr>;
771
772 def warn_property_attribute : Warning<
773   "'%1' attribute on property %0 does not match the property inherited from %2">,
774   InGroup<PropertyAttr>;
775 def warn_property_types_are_incompatible : Warning<
776   "property type %0 is incompatible with type %1 inherited from %2">,
777   InGroup<DiagGroup<"incompatible-property-type">>;
778 def warn_protocol_property_mismatch : Warning<
779   "property of type %0 was selected for synthesis">,
780   InGroup<DiagGroup<"protocol-property-synthesis-ambiguity">>;
781 def err_undef_interface : Error<"cannot find interface declaration for %0">;
782 def err_category_forward_interface : Error<
783   "cannot define %select{category|class extension}0 for undefined class %1">;
784 def err_class_extension_after_impl : Error<
785   "cannot declare class extension for %0 after class implementation">;
786 def note_implementation_declared : Note<
787   "class implementation is declared here">;
788 def note_while_in_implementation : Note<
789   "detected while default synthesizing properties in class implementation">;
790 def note_class_declared : Note<
791   "class is declared here">;
792 def note_receiver_class_declared : Note<
793   "receiver is instance of class declared here">;
794 def note_receiver_expr_here : Note<
795   "receiver expression is here">;
796 def note_receiver_is_id : Note<
797   "receiver is treated with 'id' type for purpose of method lookup">;
798 def note_suppressed_class_declare : Note<
799   "class with specified objc_requires_property_definitions attribute is declared here">;
800 def err_objc_root_class_subclass : Error<
801   "objc_root_class attribute may only be specified on a root class declaration">;
802 def err_restricted_superclass_mismatch : Error<
803   "cannot subclass a class that was declared with the "
804   "'objc_subclassing_restricted' attribute">;
805 def warn_objc_root_class_missing : Warning<
806   "class %0 defined without specifying a base class">,
807   InGroup<ObjCRootClass>;
808 def err_objc_runtime_visible_category : Error<
809   "cannot implement a category for class %0 that is only visible via the "
810   "Objective-C runtime">;
811 def err_objc_runtime_visible_subclass : Error<
812   "cannot implement subclass %0 of a superclass %1 that is only visible via the "
813   "Objective-C runtime">;
814 def note_objc_needs_superclass : Note<
815   "add a super class to fix this problem">;
816 def warn_dup_category_def : Warning<
817   "duplicate definition of category %1 on interface %0">;
818 def err_conflicting_super_class : Error<"conflicting super class name %0">;
819 def err_dup_implementation_class : Error<"reimplementation of class %0">;
820 def err_dup_implementation_category : Error<
821   "reimplementation of category %1 for class %0">;
822 def err_conflicting_ivar_type : Error<
823   "instance variable %0 has conflicting type%diff{: $ vs $|}1,2">;
824 def err_duplicate_ivar_declaration : Error<
825   "instance variable is already declared">;
826 def warn_on_superclass_use : Warning<
827   "class implementation may not have super class">;
828 def err_conflicting_ivar_bitwidth : Error<
829   "instance variable %0 has conflicting bit-field width">;
830 def err_conflicting_ivar_name : Error<
831   "conflicting instance variable names: %0 vs %1">;
832 def err_inconsistent_ivar_count : Error<
833   "inconsistent number of instance variables specified">;
834 def warn_undef_method_impl : Warning<"method definition for %0 not found">,
835   InGroup<DiagGroup<"incomplete-implementation">>;
836
837 def warn_conflicting_overriding_ret_types : Warning<
838   "conflicting return type in "
839   "declaration of %0%diff{: $ vs $|}1,2">,
840   InGroup<OverridingMethodMismatch>, DefaultIgnore;
841
842 def warn_conflicting_ret_types : Warning<
843   "conflicting return type in "
844   "implementation of %0%diff{: $ vs $|}1,2">,
845   InGroup<MismatchedReturnTypes>;
846
847 def warn_conflicting_overriding_ret_type_modifiers : Warning<
848   "conflicting distributed object modifiers on return type "
849   "in declaration of %0">,
850   InGroup<OverridingMethodMismatch>, DefaultIgnore;
851
852 def warn_conflicting_ret_type_modifiers : Warning<
853   "conflicting distributed object modifiers on return type "
854   "in implementation of %0">,
855   InGroup<DistributedObjectModifiers>;
856
857 def warn_non_covariant_overriding_ret_types : Warning<
858   "conflicting return type in "
859   "declaration of %0: %1 vs %2">,
860   InGroup<OverridingMethodMismatch>, DefaultIgnore;
861
862 def warn_non_covariant_ret_types : Warning<
863   "conflicting return type in "
864   "implementation of %0: %1 vs %2">,
865   InGroup<MethodSignatures>, DefaultIgnore;
866
867 def warn_conflicting_overriding_param_types : Warning<
868   "conflicting parameter types in "
869   "declaration of %0%diff{: $ vs $|}1,2">,
870   InGroup<OverridingMethodMismatch>, DefaultIgnore;
871
872 def warn_conflicting_param_types : Warning<
873   "conflicting parameter types in "
874   "implementation of %0%diff{: $ vs $|}1,2">,
875   InGroup<MismatchedParameterTypes>;
876
877 def warn_conflicting_param_modifiers : Warning<
878   "conflicting distributed object modifiers on parameter type "
879   "in implementation of %0">,
880   InGroup<DistributedObjectModifiers>;
881
882 def warn_conflicting_overriding_param_modifiers : Warning<
883   "conflicting distributed object modifiers on parameter type "
884   "in declaration of %0">,
885   InGroup<OverridingMethodMismatch>, DefaultIgnore;
886
887 def warn_non_contravariant_overriding_param_types : Warning<
888   "conflicting parameter types in "
889   "declaration of %0: %1 vs %2">,
890   InGroup<OverridingMethodMismatch>, DefaultIgnore;
891
892 def warn_non_contravariant_param_types : Warning<
893   "conflicting parameter types in "
894   "implementation of %0: %1 vs %2">,
895   InGroup<MethodSignatures>, DefaultIgnore;
896
897 def warn_conflicting_overriding_variadic :Warning<
898   "conflicting variadic declaration of method and its "
899   "implementation">,
900   InGroup<OverridingMethodMismatch>, DefaultIgnore;
901
902 def warn_conflicting_variadic :Warning<
903   "conflicting variadic declaration of method and its "
904   "implementation">;
905
906 def warn_category_method_impl_match:Warning<
907   "category is implementing a method which will also be implemented"
908   " by its primary class">, InGroup<ObjCProtocolMethodImpl>;
909
910 def warn_implements_nscopying : Warning<
911 "default assign attribute on property %0 which implements "
912 "NSCopying protocol is not appropriate with -fobjc-gc[-only]">;
913
914 def warn_multiple_method_decl : Warning<"multiple methods named %0 found">,
915   InGroup<ObjCMultipleMethodNames>;
916 def warn_strict_multiple_method_decl : Warning<
917   "multiple methods named %0 found">, InGroup<StrictSelector>, DefaultIgnore;
918 def warn_accessor_property_type_mismatch : Warning<
919   "type of property %0 does not match type of accessor %1">;
920 def note_conv_function_declared_at : Note<"type conversion function declared here">;
921 def note_method_declared_at : Note<"method %0 declared here">;
922 def note_property_attribute : Note<"property %0 is declared "
923   "%select{deprecated|unavailable|partial}1 here">;
924 def err_setter_type_void : Error<"type of setter must be void">;
925 def err_duplicate_method_decl : Error<"duplicate declaration of method %0">;
926 def warn_duplicate_method_decl : 
927   Warning<"multiple declarations of method %0 found and ignored">, 
928   InGroup<MethodDuplicate>, DefaultIgnore;
929 def warn_objc_cdirective_format_string :
930   Warning<"using %0 directive in %select{NSString|CFString}1 "
931           "which is being passed as a formatting argument to the formatting "
932           "%select{method|CFfunction}2">,
933   InGroup<ObjCCStringFormat>, DefaultIgnore;
934 def err_objc_var_decl_inclass : 
935     Error<"cannot declare variable inside @interface or @protocol">;
936 def err_missing_method_context : Error<
937   "missing context for method declaration">;
938 def err_objc_property_attr_mutually_exclusive : Error<
939   "property attributes '%0' and '%1' are mutually exclusive">;
940 def err_objc_property_requires_object : Error<
941   "property with '%0' attribute must be of object type">;
942 def warn_objc_property_no_assignment_attribute : Warning<
943   "no 'assign', 'retain', or 'copy' attribute is specified - "
944   "'assign' is assumed">,
945   InGroup<ObjCPropertyNoAttribute>;
946 def warn_objc_isa_use : Warning<
947   "direct access to Objective-C's isa is deprecated in favor of "
948   "object_getClass()">, InGroup<DeprecatedObjCIsaUsage>;
949 def warn_objc_isa_assign : Warning<
950   "assignment to Objective-C's isa is deprecated in favor of "
951   "object_setClass()">, InGroup<DeprecatedObjCIsaUsage>;
952 def warn_objc_pointer_masking : Warning<
953   "bitmasking for introspection of Objective-C object pointers is strongly "
954   "discouraged">,
955   InGroup<ObjCPointerIntrospect>;
956 def warn_objc_pointer_masking_performSelector : Warning<warn_objc_pointer_masking.Text>,
957   InGroup<ObjCPointerIntrospectPerformSelector>;
958 def warn_objc_property_default_assign_on_object : Warning<
959   "default property attribute 'assign' not appropriate for non-GC object">,
960   InGroup<ObjCPropertyNoAttribute>;
961 def warn_property_attr_mismatch : Warning<
962   "property attribute in class extension does not match the primary class">,
963   InGroup<PropertyAttr>;
964 def warn_property_implicitly_mismatched : Warning <
965   "primary property declaration is implicitly strong while redeclaration "
966   "in class extension is weak">,
967   InGroup<DiagGroup<"objc-property-implicit-mismatch">>;
968 def warn_objc_property_copy_missing_on_block : Warning<
969     "'copy' attribute must be specified for the block property "
970     "when -fobjc-gc-only is specified">;
971 def warn_objc_property_retain_of_block : Warning<
972     "retain'ed block property does not copy the block "
973     "- use copy attribute instead">, InGroup<ObjCRetainBlockProperty>;
974 def warn_objc_readonly_property_has_setter : Warning<
975     "setter cannot be specified for a readonly property">,
976     InGroup<ObjCReadonlyPropertyHasSetter>;
977 def warn_atomic_property_rule : Warning<
978   "writable atomic property %0 cannot pair a synthesized %select{getter|setter}1 "
979   "with a user defined %select{getter|setter}2">,
980   InGroup<DiagGroup<"atomic-property-with-user-defined-accessor">>;
981 def note_atomic_property_fixup_suggest : Note<"setter and getter must both be "
982   "synthesized, or both be user defined,or the property must be nonatomic">;
983 def err_atomic_property_nontrivial_assign_op : Error<
984   "atomic property of reference type %0 cannot have non-trivial assignment"
985   " operator">;
986 def warn_cocoa_naming_owned_rule : Warning<
987   "property follows Cocoa naming"
988   " convention for returning 'owned' objects">,
989   InGroup<DiagGroup<"objc-property-matches-cocoa-ownership-rule">>;
990 def err_cocoa_naming_owned_rule : Error<
991   "property follows Cocoa naming"
992   " convention for returning 'owned' objects">;
993 def note_cocoa_naming_declare_family : Note<
994   "explicitly declare getter %objcinstance0 with '%1' to return an 'unowned' "
995   "object">;
996 def warn_auto_synthesizing_protocol_property :Warning<
997   "auto property synthesis will not synthesize property %0"
998   " declared in protocol %1">,
999   InGroup<DiagGroup<"objc-protocol-property-synthesis">>;
1000 def warn_no_autosynthesis_shared_ivar_property : Warning <
1001   "auto property synthesis will not synthesize property "
1002   "%0 because it cannot share an ivar with another synthesized property">,
1003   InGroup<ObjCNoPropertyAutoSynthesis>;
1004 def warn_no_autosynthesis_property : Warning<
1005   "auto property synthesis will not synthesize property "
1006   "%0 because it is 'readwrite' but it will be synthesized 'readonly' "
1007   "via another property">,
1008   InGroup<ObjCNoPropertyAutoSynthesis>;
1009 def warn_autosynthesis_property_in_superclass : Warning<
1010   "auto property synthesis will not synthesize property "
1011   "%0; it will be implemented by its superclass, use @dynamic to "
1012   "acknowledge intention">,
1013   InGroup<ObjCNoPropertyAutoSynthesis>;
1014 def warn_autosynthesis_property_ivar_match :Warning<
1015   "autosynthesized property %0 will use %select{|synthesized}1 instance variable "
1016   "%2, not existing instance variable %3">,
1017   InGroup<DiagGroup<"objc-autosynthesis-property-ivar-name-match">>;
1018 def warn_missing_explicit_synthesis : Warning <
1019   "auto property synthesis is synthesizing property not explicitly synthesized">,
1020   InGroup<DiagGroup<"objc-missing-property-synthesis">>, DefaultIgnore;
1021 def warn_property_getter_owning_mismatch : Warning<
1022   "property declared as returning non-retained objects"
1023   "; getter returning retained objects">;
1024 def warn_property_redecl_getter_mismatch : Warning<
1025   "getter name mismatch between property redeclaration (%1) and its original "
1026   "declaration (%0)">, InGroup<PropertyAttr>;
1027 def err_property_setter_ambiguous_use : Error<
1028   "synthesized properties %0 and %1 both claim setter %2 -"
1029   " use of this setter will cause unexpected behavior">;
1030 def warn_default_atomic_custom_getter_setter : Warning<
1031   "atomic by default property %0 has a user defined %select{getter|setter}1 "
1032   "(property should be marked 'atomic' if this is intended)">,
1033   InGroup<CustomAtomic>, DefaultIgnore;
1034 def err_use_continuation_class : Error<
1035   "illegal redeclaration of property in class extension %0"
1036   " (attribute must be 'readwrite', while its primary must be 'readonly')">;
1037 def err_type_mismatch_continuation_class : Error<
1038   "type of property %0 in class extension does not match "
1039   "property type in primary class">;
1040 def err_use_continuation_class_redeclaration_readwrite : Error<
1041   "illegal redeclaration of 'readwrite' property in class extension %0"
1042   " (perhaps you intended this to be a 'readwrite' redeclaration of a "
1043   "'readonly' public property?)">;
1044 def err_continuation_class : Error<"class extension has no primary class">;
1045 def err_property_type : Error<"property cannot have array or function type %0">;
1046 def err_missing_property_context : Error<
1047   "missing context for property implementation declaration">;
1048 def err_bad_property_decl : Error<
1049   "property implementation must have its declaration in interface %0 or one of "
1050   "its extensions">;
1051 def err_category_property : Error<
1052   "property declared in category %0 cannot be implemented in "
1053   "class implementation">;
1054 def note_property_declare : Note<
1055   "property declared here">;
1056 def note_protocol_property_declare : Note<
1057   "it could also be property of type %0 declared here">;
1058 def note_property_synthesize : Note<
1059   "property synthesized here">;
1060 def err_synthesize_category_decl : Error<
1061   "@synthesize not allowed in a category's implementation">;
1062 def err_synthesize_on_class_property : Error<
1063   "@synthesize not allowed on a class property %0">;
1064 def err_missing_property_interface : Error<
1065   "property implementation in a category with no category declaration">;
1066 def err_bad_category_property_decl : Error<
1067   "property implementation must have its declaration in the category %0">;
1068 def err_bad_property_context : Error<
1069   "property implementation must be in a class or category implementation">;
1070 def err_missing_property_ivar_decl : Error<
1071   "synthesized property %0 must either be named the same as a compatible"
1072   " instance variable or must explicitly name an instance variable">;
1073 def err_arc_perform_selector_retains : Error<
1074   "performSelector names a selector which retains the object">;
1075 def warn_arc_perform_selector_leaks : Warning<
1076   "performSelector may cause a leak because its selector is unknown">,
1077   InGroup<DiagGroup<"arc-performSelector-leaks">>;
1078 def warn_dealloc_in_category : Warning<
1079 "-dealloc is being overridden in a category">,
1080 InGroup<DeallocInCategory>;
1081 def err_gc_weak_property_strong_type : Error<
1082   "weak attribute declared on a __strong type property in GC mode">;
1083 def warn_arc_repeated_use_of_weak : Warning <
1084   "weak %select{variable|property|implicit property|instance variable}0 %1 is "
1085   "accessed multiple times in this %select{function|method|block|lambda}2 "
1086   "but may be unpredictably set to nil; assign to a strong variable to keep "
1087   "the object alive">,
1088   InGroup<ARCRepeatedUseOfWeak>, DefaultIgnore;
1089 def warn_implicitly_retains_self : Warning <
1090   "block implicitly retains 'self'; explicitly mention 'self' to indicate "
1091   "this is intended behavior">,
1092   InGroup<DiagGroup<"implicit-retain-self">>, DefaultIgnore;
1093 def warn_arc_possible_repeated_use_of_weak : Warning <
1094   "weak %select{variable|property|implicit property|instance variable}0 %1 may "
1095   "be accessed multiple times in this %select{function|method|block|lambda}2 "
1096   "and may be unpredictably set to nil; assign to a strong variable to keep "
1097   "the object alive">,
1098   InGroup<ARCRepeatedUseOfWeakMaybe>, DefaultIgnore;
1099 def note_arc_weak_also_accessed_here : Note<
1100   "also accessed here">;
1101 def err_incomplete_synthesized_property : Error<
1102   "cannot synthesize property %0 with incomplete type %1">;
1103
1104 def err_property_ivar_type : Error<
1105   "type of property %0 (%1) does not match type of instance variable %2 (%3)">;
1106 def err_property_accessor_type : Error<
1107   "type of property %0 (%1) does not match type of accessor %2 (%3)">;
1108 def err_ivar_in_superclass_use : Error<
1109   "property %0 attempting to use instance variable %1 declared in super class %2">;
1110 def err_weak_property : Error<
1111   "existing instance variable %1 for __weak property %0 must be __weak">;
1112 def err_strong_property : Error<
1113   "existing instance variable %1 for strong property %0 may not be __weak">;
1114 def err_dynamic_property_ivar_decl : Error<
1115   "dynamic property cannot have instance variable specification">;
1116 def err_duplicate_ivar_use : Error<
1117   "synthesized properties %0 and %1 both claim instance variable %2">;
1118 def err_property_implemented : Error<"property %0 is already implemented">;
1119 def warn_objc_missing_super_call : Warning<
1120   "method possibly missing a [super %0] call">,
1121   InGroup<ObjCMissingSuperCalls>;
1122 def err_dealloc_bad_result_type : Error<
1123   "dealloc return type must be correctly specified as 'void' under ARC, "
1124   "instead of %0">;
1125 def warn_undeclared_selector : Warning<
1126   "undeclared selector %0">, InGroup<UndeclaredSelector>, DefaultIgnore;
1127 def warn_undeclared_selector_with_typo : Warning<
1128   "undeclared selector %0; did you mean %1?">,
1129   InGroup<UndeclaredSelector>, DefaultIgnore;
1130 def warn_implicit_atomic_property : Warning<
1131   "property is assumed atomic by default">, InGroup<ImplicitAtomic>, DefaultIgnore;
1132 def note_auto_readonly_iboutlet_fixup_suggest : Note<
1133   "property should be changed to be readwrite">;
1134 def warn_auto_readonly_iboutlet_property : Warning<
1135   "readonly IBOutlet property %0 when auto-synthesized may "
1136   "not work correctly with 'nib' loader">,
1137   InGroup<DiagGroup<"readonly-iboutlet-property">>;
1138 def warn_auto_implicit_atomic_property : Warning<
1139   "property is assumed atomic when auto-synthesizing the property">,
1140   InGroup<ImplicitAtomic>, DefaultIgnore;
1141 def warn_unimplemented_selector:  Warning<
1142   "no method with selector %0 is implemented in this translation unit">, 
1143   InGroup<Selector>, DefaultIgnore;
1144 def warn_unimplemented_protocol_method : Warning<
1145   "method %0 in protocol %1 not implemented">, InGroup<Protocol>;
1146 def warn_multiple_selectors: Warning<
1147   "several methods with selector %0 of mismatched types are found "
1148   "for the @selector expression">,
1149   InGroup<SelectorTypeMismatch>, DefaultIgnore;
1150
1151 def err_objc_kindof_nonobject : Error<
1152   "'__kindof' specifier cannot be applied to non-object type %0">;
1153 def err_objc_kindof_wrong_position : Error<
1154   "'__kindof' type specifier must precede the declarator">;
1155
1156 // C++ declarations
1157 def err_static_assert_expression_is_not_constant : Error<
1158   "static_assert expression is not an integral constant expression">;
1159 def err_static_assert_failed : Error<"static_assert failed%select{ %1|}0">;
1160 def ext_static_assert_no_message : ExtWarn<
1161   "static_assert with no message is a C++1z extension">, InGroup<CXX1z>;
1162 def warn_cxx14_compat_static_assert_no_message : Warning<
1163   "static_assert with no message is incompatible with C++ standards before C++1z">,
1164   DefaultIgnore, InGroup<CXXPre1zCompat>;
1165
1166 def ext_inline_variable : ExtWarn<
1167   "inline variables are a C++1z extension">, InGroup<CXX1z>;
1168 def warn_cxx14_compat_inline_variable : Warning<
1169   "inline variables are incompatible with C++ standards before C++1z">,
1170   DefaultIgnore, InGroup<CXXPre1zCompat>;
1171
1172 def warn_inline_namespace_reopened_noninline : Warning<
1173   "inline namespace reopened as a non-inline namespace">;
1174 def err_inline_namespace_mismatch : Error<
1175   "non-inline namespace cannot be reopened as inline">;
1176
1177 def err_unexpected_friend : Error<
1178   "friends can only be classes or functions">;
1179 def ext_enum_friend : ExtWarn<
1180   "befriending enumeration type %0 is a C++11 extension">, InGroup<CXX11>;
1181 def warn_cxx98_compat_enum_friend : Warning<
1182   "befriending enumeration type %0 is incompatible with C++98">,
1183   InGroup<CXX98Compat>, DefaultIgnore;
1184 def ext_nonclass_type_friend : ExtWarn<
1185   "non-class friend type %0 is a C++11 extension">, InGroup<CXX11>;
1186 def warn_cxx98_compat_nonclass_type_friend : Warning<
1187   "non-class friend type %0 is incompatible with C++98">,
1188   InGroup<CXX98Compat>, DefaultIgnore;
1189 def err_friend_is_member : Error<
1190   "friends cannot be members of the declaring class">;
1191 def warn_cxx98_compat_friend_is_member : Warning<
1192   "friend declaration naming a member of the declaring class is incompatible "
1193   "with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
1194 def ext_unelaborated_friend_type : ExtWarn<
1195   "unelaborated friend declaration is a C++11 extension; specify "
1196   "'%select{struct|interface|union|class|enum}0' to befriend %1">,
1197   InGroup<CXX11>;
1198 def warn_cxx98_compat_unelaborated_friend_type : Warning<
1199   "befriending %1 without '%select{struct|interface|union|class|enum}0' "
1200   "keyword is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
1201 def err_qualified_friend_not_found : Error<
1202   "no function named %0 with type %1 was found in the specified scope">;
1203 def err_introducing_special_friend : Error<
1204   "must use a qualified name when declaring a %select{constructor|"
1205   "destructor|conversion operator}0 as a friend">;
1206 def err_tagless_friend_type_template : Error<
1207   "friend type templates must use an elaborated type">;
1208 def err_no_matching_local_friend : Error<
1209   "no matching function found in local scope">;
1210 def err_no_matching_local_friend_suggest : Error<
1211   "no matching function %0 found in local scope; did you mean %3?">;
1212 def err_partial_specialization_friend : Error<
1213   "partial specialization cannot be declared as a friend">;
1214 def err_qualified_friend_def : Error<
1215   "friend function definition cannot be qualified with '%0'">;
1216 def err_friend_def_in_local_class : Error<
1217   "friend function cannot be defined in a local class">;
1218 def err_friend_not_first_in_declaration : Error<
1219   "'friend' must appear first in a non-function declaration">;
1220 def err_using_decl_friend : Error<
1221   "cannot befriend target of using declaration">;
1222 def warn_template_qualified_friend_unsupported : Warning<
1223   "dependent nested name specifier '%0' for friend class declaration is "
1224   "not supported; turning off access control for %1">,
1225   InGroup<UnsupportedFriend>;
1226 def warn_template_qualified_friend_ignored : Warning<
1227   "dependent nested name specifier '%0' for friend template declaration is "
1228   "not supported; ignoring this friend declaration">,
1229   InGroup<UnsupportedFriend>;
1230 def ext_friend_tag_redecl_outside_namespace : ExtWarn<
1231   "unqualified friend declaration referring to type outside of the nearest "
1232   "enclosing namespace is a Microsoft extension; add a nested name specifier">,
1233   InGroup<MicrosoftUnqualifiedFriend>;
1234 def err_pure_friend : Error<"friend declaration cannot have a pure-specifier">;
1235
1236 def err_invalid_member_in_interface : Error<
1237   "%select{data member |non-public member function |static member function |"
1238           "user-declared constructor|user-declared destructor|operator |"
1239           "nested class }0%1 is not permitted within an interface type">;
1240 def err_invalid_base_in_interface : Error<
1241   "interface type cannot inherit from "
1242   "%select{'struct|non-public 'interface|'class}0 %1'">;
1243
1244 def err_abstract_type_in_decl : Error<
1245   "%select{return|parameter|variable|field|instance variable|"
1246   "synthesized instance variable}0 type %1 is an abstract class">;
1247 def err_allocation_of_abstract_type : Error<
1248   "allocating an object of abstract class type %0">;
1249 def err_throw_abstract_type : Error<
1250   "cannot throw an object of abstract type %0">;
1251 def err_array_of_abstract_type : Error<"array of abstract class type %0">;
1252 def err_capture_of_abstract_type : Error<
1253   "by-copy capture of value of abstract type %0">;
1254 def err_capture_of_incomplete_type : Error<
1255   "by-copy capture of variable %0 with incomplete type %1">;
1256 def err_capture_default_non_local : Error<
1257   "non-local lambda expression cannot have a capture-default">;
1258
1259 def err_multiple_final_overriders : Error<
1260   "virtual function %q0 has more than one final overrider in %1">; 
1261 def note_final_overrider : Note<"final overrider of %q0 in %1">;
1262
1263 def err_type_defined_in_type_specifier : Error<
1264   "%0 cannot be defined in a type specifier">;
1265 def err_type_defined_in_result_type : Error<
1266   "%0 cannot be defined in the result type of a function">;
1267 def err_type_defined_in_param_type : Error<
1268   "%0 cannot be defined in a parameter type">;
1269 def err_type_defined_in_alias_template : Error<
1270   "%0 cannot be defined in a type alias template">;
1271 def err_type_defined_in_condition : Error<
1272   "%0 cannot be defined in a condition">;
1273
1274 def note_pure_virtual_function : Note<
1275   "unimplemented pure virtual method %0 in %1">;
1276
1277 def note_pure_qualified_call_kext : Note<
1278   "qualified call to %0::%1 is treated as a virtual call to %1 due to -fapple-kext">;
1279
1280 def err_deleted_decl_not_first : Error<
1281   "deleted definition must be first declaration">;
1282
1283 def err_deleted_override : Error<
1284   "deleted function %0 cannot override a non-deleted function">;
1285
1286 def err_non_deleted_override : Error<
1287   "non-deleted function %0 cannot override a deleted function">;
1288
1289 def warn_weak_vtable : Warning<
1290   "%0 has no out-of-line virtual method definitions; its vtable will be "
1291   "emitted in every translation unit">,
1292   InGroup<DiagGroup<"weak-vtables">>, DefaultIgnore;
1293 def warn_weak_template_vtable : Warning<
1294   "explicit template instantiation %0 will emit a vtable in every "
1295   "translation unit">,
1296   InGroup<DiagGroup<"weak-template-vtables">>, DefaultIgnore;
1297
1298 def ext_using_undefined_std : ExtWarn<
1299   "using directive refers to implicitly-defined namespace 'std'">;
1300   
1301 // C++ exception specifications
1302 def err_exception_spec_in_typedef : Error<
1303   "exception specifications are not allowed in %select{typedefs|type aliases}0">;
1304 def err_distant_exception_spec : Error<
1305   "exception specifications are not allowed beyond a single level "
1306   "of indirection">;
1307 def err_incomplete_in_exception_spec : Error<
1308   "%select{|pointer to |reference to }0incomplete type %1 is not allowed "
1309   "in exception specification">;
1310 def ext_incomplete_in_exception_spec : ExtWarn<err_incomplete_in_exception_spec.Text>,
1311   InGroup<MicrosoftExceptionSpec>;
1312 def err_rref_in_exception_spec : Error<
1313   "rvalue reference type %0 is not allowed in exception specification">;
1314 def err_mismatched_exception_spec : Error<
1315   "exception specification in declaration does not match previous declaration">;
1316 def ext_mismatched_exception_spec : ExtWarn<err_mismatched_exception_spec.Text>,
1317   InGroup<MicrosoftExceptionSpec>;
1318 def err_override_exception_spec : Error<
1319   "exception specification of overriding function is more lax than "
1320   "base version">;
1321 def ext_override_exception_spec : ExtWarn<err_override_exception_spec.Text>,
1322   InGroup<MicrosoftExceptionSpec>;
1323 def err_incompatible_exception_specs : Error<
1324   "target exception specification is not superset of source">;
1325 def warn_incompatible_exception_specs : Warning<
1326   err_incompatible_exception_specs.Text>, InGroup<IncompatibleExceptionSpec>;
1327 def err_deep_exception_specs_differ : Error<
1328   "exception specifications of %select{return|argument}0 types differ">;
1329 def warn_deep_exception_specs_differ : Warning<
1330   err_deep_exception_specs_differ.Text>, InGroup<IncompatibleExceptionSpec>;
1331 def err_missing_exception_specification : Error<
1332   "%0 is missing exception specification '%1'">;
1333 def ext_missing_exception_specification : ExtWarn<
1334   err_missing_exception_specification.Text>,
1335   InGroup<DiagGroup<"missing-exception-spec">>;
1336 def ext_ms_missing_exception_specification : ExtWarn<
1337   err_missing_exception_specification.Text>,
1338   InGroup<MicrosoftExceptionSpec>;
1339 def err_noexcept_needs_constant_expression : Error<
1340   "argument to noexcept specifier must be a constant expression">;
1341 def err_exception_spec_not_parsed : Error<
1342   "exception specification is not available until end of class definition">;
1343
1344 // C++ access checking
1345 def err_class_redeclared_with_different_access : Error<
1346   "%0 redeclared with '%1' access">;
1347 def err_access : Error<
1348   "%1 is a %select{private|protected}0 member of %3">, AccessControl;
1349 def ext_ms_using_declaration_inaccessible : ExtWarn<
1350   "using declaration referring to inaccessible member '%0' (which refers "
1351   "to accessible member '%1') is a Microsoft compatibility extension">,
1352     AccessControl, InGroup<MicrosoftUsingDecl>;
1353 def err_access_ctor : Error<
1354   "calling a %select{private|protected}0 constructor of class %2">, 
1355   AccessControl;
1356 def ext_rvalue_to_reference_access_ctor : Extension<
1357   "C++98 requires an accessible copy constructor for class %2 when binding "
1358   "a reference to a temporary; was %select{private|protected}0">,
1359   AccessControl, InGroup<BindToTemporaryCopy>;
1360 def err_access_base_ctor : Error<
1361   // The ERRORs represent other special members that aren't constructors, in
1362   // hopes that someone will bother noticing and reporting if they appear
1363   "%select{base class|inherited virtual base class}0 %1 has %select{private|"
1364   "protected}3 %select{default |copy |move |*ERROR* |*ERROR* "
1365   "|*ERROR*|}2constructor">, AccessControl;
1366 def err_access_field_ctor : Error<
1367   // The ERRORs represent other special members that aren't constructors, in
1368   // hopes that someone will bother noticing and reporting if they appear
1369   "field of type %0 has %select{private|protected}2 "
1370   "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}1constructor">,
1371   AccessControl;
1372 def err_access_friend_function : Error<
1373   "friend function %1 is a %select{private|protected}0 member of %3">,
1374   AccessControl;
1375
1376 def err_access_dtor : Error<
1377   "calling a %select{private|protected}1 destructor of class %0">, 
1378   AccessControl;
1379 def err_access_dtor_base :
1380     Error<"base class %0 has %select{private|protected}1 destructor">,
1381     AccessControl;
1382 def err_access_dtor_vbase :
1383     Error<"inherited virtual base class %1 has "
1384     "%select{private|protected}2 destructor">,
1385     AccessControl;
1386 def err_access_dtor_temp :
1387     Error<"temporary of type %0 has %select{private|protected}1 destructor">,
1388     AccessControl;
1389 def err_access_dtor_exception :
1390     Error<"exception object of type %0 has %select{private|protected}1 "
1391           "destructor">, AccessControl;
1392 def err_access_dtor_field :
1393     Error<"field of type %1 has %select{private|protected}2 destructor">,
1394     AccessControl;
1395 def err_access_dtor_var :
1396     Error<"variable of type %1 has %select{private|protected}2 destructor">,
1397     AccessControl;
1398 def err_access_dtor_ivar :
1399     Error<"instance variable of type %0 has %select{private|protected}1 "
1400           "destructor">,
1401     AccessControl;
1402 def note_previous_access_declaration : Note<
1403   "previously declared '%1' here">;
1404 def note_access_natural : Note<
1405   "%select{|implicitly }1declared %select{private|protected}0 here">;
1406 def note_access_constrained_by_path : Note<
1407   "constrained by %select{|implicitly }1%select{private|protected}0"
1408   " inheritance here">;
1409 def note_access_protected_restricted_noobject : Note<
1410   "must name member using the type of the current context %0">;
1411 def note_access_protected_restricted_ctordtor : Note<
1412   "protected %select{constructor|destructor}0 can only be used to "
1413   "%select{construct|destroy}0 a base class subobject">;
1414 def note_access_protected_restricted_object : Note<
1415   "can only access this member on an object of type %0">;
1416 def warn_cxx98_compat_sfinae_access_control : Warning<
1417   "substitution failure due to access control is incompatible with C++98">,
1418   InGroup<CXX98Compat>, DefaultIgnore, NoSFINAE;
1419   
1420 // C++ name lookup
1421 def err_incomplete_nested_name_spec : Error<
1422   "incomplete type %0 named in nested name specifier">;
1423 def err_dependent_nested_name_spec : Error<
1424   "nested name specifier for a declaration cannot depend on a template "
1425   "parameter">;
1426 def err_nested_name_member_ref_lookup_ambiguous : Error<
1427   "lookup of %0 in member access expression is ambiguous">;
1428 def ext_nested_name_member_ref_lookup_ambiguous : ExtWarn<
1429   "lookup of %0 in member access expression is ambiguous; using member of %1">,
1430   InGroup<AmbigMemberTemplate>;
1431 def note_ambig_member_ref_object_type : Note<
1432   "lookup in the object type %0 refers here">;
1433 def note_ambig_member_ref_scope : Note<
1434   "lookup from the current scope refers here">;
1435 def err_qualified_member_nonclass : Error<
1436   "qualified member access refers to a member in %0">;
1437 def err_incomplete_member_access : Error<
1438   "member access into incomplete type %0">;
1439 def err_incomplete_type : Error<
1440   "incomplete type %0 where a complete type is required">;
1441 def warn_cxx98_compat_enum_nested_name_spec : Warning<
1442   "enumeration type in nested name specifier is incompatible with C++98">,
1443   InGroup<CXX98Compat>, DefaultIgnore;
1444 def err_nested_name_spec_is_not_class : Error<
1445   "%0 cannot appear before '::' because it is not a class"
1446   "%select{ or namespace|, namespace, or enumeration}1; did you mean ':'?">;
1447 def ext_nested_name_spec_is_enum : ExtWarn<
1448   "use of enumeration in a nested name specifier is a C++11 extension">,
1449   InGroup<CXX11>;
1450
1451 // C++ class members
1452 def err_storageclass_invalid_for_member : Error<
1453   "storage class specified for a member declaration">;
1454 def err_mutable_function : Error<"'mutable' cannot be applied to functions">;
1455 def err_mutable_reference : Error<"'mutable' cannot be applied to references">;
1456 def ext_mutable_reference : ExtWarn<
1457   "'mutable' on a reference type is a Microsoft extension">,
1458   InGroup<MicrosoftMutableReference>;
1459 def err_mutable_const : Error<"'mutable' and 'const' cannot be mixed">;
1460 def err_mutable_nonmember : Error<
1461   "'mutable' can only be applied to member variables">;
1462 def err_virtual_in_union : Error<
1463   "unions cannot have virtual functions">;
1464 def err_virtual_non_function : Error<
1465   "'virtual' can only appear on non-static member functions">;
1466 def err_virtual_out_of_class : Error<
1467   "'virtual' can only be specified inside the class definition">;
1468 def err_virtual_member_function_template : Error<
1469   "'virtual' cannot be specified on member function templates">;
1470 def err_static_overrides_virtual : Error<
1471   "'static' member function %0 overrides a virtual function in a base class">;
1472 def err_explicit_non_function : Error<
1473   "'explicit' can only appear on non-static member functions">;
1474 def err_explicit_out_of_class : Error<
1475   "'explicit' can only be specified inside the class definition">;
1476 def err_explicit_non_ctor_or_conv_function : Error<
1477   "'explicit' can only be applied to a constructor or conversion function">;
1478 def err_static_not_bitfield : Error<"static member %0 cannot be a bit-field">;
1479 def err_static_out_of_line : Error<
1480   "'static' can only be specified inside the class definition">;
1481 def err_storage_class_for_static_member : Error<
1482   "static data member definition cannot specify a storage class">;
1483 def err_typedef_not_bitfield : Error<"typedef member %0 cannot be a bit-field">;
1484 def err_not_integral_type_bitfield : Error<
1485   "bit-field %0 has non-integral type %1">;
1486 def err_not_integral_type_anon_bitfield : Error<
1487   "anonymous bit-field has non-integral type %0">;
1488 def err_member_function_initialization : Error<
1489   "initializer on function does not look like a pure-specifier">;
1490 def err_non_virtual_pure : Error<
1491   "%0 is not virtual and cannot be declared pure">;
1492 def ext_pure_function_definition : ExtWarn<
1493   "function definition with pure-specifier is a Microsoft extension">,
1494   InGroup<MicrosoftPureDefinition>;
1495 def err_implicit_object_parameter_init : Error<
1496   "cannot initialize object parameter of type %0 with an expression "
1497   "of type %1">;
1498 def err_qualified_member_of_unrelated : Error<
1499   "%q0 is not a member of class %1">;
1500
1501 def warn_call_to_pure_virtual_member_function_from_ctor_dtor : Warning<
1502   "call to pure virtual member function %0 has undefined behavior; "
1503   "overrides of %0 in subclasses are not available in the "
1504   "%select{constructor|destructor}1 of %2">;
1505
1506 def note_member_declared_at : Note<"member is declared here">;
1507 def note_ivar_decl : Note<"instance variable is declared here">;
1508 def note_bitfield_decl : Note<"bit-field is declared here">;
1509 def note_implicit_param_decl : Note<"%0 is an implicit parameter">;
1510 def note_member_synthesized_at : Note<
1511   "implicit %select{default constructor|copy constructor|move constructor|copy "
1512   "assignment operator|move assignment operator|destructor}0 for %1 first "
1513   "required here">;
1514 def note_inhctor_synthesized_at : Note<
1515   "inherited constructor for %0 first required here">;
1516 def err_missing_default_ctor : Error<
1517   "%select{constructor for %1 must explicitly initialize the|"
1518   "implicit default constructor for %1 must explicitly initialize the|"
1519   "cannot use constructor inherited from base class %4;}0 "
1520   "%select{base class|member}2 %3 %select{which|which|of %1}0 "
1521   "does not have a default constructor">;
1522 def note_due_to_dllexported_class : Note<
1523   "due to '%0' being dllexported%select{|; try compiling in C++11 mode}1">;
1524
1525 def err_illegal_union_or_anon_struct_member : Error<
1526   "%select{anonymous struct|union}0 member %1 has a non-trivial "
1527   "%select{constructor|copy constructor|move constructor|copy assignment "
1528   "operator|move assignment operator|destructor}2">;
1529 def warn_cxx98_compat_nontrivial_union_or_anon_struct_member : Warning<
1530   "%select{anonymous struct|union}0 member %1 with a non-trivial "
1531   "%select{constructor|copy constructor|move constructor|copy assignment "
1532   "operator|move assignment operator|destructor}2 is incompatible with C++98">,
1533   InGroup<CXX98Compat>, DefaultIgnore;
1534
1535 def note_nontrivial_virtual_dtor : Note<
1536   "destructor for %0 is not trivial because it is virtual">;
1537 def note_nontrivial_has_virtual : Note<
1538   "because type %0 has a virtual %select{member function|base class}1">;
1539 def note_nontrivial_no_def_ctor : Note<
1540   "because %select{base class of |field of |}0type %1 has no "
1541   "default constructor">;
1542 def note_user_declared_ctor : Note<
1543   "implicit default constructor suppressed by user-declared constructor">;
1544 def note_nontrivial_no_copy : Note<
1545   "because no %select{<<ERROR>>|constructor|constructor|assignment operator|"
1546   "assignment operator|<<ERROR>>}2 can be used to "
1547   "%select{<<ERROR>>|copy|move|copy|move|<<ERROR>>}2 "
1548   "%select{base class|field|an object}0 of type %3">;
1549 def note_nontrivial_user_provided : Note<
1550   "because %select{base class of |field of |}0type %1 has a user-provided "
1551   "%select{default constructor|copy constructor|move constructor|"
1552   "copy assignment operator|move assignment operator|destructor}2">;
1553 def note_nontrivial_in_class_init : Note<
1554   "because field %0 has an initializer">;
1555 def note_nontrivial_param_type : Note<
1556   "because its parameter is %diff{of type $, not $|of the wrong type}2,3">;
1557 def note_nontrivial_default_arg : Note<"because it has a default argument">;
1558 def note_nontrivial_variadic : Note<"because it is a variadic function">;
1559 def note_nontrivial_subobject : Note<
1560   "because the function selected to %select{construct|copy|move|copy|move|"
1561   "destroy}2 %select{base class|field}0 of type %1 is not trivial">;
1562 def note_nontrivial_objc_ownership : Note<
1563   "because type %0 has a member with %select{no|no|__strong|__weak|"
1564   "__autoreleasing}1 ownership">;
1565
1566 def err_static_data_member_not_allowed_in_anon_struct : Error<
1567   "static data member %0 not allowed in anonymous struct">;
1568 def ext_static_data_member_in_union : ExtWarn<
1569   "static data member %0 in union is a C++11 extension">, InGroup<CXX11>;
1570 def warn_cxx98_compat_static_data_member_in_union : Warning<
1571   "static data member %0 in union is incompatible with C++98">,
1572   InGroup<CXX98Compat>, DefaultIgnore;
1573 def ext_union_member_of_reference_type : ExtWarn<
1574   "union member %0 has reference type %1, which is a Microsoft extension">,
1575   InGroup<MicrosoftUnionMemberReference>;
1576 def err_union_member_of_reference_type : Error<
1577   "union member %0 has reference type %1">;
1578 def ext_anonymous_struct_union_qualified : Extension<
1579   "anonymous %select{struct|union}0 cannot be '%1'">;
1580 def err_different_return_type_for_overriding_virtual_function : Error<
1581   "virtual function %0 has a different return type "
1582   "%diff{($) than the function it overrides (which has return type $)|"
1583   "than the function it overrides}1,2">;
1584 def note_overridden_virtual_function : Note<
1585   "overridden virtual function is here">;
1586 def err_conflicting_overriding_cc_attributes : Error<
1587   "virtual function %0 has different calling convention attributes "
1588   "%diff{($) than the function it overrides (which has calling convention $)|"
1589   "than the function it overrides}1,2">;
1590
1591 def err_covariant_return_inaccessible_base : Error<
1592   "invalid covariant return for virtual function: %1 is a "
1593   "%select{private|protected}2 base class of %0">, AccessControl;
1594 def err_covariant_return_ambiguous_derived_to_base_conv : Error<
1595   "return type of virtual function %3 is not covariant with the return type of "
1596   "the function it overrides (ambiguous conversion from derived class "
1597   "%0 to base class %1:%2)">;
1598 def err_covariant_return_not_derived : Error<
1599   "return type of virtual function %0 is not covariant with the return type of "
1600   "the function it overrides (%1 is not derived from %2)">;
1601 def err_covariant_return_incomplete : Error<
1602   "return type of virtual function %0 is not covariant with the return type of "
1603   "the function it overrides (%1 is incomplete)">;
1604 def err_covariant_return_type_different_qualifications : Error<
1605   "return type of virtual function %0 is not covariant with the return type of "
1606   "the function it overrides (%1 has different qualifiers than %2)">;
1607 def err_covariant_return_type_class_type_more_qualified : Error<
1608   "return type of virtual function %0 is not covariant with the return type of "
1609   "the function it overrides (class type %1 is more qualified than class "
1610   "type %2">;
1611   
1612 // C++ constructors
1613 def err_constructor_cannot_be : Error<"constructor cannot be declared '%0'">;
1614 def err_invalid_qualified_constructor : Error<
1615   "'%0' qualifier is not allowed on a constructor">;
1616 def err_ref_qualifier_constructor : Error<
1617   "ref-qualifier '%select{&&|&}0' is not allowed on a constructor">;
1618
1619 def err_constructor_return_type : Error<
1620   "constructor cannot have a return type">;
1621 def err_constructor_redeclared : Error<"constructor cannot be redeclared">;
1622 def err_constructor_byvalue_arg : Error<
1623   "copy constructor must pass its first argument by reference">;
1624 def warn_no_constructor_for_refconst : Warning<
1625   "%select{struct|interface|union|class|enum}0 %1 does not declare any "
1626   "constructor to initialize its non-modifiable members">;
1627 def note_refconst_member_not_initialized : Note<
1628   "%select{const|reference}0 member %1 will never be initialized">;
1629 def ext_ms_explicit_constructor_call : ExtWarn<
1630   "explicit constructor calls are a Microsoft extension">,
1631   InGroup<MicrosoftExplicitConstructorCall>;
1632
1633 // C++ destructors
1634 def err_destructor_not_member : Error<
1635   "destructor must be a non-static member function">;
1636 def err_destructor_cannot_be : Error<"destructor cannot be declared '%0'">;
1637 def err_invalid_qualified_destructor : Error<
1638   "'%0' qualifier is not allowed on a destructor">;
1639 def err_ref_qualifier_destructor : Error<
1640   "ref-qualifier '%select{&&|&}0' is not allowed on a destructor">;
1641 def err_destructor_return_type : Error<"destructor cannot have a return type">;
1642 def err_destructor_redeclared : Error<"destructor cannot be redeclared">;
1643 def err_destructor_with_params : Error<"destructor cannot have any parameters">;
1644 def err_destructor_variadic : Error<"destructor cannot be variadic">;
1645 def err_destructor_typedef_name : Error<
1646   "destructor cannot be declared using a %select{typedef|type alias}1 %0 of the class name">;
1647 def err_destructor_name : Error<
1648   "expected the class name after '~' to name the enclosing class">;
1649 def err_destructor_class_name : Error<
1650   "expected the class name after '~' to name a destructor">;
1651 def err_ident_in_dtor_not_a_type : Error<
1652   "identifier %0 in object destruction expression does not name a type">;
1653 def err_destructor_expr_type_mismatch : Error<
1654   "destructor type %0 in object destruction expression does not match the "
1655   "type %1 of the object being destroyed">;
1656 def note_destructor_type_here : Note<
1657   "type %0 is declared here">;
1658
1659 def err_destructor_template : Error<
1660   "destructor cannot be declared as a template">;
1661
1662 // C++ initialization
1663 def err_init_conversion_failed : Error<
1664   "cannot initialize %select{a variable|a parameter|return object|an "
1665   "exception object|a member subobject|an array element|a new value|a value|a "
1666   "base class|a constructor delegation|a vector element|a block element|a "
1667   "complex element|a lambda capture|a compound literal initializer|a "
1668   "related result|a parameter of CF audited function}0 "
1669   "%diff{of type $ with an %select{rvalue|lvalue}2 of type $|"
1670   "with an %select{rvalue|lvalue}2 of incompatible type}1,3"
1671   "%select{|: different classes%diff{ ($ vs $)|}5,6"
1672   "|: different number of parameters (%5 vs %6)"
1673   "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7"
1674   "|: different return type%diff{ ($ vs $)|}5,6"
1675   "|: different qualifiers ("
1676   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
1677   "volatile and restrict|const, volatile, and restrict}5 vs "
1678   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
1679   "volatile and restrict|const, volatile, and restrict}6)"
1680   "|: different exception specifications}4">;
1681
1682 def err_lvalue_to_rvalue_ref : Error<"rvalue reference %diff{to type $ cannot "
1683   "bind to lvalue of type $|cannot bind to incompatible lvalue}0,1">;
1684 def err_lvalue_reference_bind_to_initlist : Error<
1685   "%select{non-const|volatile}0 lvalue reference to type %1 cannot bind to an "
1686   "initializer list temporary">;
1687 def err_lvalue_reference_bind_to_temporary : Error<
1688   "%select{non-const|volatile}0 lvalue reference %diff{to type $ cannot bind "
1689   "to a temporary of type $|cannot bind to incompatible temporary}1,2">;
1690 def err_lvalue_reference_bind_to_unrelated : Error<
1691   "%select{non-const|volatile}0 lvalue reference "
1692   "%diff{to type $ cannot bind to a value of unrelated type $|"
1693   "cannot bind to a value of unrelated type}1,2">;
1694 def err_reference_bind_drops_quals : Error<
1695   "binding value %diff{of type $ to reference to type $|to reference}0,1 "
1696   "drops %select{<<ERROR>>|'const'|'restrict'|'const' and 'restrict'|"
1697   "'volatile'|'const' and 'volatile'|'restrict' and 'volatile'|"
1698   "'const', 'restrict', and 'volatile'}2 qualifier%plural{1:|2:|4:|:s}2">;
1699 def err_reference_bind_failed : Error<
1700   "reference %diff{to type $ could not bind to an %select{rvalue|lvalue}1 of "
1701   "type $|could not bind to %select{rvalue|lvalue}1 of incompatible type}0,2">;
1702 def err_reference_bind_init_list : Error<
1703   "reference to type %0 cannot bind to an initializer list">;
1704 def warn_temporary_array_to_pointer_decay : Warning<
1705   "pointer is initialized by a temporary array, which will be destroyed at the "
1706   "end of the full-expression">,
1707   InGroup<DiagGroup<"address-of-array-temporary">>;
1708 def err_init_list_bad_dest_type : Error<
1709   "%select{|non-aggregate }0type %1 cannot be initialized with an initializer "
1710   "list">;
1711 def err_member_function_call_bad_cvr : Error<"member function %0 not viable: "
1712     "'this' argument has type %1, but function is not marked "
1713     "%select{const|restrict|const or restrict|volatile|const or volatile|"
1714     "volatile or restrict|const, volatile, or restrict}2">;
1715
1716 def err_reference_bind_to_bitfield : Error<
1717   "%select{non-const|volatile}0 reference cannot bind to "
1718   "bit-field%select{| %1}2">;
1719 def err_reference_bind_to_vector_element : Error<
1720   "%select{non-const|volatile}0 reference cannot bind to vector element">;
1721 def err_reference_var_requires_init : Error<
1722   "declaration of reference variable %0 requires an initializer">;
1723 def err_reference_without_init : Error<
1724   "reference to type %0 requires an initializer">;
1725 def note_value_initialization_here : Note<
1726   "in value-initialization of type %0 here">;
1727 def err_reference_has_multiple_inits : Error<
1728   "reference cannot be initialized with multiple values">;
1729 def err_init_non_aggr_init_list : Error<
1730   "initialization of non-aggregate type %0 with an initializer list">;
1731 def err_init_reference_member_uninitialized : Error<
1732   "reference member of type %0 uninitialized">;
1733 def note_uninit_reference_member : Note<
1734   "uninitialized reference member is here">;
1735 def warn_field_is_uninit : Warning<"field %0 is uninitialized when used here">,
1736   InGroup<Uninitialized>;
1737 def warn_base_class_is_uninit : Warning<
1738   "base class %0 is uninitialized when used here to access %q1">,
1739   InGroup<Uninitialized>;
1740 def warn_reference_field_is_uninit : Warning<
1741   "reference %0 is not yet bound to a value when used here">,
1742   InGroup<Uninitialized>;
1743 def note_uninit_in_this_constructor : Note<
1744   "during field initialization in %select{this|the implicit default}0 "
1745   "constructor">;
1746 def warn_static_self_reference_in_init : Warning<
1747   "static variable %0 is suspiciously used within its own initialization">,
1748   InGroup<UninitializedStaticSelfInit>;
1749 def warn_uninit_self_reference_in_init : Warning<
1750   "variable %0 is uninitialized when used within its own initialization">,
1751   InGroup<Uninitialized>;
1752 def warn_uninit_self_reference_in_reference_init : Warning<
1753   "reference %0 is not yet bound to a value when used within its own"
1754   " initialization">,
1755   InGroup<Uninitialized>;
1756 def warn_uninit_var : Warning<
1757   "variable %0 is uninitialized when %select{used here|captured by block}1">,
1758   InGroup<Uninitialized>, DefaultIgnore;
1759 def warn_sometimes_uninit_var : Warning<
1760   "variable %0 is %select{used|captured}1 uninitialized whenever "
1761   "%select{'%3' condition is %select{true|false}4|"
1762   "'%3' loop %select{is entered|exits because its condition is false}4|"
1763   "'%3' loop %select{condition is true|exits because its condition is false}4|"
1764   "switch %3 is taken|"
1765   "its declaration is reached|"
1766   "%3 is called}2">,
1767   InGroup<UninitializedSometimes>, DefaultIgnore;
1768 def warn_maybe_uninit_var : Warning<
1769   "variable %0 may be uninitialized when "
1770   "%select{used here|captured by block}1">,
1771   InGroup<UninitializedMaybe>, DefaultIgnore;
1772 def note_var_declared_here : Note<"variable %0 is declared here">;
1773 def note_uninit_var_use : Note<
1774   "%select{uninitialized use occurs|variable is captured by block}0 here">;
1775 def warn_uninit_byref_blockvar_captured_by_block : Warning<
1776   "block pointer variable %0 is uninitialized when captured by block">,
1777   InGroup<Uninitialized>, DefaultIgnore;
1778 def note_block_var_fixit_add_initialization : Note<
1779   "did you mean to use __block %0?">;
1780 def note_in_omitted_aggregate_initializer : Note<
1781   "in implicit initialization of %select{"
1782   "array element %1 with omitted initializer|"
1783   "field %1 with omitted initializer|"
1784   "trailing array elements in runtime-sized array new}0">;
1785 def note_in_reference_temporary_list_initializer : Note<
1786   "in initialization of temporary of type %0 created to "
1787   "list-initialize this reference">;
1788 def note_var_fixit_add_initialization : Note<
1789   "initialize the variable %0 to silence this warning">;
1790 def note_uninit_fixit_remove_cond : Note<
1791   "remove the %select{'%1' if its condition|condition if it}0 "
1792   "is always %select{false|true}2">;
1793 def err_init_incomplete_type : Error<"initialization of incomplete type %0">;
1794 def err_list_init_in_parens : Error<"list-initializer for non-class type %0 "
1795   "must not be parenthesized">;
1796
1797 def warn_unsequenced_mod_mod : Warning<
1798   "multiple unsequenced modifications to %0">, InGroup<Unsequenced>;
1799 def warn_unsequenced_mod_use : Warning<
1800   "unsequenced modification and access to %0">, InGroup<Unsequenced>;
1801
1802 def err_temp_copy_no_viable : Error<
1803   "no viable constructor %select{copying variable|copying parameter|"
1804   "returning object|throwing object|copying member subobject|copying array "
1805   "element|allocating object|copying temporary|initializing base subobject|"
1806   "initializing vector element|capturing value}0 of type %1">;
1807 def ext_rvalue_to_reference_temp_copy_no_viable : Extension<
1808   "no viable constructor %select{copying variable|copying parameter|"
1809   "returning object|throwing object|copying member subobject|copying array "
1810   "element|allocating object|copying temporary|initializing base subobject|"
1811   "initializing vector element|capturing value}0 of type %1; C++98 requires a copy "
1812   "constructor when binding a reference to a temporary">,
1813   InGroup<BindToTemporaryCopy>;
1814 def err_temp_copy_ambiguous : Error<
1815   "ambiguous constructor call when %select{copying variable|copying "
1816   "parameter|returning object|throwing object|copying member subobject|copying "
1817   "array element|allocating object|copying temporary|initializing base subobject|"
1818   "initializing vector element|capturing value}0 of type %1">;
1819 def err_temp_copy_deleted : Error<
1820   "%select{copying variable|copying parameter|returning object|throwing "
1821   "object|copying member subobject|copying array element|allocating object|"
1822   "copying temporary|initializing base subobject|initializing vector element|"
1823   "capturing value}0 of type %1 invokes deleted constructor">;
1824 def err_temp_copy_incomplete : Error<
1825   "copying a temporary object of incomplete type %0">;
1826 def warn_cxx98_compat_temp_copy : Warning<
1827   "%select{copying variable|copying parameter|returning object|throwing "
1828   "object|copying member subobject|copying array element|allocating object|"
1829   "copying temporary|initializing base subobject|initializing vector element}1 "
1830   "of type %2 when binding a reference to a temporary would %select{invoke "
1831   "an inaccessible constructor|find no viable constructor|find ambiguous "
1832   "constructors|invoke a deleted constructor}0 in C++98">,
1833   InGroup<CXX98CompatBindToTemporaryCopy>, DefaultIgnore;
1834 def err_selected_explicit_constructor : Error<
1835   "chosen constructor is explicit in copy-initialization">;
1836 def note_constructor_declared_here : Note<
1837   "constructor declared here">;
1838
1839 // C++11 decltype
1840 def err_decltype_in_declarator : Error<
1841     "'decltype' cannot be used to name a declaration">;
1842     
1843 // C++11 auto
1844 def warn_cxx98_compat_auto_type_specifier : Warning<
1845   "'auto' type specifier is incompatible with C++98">,
1846   InGroup<CXX98Compat>, DefaultIgnore;
1847 def err_auto_variable_cannot_appear_in_own_initializer : Error<
1848   "variable %0 declared with %select{'auto'|'decltype(auto)'|'__auto_type'}1 "
1849   "type cannot appear in its own initializer">;
1850 def err_binding_cannot_appear_in_own_initializer : Error<
1851   "binding %0 cannot appear in the initializer of its own "
1852   "decomposition declaration">;
1853 def err_illegal_decl_array_of_auto : Error<
1854   "'%0' declared as array of %1">;
1855 def err_new_array_of_auto : Error<
1856   "cannot allocate array of 'auto'">;
1857 def err_auto_not_allowed : Error<
1858   "%select{'auto'|'decltype(auto)'|'__auto_type'}0 not allowed "
1859   "%select{in function prototype"
1860   "|in non-static struct member|in struct member"
1861   "|in non-static union member|in union member"
1862   "|in non-static class member|in interface member"
1863   "|in exception declaration|in template parameter|in block literal"
1864   "|in template argument|in typedef|in type alias|in function return type"
1865   "|in conversion function type|here|in lambda parameter"
1866   "|in type allocated by 'new'|in K&R-style function parameter}1"
1867   "%select{|||||||| until C++1z||||||||||}1">;
1868 def err_auto_not_allowed_var_inst : Error<
1869   "'auto' variable template instantiation is not allowed">;
1870 def err_auto_var_requires_init : Error<
1871   "declaration of variable %0 with type %1 requires an initializer">;
1872 def err_auto_new_requires_ctor_arg : Error<
1873   "new expression for type %0 requires a constructor argument">;
1874 def err_auto_new_list_init : Error<
1875   "new expression for type %0 cannot use list-initialization">;
1876 def err_auto_var_init_no_expression : Error<
1877   "initializer for variable %0 with type %1 is empty">;
1878 def err_auto_var_init_multiple_expressions : Error<
1879   "initializer for variable %0 with type %1 contains multiple expressions">;
1880 def err_auto_var_init_paren_braces : Error<
1881   "cannot deduce type for variable %1 with type %2 from "
1882   "%select{parenthesized|nested}0 initializer list">;
1883 def err_auto_new_ctor_multiple_expressions : Error<
1884   "new expression for type %0 contains multiple constructor arguments">;
1885 def err_auto_missing_trailing_return : Error<
1886   "'auto' return without trailing return type; deduced return types are a "
1887   "C++14 extension">;
1888 def err_deduced_return_type : Error<
1889   "deduced return types are a C++14 extension">;
1890 def err_trailing_return_without_auto : Error<
1891   "function with trailing return type must specify return type 'auto', not %0">;
1892 def err_trailing_return_in_parens : Error<
1893   "trailing return type may not be nested within parentheses">;
1894 def err_auto_var_deduction_failure : Error<
1895   "variable %0 with type %1 has incompatible initializer of type %2">;
1896 def err_auto_var_deduction_failure_from_init_list : Error<
1897   "cannot deduce actual type for variable %0 with type %1 from initializer list">;
1898 def err_auto_new_deduction_failure : Error<
1899   "new expression for type %0 has incompatible constructor argument of type %1">;
1900 def err_auto_different_deductions : Error<
1901   "'%select{auto|decltype(auto)|__auto_type}0' deduced as %1 in declaration "
1902   "of %2 and deduced as %3 in declaration of %4">;
1903 def err_implied_std_initializer_list_not_found : Error<
1904   "cannot deduce type of initializer list because std::initializer_list was "
1905   "not found; include <initializer_list>">;
1906 def err_malformed_std_initializer_list : Error<
1907   "std::initializer_list must be a class template with a single type parameter">;
1908 def warn_dangling_std_initializer_list : Warning<
1909   "array backing the initializer list will be destroyed at the end of "
1910   "%select{the full-expression|the constructor}0">,
1911   InGroup<DiagGroup<"dangling-initializer-list">>;
1912 def err_auto_init_list_from_c : Error<
1913   "cannot use __auto_type with initializer list in C">;
1914 def err_auto_bitfield : Error<
1915   "cannot pass bit-field as __auto_type initializer in C">;
1916
1917 // C++1y decltype(auto) type
1918 def err_decltype_auto_cannot_be_combined : Error<
1919   "'decltype(auto)' cannot be combined with other type specifiers">;
1920 def err_decltype_auto_function_declarator_not_declaration : Error<
1921   "'decltype(auto)' can only be used as a return type "
1922   "in a function declaration">;
1923 def err_decltype_auto_compound_type : Error<
1924   "cannot form %select{pointer to|reference to|array of}0 'decltype(auto)'">;
1925 def err_decltype_auto_initializer_list : Error<
1926   "cannot deduce 'decltype(auto)' from initializer list">;
1927
1928 // C++1y deduced return types
1929 def err_auto_fn_deduction_failure : Error<
1930   "cannot deduce return type %0 from returned value of type %1">;
1931 def err_auto_fn_different_deductions : Error<
1932   "'%select{auto|decltype(auto)}0' in return type deduced as %1 here but "
1933   "deduced as %2 in earlier return statement">;
1934 def err_auto_fn_used_before_defined : Error<
1935   "function %0 with deduced return type cannot be used before it is defined">;
1936 def err_auto_fn_no_return_but_not_auto : Error<
1937   "cannot deduce return type %0 for function with no return statements">;
1938 def err_auto_fn_return_void_but_not_auto : Error<
1939   "cannot deduce return type %0 from omitted return expression">;
1940 def err_auto_fn_return_init_list : Error<
1941   "cannot deduce return type from initializer list">;
1942 def err_auto_fn_virtual : Error<
1943   "function with deduced return type cannot be virtual">;
1944
1945 // C++11 override control
1946 def override_keyword_only_allowed_on_virtual_member_functions : Error<
1947   "only virtual member functions can be marked '%0'">;
1948 def override_keyword_hides_virtual_member_function : Error<
1949   "non-virtual member function marked '%0' hides virtual member "
1950   "%select{function|functions}1">;
1951 def err_function_marked_override_not_overriding : Error<
1952   "%0 marked 'override' but does not override any member functions">;
1953 def warn_function_marked_not_override_overriding : Warning <
1954   "%0 overrides a member function but is not marked 'override'">,
1955   InGroup<CXX11WarnOverrideMethod>;
1956 def err_class_marked_final_used_as_base : Error<
1957   "base %0 is marked '%select{final|sealed}1'">;
1958 def warn_abstract_final_class : Warning<
1959   "abstract class is marked '%select{final|sealed}0'">, InGroup<AbstractFinalClass>;
1960
1961 // C++11 attributes
1962 def err_repeat_attribute : Error<"%0 attribute cannot be repeated">;
1963
1964 // C++11 final
1965 def err_final_function_overridden : Error<
1966   "declaration of %0 overrides a '%select{final|sealed}1' function">;
1967
1968 // C++11 scoped enumerations
1969 def err_enum_invalid_underlying : Error<
1970   "non-integral type %0 is an invalid underlying type">;
1971 def err_enumerator_too_large : Error<
1972   "enumerator value is not representable in the underlying type %0">;
1973 def ext_enumerator_too_large : ExtWarn<
1974   "enumerator value is not representable in the underlying type %0">,
1975   InGroup<MicrosoftEnumValue>;
1976 def err_enumerator_wrapped : Error<
1977   "enumerator value %0 is not representable in the underlying type %1">;
1978 def err_enum_redeclare_type_mismatch : Error<
1979   "enumeration redeclared with different underlying type %0 (was %1)">;
1980 def err_enum_redeclare_fixed_mismatch : Error<
1981   "enumeration previously declared with %select{non|}0fixed underlying type">;
1982 def err_enum_redeclare_scoped_mismatch : Error<
1983   "enumeration previously declared as %select{un|}0scoped">;
1984 def err_enum_class_reference : Error<
1985   "reference to %select{|scoped }0enumeration must use 'enum' "
1986   "not 'enum class'">;
1987 def err_only_enums_have_underlying_types : Error<
1988   "only enumeration types have underlying types">;
1989 def err_underlying_type_of_incomplete_enum : Error<
1990   "cannot determine underlying type of incomplete enumeration type %0">;
1991
1992 // C++11 delegating constructors
1993 def err_delegating_ctor : Error<
1994   "delegating constructors are permitted only in C++11">;
1995 def warn_cxx98_compat_delegating_ctor : Warning<
1996   "delegating constructors are incompatible with C++98">,
1997   InGroup<CXX98Compat>, DefaultIgnore;
1998 def err_delegating_initializer_alone : Error<
1999   "an initializer for a delegating constructor must appear alone">;
2000 def warn_delegating_ctor_cycle : Warning<
2001   "constructor for %0 creates a delegation cycle">, DefaultError,
2002   InGroup<DelegatingCtorCycles>;
2003 def note_it_delegates_to : Note<"it delegates to">;
2004 def note_which_delegates_to : Note<"which delegates to">;
2005
2006 // C++11 range-based for loop
2007 def err_for_range_decl_must_be_var : Error<
2008   "for range declaration must declare a variable">;
2009 def err_for_range_storage_class : Error<
2010   "loop variable %0 may not be declared %select{'extern'|'static'|"
2011   "'__private_extern__'|'auto'|'register'|'constexpr'}1">;
2012 def err_type_defined_in_for_range : Error<
2013   "types may not be defined in a for range declaration">;
2014 def err_for_range_deduction_failure : Error<
2015   "cannot use type %0 as a range">;
2016 def err_for_range_incomplete_type : Error<
2017   "cannot use incomplete type %0 as a range">;
2018 def err_for_range_iter_deduction_failure : Error<
2019   "cannot use type %0 as an iterator">;
2020 def err_for_range_member_begin_end_mismatch : Error<
2021   "range type %0 has '%select{begin|end}1' member but no '%select{end|begin}1' member">;
2022 def ext_for_range_begin_end_types_differ : ExtWarn<
2023   "'begin' and 'end' returning different types (%0 and %1) is a C++1z extension">,
2024   InGroup<CXX1z>;
2025 def warn_for_range_begin_end_types_differ : Warning<
2026   "'begin' and 'end' returning different types (%0 and %1) is incompatible "
2027   "with C++ standards before C++1z">, InGroup<CXXPre1zCompat>, DefaultIgnore;
2028 def note_in_for_range: Note<
2029   "when looking up '%select{begin|end}0' function for range expression "
2030   "of type %1">;
2031 def err_for_range_invalid: Error<
2032   "invalid range expression of type %0; no viable '%select{begin|end}1' "
2033   "function available">;
2034 def err_range_on_array_parameter : Error<
2035   "cannot build range expression with array function parameter %0 since "
2036   "parameter with array type %1 is treated as pointer type %2">;
2037 def err_for_range_dereference : Error<
2038   "invalid range expression of type %0; did you mean to dereference it "
2039   "with '*'?">;
2040 def note_for_range_invalid_iterator : Note <
2041   "in implicit call to 'operator%select{!=|*|++}0' for iterator of type %1">;
2042 def note_for_range_begin_end : Note<
2043   "selected '%select{begin|end}0' %select{function|template }1%2 with iterator type %3">;
2044 def warn_for_range_const_reference_copy : Warning<
2045   "loop variable %0 "
2046   "%diff{has type $ but is initialized with type $"
2047   "| is initialized with a value of a different type}1,2 resulting in a copy">,
2048   InGroup<RangeLoopAnalysis>, DefaultIgnore;
2049 def note_use_type_or_non_reference : Note<
2050   "use non-reference type %0 to keep the copy or type %1 to prevent copying">;
2051 def warn_for_range_variable_always_copy : Warning<
2052   "loop variable %0 is always a copy because the range of type %1 does not "
2053   "return a reference">,
2054   InGroup<RangeLoopAnalysis>, DefaultIgnore;
2055 def note_use_non_reference_type : Note<"use non-reference type %0">;
2056 def warn_for_range_copy : Warning<
2057   "loop variable %0 of type %1 creates a copy from type %2">,
2058   InGroup<RangeLoopAnalysis>, DefaultIgnore;
2059 def note_use_reference_type : Note<"use reference type %0 to prevent copying">;
2060
2061 // C++11 constexpr
2062 def warn_cxx98_compat_constexpr : Warning<
2063   "'constexpr' specifier is incompatible with C++98">,
2064   InGroup<CXX98Compat>, DefaultIgnore;
2065 // FIXME: Maybe this should also go in -Wc++14-compat?
2066 def warn_cxx14_compat_constexpr_not_const : Warning<
2067   "'constexpr' non-static member function will not be implicitly 'const' "
2068   "in C++14; add 'const' to avoid a change in behavior">,
2069   InGroup<DiagGroup<"constexpr-not-const">>;
2070 def err_invalid_constexpr : Error<
2071   "%select{function parameter|typedef|non-static data member}0 "
2072   "cannot be constexpr">;
2073 def err_invalid_constexpr_member : Error<"non-static data member cannot be "
2074   "constexpr%select{; did you intend to make it %select{const|static}0?|}1">;
2075 def err_constexpr_tag : Error<
2076   "%select{class|struct|interface|union|enum}0 cannot be marked constexpr">;
2077 def err_constexpr_dtor : Error<"destructor cannot be marked constexpr">;
2078 def err_constexpr_no_declarators : Error<
2079   "constexpr can only be used in variable and function declarations">;
2080 def err_invalid_constexpr_var_decl : Error<
2081   "constexpr variable declaration must be a definition">;
2082 def err_constexpr_static_mem_var_requires_init : Error<
2083   "declaration of constexpr static data member %0 requires an initializer">;
2084 def err_constexpr_var_non_literal : Error<
2085   "constexpr variable cannot have non-literal type %0">;
2086 def err_constexpr_var_requires_const_init : Error<
2087   "constexpr variable %0 must be initialized by a constant expression">;
2088 def err_constexpr_redecl_mismatch : Error<
2089   "%select{non-constexpr declaration of %0 follows constexpr declaration"
2090   "|constexpr declaration of %0 follows non-constexpr declaration}1">;
2091 def err_constexpr_virtual : Error<"virtual function cannot be constexpr">;
2092 def err_constexpr_virtual_base : Error<
2093   "constexpr %select{member function|constructor}0 not allowed in "
2094   "%select{struct|interface|class}1 with virtual base "
2095   "%plural{1:class|:classes}2">;
2096 def note_non_literal_incomplete : Note<
2097   "incomplete type %0 is not a literal type">;
2098 def note_non_literal_virtual_base : Note<"%select{struct|interface|class}0 "
2099   "with virtual base %plural{1:class|:classes}1 is not a literal type">;
2100 def note_constexpr_virtual_base_here : Note<"virtual base class declared here">;
2101 def err_constexpr_non_literal_return : Error<
2102   "constexpr function's return type %0 is not a literal type">;
2103 def err_constexpr_non_literal_param : Error<
2104   "constexpr %select{function|constructor}1's %ordinal0 parameter type %2 is "
2105   "not a literal type">;
2106 def err_constexpr_body_invalid_stmt : Error<
2107   "statement not allowed in constexpr %select{function|constructor}0">;
2108 def ext_constexpr_body_invalid_stmt : ExtWarn<
2109   "use of this statement in a constexpr %select{function|constructor}0 "
2110   "is a C++14 extension">, InGroup<CXX14>;
2111 def warn_cxx11_compat_constexpr_body_invalid_stmt : Warning<
2112   "use of this statement in a constexpr %select{function|constructor}0 "
2113   "is incompatible with C++ standards before C++14">,
2114   InGroup<CXXPre14Compat>, DefaultIgnore;
2115 def ext_constexpr_type_definition : ExtWarn<
2116   "type definition in a constexpr %select{function|constructor}0 "
2117   "is a C++14 extension">, InGroup<CXX14>;
2118 def warn_cxx11_compat_constexpr_type_definition : Warning<
2119   "type definition in a constexpr %select{function|constructor}0 "
2120   "is incompatible with C++ standards before C++14">,
2121   InGroup<CXXPre14Compat>, DefaultIgnore;
2122 def err_constexpr_vla : Error<
2123   "variably-modified type %0 cannot be used in a constexpr "
2124   "%select{function|constructor}1">;
2125 def ext_constexpr_local_var : ExtWarn<
2126   "variable declaration in a constexpr %select{function|constructor}0 "
2127   "is a C++14 extension">, InGroup<CXX14>;
2128 def warn_cxx11_compat_constexpr_local_var : Warning<
2129   "variable declaration in a constexpr %select{function|constructor}0 "
2130   "is incompatible with C++ standards before C++14">,
2131   InGroup<CXXPre14Compat>, DefaultIgnore;
2132 def err_constexpr_local_var_static : Error<
2133   "%select{static|thread_local}1 variable not permitted in a constexpr "
2134   "%select{function|constructor}0">;
2135 def err_constexpr_local_var_non_literal_type : Error<
2136   "variable of non-literal type %1 cannot be defined in a constexpr "
2137   "%select{function|constructor}0">;
2138 def err_constexpr_local_var_no_init : Error<
2139   "variables defined in a constexpr %select{function|constructor}0 must be "
2140   "initialized">;
2141 def ext_constexpr_function_never_constant_expr : ExtWarn<
2142   "constexpr %select{function|constructor}0 never produces a "
2143   "constant expression">, InGroup<DiagGroup<"invalid-constexpr">>, DefaultError;
2144 def err_attr_cond_never_constant_expr : Error<
2145   "%0 attribute expression never produces a constant expression">;
2146 def err_diagnose_if_invalid_diagnostic_type : Error<
2147   "invalid diagnostic type for 'diagnose_if'; use \"error\" or \"warning\" "
2148   "instead">;
2149 def err_constexpr_body_no_return : Error<
2150   "no return statement in constexpr function">;
2151 def err_constexpr_return_missing_expr : Error<
2152   "non-void constexpr function %0 should return a value">;
2153 def warn_cxx11_compat_constexpr_body_no_return : Warning<
2154   "constexpr function with no return statements is incompatible with C++ "
2155   "standards before C++14">, InGroup<CXXPre14Compat>, DefaultIgnore;
2156 def ext_constexpr_body_multiple_return : ExtWarn<
2157   "multiple return statements in constexpr function is a C++14 extension">,
2158   InGroup<CXX14>;
2159 def warn_cxx11_compat_constexpr_body_multiple_return : Warning<
2160   "multiple return statements in constexpr function "
2161   "is incompatible with C++ standards before C++14">,
2162   InGroup<CXXPre14Compat>, DefaultIgnore;
2163 def note_constexpr_body_previous_return : Note<
2164   "previous return statement is here">;
2165 def err_constexpr_function_try_block : Error<
2166   "function try block not allowed in constexpr %select{function|constructor}0">;
2167 def err_constexpr_union_ctor_no_init : Error<
2168   "constexpr union constructor does not initialize any member">;
2169 def err_constexpr_ctor_missing_init : Error<
2170   "constexpr constructor must initialize all members">;
2171 def note_constexpr_ctor_missing_init : Note<
2172   "member not initialized by constructor">;
2173 def note_non_literal_no_constexpr_ctors : Note<
2174   "%0 is not literal because it is not an aggregate and has no constexpr "
2175   "constructors other than copy or move constructors">;
2176 def note_non_literal_base_class : Note<
2177   "%0 is not literal because it has base class %1 of non-literal type">;
2178 def note_non_literal_field : Note<
2179   "%0 is not literal because it has data member %1 of "
2180   "%select{non-literal|volatile}3 type %2">;
2181 def note_non_literal_user_provided_dtor : Note<
2182   "%0 is not literal because it has a user-provided destructor">;
2183 def note_non_literal_nontrivial_dtor : Note<
2184   "%0 is not literal because it has a non-trivial destructor">;
2185 def warn_private_extern : Warning<
2186   "use of __private_extern__ on a declaration may not produce external symbol "
2187   "private to the linkage unit and is deprecated">, InGroup<PrivateExtern>;
2188 def note_private_extern : Note<
2189   "use __attribute__((visibility(\"hidden\"))) attribute instead">;
2190
2191 // C++ Concepts TS
2192 def err_concept_wrong_decl_kind : Error<
2193   "'concept' can only appear on the definition of a function template or variable template">;
2194 def err_concept_decls_may_only_appear_in_namespace_scope : Error<
2195   "concept declarations may only appear in namespace scope">;
2196 def err_function_concept_not_defined : Error<
2197   "function concept declaration must be a definition">;
2198 def err_var_concept_not_initialized : Error<
2199   "variable concept declaration must be initialized">;
2200 def err_function_concept_exception_spec : Error<
2201   "function concept cannot have exception specification">;
2202 def err_concept_decl_invalid_specifiers : Error<
2203   "%select{variable|function}0 concept cannot be declared "
2204   "'%select{thread_local|inline|friend|constexpr}1'">;
2205 def err_function_concept_with_params : Error<
2206   "function concept cannot have any parameters">;
2207 def err_function_concept_bool_ret : Error<
2208   "declared return type of function concept must be 'bool'">;
2209 def err_variable_concept_bool_decl : Error<
2210   "declared type of variable concept must be 'bool'">;
2211 def err_concept_specified_specialization : Error<
2212   "'concept' cannot be applied on an "
2213   "%select{explicit instantiation|explicit specialization|partial specialization}0">;
2214 def err_concept_specialized : Error<
2215   "%select{function|variable}0 concept cannot be "
2216   "%select{explicitly instantiated|explicitly specialized|partially specialized}1">;
2217
2218 // C++11 char16_t/char32_t
2219 def warn_cxx98_compat_unicode_type : Warning<
2220   "'%0' type specifier is incompatible with C++98">,
2221   InGroup<CXX98Compat>, DefaultIgnore;
2222
2223 // __make_integer_seq
2224 def err_integer_sequence_negative_length : Error<
2225   "integer sequences must have non-negative sequence length">;
2226 def err_integer_sequence_integral_element_type : Error<
2227   "integer sequences must have integral element type">;
2228
2229 // __type_pack_element
2230 def err_type_pack_element_out_of_bounds : Error<
2231   "a parameter pack may not be accessed at an out of bounds index">;
2232
2233 // Objective-C++
2234 def err_objc_decls_may_only_appear_in_global_scope : Error<
2235   "Objective-C declarations may only appear in global scope">;
2236 def warn_auto_var_is_id : Warning<
2237   "'auto' deduced as 'id' in declaration of %0">,
2238   InGroup<DiagGroup<"auto-var-id">>;
2239
2240 // Attributes
2241 def err_nsobject_attribute : Error<
2242   "'NSObject' attribute is for pointer types only">;
2243 def err_attributes_are_not_compatible : Error<
2244   "%0 and %1 attributes are not compatible">;
2245 def err_attribute_wrong_number_arguments : Error<
2246   "%0 attribute %plural{0:takes no arguments|1:takes one argument|"
2247   ":requires exactly %1 arguments}1">;
2248 def err_attribute_too_many_arguments : Error<
2249   "%0 attribute takes no more than %1 argument%s1">;
2250 def err_attribute_too_few_arguments : Error<
2251   "%0 attribute takes at least %1 argument%s1">;
2252 def err_attribute_invalid_vector_type : Error<"invalid vector element type %0">;
2253 def err_attribute_bad_neon_vector_size : Error<
2254   "Neon vector size must be 64 or 128 bits">;
2255 def err_attribute_requires_positive_integer : Error<
2256   "%0 attribute requires a positive integral compile time constant expression">;
2257 def err_attribute_requires_opencl_version : Error<
2258   "%0 attribute requires OpenCL version %1%select{| or above}2">;
2259 def warn_unsupported_target_attribute
2260     : Warning<"Ignoring unsupported '%0' in the target attribute string">,
2261     InGroup<IgnoredAttributes>;
2262 def err_attribute_unsupported
2263     : Error<"%0 attribute is not supported for this target">;
2264 // The err_*_attribute_argument_not_int are seperate because they're used by
2265 // VerifyIntegerConstantExpression.
2266 def err_aligned_attribute_argument_not_int : Error<
2267   "'aligned' attribute requires integer constant">;
2268 def err_align_value_attribute_argument_not_int : Error<
2269   "'align_value' attribute requires integer constant">;
2270 def err_alignas_attribute_wrong_decl_type : Error<
2271   "%0 attribute cannot be applied to a %select{function parameter|"
2272   "variable with 'register' storage class|'catch' variable|bit-field}1">;
2273 def err_alignas_missing_on_definition : Error<
2274   "%0 must be specified on definition if it is specified on any declaration">;
2275 def note_alignas_on_declaration : Note<"declared with %0 attribute here">;
2276 def err_alignas_mismatch : Error<
2277   "redeclaration has different alignment requirement (%1 vs %0)">;
2278 def err_alignas_underaligned : Error<
2279   "requested alignment is less than minimum alignment of %1 for type %0">;
2280 def err_attribute_argument_n_type : Error<
2281   "%0 attribute requires parameter %1 to be %select{int or bool|an integer "
2282   "constant|a string|an identifier}2">;
2283 def err_attribute_argument_type : Error<
2284   "%0 attribute requires %select{int or bool|an integer "
2285   "constant|a string|an identifier}1">;
2286 def err_attribute_argument_outof_range : Error<
2287   "%0 attribute requires integer constant between %1 and %2 inclusive">;
2288 def err_init_priority_object_attr : Error<
2289   "can only use 'init_priority' attribute on file-scope definitions "
2290   "of objects of class type">;
2291 def err_attribute_argument_vec_type_hint : Error<
2292   "invalid attribute argument %0 - expecting a vector or vectorizable scalar type">;
2293 def err_attribute_argument_out_of_bounds : Error<
2294   "%0 attribute parameter %1 is out of bounds">;
2295 def err_attribute_only_once_per_parameter : Error<
2296   "%0 attribute can only be applied once per parameter">;
2297 def err_attribute_uuid_malformed_guid : Error<
2298   "uuid attribute contains a malformed GUID">;
2299 def err_mismatched_uuid : Error<"uuid does not match previous declaration">;
2300 def note_previous_uuid : Note<"previous uuid specified here">;
2301 def warn_attribute_pointers_only : Warning<
2302   "%0 attribute only applies to%select{| constant}1 pointer arguments">,
2303   InGroup<IgnoredAttributes>;
2304 def err_attribute_pointers_only : Error<warn_attribute_pointers_only.Text>;
2305 def err_attribute_integers_only : Error<
2306   "%0 attribute argument may only refer to a function parameter of integer "
2307   "type">;
2308 def warn_attribute_return_pointers_only : Warning<
2309   "%0 attribute only applies to return values that are pointers">,
2310   InGroup<IgnoredAttributes>;
2311 def warn_attribute_return_pointers_refs_only : Warning<
2312   "%0 attribute only applies to return values that are pointers or references">,
2313   InGroup<IgnoredAttributes>;
2314 def warn_attribute_pointer_or_reference_only : Warning<
2315   "%0 attribute only applies to a pointer or reference (%1 is invalid)">,
2316   InGroup<IgnoredAttributes>;
2317 def err_attribute_no_member_pointers : Error<
2318   "%0 attribute cannot be used with pointers to members">;
2319 def err_attribute_invalid_implicit_this_argument : Error<
2320   "%0 attribute is invalid for the implicit this argument">;
2321 def err_ownership_type : Error<
2322   "%0 attribute only applies to %select{pointer|integer}1 arguments">;
2323 def err_ownership_returns_index_mismatch : Error<
2324   "'ownership_returns' attribute index does not match; here it is %0">;
2325 def note_ownership_returns_index_mismatch : Note<
2326   "declared with index %0 here">;
2327 def err_format_strftime_third_parameter : Error<
2328   "strftime format attribute requires 3rd parameter to be 0">;
2329 def err_format_attribute_requires_variadic : Error<
2330   "format attribute requires variadic function">;
2331 def err_format_attribute_not : Error<"format argument not %0">;
2332 def err_format_attribute_result_not : Error<"function does not return %0">;
2333 def err_format_attribute_implicit_this_format_string : Error<
2334   "format attribute cannot specify the implicit this argument as the format "
2335   "string">;
2336 def err_init_method_bad_return_type : Error<
2337   "init methods must return an object pointer type, not %0">;
2338 def err_attribute_invalid_size : Error<
2339   "vector size not an integral multiple of component size">;
2340 def err_attribute_zero_size : Error<"zero vector size">;
2341 def err_attribute_size_too_large : Error<"vector size too large">;
2342 def err_typecheck_vector_not_convertable : Error<
2343   "cannot convert between vector values of different size (%0 and %1)">;
2344 def err_typecheck_vector_not_convertable_non_scalar : Error<
2345   "cannot convert between vector and non-scalar values (%0 and %1)">;
2346 def err_typecheck_vector_lengths_not_equal : Error<
2347   "vector operands do not have the same number of elements (%0 and %1)">;
2348 def warn_typecheck_vector_element_sizes_not_equal : Warning<
2349   "vector operands do not have the same elements sizes (%0 and %1)">,
2350   InGroup<DiagGroup<"vec-elem-size">>, DefaultError;
2351 def err_ext_vector_component_exceeds_length : Error<
2352   "vector component access exceeds type %0">;
2353 def err_ext_vector_component_name_illegal : Error<
2354   "illegal vector component name '%0'">;
2355 def err_attribute_address_space_negative : Error<
2356   "address space is negative">;
2357 def err_attribute_address_space_too_high : Error<
2358   "address space is larger than the maximum supported (%0)">;
2359 def err_attribute_address_multiple_qualifiers : Error<
2360   "multiple address spaces specified for type">;
2361 def err_attribute_address_function_type : Error<
2362   "function type may not be qualified with an address space">;
2363 def err_as_qualified_auto_decl : Error<
2364   "automatic variable qualified with an address space">;
2365 def err_arg_with_address_space : Error<
2366   "parameter may not be qualified with an address space">;
2367 def err_field_with_address_space : Error<
2368   "field may not be qualified with an address space">;
2369 def err_attr_objc_ownership_redundant : Error<
2370   "the type %0 is already explicitly ownership-qualified">;
2371 def err_invalid_nsnumber_type : Error<
2372   "%0 is not a valid literal type for NSNumber">;
2373 def err_objc_illegal_boxed_expression_type : Error<
2374   "illegal type %0 used in a boxed expression">;
2375 def err_objc_non_trivially_copyable_boxed_expression_type : Error<
2376   "non-trivially copyable type %0 cannot be used in a boxed expression">;
2377 def err_objc_incomplete_boxed_expression_type : Error<
2378   "incomplete type %0 used in a boxed expression">;
2379 def err_undeclared_objc_literal_class : Error<
2380   "definition of class %0 must be available to use Objective-C "
2381   "%select{array literals|dictionary literals|numeric literals|boxed expressions|"
2382   "string literals}1">;
2383 def err_undeclared_boxing_method : Error<
2384   "declaration of %0 is missing in %1 class">;
2385 def err_objc_literal_method_sig : Error<
2386   "literal construction method %0 has incompatible signature">;
2387 def note_objc_literal_method_param : Note<
2388   "%select{first|second|third}0 parameter has unexpected type %1 "
2389   "(should be %2)">;
2390 def note_objc_literal_method_return : Note<
2391   "method returns unexpected type %0 (should be an object type)">;
2392 def err_invalid_collection_element : Error<
2393   "collection element of type %0 is not an Objective-C object">;
2394 def err_box_literal_collection : Error<
2395   "%select{string|character|boolean|numeric}0 literal must be prefixed by '@' "
2396   "in a collection">;
2397 def warn_objc_literal_comparison : Warning<
2398   "direct comparison of %select{an array literal|a dictionary literal|"
2399   "a numeric literal|a boxed expression|}0 has undefined behavior">,
2400   InGroup<ObjCLiteralComparison>;
2401 def err_missing_atsign_prefix : Error<
2402   "string literal must be prefixed by '@' ">;
2403 def warn_objc_string_literal_comparison : Warning<
2404   "direct comparison of a string literal has undefined behavior">, 
2405   InGroup<ObjCStringComparison>;
2406 def warn_concatenated_nsarray_literal : Warning<
2407   "concatenated NSString literal for an NSArray expression - "
2408   "possibly missing a comma">,
2409   InGroup<ObjCStringConcatenation>;
2410 def note_objc_literal_comparison_isequal : Note<
2411   "use 'isEqual:' instead">;
2412 def warn_objc_collection_literal_element : Warning<
2413   "object of type %0 is not compatible with "
2414   "%select{array element type|dictionary key type|dictionary value type}1 %2">,
2415   InGroup<ObjCLiteralConversion>;
2416 def err_swift_param_attr_not_swiftcall : Error<
2417   "'%0' parameter can only be used with swiftcall calling convention">;
2418 def err_swift_indirect_result_not_first : Error<
2419   "'swift_indirect_result' parameters must be first parameters of function">;
2420 def err_swift_error_result_not_after_swift_context : Error<
2421   "'swift_error_result' parameter must follow 'swift_context' parameter">;
2422 def err_swift_abi_parameter_wrong_type : Error<
2423   "'%0' parameter must have pointer%select{| to unqualified pointer}1 type; "
2424   "type here is %2">;
2425
2426 def err_attribute_argument_invalid : Error<
2427   "%0 attribute argument is invalid: %select{max must be 0 since min is 0|"
2428   "min must not be greater than max}1">;
2429 def err_attribute_argument_is_zero : Error<
2430   "%0 attribute must be greater than 0">;
2431 def warn_attribute_argument_n_negative : Warning<
2432   "%0 attribute parameter %1 is negative and will be ignored">,
2433   InGroup<CudaCompat>;
2434 def err_property_function_in_objc_container : Error<
2435   "use of Objective-C property in function nested in Objective-C "
2436   "container not supported, move function outside its container">;
2437
2438 let CategoryName = "Cocoa API Issue" in {
2439 def warn_objc_redundant_literal_use : Warning<
2440   "using %0 with a literal is redundant">, InGroup<ObjCRedundantLiteralUse>;
2441 }
2442
2443 def err_attr_tlsmodel_arg : Error<"tls_model must be \"global-dynamic\", "
2444   "\"local-dynamic\", \"initial-exec\" or \"local-exec\"">;
2445
2446 def err_tls_var_aligned_over_maximum : Error<
2447   "alignment (%0) of thread-local variable %1 is greater than the maximum supported "
2448   "alignment (%2) for a thread-local variable on this target">;
2449
2450 def err_only_annotate_after_access_spec : Error<
2451   "access specifier can only have annotation attributes">;
2452
2453 def err_attribute_section_invalid_for_target : Error<
2454   "argument to 'section' attribute is not valid for this target: %0">;
2455 def warn_mismatched_section : Warning<
2456   "section does not match previous declaration">, InGroup<Section>;
2457
2458 def err_anonymous_property: Error<
2459   "anonymous property is not supported">;
2460 def err_property_is_variably_modified : Error<
2461   "property %0 has a variably modified type">;
2462 def err_no_accessor_for_property : Error<
2463   "no %select{getter|setter}0 defined for property %1">;
2464 def err_cannot_find_suitable_accessor : Error<
2465   "cannot find suitable %select{getter|setter}0 for property %1">;
2466
2467 def warn_alloca_align_alignof : Warning<
2468   "second argument to __builtin_alloca_with_align is supposed to be in bits">,
2469   InGroup<DiagGroup<"alloca-with-align-alignof">>;
2470
2471 def err_alignment_too_small : Error<
2472   "requested alignment must be %0 or greater">;
2473 def err_alignment_too_big : Error<
2474   "requested alignment must be %0 or smaller">;
2475 def err_alignment_not_power_of_two : Error<
2476   "requested alignment is not a power of 2">;
2477 def err_alignment_dependent_typedef_name : Error<
2478   "requested alignment is dependent but declaration is not dependent">;
2479
2480 def err_attribute_aligned_too_great : Error<
2481   "requested alignment must be %0 bytes or smaller">;
2482 def warn_redeclaration_without_attribute_prev_attribute_ignored : Warning<
2483   "%q0 redeclared without %1 attribute: previous %1 ignored">,
2484   InGroup<MicrosoftInconsistentDllImport>;
2485 def warn_redeclaration_without_import_attribute : Warning<
2486   "%q0 redeclared without 'dllimport' attribute: 'dllexport' attribute added">,
2487   InGroup<MicrosoftInconsistentDllImport>;
2488 def warn_dllimport_dropped_from_inline_function : Warning<
2489   "%q0 redeclared inline; %1 attribute ignored">,
2490   InGroup<IgnoredAttributes>;
2491 def warn_attribute_ignored : Warning<"%0 attribute ignored">,
2492   InGroup<IgnoredAttributes>;
2493 def warn_attribute_ignored_on_inline :
2494   Warning<"%0 attribute ignored on inline function">,
2495   InGroup<IgnoredAttributes>;
2496 def warn_attribute_after_definition_ignored : Warning<
2497   "attribute %0 after definition is ignored">,
2498    InGroup<IgnoredAttributes>;
2499 def warn_unknown_attribute_ignored : Warning<
2500   "unknown attribute %0 ignored">, InGroup<UnknownAttributes>;
2501 def warn_cxx11_gnu_attribute_on_type : Warning<
2502   "attribute %0 ignored, because it cannot be applied to a type">,
2503   InGroup<IgnoredAttributes>;
2504 def warn_unhandled_ms_attribute_ignored : Warning<
2505   "__declspec attribute %0 is not supported">, 
2506   InGroup<IgnoredAttributes>;
2507 def err_decl_attribute_invalid_on_stmt : Error<
2508   "%0 attribute cannot be applied to a statement">;
2509 def err_stmt_attribute_invalid_on_decl : Error<
2510   "%0 attribute cannot be applied to a declaration">;
2511 def warn_declspec_attribute_ignored : Warning<
2512   "attribute %0 is ignored, place it after "
2513   "\"%select{class|struct|interface|union|enum}1\" to apply attribute to "
2514   "type declaration">, InGroup<IgnoredAttributes>;
2515 def warn_attribute_precede_definition : Warning<
2516   "attribute declaration must precede definition">,
2517   InGroup<IgnoredAttributes>;
2518 def warn_attribute_void_function_method : Warning<
2519   "attribute %0 cannot be applied to "
2520   "%select{functions|Objective-C method}1 without return value">,
2521   InGroup<IgnoredAttributes>;
2522 def warn_attribute_weak_on_field : Warning<
2523   "__weak attribute cannot be specified on a field declaration">,
2524   InGroup<IgnoredAttributes>;
2525 def warn_gc_attribute_weak_on_local : Warning<
2526   "Objective-C GC does not allow weak variables on the stack">,
2527   InGroup<IgnoredAttributes>;
2528 def warn_nsobject_attribute : Warning<
2529   "'NSObject' attribute may be put on a typedef only; attribute is ignored">,
2530   InGroup<NSobjectAttribute>;
2531 def warn_independentclass_attribute : Warning<
2532   "'objc_independent_class' attribute may be put on a typedef only; "
2533   "attribute is ignored">,
2534   InGroup<IndependentClassAttribute>;
2535 def warn_ptr_independentclass_attribute : Warning<
2536   "'objc_independent_class' attribute may be put on Objective-C object "
2537   "pointer type only; attribute is ignored">,
2538   InGroup<IndependentClassAttribute>;
2539 def warn_attribute_weak_on_local : Warning<
2540   "__weak attribute cannot be specified on an automatic variable when ARC "
2541   "is not enabled">,
2542   InGroup<IgnoredAttributes>;
2543 def warn_weak_identifier_undeclared : Warning<
2544   "weak identifier %0 never declared">;
2545 def err_attribute_weak_static : Error<
2546   "weak declaration cannot have internal linkage">;
2547 def err_attribute_selectany_non_extern_data : Error<
2548   "'selectany' can only be applied to data items with external linkage">;
2549 def err_declspec_thread_on_thread_variable : Error<
2550   "'__declspec(thread)' applied to variable that already has a "
2551   "thread-local storage specifier">;
2552 def err_attribute_dll_not_extern : Error<
2553   "%q0 must have external linkage when declared %q1">;
2554 def err_attribute_dll_thread_local : Error<
2555   "%q0 cannot be thread local when declared %q1">;
2556 def err_attribute_dll_lambda : Error<
2557   "lambda cannot be declared %0">;
2558 def warn_attribute_invalid_on_definition : Warning<
2559   "'%0' attribute cannot be specified on a definition">,
2560   InGroup<IgnoredAttributes>;
2561 def err_attribute_dll_redeclaration : Error<
2562   "redeclaration of %q0 cannot add %q1 attribute">;
2563 def warn_attribute_dll_redeclaration : Warning<
2564   "redeclaration of %q0 should not add %q1 attribute">,
2565   InGroup<DiagGroup<"dll-attribute-on-redeclaration">>;
2566 def err_attribute_dllimport_function_definition : Error<
2567   "dllimport cannot be applied to non-inline function definition">;
2568 def err_attribute_dll_deleted : Error<
2569   "attribute %q0 cannot be applied to a deleted function">;
2570 def err_attribute_dllimport_data_definition : Error<
2571   "definition of dllimport data">;
2572 def err_attribute_dllimport_static_field_definition : Error<
2573   "definition of dllimport static field not allowed">;
2574 def warn_attribute_dllimport_static_field_definition : Warning<
2575   "definition of dllimport static field">,
2576   InGroup<DiagGroup<"dllimport-static-field-def">>;
2577 def warn_attribute_dllexport_explicit_instantiation_decl : Warning<
2578   "explicit instantiation declaration should not be 'dllexport'">,
2579   InGroup<DiagGroup<"dllexport-explicit-instantiation-decl">>;
2580 def warn_invalid_initializer_from_system_header : Warning<
2581   "invalid constructor form class in system header, should not be explicit">,
2582   InGroup<DiagGroup<"invalid-initializer-from-system-header">>;
2583 def note_used_in_initialization_here : Note<"used in initialization here">;
2584 def err_attribute_dll_member_of_dll_class : Error<
2585   "attribute %q0 cannot be applied to member of %q1 class">;
2586 def warn_attribute_dll_instantiated_base_class : Warning<
2587   "propagating dll attribute to %select{already instantiated|explicitly specialized}0 "
2588   "base class template without dll attribute is not supported">,
2589   InGroup<DiagGroup<"unsupported-dll-base-class-template">>, DefaultIgnore;
2590 def err_attribute_dll_ambiguous_default_ctor : Error<
2591   "'__declspec(dllexport)' cannot be applied to more than one default constructor in %0">;
2592 def err_attribute_weakref_not_static : Error<
2593   "weakref declaration must have internal linkage">;
2594 def err_attribute_weakref_not_global_context : Error<
2595   "weakref declaration of %0 must be in a global context">;
2596 def err_attribute_weakref_without_alias : Error<
2597   "weakref declaration of %0 must also have an alias attribute">;
2598 def err_alias_not_supported_on_darwin : Error <
2599   "only weak aliases are supported on darwin">;
2600 def err_alias_to_undefined : Error<
2601   "%select{alias|ifunc}0 must point to a defined %select{variable or |}1function">;
2602 def warn_alias_to_weak_alias : Warning<
2603   "%select{alias|ifunc}2 will always resolve to %0 even if weak definition of %1 is overridden">,
2604   InGroup<IgnoredAttributes>;
2605 def warn_alias_with_section : Warning<
2606   "%select{alias|ifunc}1 will not be in section '%0' but in the same section as the %select{aliasee|resolver}2">,
2607   InGroup<IgnoredAttributes>;
2608 def err_duplicate_mangled_name : Error<
2609   "definition with same mangled name as another definition">;
2610 def err_cyclic_alias : Error<
2611   "%select{alias|ifunc}0 definition is part of a cycle">;
2612 def err_ifunc_resolver_return : Error<
2613   "ifunc resolver function must return a pointer">;
2614 def err_ifunc_resolver_params : Error<
2615   "ifunc resolver function must have no parameters">;
2616 def warn_attribute_wrong_decl_type : Warning<
2617   "%0 attribute only applies to %select{"
2618   "functions"
2619   "|unions"
2620   "|variables and functions"
2621   "|functions and global variables"
2622   "|functions, variables, and Objective-C interfaces"
2623   "|functions and methods"
2624   "|parameters"
2625   "|functions, methods and blocks"
2626   "|functions, methods, and classes"
2627   "|functions, methods, and parameters"
2628   "|functions, methods, and global variables"
2629   "|classes"
2630   "|enums"
2631   "|variables"
2632   "|methods"
2633   "|fields and global variables"
2634   "|structs"
2635   "|parameters and typedefs"
2636   "|variables and typedefs"
2637   "|thread-local variables"
2638   "|variables and fields"
2639   "|variables, data members and tag types"
2640   "|types and namespaces"
2641   "|Objective-C interfaces"
2642   "|methods and properties"
2643   "|struct or union"
2644   "|struct, union or class"
2645   "|types"
2646   "|Objective-C instance methods"
2647   "|init methods of interface or class extension declarations"
2648   "|variables, functions and classes"
2649   "|functions, variables, classes, and Objective-C interfaces"
2650   "|Objective-C protocols"
2651   "|variables with static or thread storage duration"
2652   "|functions, methods, properties, and global variables"
2653   "|structs, unions, and typedefs"
2654   "|structs and typedefs"
2655   "|interface or protocol declarations"
2656   "|kernel functions"
2657   "|non-K&R-style functions"
2658   "|variables, enums, fields and typedefs"
2659   "|functions, methods, enums, and classes"
2660   "|structs, classes, variables, functions, and inline namespaces"
2661   "|variables, functions, methods, types, enumerations, enumerators, labels, and non-static data members"
2662   "|classes and enumerations}1">,
2663   InGroup<IgnoredAttributes>;
2664 def err_attribute_wrong_decl_type : Error<warn_attribute_wrong_decl_type.Text>;
2665 def warn_type_attribute_wrong_type : Warning<
2666   "'%0' only applies to %select{function|pointer|"
2667   "Objective-C object or block pointer}1 types; type here is %2">,
2668   InGroup<IgnoredAttributes>;
2669 def warn_incomplete_encoded_type : Warning<
2670   "encoding of %0 type is incomplete because %1 component has unknown encoding">,
2671   InGroup<DiagGroup<"encode-type">>;
2672 def warn_gnu_inline_attribute_requires_inline : Warning<
2673   "'gnu_inline' attribute requires function to be marked 'inline',"
2674   " attribute ignored">,
2675   InGroup<IgnoredAttributes>;
2676 def err_attribute_vecreturn_only_vector_member : Error<
2677   "the vecreturn attribute can only be used on a class or structure with one member, which must be a vector">;
2678 def err_attribute_vecreturn_only_pod_record : Error<
2679   "the vecreturn attribute can only be used on a POD (plain old data) class or structure (i.e. no virtual functions)">;
2680 def err_cconv_change : Error<
2681   "function declared '%0' here was previously declared "
2682   "%select{'%2'|without calling convention}1">;
2683 def warn_cconv_ignored : Warning<
2684   "calling convention %0 ignored for this target">, InGroup<IgnoredAttributes>;
2685 def err_cconv_knr : Error<
2686   "function with no prototype cannot use the %0 calling convention">;
2687 def warn_cconv_knr : Warning<
2688   err_cconv_knr.Text>,
2689   InGroup<DiagGroup<"missing-prototype-for-cc">>;
2690 def err_cconv_varargs : Error<
2691   "variadic function cannot use %0 calling convention">;
2692 def warn_cconv_varargs : Warning<
2693   "%0 calling convention ignored on variadic function">,
2694   InGroup<IgnoredAttributes>;
2695 def warn_cconv_structors : Warning<
2696   "%0 calling convention ignored on constructor/destructor">,
2697   InGroup<IgnoredAttributes>;
2698 def err_regparm_mismatch : Error<"function declared with regparm(%0) "
2699   "attribute was previously declared "
2700   "%plural{0:without the regparm|:with the regparm(%1)}1 attribute">;
2701 def err_returns_retained_mismatch : Error<
2702   "function declared with the ns_returns_retained attribute "
2703   "was previously declared without the ns_returns_retained attribute">;
2704 def err_objc_precise_lifetime_bad_type : Error<
2705   "objc_precise_lifetime only applies to retainable types; type here is %0">;
2706 def warn_objc_precise_lifetime_meaningless : Error<
2707   "objc_precise_lifetime is not meaningful for "
2708   "%select{__unsafe_unretained|__autoreleasing}0 objects">;
2709 def err_invalid_pcs : Error<"invalid PCS type">;
2710 def warn_attribute_not_on_decl : Warning<
2711   "%0 attribute ignored when parsing type">, InGroup<IgnoredAttributes>;
2712 def err_base_specifier_attribute : Error<
2713   "%0 attribute cannot be applied to a base specifier">;
2714 def err_invalid_attribute_on_virtual_function : Error<
2715   "%0 attribute cannot be applied to virtual functions">;
2716
2717 // Availability attribute
2718 def warn_availability_unknown_platform : Warning<
2719   "unknown platform %0 in availability macro">, InGroup<Availability>;
2720 def warn_availability_version_ordering : Warning<
2721   "feature cannot be %select{introduced|deprecated|obsoleted}0 in %1 version "
2722   "%2 before it was %select{introduced|deprecated|obsoleted}3 in version %4; "
2723   "attribute ignored">, InGroup<Availability>;
2724 def warn_mismatched_availability: Warning<
2725   "availability does not match previous declaration">, InGroup<Availability>;
2726 def warn_mismatched_availability_override : Warning<
2727   "%select{|overriding }4method %select{introduced after|"
2728   "deprecated before|obsoleted before}0 "
2729   "%select{the protocol method it implements|overridden method}4 "
2730   "on %1 (%2 vs. %3)">, InGroup<Availability>;
2731 def warn_mismatched_availability_override_unavail : Warning<
2732   "%select{|overriding }1method cannot be unavailable on %0 when "
2733   "%select{the protocol method it implements|its overridden method}1 is "
2734   "available">,
2735   InGroup<Availability>;
2736 def note_overridden_method : Note<
2737   "overridden method is here">;
2738 def note_protocol_method : Note<
2739   "protocol method is here">;
2740
2741 def warn_unguarded_availability :
2742   Warning<"%0 is only available on %1 %2 or newer">,
2743   InGroup<UnguardedAvailability>, DefaultIgnore;
2744 def warn_partial_availability : Warning<"%0 is only available conditionally">,
2745     InGroup<UnguardedAvailability>, DefaultIgnore;
2746 def note_partial_availability_silence : Note<
2747   "explicitly redeclare %0 to silence this warning">;
2748 def note_unguarded_available_silence : Note<
2749   "enclose %0 in an @available check to silence this warning">;
2750 def warn_partial_message : Warning<"%0 is partial: %1">,
2751     InGroup<UnguardedAvailability>, DefaultIgnore;
2752 def warn_partial_fwdclass_message : Warning<
2753     "%0 may be partial because the receiver type is unknown">,
2754     InGroup<UnguardedAvailability>, DefaultIgnore;
2755
2756 // Thread Safety Attributes
2757 def warn_invalid_capability_name : Warning<
2758   "invalid capability name '%0'; capability name must be 'mutex' or 'role'">,
2759   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2760 def warn_thread_attribute_ignored : Warning<
2761   "ignoring %0 attribute because its argument is invalid">,
2762   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2763 def warn_thread_attribute_argument_not_lockable : Warning<
2764   "%0 attribute requires arguments whose type is annotated "
2765   "with 'capability' attribute; type here is %1">,
2766   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2767 def warn_thread_attribute_decl_not_lockable : Warning<
2768   "%0 attribute can only be applied in a context annotated "
2769   "with 'capability(\"mutex\")' attribute">,
2770   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2771 def warn_thread_attribute_decl_not_pointer : Warning<
2772   "%0 only applies to pointer types; type here is %1">,
2773   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2774 def err_attribute_argument_out_of_range : Error<
2775   "%0 attribute parameter %1 is out of bounds: "
2776   "%plural{0:no parameters to index into|"
2777   "1:can only be 1, since there is one parameter|"
2778   ":must be between 1 and %2}2">;
2779
2780 // Thread Safety Analysis   
2781 def warn_unlock_but_no_lock : Warning<"releasing %0 '%1' that was not held">,
2782   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2783 def warn_unlock_kind_mismatch : Warning<
2784   "releasing %0 '%1' using %select{shared|exclusive}2 access, expected "
2785   "%select{shared|exclusive}3 access">,
2786   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2787 def warn_double_lock : Warning<"acquiring %0 '%1' that is already held">,
2788   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2789 def warn_no_unlock : Warning<
2790   "%0 '%1' is still held at the end of function">,
2791   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2792 def warn_expecting_locked : Warning<
2793   "expecting %0 '%1' to be held at the end of function">,
2794   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;  
2795 // FIXME: improve the error message about locks not in scope
2796 def warn_lock_some_predecessors : Warning<
2797   "%0 '%1' is not held on every path through here">,
2798   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2799 def warn_expecting_lock_held_on_loop : Warning<
2800   "expecting %0 '%1' to be held at start of each loop">,
2801   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2802 def note_locked_here : Note<"%0 acquired here">;
2803 def warn_lock_exclusive_and_shared : Warning<
2804   "%0 '%1' is acquired exclusively and shared in the same scope">,
2805   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2806 def note_lock_exclusive_and_shared : Note<
2807   "the other acquisition of %0 '%1' is here">;
2808 def warn_variable_requires_any_lock : Warning<
2809   "%select{reading|writing}1 variable '%0' requires holding "
2810   "%select{any mutex|any mutex exclusively}1">,
2811   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2812 def warn_var_deref_requires_any_lock : Warning<
2813   "%select{reading|writing}1 the value pointed to by '%0' requires holding "
2814   "%select{any mutex|any mutex exclusively}1">,
2815   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2816 def warn_fun_excludes_mutex : Warning<
2817   "cannot call function '%1' while %0 '%2' is held">,
2818   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2819 def warn_cannot_resolve_lock : Warning<
2820   "cannot resolve lock expression">,
2821   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2822 def warn_acquired_before : Warning<
2823   "%0 '%1' must be acquired before '%2'">,
2824   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2825 def warn_acquired_before_after_cycle : Warning<
2826   "Cycle in acquired_before/after dependencies, starting with '%0'">,
2827   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2828
2829
2830 // Thread safety warnings negative capabilities
2831 def warn_acquire_requires_negative_cap : Warning<
2832   "acquiring %0 '%1' requires negative capability '%2'">,
2833   InGroup<ThreadSafetyNegative>, DefaultIgnore;
2834
2835 // Thread safety warnings on pass by reference
2836 def warn_guarded_pass_by_reference : Warning<
2837   "passing variable '%1' by reference requires holding %0 "
2838   "%select{'%2'|'%2' exclusively}3">,
2839   InGroup<ThreadSafetyReference>, DefaultIgnore;
2840 def warn_pt_guarded_pass_by_reference : Warning<
2841   "passing the value that '%1' points to by reference requires holding %0 "
2842   "%select{'%2'|'%2' exclusively}3">,
2843   InGroup<ThreadSafetyReference>, DefaultIgnore;
2844
2845 // Imprecise thread safety warnings
2846 def warn_variable_requires_lock : Warning<
2847   "%select{reading|writing}3 variable '%1' requires holding %0 "
2848   "%select{'%2'|'%2' exclusively}3">,
2849   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2850 def warn_var_deref_requires_lock : Warning<
2851   "%select{reading|writing}3 the value pointed to by '%1' requires "
2852   "holding %0 %select{'%2'|'%2' exclusively}3">,
2853   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2854 def warn_fun_requires_lock : Warning<
2855   "calling function '%1' requires holding %0 %select{'%2'|'%2' exclusively}3">,
2856   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2857
2858 // Precise thread safety warnings
2859 def warn_variable_requires_lock_precise :
2860   Warning<warn_variable_requires_lock.Text>,
2861   InGroup<ThreadSafetyPrecise>, DefaultIgnore;
2862 def warn_var_deref_requires_lock_precise :
2863   Warning<warn_var_deref_requires_lock.Text>,
2864   InGroup<ThreadSafetyPrecise>, DefaultIgnore;
2865 def warn_fun_requires_lock_precise :
2866   Warning<warn_fun_requires_lock.Text>,
2867   InGroup<ThreadSafetyPrecise>, DefaultIgnore;
2868 def note_found_mutex_near_match : Note<"found near match '%0'">;
2869
2870 // Verbose thread safety warnings
2871 def warn_thread_safety_verbose : Warning<"Thread safety verbose warning.">, 
2872   InGroup<ThreadSafetyVerbose>, DefaultIgnore;
2873 def note_thread_warning_in_fun : Note<"Thread warning in function '%0'">;
2874 def note_guarded_by_declared_here : Note<"Guarded_by declared here.">;
2875
2876 // Dummy warning that will trigger "beta" warnings from the analysis if enabled. 
2877 def warn_thread_safety_beta : Warning<"Thread safety beta warning.">, 
2878   InGroup<ThreadSafetyBeta>, DefaultIgnore;
2879
2880 // Consumed warnings
2881 def warn_use_in_invalid_state : Warning<
2882   "invalid invocation of method '%0' on object '%1' while it is in the '%2' "
2883   "state">, InGroup<Consumed>, DefaultIgnore;
2884 def warn_use_of_temp_in_invalid_state : Warning<
2885   "invalid invocation of method '%0' on a temporary object while it is in the "
2886   "'%1' state">, InGroup<Consumed>, DefaultIgnore;
2887 def warn_attr_on_unconsumable_class : Warning<
2888   "consumed analysis attribute is attached to member of class '%0' which isn't "
2889   "marked as consumable">, InGroup<Consumed>, DefaultIgnore;
2890 def warn_return_typestate_for_unconsumable_type : Warning<
2891   "return state set for an unconsumable type '%0'">, InGroup<Consumed>,
2892   DefaultIgnore;
2893 def warn_return_typestate_mismatch : Warning<
2894   "return value not in expected state; expected '%0', observed '%1'">,
2895   InGroup<Consumed>, DefaultIgnore;
2896 def warn_loop_state_mismatch : Warning<
2897   "state of variable '%0' must match at the entry and exit of loop">,
2898   InGroup<Consumed>, DefaultIgnore;
2899 def warn_param_return_typestate_mismatch : Warning<
2900   "parameter '%0' not in expected state when the function returns: expected "
2901   "'%1', observed '%2'">, InGroup<Consumed>, DefaultIgnore;
2902 def warn_param_typestate_mismatch : Warning<
2903   "argument not in expected state; expected '%0', observed '%1'">,
2904   InGroup<Consumed>, DefaultIgnore;
2905
2906 // no_sanitize attribute
2907 def warn_unknown_sanitizer_ignored : Warning<
2908   "unknown sanitizer '%0' ignored">, InGroup<UnknownSanitizers>;
2909
2910 def warn_impcast_vector_scalar : Warning<
2911   "implicit conversion turns vector to scalar: %0 to %1">,
2912   InGroup<Conversion>, DefaultIgnore;
2913 def warn_impcast_complex_scalar : Warning<
2914   "implicit conversion discards imaginary component: %0 to %1">,
2915   InGroup<Conversion>, DefaultIgnore;
2916 def warn_impcast_float_precision : Warning<
2917   "implicit conversion loses floating-point precision: %0 to %1">,
2918   InGroup<Conversion>, DefaultIgnore;
2919 def warn_impcast_double_promotion : Warning<
2920   "implicit conversion increases floating-point precision: %0 to %1">,
2921   InGroup<DoublePromotion>, DefaultIgnore;
2922 def warn_impcast_integer_sign : Warning<
2923   "implicit conversion changes signedness: %0 to %1">,
2924   InGroup<SignConversion>, DefaultIgnore;
2925 def warn_impcast_integer_sign_conditional : Warning<
2926   "operand of ? changes signedness: %0 to %1">,
2927   InGroup<SignConversion>, DefaultIgnore;
2928 def warn_impcast_integer_precision : Warning<
2929   "implicit conversion loses integer precision: %0 to %1">,
2930   InGroup<Conversion>, DefaultIgnore;
2931 def warn_impcast_integer_64_32 : Warning<
2932   "implicit conversion loses integer precision: %0 to %1">,
2933   InGroup<Shorten64To32>, DefaultIgnore;
2934 def warn_impcast_integer_precision_constant : Warning<
2935   "implicit conversion from %2 to %3 changes value from %0 to %1">,
2936   InGroup<ConstantConversion>;
2937 def warn_impcast_bitfield_precision_constant : Warning<
2938   "implicit truncation from %2 to bit-field changes value from %0 to %1">,
2939   InGroup<BitFieldConstantConversion>;
2940
2941 def warn_impcast_literal_float_to_integer : Warning<
2942   "implicit conversion from %0 to %1 changes value from %2 to %3">,
2943   InGroup<LiteralConversion>;
2944 def warn_impcast_float_integer : Warning<
2945   "implicit conversion turns floating-point number into integer: %0 to %1">,
2946   InGroup<FloatConversion>, DefaultIgnore;
2947
2948 def warn_impcast_float_to_integer : Warning<
2949   "implicit conversion of out of range value from %0 to %1 changes value "
2950   "from %2 to %3">,
2951   InGroup<FloatOverflowConversion>, DefaultIgnore;
2952 def warn_impcast_float_to_integer_zero : Warning<
2953   "implicit conversion from %0 to %1 changes non-zero value from %2 to %3">,
2954   InGroup<FloatZeroConversion>, DefaultIgnore;
2955
2956 def warn_impcast_string_literal_to_bool : Warning<
2957   "implicit conversion turns string literal into bool: %0 to %1">,
2958   InGroup<StringConversion>, DefaultIgnore;
2959 def warn_impcast_different_enum_types : Warning<
2960   "implicit conversion from enumeration type %0 to different enumeration type "
2961   "%1">, InGroup<EnumConversion>;
2962 def warn_impcast_bool_to_null_pointer : Warning<
2963     "initialization of pointer of type %0 to null from a constant boolean "
2964     "expression">, InGroup<BoolConversion>;
2965 def warn_non_literal_null_pointer : Warning<
2966     "expression which evaluates to zero treated as a null pointer constant of "
2967     "type %0">, InGroup<NonLiteralNullConversion>;
2968 def warn_impcast_null_pointer_to_integer : Warning<
2969     "implicit conversion of %select{NULL|nullptr}0 constant to %1">,
2970     InGroup<NullConversion>;
2971 def warn_impcast_floating_point_to_bool : Warning<
2972     "implicit conversion turns floating-point number into bool: %0 to %1">,
2973     InGroup<ImplicitConversionFloatingPointToBool>;
2974 def ext_ms_impcast_fn_obj : ExtWarn<
2975   "implicit conversion between pointer-to-function and pointer-to-object is a "
2976   "Microsoft extension">, InGroup<MicrosoftCast>;
2977
2978 def warn_impcast_pointer_to_bool : Warning<
2979     "address of%select{| function| array}0 '%1' will always evaluate to "
2980     "'true'">,
2981     InGroup<PointerBoolConversion>;
2982 def warn_cast_nonnull_to_bool : Warning<
2983     "nonnull %select{function call|parameter}0 '%1' will evaluate to "
2984     "'true' on first encounter">,
2985     InGroup<PointerBoolConversion>;
2986 def warn_this_bool_conversion : Warning<
2987   "'this' pointer cannot be null in well-defined C++ code; pointer may be "
2988   "assumed to always convert to true">, InGroup<UndefinedBoolConversion>;
2989 def warn_address_of_reference_bool_conversion : Warning<
2990   "reference cannot be bound to dereferenced null pointer in well-defined C++ "
2991   "code; pointer may be assumed to always convert to true">,
2992   InGroup<UndefinedBoolConversion>;
2993
2994 def warn_null_pointer_compare : Warning<
2995     "comparison of %select{address of|function|array}0 '%1' %select{not |}2"
2996     "equal to a null pointer is always %select{true|false}2">,
2997     InGroup<TautologicalPointerCompare>;
2998 def warn_nonnull_expr_compare : Warning<
2999     "comparison of nonnull %select{function call|parameter}0 '%1' "
3000     "%select{not |}2equal to a null pointer is '%select{true|false}2' on first "
3001     "encounter">,
3002     InGroup<TautologicalPointerCompare>;
3003 def warn_this_null_compare : Warning<
3004   "'this' pointer cannot be null in well-defined C++ code; comparison may be "
3005   "assumed to always evaluate to %select{true|false}0">,
3006   InGroup<TautologicalUndefinedCompare>;
3007 def warn_address_of_reference_null_compare : Warning<
3008   "reference cannot be bound to dereferenced null pointer in well-defined C++ "
3009   "code; comparison may be assumed to always evaluate to "
3010   "%select{true|false}0">,
3011   InGroup<TautologicalUndefinedCompare>;
3012 def note_reference_is_return_value : Note<"%0 returns a reference">;
3013
3014 def note_function_warning_silence : Note<
3015     "prefix with the address-of operator to silence this warning">;
3016 def note_function_to_function_call : Note<
3017     "suffix with parentheses to turn this into a function call">;
3018 def warn_impcast_objective_c_literal_to_bool : Warning<
3019     "implicit boolean conversion of Objective-C object literal always "
3020     "evaluates to true">,
3021     InGroup<ObjCLiteralConversion>;
3022
3023 def warn_cast_align : Warning<
3024   "cast from %0 to %1 increases required alignment from %2 to %3">,
3025   InGroup<CastAlign>, DefaultIgnore;
3026 def warn_old_style_cast : Warning<
3027   "use of old-style cast">, InGroup<OldStyleCast>, DefaultIgnore;
3028
3029 // Separate between casts to void* and non-void* pointers.
3030 // Some APIs use (abuse) void* for something like a user context,
3031 // and often that value is an integer even if it isn't a pointer itself.
3032 // Having a separate warning flag allows users to control the warning
3033 // for their workflow.
3034 def warn_int_to_pointer_cast : Warning<
3035   "cast to %1 from smaller integer type %0">,
3036   InGroup<IntToPointerCast>;
3037 def warn_int_to_void_pointer_cast : Warning<
3038   "cast to %1 from smaller integer type %0">,
3039   InGroup<IntToVoidPointerCast>;
3040
3041 def warn_no_underlying_type_specified_for_enum_bitfield : Warning<
3042   "enums in the Microsoft ABI are signed integers by default; consider giving "
3043   "the enum %0 an unsigned underlying type to make this code portable">,
3044   InGroup<SignedEnumBitfield>, DefaultIgnore;
3045 def warn_attribute_packed_for_bitfield : Warning<
3046   "'packed' attribute was ignored on bit-fields with single-byte alignment "
3047   "in older versions of GCC and Clang">,
3048   InGroup<DiagGroup<"attribute-packed-for-bitfield">>;
3049 def warn_transparent_union_attribute_field_size_align : Warning<
3050   "%select{alignment|size}0 of field %1 (%2 bits) does not match the "
3051   "%select{alignment|size}0 of the first field in transparent union; "
3052   "transparent_union attribute ignored">,
3053   InGroup<IgnoredAttributes>;
3054 def note_transparent_union_first_field_size_align : Note<
3055   "%select{alignment|size}0 of first field is %1 bits">;
3056 def warn_transparent_union_attribute_not_definition : Warning<
3057   "transparent_union attribute can only be applied to a union definition; "
3058   "attribute ignored">,
3059   InGroup<IgnoredAttributes>;
3060 def warn_transparent_union_attribute_floating : Warning<
3061   "first field of a transparent union cannot have %select{floating point|"
3062   "vector}0 type %1; transparent_union attribute ignored">,
3063   InGroup<IgnoredAttributes>;
3064 def warn_transparent_union_attribute_zero_fields : Warning<
3065   "transparent union definition must contain at least one field; "
3066   "transparent_union attribute ignored">,
3067   InGroup<IgnoredAttributes>;
3068 def warn_attribute_type_not_supported : Warning<
3069   "%0 attribute argument not supported: %1">,
3070   InGroup<IgnoredAttributes>;
3071 def warn_attribute_unknown_visibility : Warning<"unknown visibility %0">,
3072   InGroup<IgnoredAttributes>;
3073 def warn_attribute_protected_visibility :
3074   Warning<"target does not support 'protected' visibility; using 'default'">,
3075   InGroup<DiagGroup<"unsupported-visibility">>;
3076 def err_mismatched_visibility: Error<"visibility does not match previous declaration">;
3077 def note_previous_attribute : Note<"previous attribute is here">;
3078 def note_conflicting_attribute : Note<"conflicting attribute is here">;
3079 def note_attribute : Note<"attribute is here">;
3080 def err_mismatched_ms_inheritance : Error<
3081   "inheritance model does not match %select{definition|previous declaration}0">;
3082 def warn_ignored_ms_inheritance : Warning<
3083   "inheritance model ignored on %select{primary template|partial specialization}0">,
3084   InGroup<IgnoredAttributes>;
3085 def note_previous_ms_inheritance : Note<
3086   "previous inheritance model specified here">;
3087 def err_machine_mode : Error<"%select{unknown|unsupported}0 machine mode %1">;
3088 def err_mode_not_primitive : Error<
3089   "mode attribute only supported for integer and floating-point types">;
3090 def err_mode_wrong_type : Error<
3091   "type of machine mode does not match type of base type">;
3092 def warn_vector_mode_deprecated : Warning<
3093   "specifying vector types with the 'mode' attribute is deprecated; "
3094   "use the 'vector_size' attribute instead">,
3095   InGroup<DeprecatedAttributes>;
3096 def err_complex_mode_vector_type : Error<
3097   "type of machine mode does not support base vector types">;
3098 def err_enum_mode_vector_type : Error<
3099   "mode %0 is not supported for enumeration types">;
3100 def warn_attribute_nonnull_no_pointers : Warning<
3101   "'nonnull' attribute applied to function with no pointer arguments">,
3102   InGroup<IgnoredAttributes>;
3103 def warn_attribute_nonnull_parm_no_args : Warning<
3104   "'nonnull' attribute when used on parameters takes no arguments">,
3105   InGroup<IgnoredAttributes>;
3106 def note_declared_nonnull : Note<
3107   "declared %select{'returns_nonnull'|'nonnull'}0 here">;
3108 def warn_attribute_sentinel_named_arguments : Warning<
3109   "'sentinel' attribute requires named arguments">,
3110   InGroup<IgnoredAttributes>;
3111 def warn_attribute_sentinel_not_variadic : Warning<
3112   "'sentinel' attribute only supported for variadic %select{functions|blocks}0">,
3113   InGroup<IgnoredAttributes>;
3114 def err_attribute_sentinel_less_than_zero : Error<
3115   "'sentinel' parameter 1 less than zero">;
3116 def err_attribute_sentinel_not_zero_or_one : Error<
3117   "'sentinel' parameter 2 not 0 or 1">;
3118 def warn_cleanup_ext : Warning<
3119   "GCC does not allow the 'cleanup' attribute argument to be anything other "
3120   "than a simple identifier">, 
3121   InGroup<GccCompat>;
3122 def err_attribute_cleanup_arg_not_function : Error<
3123   "'cleanup' argument %select{|%1 |%1 }0is not a %select{||single }0function">;
3124 def err_attribute_cleanup_func_must_take_one_arg : Error<
3125   "'cleanup' function %0 must take 1 parameter">;
3126 def err_attribute_cleanup_func_arg_incompatible_type : Error<
3127   "'cleanup' function %0 parameter has "
3128   "%diff{type $ which is incompatible with type $|incompatible type}1,2">;
3129 def err_attribute_regparm_wrong_platform : Error<
3130   "'regparm' is not valid on this platform">;
3131 def err_attribute_regparm_invalid_number : Error<
3132   "'regparm' parameter must be between 0 and %0 inclusive">;
3133 def err_attribute_not_supported_in_lang : Error<
3134   "%0 attribute is not supported in %select{C|C++|Objective-C}1">;
3135
3136
3137 // Clang-Specific Attributes
3138 def warn_attribute_iboutlet : Warning<
3139   "%0 attribute can only be applied to instance variables or properties">,
3140   InGroup<IgnoredAttributes>;
3141 def err_iboutletcollection_type : Error<
3142   "invalid type %0 as argument of iboutletcollection attribute">;
3143 def err_iboutletcollection_builtintype : Error<
3144   "type argument of iboutletcollection attribute cannot be a builtin type">;
3145 def warn_iboutlet_object_type : Warning<
3146   "%select{instance variable|property}2 with %0 attribute must "
3147   "be an object type (invalid %1)">, InGroup<ObjCInvalidIBOutletProperty>;
3148 def warn_iboutletcollection_property_assign : Warning<
3149   "IBOutletCollection properties should be copy/strong and not assign">,
3150   InGroup<ObjCInvalidIBOutletProperty>;
3151   
3152 def err_attribute_overloadable_missing : Error<
3153   "%select{overloaded function|redeclaration of}0 %1 must have the "
3154   "'overloadable' attribute">;
3155 def note_attribute_overloadable_prev_overload : Note<
3156   "previous overload of function is here">;
3157 def err_attribute_overloadable_no_prototype : Error<
3158   "'overloadable' function %0 must have a prototype">;
3159 def warn_ns_attribute_wrong_return_type : Warning<
3160   "%0 attribute only applies to %select{functions|methods|properties}1 that "
3161   "return %select{an Objective-C object|a pointer|a non-retainable pointer}2">,
3162   InGroup<IgnoredAttributes>;
3163 def err_ns_attribute_wrong_parameter_type : Error<
3164   "%0 attribute only applies to "
3165   "%select{Objective-C object|pointer|pointer-to-CF-pointer}1 parameters">;
3166 def warn_ns_attribute_wrong_parameter_type : Warning<
3167   "%0 attribute only applies to "
3168   "%select{Objective-C object|pointer|pointer-to-CF-pointer}1 parameters">,
3169   InGroup<IgnoredAttributes>;
3170 def warn_objc_requires_super_protocol : Warning<
3171   "%0 attribute cannot be applied to %select{methods in protocols|dealloc}1">,
3172   InGroup<DiagGroup<"requires-super-attribute">>;
3173 def note_protocol_decl : Note<
3174   "protocol is declared here">;
3175 def note_protocol_decl_undefined : Note<
3176   "protocol %0 has no definition">;
3177
3178 // objc_designated_initializer attribute diagnostics.
3179 def warn_objc_designated_init_missing_super_call : Warning<
3180   "designated initializer missing a 'super' call to a designated initializer of the super class">,
3181   InGroup<ObjCDesignatedInit>;
3182 def note_objc_designated_init_marked_here : Note<
3183   "method marked as designated initializer of the class here">;
3184 def warn_objc_designated_init_non_super_designated_init_call : Warning<
3185   "designated initializer should only invoke a designated initializer on 'super'">,
3186   InGroup<ObjCDesignatedInit>;
3187 def warn_objc_designated_init_non_designated_init_call : Warning<
3188   "designated initializer invoked a non-designated initializer">,
3189   InGroup<ObjCDesignatedInit>;
3190 def warn_objc_secondary_init_super_init_call : Warning<
3191   "convenience initializer should not invoke an initializer on 'super'">,
3192   InGroup<ObjCDesignatedInit>;
3193 def warn_objc_secondary_init_missing_init_call : Warning<
3194   "convenience initializer missing a 'self' call to another initializer">,
3195   InGroup<ObjCDesignatedInit>;
3196 def warn_objc_implementation_missing_designated_init_override : Warning<
3197   "method override for the designated initializer of the superclass %objcinstance0 not found">,
3198   InGroup<ObjCDesignatedInit>;
3199
3200 // objc_bridge attribute diagnostics.
3201 def err_objc_attr_not_id : Error<
3202   "parameter of %0 attribute must be a single name of an Objective-C %select{class|protocol}1">;
3203 def err_objc_attr_typedef_not_id : Error<
3204   "parameter of %0 attribute must be 'id' when used on a typedef">;
3205 def err_objc_attr_typedef_not_void_pointer : Error<
3206   "'objc_bridge(id)' is only allowed on structs and typedefs of void pointers">;
3207 def err_objc_cf_bridged_not_interface : Error<
3208   "CF object of type %0 is bridged to %1, which is not an Objective-C class">;
3209 def err_objc_ns_bridged_invalid_cfobject : Error<
3210   "ObjectiveC object of type %0 is bridged to %1, which is not valid CF object">;
3211 def warn_objc_invalid_bridge : Warning<
3212   "%0 bridges to %1, not %2">, InGroup<ObjCBridge>;
3213 def warn_objc_invalid_bridge_to_cf : Warning<
3214   "%0 cannot bridge to %1">, InGroup<ObjCBridge>;
3215
3216 // objc_bridge_related attribute diagnostics.
3217 def err_objc_bridged_related_invalid_class : Error<
3218   "could not find Objective-C class %0 to convert %1 to %2">;
3219 def err_objc_bridged_related_invalid_class_name : Error<
3220   "%0 must be name of an Objective-C class to be able to convert %1 to %2">;
3221 def err_objc_bridged_related_known_method : Error<
3222  "%0 must be explicitly converted to %1; use %select{%objcclass2|%objcinstance2}3 "
3223  "method for this conversion">;
3224
3225 def err_objc_attr_protocol_requires_definition : Error<
3226   "attribute %0 can only be applied to @protocol definitions, not forward declarations">;
3227
3228 // Function Parameter Semantic Analysis.
3229 def err_param_with_void_type : Error<"argument may not have 'void' type">;
3230 def err_void_only_param : Error<
3231   "'void' must be the first and only parameter if specified">;
3232 def err_void_param_qualified : Error<
3233   "'void' as parameter must not have type qualifiers">;
3234 def err_ident_list_in_fn_declaration : Error<
3235   "a parameter list without types is only allowed in a function definition">;
3236 def ext_param_not_declared : Extension<
3237   "parameter %0 was not declared, defaulting to type 'int'">;
3238 def err_param_default_argument : Error<
3239   "C does not support default arguments">;
3240 def err_param_default_argument_redefinition : Error<
3241   "redefinition of default argument">;
3242 def ext_param_default_argument_redefinition : ExtWarn<
3243   err_param_default_argument_redefinition.Text>,
3244   InGroup<MicrosoftDefaultArgRedefinition>;
3245 def err_param_default_argument_missing : Error<
3246   "missing default argument on parameter">;
3247 def err_param_default_argument_missing_name : Error<
3248   "missing default argument on parameter %0">;
3249 def err_param_default_argument_references_param : Error<
3250   "default argument references parameter %0">;
3251 def err_param_default_argument_references_local : Error<
3252   "default argument references local variable %0 of enclosing function">;
3253 def err_param_default_argument_references_this : Error<
3254   "default argument references 'this'">;
3255 def err_param_default_argument_nonfunc : Error<
3256   "default arguments can only be specified for parameters in a function "
3257   "declaration">;
3258 def err_param_default_argument_template_redecl : Error<
3259   "default arguments cannot be added to a function template that has already "
3260   "been declared">;
3261 def err_param_default_argument_member_template_redecl : Error<
3262   "default arguments cannot be added to an out-of-line definition of a member "
3263   "of a %select{class template|class template partial specialization|nested "
3264   "class in a template}0">;
3265 def err_param_default_argument_on_parameter_pack : Error<
3266   "parameter pack cannot have a default argument">;
3267 def err_uninitialized_member_for_assign : Error<
3268   "cannot define the implicit copy assignment operator for %0, because "
3269   "non-static %select{reference|const}1 member %2 cannot use copy "
3270   "assignment operator">;
3271 def err_uninitialized_member_in_ctor : Error<
3272   "%select{constructor for %1|"
3273   "implicit default constructor for %1|"
3274   "cannot use constructor inherited from %1:}0 must explicitly "
3275   "initialize the %select{reference|const}2 member %3">;
3276 def err_default_arg_makes_ctor_special : Error<
3277   "addition of default argument on redeclaration makes this constructor a "
3278   "%select{default|copy|move}0 constructor">;
3279
3280 def err_use_of_default_argument_to_function_declared_later : Error<
3281   "use of default argument to function %0 that is declared later in class %1">;
3282 def note_default_argument_declared_here : Note<
3283   "default argument declared here">;
3284 def err_recursive_default_argument : Error<"recursive evaluation of default argument">;
3285
3286 def ext_param_promoted_not_compatible_with_prototype : ExtWarn<
3287   "%diff{promoted type $ of K&R function parameter is not compatible with the "
3288   "parameter type $|promoted type of K&R function parameter is not compatible "
3289   "with parameter type}0,1 declared in a previous prototype">,
3290   InGroup<KNRPromotedParameter>;
3291
3292
3293 // C++ Overloading Semantic Analysis.
3294 def err_ovl_diff_return_type : Error<
3295   "functions that differ only in their return type cannot be overloaded">;
3296 def err_ovl_static_nonstatic_member : Error<
3297   "static and non-static member functions with the same parameter types "
3298   "cannot be overloaded">;
3299
3300 def err_ovl_no_viable_function_in_call : Error<
3301   "no matching function for call to %0">;
3302 def err_ovl_no_viable_member_function_in_call : Error<
3303   "no matching member function for call to %0">;
3304 def err_ovl_ambiguous_call : Error<
3305   "call to %0 is ambiguous">;
3306 def err_ovl_deleted_call : Error<
3307   "call to %select{unavailable|deleted}0 function %1%2">;
3308 def err_ovl_ambiguous_member_call : Error<
3309   "call to member function %0 is ambiguous">;
3310 def err_ovl_deleted_member_call : Error<
3311   "call to %select{unavailable|deleted}0 member function %1%2">;
3312 def note_ovl_too_many_candidates : Note<
3313     "remaining %0 candidate%s0 omitted; "
3314     "pass -fshow-overloads=all to show them">;
3315 def note_ovl_candidate : Note<"candidate "
3316     "%select{function|function|constructor|"
3317     "function |function |constructor |"
3318     "is the implicit default constructor|"
3319     "is the implicit copy constructor|"
3320     "is the implicit move constructor|"
3321     "is the implicit copy assignment operator|"
3322     "is the implicit move assignment operator|"
3323     "inherited constructor|"
3324     "inherited constructor }0%2"
3325     "%select{| has different class%diff{ (expected $ but has $)|}4,5"
3326     "| has different number of parameters (expected %4 but has %5)"
3327     "| has type mismatch at %ordinal4 parameter"
3328     "%diff{ (expected $ but has $)|}5,6"
3329     "| has different return type%diff{ ($ expected but has $)|}4,5"
3330     "| has different qualifiers (expected "
3331     "%select{none|const|restrict|const and restrict|volatile|const and volatile"
3332     "|volatile and restrict|const, volatile, and restrict}4 but found "
3333     "%select{none|const|restrict|const and restrict|volatile|const and volatile"
3334     "|volatile and restrict|const, volatile, and restrict}5)"
3335     "| has different exception specification}3">;
3336
3337 def note_ovl_candidate_inherited_constructor : Note<
3338     "constructor from base class %0 inherited here">;
3339 def note_ovl_candidate_inherited_constructor_slice : Note<
3340     "candidate %select{constructor|template}0 ignored: "
3341     "inherited constructor cannot be used to %select{copy|move}1 object">;
3342 def note_ovl_candidate_illegal_constructor : Note<
3343     "candidate %select{constructor|template}0 ignored: "
3344     "instantiation %select{takes|would take}0 its own class type by value">;
3345 def note_ovl_candidate_bad_deduction : Note<
3346     "candidate template ignored: failed template argument deduction">;
3347 def note_ovl_candidate_incomplete_deduction : Note<"candidate template ignored: "
3348     "couldn't infer template argument %0">;
3349 def note_ovl_candidate_inconsistent_deduction : Note<
3350     "candidate template ignored: deduced conflicting %select{types|values|"
3351     "templates}0 for parameter %1%diff{ ($ vs. $)|}2,3">;
3352 def note_ovl_candidate_inconsistent_deduction_types : Note<
3353     "candidate template ignored: deduced values %diff{"
3354     "of conflicting types for parameter %0 (%1 of type $ vs. %3 of type $)|"
3355     "%1 and %3 of conflicting types for parameter %0}2,4">;
3356 def note_ovl_candidate_explicit_arg_mismatch_named : Note<
3357     "candidate template ignored: invalid explicitly-specified argument "
3358     "for template parameter %0">;
3359 def note_ovl_candidate_explicit_arg_mismatch_unnamed : Note<
3360     "candidate template ignored: invalid explicitly-specified argument "
3361     "for %ordinal0 template parameter">;
3362 def note_ovl_candidate_instantiation_depth : Note<
3363     "candidate template ignored: substitution exceeded maximum template "
3364     "instantiation depth">;
3365 def note_ovl_candidate_underqualified : Note<
3366     "candidate template ignored: cannot deduce a type for %0 that would "
3367     "make %2 equal %1">;
3368 def note_ovl_candidate_substitution_failure : Note<
3369     "candidate template ignored: substitution failure%0%1">;
3370 def note_ovl_candidate_disabled_by_enable_if : Note<
3371     "candidate template ignored: disabled by %0%1">;
3372 def note_ovl_candidate_has_pass_object_size_params: Note<
3373     "candidate address cannot be taken because parameter %0 has "
3374     "pass_object_size attribute">;
3375 def err_diagnose_if_succeeded : Error<"%0">;
3376 def warn_diagnose_if_succeeded : Warning<"%0">, InGroup<UserDefinedWarnings>,
3377     ShowInSystemHeader;
3378 def note_ovl_candidate_disabled_by_function_cond_attr : Note<
3379     "candidate disabled: %0">;
3380 def note_ovl_candidate_disabled_by_extension : Note<
3381     "candidate disabled due to OpenCL extension">;
3382 def err_addrof_function_disabled_by_enable_if_attr : Error<
3383     "cannot take address of function %0 becuase it has one or more "
3384     "non-tautological enable_if conditions">;
3385 def note_addrof_ovl_candidate_disabled_by_enable_if_attr : Note<
3386     "candidate function made ineligible by enable_if">;
3387 def note_ovl_candidate_deduced_mismatch : Note<
3388     "candidate template ignored: deduced type "
3389     "%diff{$ of %select{|element of }4%ordinal0 parameter does not match "
3390     "adjusted type $ of %select{|element of }4argument"
3391     "|of %select{|element of }4%ordinal0 parameter does not match "
3392     "adjusted type of %select{|element of }4argument}1,2%3">;
3393 def note_ovl_candidate_non_deduced_mismatch : Note<
3394     "candidate template ignored: could not match %diff{$ against $|types}0,1">;
3395 // This note is needed because the above note would sometimes print two
3396 // different types with the same name.  Remove this note when the above note
3397 // can handle that case properly.
3398 def note_ovl_candidate_non_deduced_mismatch_qualified : Note<
3399     "candidate template ignored: could not match %q0 against %q1">;
3400
3401 // Note that we don't treat templates differently for this diagnostic.
3402 def note_ovl_candidate_arity : Note<"candidate "
3403     "%select{function|function|constructor|function|function|constructor|"
3404     "constructor (the implicit default constructor)|"
3405     "constructor (the implicit copy constructor)|"
3406     "constructor (the implicit move constructor)|"
3407     "function (the implicit copy assignment operator)|"
3408     "function (the implicit move assignment operator)|"
3409     "inherited constructor|"
3410     "inherited constructor}0 %select{|template }1"
3411     "not viable: requires%select{ at least| at most|}2 %3 argument%s3, but %4 "
3412     "%plural{1:was|:were}4 provided">;
3413
3414 def note_ovl_candidate_arity_one : Note<"candidate "
3415     "%select{function|function|constructor|function|function|constructor|"
3416     "constructor (the implicit default constructor)|"
3417     "constructor (the implicit copy constructor)|"
3418     "constructor (the implicit move constructor)|"
3419     "function (the implicit copy assignment operator)|"
3420     "function (the implicit move assignment operator)|"
3421     "inherited constructor|"
3422     "inherited constructor}0 %select{|template }1not viable: "
3423     "%select{requires at least|allows at most single|requires single}2 "
3424     "argument %3, but %plural{0:no|:%4}4 arguments were provided">;
3425
3426 def note_ovl_candidate_deleted : Note<
3427     "candidate %select{function|function|constructor|"
3428     "function |function |constructor |"
3429     "constructor (the implicit default constructor)|"
3430     "constructor (the implicit copy constructor)|"
3431     "constructor (the implicit move constructor)|"
3432     "function (the implicit copy assignment operator)|"
3433     "function (the implicit move assignment operator)|"
3434     "inherited constructor|"
3435     "inherited constructor }0%1 has been "
3436     "%select{explicitly made unavailable|explicitly deleted|"
3437     "implicitly deleted}2">;
3438
3439 // Giving the index of the bad argument really clutters this message, and
3440 // it's relatively unimportant because 1) it's generally obvious which
3441 // argument(s) are of the given object type and 2) the fix is usually
3442 // to complete the type, which doesn't involve changes to the call line
3443 // anyway.  If people complain, we can change it.
3444 def note_ovl_candidate_bad_conv_incomplete : Note<"candidate "
3445     "%select{function|function|constructor|"
3446     "function |function |constructor |"
3447     "constructor (the implicit default constructor)|"
3448     "constructor (the implicit copy constructor)|"
3449     "constructor (the implicit move constructor)|"
3450     "function (the implicit copy assignment operator)|"
3451     "function (the implicit move assignment operator)|"
3452     "inherited constructor|"
3453     "inherited constructor }0%1 "
3454     "not viable: cannot convert argument of incomplete type "
3455     "%diff{$ to $|to parameter type}2,3 for "
3456     "%select{%ordinal5 argument|object argument}4"
3457     "%select{|; dereference the argument with *|"
3458     "; take the address of the argument with &|"
3459     "; remove *|"
3460     "; remove &}6">;
3461 def note_ovl_candidate_bad_list_argument : Note<"candidate "
3462     "%select{function|function|constructor|"
3463     "function |function |constructor |"
3464     "constructor (the implicit default constructor)|"
3465     "constructor (the implicit copy constructor)|"
3466     "constructor (the implicit move constructor)|"
3467     "function (the implicit copy assignment operator)|"
3468     "function (the implicit move assignment operator)|"
3469     "inherited constructor|"
3470     "inherited constructor }0%1 "
3471     "not viable: cannot convert initializer list argument to %3">;
3472 def note_ovl_candidate_bad_overload : Note<"candidate "
3473     "%select{function|function|constructor|"
3474     "function |function |constructor |"
3475     "constructor (the implicit default constructor)|"
3476     "constructor (the implicit copy constructor)|"
3477     "constructor (the implicit move constructor)|"
3478     "function (the implicit copy assignment operator)|"
3479     "function (the implicit move assignment operator)|"
3480     "inherited constructor|"
3481     "inherited constructor }0%1"
3482     " not viable: no overload of %3 matching %2 for %ordinal4 argument">;
3483 def note_ovl_candidate_bad_conv : Note<"candidate "
3484     "%select{function|function|constructor|"
3485     "function |function |constructor |"
3486     "constructor (the implicit default constructor)|"
3487     "constructor (the implicit copy constructor)|"
3488     "constructor (the implicit move constructor)|"
3489     "function (the implicit copy assignment operator)|"
3490     "function (the implicit move assignment operator)|"
3491     "inherited constructor|"
3492     "inherited constructor }0%1"
3493     " not viable: no known conversion "
3494     "%diff{from $ to $|from argument type to parameter type}2,3 for "
3495     "%select{%ordinal5 argument|object argument}4"
3496     "%select{|; dereference the argument with *|"
3497     "; take the address of the argument with &|"
3498     "; remove *|"
3499     "; remove &}6">;
3500 def note_ovl_candidate_bad_arc_conv : Note<"candidate "
3501     "%select{function|function|constructor|"
3502     "function |function |constructor |"
3503     "constructor (the implicit default constructor)|"
3504     "constructor (the implicit copy constructor)|"
3505     "constructor (the implicit move constructor)|"
3506     "function (the implicit copy assignment operator)|"
3507     "function (the implicit move assignment operator)|"
3508     "inherited constructor|"
3509     "inherited constructor }0%1"
3510     " not viable: cannot implicitly convert argument "
3511     "%diff{of type $ to $|type to parameter type}2,3 for "
3512     "%select{%ordinal5 argument|object argument}4 under ARC">;
3513 def note_ovl_candidate_bad_lvalue : Note<"candidate "
3514     "%select{function|function|constructor|"
3515     "function |function |constructor |"
3516     "constructor (the implicit default constructor)|"
3517     "constructor (the implicit copy constructor)|"
3518     "constructor (the implicit move constructor)|"
3519     "function (the implicit copy assignment operator)|"
3520     "function (the implicit move assignment operator)|"
3521     "inherited constructor|"
3522     "inherited constructor }0%1"
3523     " not viable: expects an l-value for "
3524     "%select{%ordinal3 argument|object argument}2">;
3525 def note_ovl_candidate_bad_addrspace : Note<"candidate "
3526     "%select{function|function|constructor|"
3527     "function |function |constructor |"
3528     "constructor (the implicit default constructor)|"
3529     "constructor (the implicit copy constructor)|"
3530     "constructor (the implicit move constructor)|"
3531     "function (the implicit copy assignment operator)|"
3532     "function (the implicit move assignment operator)|"
3533     "inherited constructor|"
3534     "inherited constructor }0%1 not viable: "
3535     "%select{%ordinal6|'this'}5 argument (%2) is in "
3536     "address space %3, but parameter must be in address space %4">;
3537 def note_ovl_candidate_bad_gc : Note<"candidate "
3538     "%select{function|function|constructor|"
3539     "function |function |constructor |"
3540     "constructor (the implicit default constructor)|"
3541     "constructor (the implicit copy constructor)|"
3542     "constructor (the implicit move constructor)|"
3543     "function (the implicit copy assignment operator)|"
3544     "function (the implicit move assignment operator)|"
3545     "inherited constructor|"
3546     "inherited constructor }0%1 not viable: "
3547     "%select{%ordinal6|'this'}5 argument (%2) has %select{no|__weak|__strong}3 "
3548     "ownership, but parameter has %select{no|__weak|__strong}4 ownership">;
3549 def note_ovl_candidate_bad_ownership : Note<"candidate "
3550     "%select{function|function|constructor|"
3551     "function |function |constructor |"
3552     "constructor (the implicit default constructor)|"
3553     "constructor (the implicit copy constructor)|"
3554     "constructor (the implicit move constructor)|"
3555     "function (the implicit copy assignment operator)|"
3556     "function (the implicit move assignment operator)|"
3557     "inherited constructor|"
3558     "inherited constructor }0%1 not viable: "
3559     "%select{%ordinal6|'this'}5 argument (%2) has "
3560     "%select{no|__unsafe_unretained|__strong|__weak|__autoreleasing}3 ownership,"
3561     " but parameter has %select{no|__unsafe_unretained|__strong|__weak|"
3562     "__autoreleasing}4 ownership">;
3563 def note_ovl_candidate_bad_cvr_this : Note<"candidate "
3564     "%select{|function|||function|||||"
3565     "function (the implicit copy assignment operator)|"
3566     "function (the implicit move assignment operator)||}0 not viable: "
3567     "'this' argument has type %2, but method is not marked "
3568     "%select{const|restrict|const or restrict|volatile|const or volatile|"
3569     "volatile or restrict|const, volatile, or restrict}3">;
3570 def note_ovl_candidate_bad_cvr : Note<"candidate "
3571     "%select{function|function|constructor|"
3572     "function |function |constructor |"
3573     "constructor (the implicit default constructor)|"
3574     "constructor (the implicit copy constructor)|"
3575     "constructor (the implicit move constructor)|"
3576     "function (the implicit copy assignment operator)|"
3577     "function (the implicit move assignment operator)|"
3578     "inherited constructor|"
3579     "inherited constructor }0%1 not viable: "
3580     "%ordinal4 argument (%2) would lose "
3581     "%select{const|restrict|const and restrict|volatile|const and volatile|"
3582     "volatile and restrict|const, volatile, and restrict}3 qualifier"
3583     "%select{||s||s|s|s}3">;
3584 def note_ovl_candidate_bad_unaligned : Note<"candidate "
3585     "%select{function|function|constructor|"
3586     "function |function |constructor |"
3587     "constructor (the implicit default constructor)|"
3588     "constructor (the implicit copy constructor)|"
3589     "constructor (the implicit move constructor)|"
3590     "function (the implicit copy assignment operator)|"
3591     "function (the implicit move assignment operator)|"
3592     "inherited constructor|"
3593     "inherited constructor }0%1 not viable: "
3594     "%ordinal4 argument (%2) would lose __unaligned qualifier">;
3595 def note_ovl_candidate_bad_base_to_derived_conv : Note<"candidate "
3596     "%select{function|function|constructor|"
3597     "function |function |constructor |"
3598     "constructor (the implicit default constructor)|"
3599     "constructor (the implicit copy constructor)|"
3600     "constructor (the implicit move constructor)|"
3601     "function (the implicit copy assignment operator)|"
3602     "function (the implicit move assignment operator)|"
3603     "inherited constructor|"
3604     "inherited constructor }0%1 not viable: "
3605     "cannot %select{convert from|convert from|bind}2 "
3606     "%select{base class pointer|superclass|base class object of type}2 %3 to "
3607     "%select{derived class pointer|subclass|derived class reference}2 %4 for "
3608     "%ordinal5 argument">;
3609 def note_ovl_candidate_bad_target : Note<
3610     "candidate %select{function|function|constructor|"
3611     "function|function|constructor|"
3612     "constructor (the implicit default constructor)|"
3613     "constructor (the implicit copy constructor)|"
3614     "constructor (the implicit move constructor)|"
3615     "function (the implicit copy assignment operator)|"
3616     "function (the implicit move assignment operator)|"
3617     "inherited constructor|"
3618     "inherited constructor}0 not viable: "
3619     "call to "
3620     "%select{__device__|__global__|__host__|__host__ __device__|invalid}1 function from"
3621     " %select{__device__|__global__|__host__|__host__ __device__|invalid}2 function">;
3622 def note_implicit_member_target_infer_collision : Note<
3623     "implicit %select{"
3624     "default constructor|"
3625     "copy constructor|"
3626     "move constructor|"
3627     "copy assignment operator|"
3628     "move assignment operator|"
3629     "destructor}0 inferred target collision: call to both "
3630     "%select{__device__|__global__|__host__|__host__ __device__}1 and "
3631     "%select{__device__|__global__|__host__|__host__ __device__}2 members">;
3632
3633 def note_ambiguous_type_conversion: Note<
3634     "because of ambiguity in conversion %diff{of $ to $|between types}0,1">;
3635 def note_ovl_builtin_binary_candidate : Note<
3636     "built-in candidate %0">;
3637 def note_ovl_builtin_unary_candidate : Note<
3638     "built-in candidate %0">;
3639 def err_ovl_no_viable_function_in_init : Error<
3640   "no matching constructor for initialization of %0">;
3641 def err_ovl_no_conversion_in_cast : Error<
3642   "cannot convert %1 to %2 without a conversion operator">;
3643 def err_ovl_no_viable_conversion_in_cast : Error<
3644   "no matching conversion for %select{|static_cast|reinterpret_cast|"
3645   "dynamic_cast|C-style cast|functional-style cast}0 from %1 to %2">;
3646 def err_ovl_ambiguous_conversion_in_cast : Error<
3647   "ambiguous conversion for %select{|static_cast|reinterpret_cast|"
3648   "dynamic_cast|C-style cast|functional-style cast}0 from %1 to %2">;
3649 def err_ovl_deleted_conversion_in_cast : Error<
3650   "%select{|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
3651   "functional-style cast}0 from %1 to %2 uses deleted function">;
3652 def err_ovl_ambiguous_init : Error<"call to constructor of %0 is ambiguous">;
3653 def err_ref_init_ambiguous : Error<
3654   "reference initialization of type %0 with initializer of type %1 is ambiguous">;
3655 def err_ovl_deleted_init : Error<
3656   "call to %select{unavailable|deleted}0 constructor of %1">;
3657 def err_ovl_deleted_special_init : Error<
3658   "call to implicitly-deleted %select{default constructor|copy constructor|"
3659   "move constructor|copy assignment operator|move assignment operator|"
3660   "destructor|function}0 of %1">;
3661 def err_ovl_ambiguous_oper_unary : Error<
3662   "use of overloaded operator '%0' is ambiguous (operand type %1)">;
3663 def err_ovl_ambiguous_oper_binary : Error<
3664   "use of overloaded operator '%0' is ambiguous (with operand types %1 and %2)">;
3665 def err_ovl_no_viable_oper : Error<"no viable overloaded '%0'">;
3666 def note_assign_lhs_incomplete : Note<"type %0 is incomplete">;
3667 def err_ovl_deleted_oper : Error<
3668   "overload resolution selected %select{unavailable|deleted}0 operator '%1'%2">;
3669 def err_ovl_deleted_special_oper : Error<
3670   "object of type %0 cannot be %select{constructed|copied|moved|assigned|"
3671   "assigned|destroyed}1 because its %select{default constructor|"
3672   "copy constructor|move constructor|copy assignment operator|"
3673   "move assignment operator|destructor}1 is implicitly deleted">;
3674 def err_ovl_no_viable_subscript :
3675     Error<"no viable overloaded operator[] for type %0">;
3676 def err_ovl_no_oper :
3677     Error<"type %0 does not provide a %select{subscript|call}1 operator">;
3678 def err_ovl_unresolvable : Error<
3679   "reference to overloaded function could not be resolved; "
3680   "did you mean to call it%select{| with no arguments}0?">;
3681 def err_bound_member_function : Error<
3682   "reference to non-static member function must be called"
3683   "%select{|; did you mean to call it with no arguments?}0">;
3684 def note_possible_target_of_call : Note<"possible target for call">;
3685
3686 def err_ovl_no_viable_object_call : Error<
3687   "no matching function for call to object of type %0">;
3688 def err_ovl_ambiguous_object_call : Error<
3689   "call to object of type %0 is ambiguous">;
3690 def err_ovl_deleted_object_call : Error<
3691   "call to %select{unavailable|deleted}0 function call operator in type %1%2">;
3692 def note_ovl_surrogate_cand : Note<"conversion candidate of type %0">;
3693 def err_member_call_without_object : Error<
3694   "call to non-static member function without an object argument">;
3695
3696 // C++ Address of Overloaded Function
3697 def err_addr_ovl_no_viable : Error<
3698   "address of overloaded function %0 does not match required type %1">;
3699 def err_addr_ovl_ambiguous : Error<
3700   "address of overloaded function %0 is ambiguous">;
3701 def err_addr_ovl_not_func_ptrref : Error<
3702   "address of overloaded function %0 cannot be converted to type %1">;
3703 def err_addr_ovl_no_qualifier : Error<
3704   "cannot form member pointer of type %0 without '&' and class name">;
3705
3706 // C++11 Literal Operators
3707 def err_ovl_no_viable_literal_operator : Error<
3708   "no matching literal operator for call to %0"
3709   "%select{| with argument of type %2| with arguments of types %2 and %3}1"
3710   "%select{| or 'const char *'}4"
3711   "%select{|, and no matching literal operator template}5">;
3712
3713 // C++ Template Declarations
3714 def err_template_param_shadow : Error<
3715   "declaration of %0 shadows template parameter">;
3716 def note_template_param_here : Note<"template parameter is declared here">;
3717 def warn_template_export_unsupported : Warning<
3718   "exported templates are unsupported">;
3719 def err_template_outside_namespace_or_class_scope : Error<
3720   "templates can only be declared in namespace or class scope">;
3721 def err_template_inside_local_class : Error<
3722   "templates cannot be declared inside of a local class">;
3723 def err_template_linkage : Error<"templates must have C++ linkage">;
3724 def err_template_typedef : Error<"a typedef cannot be a template">;
3725 def err_template_unnamed_class : Error<
3726   "cannot declare a class template with no name">;
3727 def err_template_param_list_different_arity : Error<
3728   "%select{too few|too many}0 template parameters in template "
3729   "%select{|template parameter }1redeclaration">;
3730 def note_template_param_list_different_arity : Note<
3731   "%select{too few|too many}0 template parameters in template template "
3732   "argument">;
3733 def note_template_prev_declaration : Note<
3734   "previous template %select{declaration|template parameter}0 is here">;
3735 def err_template_param_different_kind : Error<
3736   "template parameter has a different kind in template "
3737   "%select{|template parameter }0redeclaration">;
3738 def note_template_param_different_kind : Note<
3739   "template parameter has a different kind in template argument">;
3740   
3741 def err_template_nontype_parm_different_type : Error<
3742   "template non-type parameter has a different type %0 in template "
3743   "%select{|template parameter }1redeclaration">;
3744
3745 def note_template_nontype_parm_different_type : Note<
3746   "template non-type parameter has a different type %0 in template argument">;
3747 def note_template_nontype_parm_prev_declaration : Note<
3748   "previous non-type template parameter with type %0 is here">;
3749 def err_template_nontype_parm_bad_type : Error<
3750   "a non-type template parameter cannot have type %0">;
3751 def warn_cxx14_compat_template_nontype_parm_auto_type : Warning<
3752   "non-type template parameters declared with %0 are incompatible with C++ "
3753   "standards before C++1z">,
3754   DefaultIgnore, InGroup<CXXPre1zCompat>;
3755 def err_template_param_default_arg_redefinition : Error<
3756   "template parameter redefines default argument">;
3757 def note_template_param_prev_default_arg : Note<
3758   "previous default template argument defined here">;
3759 def err_template_param_default_arg_missing : Error<
3760   "template parameter missing a default argument">;
3761 def ext_template_parameter_default_in_function_template : ExtWarn<
3762   "default template arguments for a function template are a C++11 extension">,
3763   InGroup<CXX11>;
3764 def warn_cxx98_compat_template_parameter_default_in_function_template : Warning<
3765   "default template arguments for a function template are incompatible with C++98">,
3766   InGroup<CXX98Compat>, DefaultIgnore;
3767 def err_template_parameter_default_template_member : Error<
3768   "cannot add a default template argument to the definition of a member of a "
3769   "class template">;
3770 def err_template_parameter_default_friend_template : Error<
3771   "default template argument not permitted on a friend template">;
3772 def err_template_template_parm_no_parms : Error<
3773   "template template parameter must have its own template parameters">;
3774
3775 def ext_variable_template : ExtWarn<"variable templates are a C++14 extension">,
3776   InGroup<CXX14>;
3777 def warn_cxx11_compat_variable_template : Warning<
3778   "variable templates are incompatible with C++ standards before C++14">,
3779   InGroup<CXXPre14Compat>, DefaultIgnore;
3780 def err_template_variable_noparams : Error<
3781   "extraneous 'template<>' in declaration of variable %0">;
3782 def err_template_member : Error<"member %0 declared as a template">;
3783 def err_template_member_noparams : Error<
3784   "extraneous 'template<>' in declaration of member %0">;
3785 def err_template_tag_noparams : Error<
3786   "extraneous 'template<>' in declaration of %0 %1">;
3787 def err_template_decl_ref : Error<
3788   "cannot refer to %select{class|variable}0 template %1 without a template argument list">;
3789
3790 // C++ Template Argument Lists
3791 def err_template_missing_args : Error<
3792   "use of class template %0 requires template arguments">;
3793 def err_template_arg_list_different_arity : Error<
3794   "%select{too few|too many}0 template arguments for "
3795   "%select{class template|function template|template template parameter"
3796   "|template}1 %2">;
3797 def note_template_decl_here : Note<"template is declared here">;
3798 def err_template_arg_must_be_type : Error<
3799   "template argument for template type parameter must be a type">;
3800 def err_template_arg_must_be_type_suggest : Error<
3801   "template argument for template type parameter must be a type; "
3802   "did you forget 'typename'?">;
3803 def ext_ms_template_type_arg_missing_typename : ExtWarn<
3804   "template argument for template type parameter must be a type; "
3805   "omitted 'typename' is a Microsoft extension">,
3806   InGroup<MicrosoftTemplate>;
3807 def err_template_arg_must_be_expr : Error<
3808   "template argument for non-type template parameter must be an expression">;
3809 def err_template_arg_nontype_ambig : Error<
3810   "template argument for non-type template parameter is treated as function type %0">;
3811 def err_template_arg_must_be_template : Error<
3812   "template argument for template template parameter must be a class template%select{| or type alias template}0">;
3813 def ext_template_arg_local_type : ExtWarn<
3814   "template argument uses local type %0">, InGroup<LocalTypeTemplateArgs>;
3815 def ext_template_arg_unnamed_type : ExtWarn<
3816   "template argument uses unnamed type">, InGroup<UnnamedTypeTemplateArgs>;
3817 def warn_cxx98_compat_template_arg_local_type : Warning<
3818   "local type %0 as template argument is incompatible with C++98">,
3819   InGroup<CXX98CompatLocalTypeTemplateArgs>, DefaultIgnore;
3820 def warn_cxx98_compat_template_arg_unnamed_type : Warning<
3821   "unnamed type as template argument is incompatible with C++98">,
3822   InGroup<CXX98CompatUnnamedTypeTemplateArgs>, DefaultIgnore;
3823 def note_template_unnamed_type_here : Note<
3824   "unnamed type used in template argument was declared here">;
3825 def err_template_arg_overload_type : Error<
3826   "template argument is the type of an unresolved overloaded function">;
3827 def err_template_arg_not_valid_template : Error<
3828   "template argument does not refer to a class or alias template, or template "
3829   "template parameter">;
3830 def note_template_arg_refers_here_func : Note<
3831   "template argument refers to function template %0, here">;
3832 def err_template_arg_template_params_mismatch : Error<
3833   "template template argument has different template parameters than its "
3834   "corresponding template template parameter">;
3835 def err_template_arg_not_integral_or_enumeral : Error<
3836   "non-type template argument of type %0 must have an integral or enumeration"
3837   " type">;
3838 def err_template_arg_not_ice : Error<
3839   "non-type template argument of type %0 is not an integral constant "
3840   "expression">;
3841 def err_template_arg_not_address_constant : Error<
3842   "non-type template argument of type %0 is not a constant expression">;
3843 def warn_cxx98_compat_template_arg_null : Warning<
3844   "use of null pointer as non-type template argument is incompatible with "
3845   "C++98">, InGroup<CXX98Compat>, DefaultIgnore;
3846 def err_template_arg_untyped_null_constant : Error<
3847   "null non-type template argument must be cast to template parameter type %0">;
3848 def err_template_arg_wrongtype_null_constant : Error<
3849   "null non-type template argument of type %0 does not match template parameter "
3850   "of type %1">;
3851 def err_non_type_template_parm_type_deduction_failure : Error<
3852   "non-type template parameter %0 with type %1 has incompatible initializer of type %2">;
3853 def err_deduced_non_type_template_arg_type_mismatch : Error<
3854   "deduced non-type template argument does not have the same type as the "
3855   "corresponding template parameter%diff{ ($ vs $)|}0,1">;
3856 def err_non_type_template_arg_subobject : Error<
3857   "non-type template argument refers to subobject '%0'">;
3858 def err_non_type_template_arg_addr_label_diff : Error<
3859   "template argument / label address difference / what did you expect?">;
3860 def err_template_arg_not_convertible : Error<
3861   "non-type template argument of type %0 cannot be converted to a value "
3862   "of type %1">;
3863 def warn_template_arg_negative : Warning<
3864   "non-type template argument with value '%0' converted to '%1' for unsigned "
3865   "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
3866 def warn_template_arg_too_large : Warning<
3867   "non-type template argument value '%0' truncated to '%1' for "
3868   "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
3869 def err_template_arg_no_ref_bind : Error<
3870   "non-type template parameter of reference type "
3871   "%diff{$ cannot bind to template argument of type $"
3872   "|cannot bind to template of incompatible argument type}0,1">;
3873 def err_template_arg_ref_bind_ignores_quals : Error<
3874   "reference binding of non-type template parameter "
3875   "%diff{of type $ to template argument of type $|to template argument}0,1 "
3876   "ignores qualifiers">;
3877 def err_template_arg_not_decl_ref : Error<
3878   "non-type template argument does not refer to any declaration">;
3879 def err_template_arg_not_address_of : Error<
3880   "non-type template argument for template parameter of pointer type %0 must "
3881   "have its address taken">;
3882 def err_template_arg_address_of_non_pointer : Error<
3883   "address taken in non-type template argument for template parameter of "
3884   "reference type %0">;
3885 def err_template_arg_reference_var : Error<
3886   "non-type template argument of reference type %0 is not an object">;
3887 def err_template_arg_field : Error<
3888   "non-type template argument refers to non-static data member %0">;
3889 def err_template_arg_method : Error<
3890   "non-type template argument refers to non-static member function %0">;
3891 def err_template_arg_object_no_linkage : Error<
3892   "non-type template argument refers to %select{function|object}0 %1 that "
3893   "does not have linkage">;
3894 def warn_cxx98_compat_template_arg_object_internal : Warning<
3895   "non-type template argument referring to %select{function|object}0 %1 with "
3896   "internal linkage is incompatible with C++98">,
3897   InGroup<CXX98Compat>, DefaultIgnore;
3898 def ext_template_arg_object_internal : ExtWarn<
3899   "non-type template argument referring to %select{function|object}0 %1 with "
3900   "internal linkage is a C++11 extension">, InGroup<CXX11>;
3901 def err_template_arg_thread_local : Error<
3902   "non-type template argument refers to thread-local object">;
3903 def note_template_arg_internal_object : Note<
3904   "non-type template argument refers to %select{function|object}0 here">;
3905 def note_template_arg_refers_here : Note<
3906   "non-type template argument refers here">;
3907 def err_template_arg_not_object_or_func : Error<
3908   "non-type template argument does not refer to an object or function">;
3909 def err_template_arg_not_pointer_to_member_form : Error<
3910   "non-type template argument is not a pointer to member constant">;
3911 def err_template_arg_member_ptr_base_derived_not_supported : Error<
3912   "sorry, non-type template argument of pointer-to-member type %1 that refers "
3913   "to member %q0 of a different class is not supported yet">;
3914 def ext_template_arg_extra_parens : ExtWarn<
3915   "address non-type template argument cannot be surrounded by parentheses">;
3916 def warn_cxx98_compat_template_arg_extra_parens : Warning<
3917   "redundant parentheses surrounding address non-type template argument are "
3918   "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
3919 def err_pointer_to_member_type : Error<
3920   "invalid use of pointer to member type after %select{.*|->*}0">;
3921 def err_pointer_to_member_call_drops_quals : Error<
3922   "call to pointer to member function of type %0 drops '%1' qualifier%s2">;
3923 def err_pointer_to_member_oper_value_classify: Error<
3924   "pointer-to-member function type %0 can only be called on an "
3925   "%select{rvalue|lvalue}1">;
3926 def ext_ms_deref_template_argument: ExtWarn<
3927   "non-type template argument containing a dereference operation is a "
3928   "Microsoft extension">, InGroup<MicrosoftTemplate>;
3929 def ext_ms_delayed_template_argument: ExtWarn<
3930   "using the undeclared type %0 as a default template argument is a "
3931   "Microsoft extension">, InGroup<MicrosoftTemplate>;
3932 def err_template_arg_deduced_incomplete_pack : Error<
3933   "deduced incomplete pack %0 for template parameter %1">;
3934
3935 // C++ template specialization
3936 def err_template_spec_unknown_kind : Error<
3937   "can only provide an explicit specialization for a class template, function "
3938   "template, variable template, or a member function, static data member, "
3939   "%select{or member class|member class, or member enumeration}0 of a "
3940   "class template">;
3941 def note_specialized_entity : Note<
3942   "explicitly specialized declaration is here">;
3943 def note_explicit_specialization_declared_here : Note<
3944   "explicit specialization declared here">;
3945 def err_template_spec_decl_function_scope : Error<
3946   "explicit specialization of %0 in function scope">;
3947 def err_template_spec_decl_class_scope : Error<
3948   "explicit specialization of %0 in class scope">;
3949 def err_template_spec_decl_friend : Error<
3950   "cannot declare an explicit specialization in a friend">;
3951 def err_template_spec_decl_out_of_scope_global : Error<
3952   "%select{class template|class template partial|variable template|"
3953   "variable template partial|function template|member function|"
3954   "static data member|member class|member enumeration}0 "
3955   "specialization of %1 must originally be declared in the global scope">;
3956 def err_template_spec_decl_out_of_scope : Error<
3957   "%select{class template|class template partial|variable template|"
3958   "variable template partial|function template|member "
3959   "function|static data member|member class|member enumeration}0 "
3960   "specialization of %1 must originally be declared in namespace %2">;
3961 def ext_template_spec_decl_out_of_scope : ExtWarn<
3962   "first declaration of %select{class template|class template partial|"
3963   "variable template|variable template partial|"
3964   "function template|member function|static data member|member class|"
3965   "member enumeration}0 specialization of %1 outside namespace %2 is a "
3966   "C++11 extension">, InGroup<CXX11>;
3967 def warn_cxx98_compat_template_spec_decl_out_of_scope : Warning<
3968   "%select{class template|class template partial|variable template|"
3969   "variable template partial|function template|member "
3970   "function|static data member|member class|member enumeration}0 "
3971   "specialization of %1 outside namespace %2 is incompatible with C++98">,
3972   InGroup<CXX98Compat>, DefaultIgnore;
3973 def err_template_spec_redecl_out_of_scope : Error<
3974   "%select{class template|class template partial|variable template|"
3975   "variable template partial|function template|member "
3976   "function|static data member|member class|member enumeration}0 "
3977   "specialization of %1 not in a namespace enclosing %2">;
3978 def ext_ms_template_spec_redecl_out_of_scope: ExtWarn<
3979   "%select{class template|class template partial|variable template|"
3980   "variable template partial|function template|member "
3981   "function|static data member|member class|member enumeration}0 "
3982   "specialization of %1 outside namespace enclosing %2 "
3983   "is a Microsoft extension">, InGroup<MicrosoftTemplate>;
3984 def err_template_spec_redecl_global_scope : Error<
3985   "%select{class template|class template partial|variable template|"
3986   "variable template partial|function template|member "
3987   "function|static data member|member class|member enumeration}0 "
3988   "specialization of %1 must occur at global scope">;
3989 def err_spec_member_not_instantiated : Error<
3990   "specialization of member %q0 does not specialize an instantiated member">;
3991 def note_specialized_decl : Note<"attempt to specialize declaration here">;
3992 def err_specialization_after_instantiation : Error<
3993   "explicit specialization of %0 after instantiation">;
3994 def note_instantiation_required_here : Note<
3995   "%select{implicit|explicit}0 instantiation first required here">;
3996 def err_template_spec_friend : Error<
3997   "template specialization declaration cannot be a friend">;
3998 def err_template_spec_default_arg : Error<
3999   "default argument not permitted on an explicit "
4000   "%select{instantiation|specialization}0 of function %1">;
4001 def err_not_class_template_specialization : Error<
4002   "cannot specialize a %select{dependent template|template template "
4003   "parameter}0">;
4004 def err_function_specialization_in_class : Error<
4005   "cannot specialize a function %0 within class scope">;
4006 def ext_function_specialization_in_class : ExtWarn<
4007   "explicit specialization of %0 within class scope is a Microsoft extension">,
4008   InGroup<MicrosoftTemplate>;
4009 def ext_explicit_specialization_storage_class : ExtWarn<
4010   "explicit specialization cannot have a storage class">;
4011 def err_explicit_specialization_inconsistent_storage_class : Error<
4012   "explicit specialization has extraneous, inconsistent storage class "
4013   "'%select{none|extern|static|__private_extern__|auto|register}0'">;
4014
4015 // C++ class template specializations and out-of-line definitions
4016 def err_template_spec_needs_header : Error<
4017   "template specialization requires 'template<>'">;
4018 def err_template_spec_needs_template_parameters : Error<
4019   "template specialization or definition requires a template parameter list "
4020   "corresponding to the nested type %0">;
4021 def err_template_param_list_matches_nontemplate : Error<
4022   "template parameter list matching the non-templated nested type %0 should "
4023   "be empty ('template<>')">;
4024 def err_alias_template_extra_headers : Error<
4025   "extraneous template parameter list in alias template declaration">;
4026 def err_template_spec_extra_headers : Error<
4027   "extraneous template parameter list in template specialization or "
4028   "out-of-line template definition">;
4029 def warn_template_spec_extra_headers : Warning<
4030   "extraneous template parameter list in template specialization">;
4031 def note_explicit_template_spec_does_not_need_header : Note<
4032   "'template<>' header not required for explicitly-specialized class %0 "
4033   "declared here">;
4034 def err_template_qualified_declarator_no_match : Error<
4035   "nested name specifier '%0' for declaration does not refer into a class, "
4036   "class template or class template partial specialization">;
4037 def err_specialize_member_of_template : Error<
4038   "cannot specialize %select{|(with 'template<>') }0a member of an "
4039   "unspecialized template">;
4040
4041 // C++ Class Template Partial Specialization
4042 def err_default_arg_in_partial_spec : Error<
4043     "default template argument in a class template partial specialization">;
4044 def err_dependent_non_type_arg_in_partial_spec : Error<
4045     "type of specialized non-type template argument depends on a template "
4046     "parameter of the partial specialization">;
4047 def note_dependent_non_type_default_arg_in_partial_spec : Note<
4048     "template parameter is used in default argument declared here">;
4049 def err_dependent_typed_non_type_arg_in_partial_spec : Error<
4050     "non-type template argument specializes a template parameter with "
4051     "dependent type %0">;
4052 def err_partial_spec_args_match_primary_template : Error<
4053     "%select{class|variable}0 template partial specialization does not "
4054     "specialize any template argument; to %select{declare|define}1 the "
4055     "primary template, remove the template argument list">; 
4056 def ext_partial_spec_not_more_specialized_than_primary : ExtWarn<
4057     "%select{class|variable}0 template partial specialization is not "
4058     "more specialized than the primary template">, DefaultError,
4059     InGroup<DiagGroup<"invalid-partial-specialization">>;
4060 def note_partial_spec_not_more_specialized_than_primary : Note<"%0">;
4061 def ext_partial_specs_not_deducible : ExtWarn<
4062     "%select{class|variable}0 template partial specialization contains "
4063     "%select{a template parameter|template parameters}1 that cannot be "
4064     "deduced; this partial specialization will never be used">,
4065     DefaultError, InGroup<DiagGroup<"unusable-partial-specialization">>;
4066 def note_partial_spec_unused_parameter : Note<
4067     "non-deducible template parameter %0">;
4068 def err_partial_spec_ordering_ambiguous : Error<
4069     "ambiguous partial specializations of %0">;
4070 def note_partial_spec_match : Note<"partial specialization matches %0">;
4071 def err_partial_spec_redeclared : Error<
4072   "class template partial specialization %0 cannot be redeclared">;
4073 def note_partial_specialization_declared_here : Note<
4074   "explicit specialization declared here">;
4075 def note_prev_partial_spec_here : Note<
4076   "previous declaration of class template partial specialization %0 is here">;
4077 def err_partial_spec_fully_specialized : Error<
4078   "partial specialization of %0 does not use any of its template parameters">;
4079
4080 // C++ Variable Template Partial Specialization
4081 def err_var_partial_spec_redeclared : Error<
4082   "variable template partial specialization %0 cannot be redefined">;
4083 def note_var_prev_partial_spec_here : Note<
4084   "previous declaration of variable template partial specialization is here">;
4085 def err_var_spec_no_template : Error<
4086   "no variable template matches%select{| partial}0 specialization">;
4087 def err_var_spec_no_template_but_method : Error<
4088   "no variable template matches specialization; "
4089   "did you mean to use %0 as function template instead?">;
4090   
4091 // C++ Function template specializations
4092 def err_function_template_spec_no_match : Error<
4093     "no function template matches function template specialization %0">;
4094 def err_function_template_spec_ambiguous : Error<
4095     "function template specialization %0 ambiguously refers to more than one "
4096     "function template; explicitly specify%select{| additional}1 template "
4097     "arguments to identify a particular function template">;
4098 def note_function_template_spec_matched : Note<
4099     "function template %q0 matches specialization %1">;
4100 def err_function_template_partial_spec : Error<
4101     "function template partial specialization is not allowed">;
4102
4103 // C++ Template Instantiation
4104 def err_template_recursion_depth_exceeded : Error<
4105   "recursive template instantiation exceeded maximum depth of %0">,
4106   DefaultFatal, NoSFINAE;
4107 def note_template_recursion_depth : Note<
4108   "use -ftemplate-depth=N to increase recursive template instantiation depth">;
4109
4110 def err_template_instantiate_within_definition : Error<
4111   "%select{implicit|explicit}0 instantiation of template %1 within its"
4112   " own definition">;
4113 def err_template_instantiate_undefined : Error<
4114   "%select{implicit|explicit}0 instantiation of undefined template %1">;
4115 def err_implicit_instantiate_member_undefined : Error<
4116   "implicit instantiation of undefined member %0">;
4117 def note_template_class_instantiation_was_here : Note<
4118   "class template %0 was instantiated here">;
4119 def note_template_class_explicit_specialization_was_here : Note<
4120   "class template %0 was explicitly specialized here">;
4121 def note_template_class_instantiation_here : Note<
4122   "in instantiation of template class %q0 requested here">;
4123 def note_template_member_class_here : Note<
4124   "in instantiation of member class %q0 requested here">;
4125 def note_template_member_function_here : Note<
4126   "in instantiation of member function %q0 requested here">;
4127 def note_function_template_spec_here : Note<
4128   "in instantiation of function template specialization %q0 requested here">;
4129 def note_template_static_data_member_def_here : Note<
4130   "in instantiation of static data member %q0 requested here">;
4131 def note_template_variable_def_here : Note<
4132   "in instantiation of variable template specialization %q0 requested here">;
4133 def note_template_enum_def_here : Note<
4134   "in instantiation of enumeration %q0 requested here">;
4135 def note_template_nsdmi_here : Note<
4136   "in instantiation of default member initializer %q0 requested here">;
4137 def note_template_type_alias_instantiation_here : Note<
4138   "in instantiation of template type alias %0 requested here">;
4139 def note_template_exception_spec_instantiation_here : Note<
4140   "in instantiation of exception specification for %0 requested here">;
4141 def warn_var_template_missing : Warning<"instantiation of variable %q0 "
4142   "required here, but no definition is available">,
4143   InGroup<UndefinedVarTemplate>;
4144 def warn_func_template_missing : Warning<"instantiation of function %q0 "
4145   "required here, but no definition is available">,
4146   InGroup<UndefinedFuncTemplate>, DefaultIgnore;
4147 def note_forward_template_decl : Note<
4148   "forward declaration of template entity is here">;
4149 def note_inst_declaration_hint : Note<"add an explicit instantiation "
4150   "declaration to suppress this warning if %q0 is explicitly instantiated in "
4151   "another translation unit">;
4152
4153 def note_default_arg_instantiation_here : Note<
4154   "in instantiation of default argument for '%0' required here">;
4155 def note_default_function_arg_instantiation_here : Note<
4156   "in instantiation of default function argument expression "
4157   "for '%0' required here">;
4158 def note_explicit_template_arg_substitution_here : Note<
4159   "while substituting explicitly-specified template arguments into function "
4160   "template %0 %1">;
4161 def note_function_template_deduction_instantiation_here : Note<
4162   "while substituting deduced template arguments into function template %0 "
4163   "%1">;
4164 def note_deduced_template_arg_substitution_here : Note<
4165   "during template argument deduction for %select{class|variable}0 template "
4166   "%select{partial specialization |}1%2 %3">;
4167 def note_prior_template_arg_substitution : Note<
4168   "while substituting prior template arguments into %select{non-type|template}0"
4169   " template parameter%1 %2">;
4170 def note_template_default_arg_checking : Note<
4171   "while checking a default template argument used here">;
4172 def note_instantiation_contexts_suppressed : Note<
4173   "(skipping %0 context%s0 in backtrace; use -ftemplate-backtrace-limit=0 to "
4174   "see all)">;
4175
4176 def err_field_instantiates_to_function : Error<
4177   "data member instantiated with function type %0">;
4178 def err_variable_instantiates_to_function : Error<
4179   "%select{variable|static data member}0 instantiated with function type %1">;
4180 def err_nested_name_spec_non_tag : Error<
4181   "type %0 cannot be used prior to '::' because it has no members">;
4182
4183 def err_using_pack_expansion_empty : Error<
4184   "%select{|member}0 using declaration %1 instantiates to an empty pack">;
4185
4186 // C++ Explicit Instantiation
4187 def err_explicit_instantiation_duplicate : Error<
4188     "duplicate explicit instantiation of %0">;
4189 def ext_explicit_instantiation_duplicate : ExtWarn<
4190     "duplicate explicit instantiation of %0 ignored as a Microsoft extension">,
4191     InGroup<MicrosoftTemplate>;
4192 def note_previous_explicit_instantiation : Note<
4193     "previous explicit instantiation is here">;
4194 def warn_explicit_instantiation_after_specialization : Warning<
4195   "explicit instantiation of %0 that occurs after an explicit "
4196   "specialization has no effect">,
4197   InGroup<DiagGroup<"instantiation-after-specialization">>;
4198 def note_previous_template_specialization : Note<
4199     "previous template specialization is here">;
4200 def err_explicit_instantiation_nontemplate_type : Error<
4201     "explicit instantiation of non-templated type %0">;
4202 def note_nontemplate_decl_here : Note<
4203     "non-templated declaration is here">;
4204 def err_explicit_instantiation_in_class : Error<
4205   "explicit instantiation of %0 in class scope">;
4206 def err_explicit_instantiation_out_of_scope : Error<
4207   "explicit instantiation of %0 not in a namespace enclosing %1">;
4208 def err_explicit_instantiation_must_be_global : Error<
4209   "explicit instantiation of %0 must occur at global scope">;
4210 def warn_explicit_instantiation_out_of_scope_0x : Warning<
4211   "explicit instantiation of %0 not in a namespace enclosing %1">, 
4212   InGroup<CXX11Compat>, DefaultIgnore;
4213 def warn_explicit_instantiation_must_be_global_0x : Warning<
4214   "explicit instantiation of %0 must occur at global scope">, 
4215   InGroup<CXX11Compat>, DefaultIgnore;
4216   
4217 def err_explicit_instantiation_requires_name : Error<
4218   "explicit instantiation declaration requires a name">;
4219 def err_explicit_instantiation_of_typedef : Error<
4220   "explicit instantiation of typedef %0">;
4221 def err_explicit_instantiation_storage_class : Error<
4222   "explicit instantiation cannot have a storage class">;
4223 def err_explicit_instantiation_not_known : Error<
4224   "explicit instantiation of %0 does not refer to a function template, "
4225   "variable template, member function, member class, or static data member">;
4226 def note_explicit_instantiation_here : Note<
4227   "explicit instantiation refers here">;
4228 def err_explicit_instantiation_data_member_not_instantiated : Error<
4229   "explicit instantiation refers to static data member %q0 that is not an "
4230   "instantiation">;
4231 def err_explicit_instantiation_member_function_not_instantiated : Error<
4232   "explicit instantiation refers to member function %q0 that is not an "
4233   "instantiation">;
4234 def err_explicit_instantiation_ambiguous : Error<
4235   "partial ordering for explicit instantiation of %0 is ambiguous">;
4236 def note_explicit_instantiation_candidate : Note<
4237   "explicit instantiation candidate function %q0 template here %1">;
4238 def err_explicit_instantiation_inline : Error<
4239   "explicit instantiation cannot be 'inline'">;
4240 def warn_explicit_instantiation_inline_0x : Warning<
4241   "explicit instantiation cannot be 'inline'">, InGroup<CXX11Compat>,
4242   DefaultIgnore;
4243 def err_explicit_instantiation_constexpr : Error<
4244   "explicit instantiation cannot be 'constexpr'">;
4245 def ext_explicit_instantiation_without_qualified_id : Extension<
4246   "qualifier in explicit instantiation of %q0 requires a template-id "
4247   "(a typedef is not permitted)">;
4248 def err_explicit_instantiation_without_template_id : Error<
4249   "explicit instantiation of %q0 must specify a template argument list">;
4250 def err_explicit_instantiation_unqualified_wrong_namespace : Error<
4251   "explicit instantiation of %q0 must occur in namespace %1">;
4252 def warn_explicit_instantiation_unqualified_wrong_namespace_0x : Warning<
4253   "explicit instantiation of %q0 must occur in namespace %1">,
4254   InGroup<CXX11Compat>, DefaultIgnore;
4255 def err_explicit_instantiation_undefined_member : Error<
4256   "explicit instantiation of undefined %select{member class|member function|"
4257   "static data member}0 %1 of class template %2">;
4258 def err_explicit_instantiation_undefined_func_template : Error<
4259   "explicit instantiation of undefined function template %0">;
4260 def err_explicit_instantiation_undefined_var_template : Error<
4261   "explicit instantiation of undefined variable template %q0">;
4262 def err_explicit_instantiation_declaration_after_definition : Error<
4263   "explicit instantiation declaration (with 'extern') follows explicit "
4264   "instantiation definition (without 'extern')">;
4265 def note_explicit_instantiation_definition_here : Note<
4266   "explicit instantiation definition is here">;
4267 def err_invalid_var_template_spec_type : Error<"type %2 "
4268   "of %select{explicit instantiation|explicit specialization|"
4269   "partial specialization|redeclaration}0 of %1 does not match"
4270   " expected type %3">;
4271 def err_mismatched_exception_spec_explicit_instantiation : Error<
4272   "exception specification in explicit instantiation does not match "
4273   "instantiated one">;
4274 def ext_mismatched_exception_spec_explicit_instantiation : ExtWarn<
4275   err_mismatched_exception_spec_explicit_instantiation.Text>,
4276   InGroup<MicrosoftExceptionSpec>;
4277   
4278 // C++ typename-specifiers
4279 def err_typename_nested_not_found : Error<"no type named %0 in %1">;
4280 def err_typename_nested_not_found_enable_if : Error<
4281   "no type named 'type' in %0; 'enable_if' cannot be used to disable "
4282   "this declaration">;
4283 def err_typename_nested_not_type : Error<
4284     "typename specifier refers to non-type member %0 in %1">;
4285 def note_typename_refers_here : Note<
4286     "referenced member %0 is declared here">;
4287 def err_typename_missing : Error<
4288   "missing 'typename' prior to dependent type name '%0%1'">;
4289 def ext_typename_missing : ExtWarn<
4290   "missing 'typename' prior to dependent type name '%0%1'">,
4291   InGroup<DiagGroup<"typename-missing">>;
4292 def ext_typename_outside_of_template : ExtWarn<
4293   "'typename' occurs outside of a template">, InGroup<CXX11>;
4294 def warn_cxx98_compat_typename_outside_of_template : Warning<
4295   "use of 'typename' outside of a template is incompatible with C++98">,
4296   InGroup<CXX98Compat>, DefaultIgnore;
4297 def err_typename_refers_to_using_value_decl : Error<
4298   "typename specifier refers to a dependent using declaration for a value "
4299   "%0 in %1">;
4300 def note_using_value_decl_missing_typename : Note<
4301   "add 'typename' to treat this using declaration as a type">;
4302
4303 def err_template_kw_refers_to_non_template : Error<
4304   "%0 following the 'template' keyword does not refer to a template">;
4305 def err_template_kw_refers_to_class_template : Error<
4306   "'%0%1' instantiated to a class template, not a function template">;
4307 def note_referenced_class_template : Error<
4308   "class template declared here">;
4309 def err_template_kw_missing : Error<
4310   "missing 'template' keyword prior to dependent template name '%0%1'">;
4311 def ext_template_outside_of_template : ExtWarn<
4312   "'template' keyword outside of a template">, InGroup<CXX11>;
4313 def warn_cxx98_compat_template_outside_of_template : Warning<
4314   "use of 'template' keyword outside of a template is incompatible with C++98">,
4315   InGroup<CXX98Compat>, DefaultIgnore;
4316
4317 def err_non_type_template_in_nested_name_specifier : Error<
4318   "qualified name refers into a specialization of %select{function|variable}0 "
4319   "template %1">;
4320 def err_template_id_not_a_type : Error<
4321   "template name refers to non-type template %0">;
4322 def note_template_declared_here : Note<
4323   "%select{function template|class template|variable template"
4324   "|type alias template|template template parameter}0 "
4325   "%1 declared here">;
4326 def err_alias_template_expansion_into_fixed_list : Error<
4327   "pack expansion used as argument for non-pack parameter of alias template">;
4328 def note_parameter_type : Note<
4329   "parameter of type %0 is declared here">;
4330
4331 // C++11 Variadic Templates
4332 def err_template_param_pack_default_arg : Error<
4333   "template parameter pack cannot have a default argument">;
4334 def err_template_param_pack_must_be_last_template_parameter : Error<
4335   "template parameter pack must be the last template parameter">;
4336
4337 def err_template_parameter_pack_non_pack : Error<
4338   "%select{template type|non-type template|template template}0 parameter"
4339   "%select{| pack}1 conflicts with previous %select{template type|"
4340   "non-type template|template template}0 parameter%select{ pack|}1">;
4341 def note_template_parameter_pack_non_pack : Note<
4342   "%select{template type|non-type template|template template}0 parameter"
4343   "%select{| pack}1 does not match %select{template type|non-type template"
4344   "|template template}0 parameter%select{ pack|}1 in template argument">;
4345 def note_template_parameter_pack_here : Note<
4346   "previous %select{template type|non-type template|template template}0 "
4347   "parameter%select{| pack}1 declared here">;
4348   
4349 def err_unexpanded_parameter_pack : Error<
4350   "%select{expression|base type|declaration type|data member type|bit-field "
4351   "size|static assertion|fixed underlying type|enumerator value|"
4352   "using declaration|friend declaration|qualifier|initializer|default argument|"
4353   "non-type template parameter type|exception type|partial specialization|"
4354   "__if_exists name|__if_not_exists name|lambda|block}0 contains"
4355   "%plural{0: an|:}1 unexpanded parameter pack"
4356   "%plural{0:|1: %2|2:s %2 and %3|:s %2, %3, ...}1">;
4357
4358 def err_pack_expansion_without_parameter_packs : Error<
4359   "pack expansion does not contain any unexpanded parameter packs">;
4360 def err_pack_expansion_length_conflict : Error<
4361   "pack expansion contains parameter packs %0 and %1 that have different "
4362   "lengths (%2 vs. %3)">;
4363 def err_pack_expansion_length_conflict_multilevel : Error<
4364   "pack expansion contains parameter pack %0 that has a different "
4365   "length (%1 vs. %2) from outer parameter packs">;
4366 def err_pack_expansion_member_init : Error<
4367   "pack expansion for initialization of member %0">;
4368
4369 def err_function_parameter_pack_without_parameter_packs : Error<
4370   "type %0 of function parameter pack does not contain any unexpanded "
4371   "parameter packs">;
4372 def err_ellipsis_in_declarator_not_parameter : Error<
4373   "only function and template parameters can be parameter packs">;
4374
4375 def err_sizeof_pack_no_pack_name : Error<
4376   "%0 does not refer to the name of a parameter pack">;
4377
4378 def err_fold_expression_packs_both_sides : Error<
4379   "binary fold expression has unexpanded parameter packs in both operands">;
4380 def err_fold_expression_empty : Error<
4381   "unary fold expression has empty expansion for operator '%0' "
4382   "with no fallback value">;
4383 def err_fold_expression_bad_operand : Error<
4384   "expression not permitted as operand of fold expression">;
4385
4386 def err_unexpected_typedef : Error<
4387   "unexpected type name %0: expected expression">;
4388 def err_unexpected_namespace : Error<
4389   "unexpected namespace name %0: expected expression">;
4390 def err_undeclared_var_use : Error<"use of undeclared identifier %0">;
4391 def ext_undeclared_unqual_id_with_dependent_base : ExtWarn<
4392   "use of undeclared identifier %0; "
4393   "unqualified lookup into dependent bases of class template %1 is a Microsoft extension">,
4394   InGroup<MicrosoftTemplate>;
4395 def ext_found_via_dependent_bases_lookup : ExtWarn<"use of identifier %0 "
4396   "found via unqualified lookup into dependent bases of class templates is a "
4397   "Microsoft extension">, InGroup<MicrosoftTemplate>;
4398 def note_dependent_var_use : Note<"must qualify identifier to find this "
4399     "declaration in dependent base class">;
4400 def err_not_found_by_two_phase_lookup : Error<"call to function %0 that is neither "
4401     "visible in the template definition nor found by argument-dependent lookup">;
4402 def note_not_found_by_two_phase_lookup : Note<"%0 should be declared prior to the "
4403     "call site%select{| or in %2| or in an associated namespace of one of its arguments}1">;
4404 def err_undeclared_use : Error<"use of undeclared %0">;
4405 def warn_deprecated : Warning<"%0 is deprecated">,
4406     InGroup<DeprecatedDeclarations>;
4407 def note_from_diagnose_if : Note<"from 'diagnose_if' attribute on %0:">;
4408 def warn_property_method_deprecated :
4409     Warning<"property access is using %0 method which is deprecated">,
4410     InGroup<DeprecatedDeclarations>;
4411 def warn_deprecated_message : Warning<"%0 is deprecated: %1">,
4412     InGroup<DeprecatedDeclarations>;
4413 def warn_deprecated_anonymous_namespace : Warning<
4414   "'deprecated' attribute on anonymous namespace ignored">,
4415   InGroup<IgnoredAttributes>;
4416 def warn_deprecated_fwdclass_message : Warning<
4417     "%0 may be deprecated because the receiver type is unknown">,
4418     InGroup<DeprecatedDeclarations>;
4419 def warn_deprecated_def : Warning<
4420     "Implementing deprecated %select{method|class|category}0">,
4421     InGroup<DeprecatedImplementations>, DefaultIgnore;
4422 def err_unavailable : Error<"%0 is unavailable">;
4423 def err_property_method_unavailable :
4424     Error<"property access is using %0 method which is unavailable">;
4425 def err_unavailable_message : Error<"%0 is unavailable: %1">;
4426 def warn_unavailable_fwdclass_message : Warning<
4427     "%0 may be unavailable because the receiver type is unknown">,
4428     InGroup<UnavailableDeclarations>;
4429 def note_availability_specified_here : Note<
4430   "%0 has been explicitly marked "
4431   "%select{unavailable|deleted|deprecated|partial}1 here">;
4432 def note_implicitly_deleted : Note<
4433   "explicitly defaulted function was implicitly deleted here">;
4434 def warn_not_enough_argument : Warning<
4435   "not enough variable arguments in %0 declaration to fit a sentinel">,
4436   InGroup<Sentinel>;
4437 def warn_missing_sentinel : Warning <
4438   "missing sentinel in %select{function call|method dispatch|block call}0">,
4439   InGroup<Sentinel>;
4440 def note_sentinel_here : Note<
4441   "%select{function|method|block}0 has been explicitly marked sentinel here">;
4442 def warn_missing_prototype : Warning<
4443   "no previous prototype for function %0">,
4444   InGroup<DiagGroup<"missing-prototypes">>, DefaultIgnore;
4445 def note_declaration_not_a_prototype : Note<
4446   "this declaration is not a prototype; add 'void' to make it a prototype for a zero-parameter function">; 
4447 def warn_strict_prototypes : Warning<
4448   "this %select{function declaration is not|"
4449   "old-style function definition is not preceded by}0 a prototype">,
4450   InGroup<DiagGroup<"strict-prototypes">>, DefaultIgnore;
4451 def warn_missing_variable_declarations : Warning<
4452   "no previous extern declaration for non-static variable %0">,
4453   InGroup<DiagGroup<"missing-variable-declarations">>, DefaultIgnore;
4454 def err_static_data_member_reinitialization :
4455   Error<"static data member %0 already has an initializer">;
4456 def err_redefinition : Error<"redefinition of %0">;
4457 def err_alias_after_tentative :
4458   Error<"alias definition of %0 after tentative definition">;
4459 def err_alias_is_definition :
4460   Error<"definition %0 cannot also be an %select{alias|ifunc}1">;
4461 def err_definition_of_implicitly_declared_member : Error<
4462   "definition of implicitly declared %select{default constructor|copy "
4463   "constructor|move constructor|copy assignment operator|move assignment "
4464   "operator|destructor|function}1">;
4465 def err_definition_of_explicitly_defaulted_member : Error<
4466   "definition of explicitly defaulted %select{default constructor|copy "
4467   "constructor|move constructor|copy assignment operator|move assignment "
4468   "operator|destructor|function}0">;
4469 def err_redefinition_extern_inline : Error<
4470   "redefinition of a 'extern inline' function %0 is not supported in "
4471   "%select{C99 mode|C++}1">;
4472 def warn_attr_abi_tag_namespace : Warning<
4473   "'abi_tag' attribute on %select{non-inline|anonymous}0 namespace ignored">,
4474   InGroup<IgnoredAttributes>;
4475 def err_abi_tag_on_redeclaration : Error<
4476   "cannot add 'abi_tag' attribute in a redeclaration">;
4477 def err_new_abi_tag_on_redeclaration : Error<
4478   "'abi_tag' %0 missing in original declaration">;
4479
4480 def note_deleted_dtor_no_operator_delete : Note<
4481   "virtual destructor requires an unambiguous, accessible 'operator delete'">;
4482 def note_deleted_special_member_class_subobject : Note<
4483   "%select{default constructor of|copy constructor of|move constructor of|"
4484   "copy assignment operator of|move assignment operator of|destructor of|"
4485   "constructor inherited by}0 "
4486   "%1 is implicitly deleted because "
4487   "%select{base class %3|%select{||||variant }4field %3}2 has "
4488   "%select{no|a deleted|multiple|an inaccessible|a non-trivial}4 "
4489   "%select{%select{default constructor|copy constructor|move constructor|copy "
4490   "assignment operator|move assignment operator|destructor|"
4491   "%select{default|corresponding|default|default|default}4 constructor}0|"
4492   "destructor}5"
4493   "%select{||s||}4">;
4494 def note_deleted_default_ctor_uninit_field : Note<
4495   "%select{default constructor of|constructor inherited by}0 "
4496   "%1 is implicitly deleted because field %2 of "
4497   "%select{reference|const-qualified}4 type %3 would not be initialized">;
4498 def note_deleted_default_ctor_all_const : Note<
4499   "%select{default constructor of|constructor inherited by}0 "
4500   "%1 is implicitly deleted because all "
4501   "%select{data members|data members of an anonymous union member}2"
4502   " are const-qualified">;
4503 def note_deleted_copy_ctor_rvalue_reference : Note<
4504   "copy constructor of %0 is implicitly deleted because field %1 is of "
4505   "rvalue reference type %2">;
4506 def note_deleted_copy_user_declared_move : Note<
4507   "copy %select{constructor|assignment operator}0 is implicitly deleted because"
4508   " %1 has a user-declared move %select{constructor|assignment operator}2">;
4509 def note_deleted_assign_field : Note<
4510   "%select{copy|move}0 assignment operator of %1 is implicitly deleted "
4511   "because field %2 is of %select{reference|const-qualified}4 type %3">;
4512
4513 // These should be errors.
4514 def warn_undefined_internal : Warning<
4515   "%select{function|variable}0 %q1 has internal linkage but is not defined">,
4516   InGroup<DiagGroup<"undefined-internal">>;
4517 def warn_undefined_inline : Warning<"inline function %q0 is not defined">,
4518   InGroup<DiagGroup<"undefined-inline">>;
4519 def err_undefined_inline_var : Error<"inline variable %q0 is not defined">;
4520 def note_used_here : Note<"used here">;
4521
4522 def err_internal_linkage_redeclaration : Error<
4523   "'internal_linkage' attribute does not appear on the first declaration of %0">;
4524 def warn_internal_linkage_local_storage : Warning<
4525   "'internal_linkage' attribute on a non-static local variable is ignored">,
4526   InGroup<IgnoredAttributes>;
4527
4528 def ext_internal_in_extern_inline : ExtWarn<
4529   "static %select{function|variable}0 %1 is used in an inline function with "
4530   "external linkage">, InGroup<StaticInInline>;
4531 def ext_internal_in_extern_inline_quiet : Extension<
4532   "static %select{function|variable}0 %1 is used in an inline function with "
4533   "external linkage">, InGroup<StaticInInline>;
4534 def warn_static_local_in_extern_inline : Warning<
4535   "non-constant static local variable in inline function may be different "
4536   "in different files">, InGroup<StaticLocalInInline>;
4537 def note_convert_inline_to_static : Note<
4538   "use 'static' to give inline function %0 internal linkage">;
4539
4540 def ext_redefinition_of_typedef : ExtWarn<
4541   "redefinition of typedef %0 is a C11 feature">,
4542   InGroup<DiagGroup<"typedef-redefinition"> >;
4543 def err_redefinition_variably_modified_typedef : Error<
4544   "redefinition of %select{typedef|type alias}0 for variably-modified type %1">;
4545
4546 def err_inline_decl_follows_def : Error<
4547   "inline declaration of %0 follows non-inline definition">;
4548 def err_inline_declaration_block_scope : Error<
4549   "inline declaration of %0 not allowed in block scope">;
4550 def err_static_non_static : Error<
4551   "static declaration of %0 follows non-static declaration">;
4552 def err_different_language_linkage : Error<
4553   "declaration of %0 has a different language linkage">;
4554 def ext_retained_language_linkage : Extension<
4555   "friend function %0 retaining previous language linkage is an extension">,
4556   InGroup<DiagGroup<"retained-language-linkage">>;
4557 def err_extern_c_global_conflict : Error<
4558   "declaration of %1 %select{with C language linkage|in global scope}0 "
4559   "conflicts with declaration %select{in global scope|with C language linkage}0">;
4560 def note_extern_c_global_conflict : Note<
4561   "declared %select{in global scope|with C language linkage}0 here">;
4562 def note_extern_c_begins_here : Note<
4563   "extern \"C\" language linkage specification begins here">;
4564 def warn_weak_import : Warning <
4565   "an already-declared variable is made a weak_import declaration %0">;
4566 def ext_static_non_static : Extension<
4567   "redeclaring non-static %0 as static is a Microsoft extension">,
4568   InGroup<MicrosoftRedeclareStatic>;
4569 def err_non_static_static : Error<
4570   "non-static declaration of %0 follows static declaration">;
4571 def err_extern_non_extern : Error<
4572   "extern declaration of %0 follows non-extern declaration">;
4573 def err_non_extern_extern : Error<
4574   "non-extern declaration of %0 follows extern declaration">;
4575 def err_non_thread_thread : Error<
4576   "non-thread-local declaration of %0 follows thread-local declaration">;
4577 def err_thread_non_thread : Error<
4578   "thread-local declaration of %0 follows non-thread-local declaration">;
4579 def err_thread_thread_different_kind : Error<
4580   "thread-local declaration of %0 with %select{static|dynamic}1 initialization "
4581   "follows declaration with %select{dynamic|static}1 initialization">;
4582 def err_redefinition_different_type : Error<
4583   "redefinition of %0 with a different type%diff{: $ vs $|}1,2">;
4584 def err_redefinition_different_kind : Error<
4585   "redefinition of %0 as different kind of symbol">;
4586 def err_redefinition_different_namespace_alias : Error<
4587   "redefinition of %0 as an alias for a different namespace">;
4588 def note_previous_namespace_alias : Note<
4589   "previously defined as an alias for %0">;
4590 def warn_forward_class_redefinition : Warning<
4591   "redefinition of forward class %0 of a typedef name of an object type is ignored">,
4592   InGroup<DiagGroup<"objc-forward-class-redefinition">>;
4593 def err_redefinition_different_typedef : Error<
4594   "%select{typedef|type alias|type alias template}0 "
4595   "redefinition with different types%diff{ ($ vs $)|}1,2">;
4596 def err_tag_reference_non_tag : Error<
4597   "%select{non-struct type|non-class type|non-union type|non-enum "
4598   "type|typedef|type alias|template|type alias template|template "
4599   "template argument}1 %0 cannot be referenced with a "
4600   "%select{struct|interface|union|class|enum}2 specifier">;
4601 def err_tag_reference_conflict : Error<
4602   "implicit declaration introduced by elaborated type conflicts with a "
4603   "%select{non-struct type|non-class type|non-union type|non-enum "
4604   "type|typedef|type alias|template|type alias template|template "
4605   "template argument}0 of the same name">;
4606 def err_dependent_tag_decl : Error<
4607   "%select{declaration|definition}0 of "
4608   "%select{struct|interface|union|class|enum}1 in a dependent scope">;
4609 def err_tag_definition_of_typedef : Error<
4610   "definition of type %0 conflicts with %select{typedef|type alias}1 of the same name">;
4611 def err_conflicting_types : Error<"conflicting types for %0">;
4612 def err_different_pass_object_size_params : Error<
4613   "conflicting pass_object_size attributes on parameters">;
4614 def err_late_asm_label_name : Error<
4615   "cannot apply asm label to %select{variable|function}0 after its first use">;
4616 def err_different_asm_label : Error<"conflicting asm label">;
4617 def err_nested_redefinition : Error<"nested redefinition of %0">;
4618 def err_use_with_wrong_tag : Error<
4619   "use of %0 with tag type that does not match previous declaration">;
4620 def warn_struct_class_tag_mismatch : Warning<
4621     "%select{struct|interface|class}0%select{| template}1 %2 was previously "
4622     "declared as a %select{struct|interface|class}3%select{| template}1">,
4623     InGroup<MismatchedTags>, DefaultIgnore;
4624 def warn_struct_class_previous_tag_mismatch : Warning<
4625     "%2 defined as %select{a struct|an interface|a class}0%select{| template}1 "
4626     "here but previously declared as "
4627     "%select{a struct|an interface|a class}3%select{| template}1">,
4628      InGroup<MismatchedTags>, DefaultIgnore;
4629 def note_struct_class_suggestion : Note<
4630     "did you mean %select{struct|interface|class}0 here?">;
4631 def ext_forward_ref_enum : Extension<
4632   "ISO C forbids forward references to 'enum' types">;
4633 def err_forward_ref_enum : Error<
4634   "ISO C++ forbids forward references to 'enum' types">;
4635 def ext_ms_forward_ref_enum : Extension<
4636   "forward references to 'enum' types are a Microsoft extension">,
4637   InGroup<MicrosoftEnumForwardReference>;
4638 def ext_forward_ref_enum_def : Extension<
4639   "redeclaration of already-defined enum %0 is a GNU extension">,
4640   InGroup<GNURedeclaredEnum>;
4641   
4642 def err_redefinition_of_enumerator : Error<"redefinition of enumerator %0">;
4643 def err_duplicate_member : Error<"duplicate member %0">;
4644 def err_misplaced_ivar : Error<
4645   "instance variables may not be placed in %select{categories|class extension}0">;
4646 def warn_ivars_in_interface : Warning<
4647   "declaration of instance variables in the interface is deprecated">,
4648   InGroup<DiagGroup<"objc-interface-ivars">>, DefaultIgnore;
4649 def ext_enum_value_not_int : Extension<
4650   "ISO C restricts enumerator values to range of 'int' (%0 is too "
4651   "%select{small|large}1)">;
4652 def ext_enum_too_large : ExtWarn<
4653   "enumeration values exceed range of largest integer">, InGroup<EnumTooLarge>;
4654 def ext_enumerator_increment_too_large : ExtWarn<
4655   "incremented enumerator value %0 is not representable in the "
4656   "largest integer type">, InGroup<EnumTooLarge>;
4657 def warn_flag_enum_constant_out_of_range : Warning<
4658   "enumeration value %0 is out of range of flags in enumeration type %1">,
4659   InGroup<FlagEnum>;
4660   
4661 def warn_illegal_constant_array_size : Extension<
4662   "size of static array must be an integer constant expression">;
4663 def err_vm_decl_in_file_scope : Error<
4664   "variably modified type declaration not allowed at file scope">;
4665 def err_vm_decl_has_extern_linkage : Error<
4666   "variably modified type declaration cannot have 'extern' linkage">;
4667 def err_typecheck_field_variable_size : Error<
4668   "fields must have a constant size: 'variable length array in structure' "
4669   "extension will never be supported">;
4670 def err_vm_func_decl : Error<
4671   "function declaration cannot have variably modified type">;
4672 def err_array_too_large : Error<
4673   "array is too large (%0 elements)">;
4674
4675 // -Wpadded, -Wpacked
4676 def warn_padded_struct_field : Warning<
4677   "padding %select{struct|interface|class}0 %1 with %2 "
4678   "%select{byte|bit}3%s2 to align %4">,
4679   InGroup<Padded>, DefaultIgnore;
4680 def warn_padded_struct_anon_field : Warning<
4681   "padding %select{struct|interface|class}0 %1 with %2 "
4682   "%select{byte|bit}3%s2 to align anonymous bit-field">,
4683   InGroup<Padded>, DefaultIgnore;
4684 def warn_padded_struct_size : Warning<
4685   "padding size of %0 with %1 %select{byte|bit}2%s1 to alignment boundary">,
4686   InGroup<Padded>, DefaultIgnore;
4687 def warn_unnecessary_packed : Warning<
4688   "packed attribute is unnecessary for %0">, InGroup<Packed>, DefaultIgnore;
4689
4690 def err_typecheck_negative_array_size : Error<"array size is negative">;
4691 def warn_typecheck_function_qualifiers_ignored : Warning<
4692   "'%0' qualifier on function type %1 has no effect">,
4693   InGroup<IgnoredQualifiers>;
4694 def warn_typecheck_function_qualifiers_unspecified : Warning<
4695   "'%0' qualifier on function type %1 has unspecified behavior">;
4696 def warn_typecheck_reference_qualifiers : Warning<
4697   "'%0' qualifier on reference type %1 has no effect">,
4698   InGroup<IgnoredQualifiers>;
4699 def err_typecheck_invalid_restrict_not_pointer : Error<
4700   "restrict requires a pointer or reference (%0 is invalid)">;
4701 def err_typecheck_invalid_restrict_not_pointer_noarg : Error<
4702   "restrict requires a pointer or reference">;
4703 def err_typecheck_invalid_restrict_invalid_pointee : Error<
4704   "pointer to function type %0 may not be 'restrict' qualified">;
4705 def ext_typecheck_zero_array_size : Extension<
4706   "zero size arrays are an extension">, InGroup<ZeroLengthArray>;
4707 def err_typecheck_zero_array_size : Error<
4708   "zero-length arrays are not permitted in C++">;
4709 def warn_typecheck_zero_static_array_size : Warning<
4710   "'static' has no effect on zero-length arrays">,
4711   InGroup<ArrayBounds>;
4712 def err_array_size_non_int : Error<"size of array has non-integer type %0">;
4713 def err_init_element_not_constant : Error<
4714   "initializer element is not a compile-time constant">;
4715 def ext_aggregate_init_not_constant : Extension<
4716   "initializer for aggregate is not a compile-time constant">, InGroup<C99>;
4717 def err_local_cant_init : Error<
4718   "'__local' variable cannot have an initializer">;
4719 def err_block_extern_cant_init : Error<
4720   "'extern' variable cannot have an initializer">;
4721 def warn_extern_init : Warning<"'extern' variable has an initializer">,
4722   InGroup<DiagGroup<"extern-initializer">>;
4723 def err_variable_object_no_init : Error<
4724   "variable-sized object may not be initialized">;
4725 def err_excess_initializers : Error<
4726   "excess elements in %select{array|vector|scalar|union|struct}0 initializer">;
4727 def ext_excess_initializers : ExtWarn<
4728   "excess elements in %select{array|vector|scalar|union|struct}0 initializer">;
4729 def err_excess_initializers_in_char_array_initializer : Error<
4730   "excess elements in char array initializer">;
4731 def ext_excess_initializers_in_char_array_initializer : ExtWarn<
4732   "excess elements in char array initializer">;
4733 def err_initializer_string_for_char_array_too_long : Error<
4734   "initializer-string for char array is too long">;
4735 def ext_initializer_string_for_char_array_too_long : ExtWarn<
4736   "initializer-string for char array is too long">;
4737 def warn_missing_field_initializers : Warning<
4738   "missing field %0 initializer">,
4739   InGroup<MissingFieldInitializers>, DefaultIgnore;
4740 def warn_braces_around_scalar_init : Warning<
4741   "braces around scalar initializer">, InGroup<DiagGroup<"braced-scalar-init">>;
4742 def ext_many_braces_around_scalar_init : ExtWarn<
4743   "too many braces around scalar initializer">,
4744   InGroup<DiagGroup<"many-braces-around-scalar-init">>;
4745 def ext_complex_component_init : Extension<
4746   "complex initialization specifying real and imaginary components "
4747   "is an extension">, InGroup<DiagGroup<"complex-component-init">>;
4748 def err_empty_scalar_initializer : Error<"scalar initializer cannot be empty">;
4749 def warn_cxx98_compat_empty_scalar_initializer : Warning<
4750   "scalar initialized from empty initializer list is incompatible with C++98">,
4751   InGroup<CXX98Compat>, DefaultIgnore;
4752 def warn_cxx98_compat_reference_list_init : Warning<
4753   "reference initialized from initializer list is incompatible with C++98">,
4754   InGroup<CXX98Compat>, DefaultIgnore;
4755 def warn_cxx98_compat_initializer_list_init : Warning<
4756   "initialization of initializer_list object is incompatible with C++98">,
4757   InGroup<CXX98Compat>, DefaultIgnore;
4758 def warn_cxx98_compat_ctor_list_init : Warning<
4759   "constructor call from initializer list is incompatible with C++98">,
4760   InGroup<CXX98Compat>, DefaultIgnore;
4761 def err_illegal_initializer : Error<
4762   "illegal initializer (only variables can be initialized)">;
4763 def err_illegal_initializer_type : Error<"illegal initializer type %0">;
4764 def ext_init_list_type_narrowing : ExtWarn<
4765   "type %0 cannot be narrowed to %1 in initializer list">, 
4766   InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
4767 def ext_init_list_variable_narrowing : ExtWarn<
4768   "non-constant-expression cannot be narrowed from type %0 to %1 in "
4769   "initializer list">, InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
4770 def ext_init_list_constant_narrowing : ExtWarn<
4771   "constant expression evaluates to %0 which cannot be narrowed to type %1">,
4772   InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
4773 def warn_init_list_type_narrowing : Warning<
4774   "type %0 cannot be narrowed to %1 in initializer list in C++11">,
4775   InGroup<CXX11Narrowing>, DefaultIgnore;
4776 def warn_init_list_variable_narrowing : Warning<
4777   "non-constant-expression cannot be narrowed from type %0 to %1 in "
4778   "initializer list in C++11">,
4779   InGroup<CXX11Narrowing>, DefaultIgnore;
4780 def warn_init_list_constant_narrowing : Warning<
4781   "constant expression evaluates to %0 which cannot be narrowed to type %1 in "
4782   "C++11">,
4783   InGroup<CXX11Narrowing>, DefaultIgnore;
4784 def note_init_list_narrowing_silence : Note<
4785   "insert an explicit cast to silence this issue">;
4786 def err_init_objc_class : Error<
4787   "cannot initialize Objective-C class type %0">;
4788 def err_implicit_empty_initializer : Error<
4789   "initializer for aggregate with no elements requires explicit braces">;
4790 def err_bitfield_has_negative_width : Error<
4791   "bit-field %0 has negative width (%1)">;
4792 def err_anon_bitfield_has_negative_width : Error<
4793   "anonymous bit-field has negative width (%0)">;
4794 def err_bitfield_has_zero_width : Error<"named bit-field %0 has zero width">;
4795 def err_bitfield_width_exceeds_type_width : Error<
4796   "width of bit-field %0 (%1 bits) exceeds %select{width|size}2 "
4797   "of its type (%3 bit%s3)">;
4798 def err_anon_bitfield_width_exceeds_type_width : Error<
4799   "width of anonymous bit-field (%0 bits) exceeds %select{width|size}1 "
4800   "of its type (%2 bit%s2)">;
4801 def err_incorrect_number_of_vector_initializers : Error<
4802   "number of elements must be either one or match the size of the vector">;
4803
4804 // Used by C++ which allows bit-fields that are wider than the type.
4805 def warn_bitfield_width_exceeds_type_width: Warning<
4806   "width of bit-field %0 (%1 bits) exceeds the width of its type; value will "
4807   "be truncated to %2 bit%s2">, InGroup<BitFieldWidth>;
4808 def warn_anon_bitfield_width_exceeds_type_width : Warning<
4809   "width of anonymous bit-field (%0 bits) exceeds width of its type; value "
4810   "will be truncated to %1 bit%s1">, InGroup<BitFieldWidth>;
4811
4812 def warn_missing_braces : Warning<
4813   "suggest braces around initialization of subobject">,
4814   InGroup<MissingBraces>, DefaultIgnore;
4815
4816 def err_redefinition_of_label : Error<"redefinition of label %0">;
4817 def err_undeclared_label_use : Error<"use of undeclared label %0">;
4818 def err_goto_ms_asm_label : Error<
4819   "cannot jump from this goto statement to label %0 inside an inline assembly block">;
4820 def note_goto_ms_asm_label : Note<
4821   "inline assembly label %0 declared here">;
4822 def warn_unused_label : Warning<"unused label %0">,
4823   InGroup<UnusedLabel>, DefaultIgnore;
4824
4825 def err_goto_into_protected_scope : Error<
4826   "cannot jump from this goto statement to its label">;
4827 def ext_goto_into_protected_scope : ExtWarn<
4828   "jump from this goto statement to its label is a Microsoft extension">,
4829   InGroup<MicrosoftGoto>;
4830 def warn_cxx98_compat_goto_into_protected_scope : Warning<
4831   "jump from this goto statement to its label is incompatible with C++98">,
4832   InGroup<CXX98Compat>, DefaultIgnore;
4833 def err_switch_into_protected_scope : Error<
4834   "cannot jump from switch statement to this case label">;
4835 def warn_cxx98_compat_switch_into_protected_scope : Warning<
4836   "jump from switch statement to this case label is incompatible with C++98">,
4837   InGroup<CXX98Compat>, DefaultIgnore;
4838 def err_indirect_goto_without_addrlabel : Error<
4839   "indirect goto in function with no address-of-label expressions">;
4840 def err_indirect_goto_in_protected_scope : Error<
4841   "cannot jump from this indirect goto statement to one of its possible targets">;
4842 def warn_cxx98_compat_indirect_goto_in_protected_scope : Warning<
4843   "jump from this indirect goto statement to one of its possible targets "
4844   "is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
4845 def note_indirect_goto_target : Note<
4846   "possible target of indirect goto statement">;
4847 def note_protected_by_variable_init : Note<
4848   "jump bypasses variable initialization">;
4849 def note_protected_by_variable_nontriv_destructor : Note<
4850   "jump bypasses variable with a non-trivial destructor">;
4851 def note_protected_by_variable_non_pod : Note<
4852   "jump bypasses initialization of non-POD variable">;
4853 def note_protected_by_cleanup : Note<
4854   "jump bypasses initialization of variable with __attribute__((cleanup))">;
4855 def note_protected_by_vla_typedef : Note<
4856   "jump bypasses initialization of VLA typedef">;
4857 def note_protected_by_vla_type_alias : Note<
4858   "jump bypasses initialization of VLA type alias">;
4859 def note_protected_by_constexpr_if : Note<
4860   "jump enters controlled statement of constexpr if">;
4861 def note_protected_by_if_available : Note<
4862   "jump enters controlled statement of if available">;
4863 def note_protected_by_vla : Note<
4864   "jump bypasses initialization of variable length array">;
4865 def note_protected_by_objc_try : Note<
4866   "jump bypasses initialization of @try block">;
4867 def note_protected_by_objc_catch : Note<
4868   "jump bypasses initialization of @catch block">;
4869 def note_protected_by_objc_finally : Note<
4870   "jump bypasses initialization of @finally block">;
4871 def note_protected_by_objc_synchronized : Note<
4872   "jump bypasses initialization of @synchronized block">;
4873 def note_protected_by_objc_autoreleasepool : Note<
4874   "jump bypasses auto release push of @autoreleasepool block">;
4875 def note_protected_by_cxx_try : Note<
4876   "jump bypasses initialization of try block">;
4877 def note_protected_by_cxx_catch : Note<
4878   "jump bypasses initialization of catch block">;
4879 def note_protected_by_seh_try : Note<
4880   "jump bypasses initialization of __try block">;
4881 def note_protected_by_seh_except : Note<
4882   "jump bypasses initialization of __except block">;
4883 def note_protected_by_seh_finally : Note<
4884   "jump bypasses initialization of __finally block">;
4885 def note_protected_by___block : Note<
4886   "jump bypasses setup of __block variable">;
4887 def note_protected_by_objc_strong_init : Note<
4888   "jump bypasses initialization of __strong variable">;
4889 def note_protected_by_objc_weak_init : Note<
4890   "jump bypasses initialization of __weak variable">;
4891 def note_enters_block_captures_cxx_obj : Note<
4892   "jump enters lifetime of block which captures a destructible C++ object">;
4893 def note_enters_block_captures_strong : Note<
4894   "jump enters lifetime of block which strongly captures a variable">;
4895 def note_enters_block_captures_weak : Note<
4896   "jump enters lifetime of block which weakly captures a variable">;
4897
4898 def note_exits_cleanup : Note<
4899   "jump exits scope of variable with __attribute__((cleanup))">;
4900 def note_exits_dtor : Note<
4901   "jump exits scope of variable with non-trivial destructor">;
4902 def note_exits_temporary_dtor : Note<
4903   "jump exits scope of lifetime-extended temporary with non-trivial "
4904   "destructor">;
4905 def note_exits___block : Note<
4906   "jump exits scope of __block variable">;
4907 def note_exits_objc_try : Note<
4908   "jump exits @try block">;
4909 def note_exits_objc_catch : Note<
4910   "jump exits @catch block">;
4911 def note_exits_objc_finally : Note<
4912   "jump exits @finally block">;
4913 def note_exits_objc_synchronized : Note<
4914   "jump exits @synchronized block">;
4915 def note_exits_cxx_try : Note<
4916   "jump exits try block">;
4917 def note_exits_cxx_catch : Note<
4918   "jump exits catch block">;
4919 def note_exits_seh_try : Note<
4920   "jump exits __try block">;
4921 def note_exits_seh_except : Note<
4922   "jump exits __except block">;
4923 def note_exits_seh_finally : Note<
4924   "jump exits __finally block">;
4925 def note_exits_objc_autoreleasepool : Note<
4926   "jump exits autoreleasepool block">;
4927 def note_exits_objc_strong : Note<
4928   "jump exits scope of __strong variable">;
4929 def note_exits_objc_weak : Note<
4930   "jump exits scope of __weak variable">;
4931 def note_exits_block_captures_cxx_obj : Note<
4932   "jump exits lifetime of block which captures a destructible C++ object">;
4933 def note_exits_block_captures_strong : Note<
4934   "jump exits lifetime of block which strongly captures a variable">;
4935 def note_exits_block_captures_weak : Note<
4936   "jump exits lifetime of block which weakly captures a variable">;
4937
4938 def err_func_returning_qualified_void : ExtWarn<
4939   "function cannot return qualified void type %0">,
4940   InGroup<DiagGroup<"qualified-void-return-type">>;
4941 def err_func_returning_array_function : Error<
4942   "function cannot return %select{array|function}0 type %1">;
4943 def err_field_declared_as_function : Error<"field %0 declared as a function">;
4944 def err_field_incomplete : Error<"field has incomplete type %0">;
4945 def ext_variable_sized_type_in_struct : ExtWarn<
4946   "field %0 with variable sized type %1 not at the end of a struct or class is"
4947   " a GNU extension">, InGroup<GNUVariableSizedTypeNotAtEnd>;
4948
4949 def ext_c99_flexible_array_member : Extension<
4950   "flexible array members are a C99 feature">, InGroup<C99>;
4951 def err_flexible_array_virtual_base : Error<
4952   "flexible array member %0 not allowed in "
4953   "%select{struct|interface|union|class|enum}1 which has a virtual base class">;
4954 def err_flexible_array_empty_aggregate : Error<
4955   "flexible array member %0 not allowed in otherwise empty "
4956   "%select{struct|interface|union|class|enum}1">;
4957 def err_flexible_array_has_nontrivial_dtor : Error<
4958   "flexible array member %0 of type %1 with non-trivial destruction">;
4959 def ext_flexible_array_in_struct : Extension<
4960   "%0 may not be nested in a struct due to flexible array member">,
4961   InGroup<FlexibleArrayExtensions>;
4962 def ext_flexible_array_in_array : Extension<
4963   "%0 may not be used as an array element due to flexible array member">,
4964   InGroup<FlexibleArrayExtensions>;
4965 def err_flexible_array_init : Error<
4966   "initialization of flexible array member is not allowed">;
4967 def ext_flexible_array_empty_aggregate_ms : Extension<
4968   "flexible array member %0 in otherwise empty "
4969   "%select{struct|interface|union|class|enum}1 is a Microsoft extension">,
4970   InGroup<MicrosoftFlexibleArray>;
4971 def err_flexible_array_union : Error<
4972   "flexible array member %0 in a union is not allowed">;
4973 def ext_flexible_array_union_ms : Extension<
4974   "flexible array member %0 in a union is a Microsoft extension">,
4975   InGroup<MicrosoftFlexibleArray>;
4976 def ext_flexible_array_empty_aggregate_gnu : Extension<
4977   "flexible array member %0 in otherwise empty "
4978   "%select{struct|interface|union|class|enum}1 is a GNU extension">,
4979   InGroup<GNUEmptyStruct>;
4980 def ext_flexible_array_union_gnu : Extension<
4981   "flexible array member %0 in a union is a GNU extension">, InGroup<GNUFlexibleArrayUnionMember>;
4982
4983 let CategoryName = "ARC Semantic Issue" in {
4984
4985 // ARC-mode diagnostics.
4986
4987 let CategoryName = "ARC Weak References" in {
4988
4989 def err_arc_weak_no_runtime : Error<
4990   "cannot create __weak reference because the current deployment target "
4991   "does not support weak references">;
4992 def err_arc_weak_disabled : Error<
4993   "cannot create __weak reference in file using manual reference counting">;
4994 def err_synthesizing_arc_weak_property_disabled : Error<
4995   "cannot synthesize weak property in file using manual reference counting">;
4996 def err_synthesizing_arc_weak_property_no_runtime : Error<
4997   "cannot synthesize weak property because the current deployment target "
4998   "does not support weak references">;
4999 def err_arc_unsupported_weak_class : Error<
5000   "class is incompatible with __weak references">;
5001 def err_arc_weak_unavailable_assign : Error<
5002   "assignment of a weak-unavailable object to a __weak object">;
5003 def err_arc_weak_unavailable_property : Error<
5004   "synthesizing __weak instance variable of type %0, which does not "
5005   "support weak references">;
5006 def note_implemented_by_class : Note<
5007   "when implemented by class %0">;
5008 def err_arc_convesion_of_weak_unavailable : Error<
5009   "%select{implicit conversion|cast}0 of weak-unavailable object of type %1 to"
5010   " a __weak object of type %2">;
5011
5012 } // end "ARC Weak References" category
5013
5014 let CategoryName = "ARC Restrictions" in {
5015
5016 def err_unavailable_in_arc : Error<
5017   "%0 is unavailable in ARC">;
5018 def note_arc_forbidden_type : Note<
5019   "declaration uses type that is ill-formed in ARC">;
5020 def note_performs_forbidden_arc_conversion : Note<
5021   "inline function performs a conversion which is forbidden in ARC">;
5022 def note_arc_init_returns_unrelated : Note<
5023   "init method must return a type related to its receiver type">;
5024 def note_arc_weak_disabled : Note<
5025   "declaration uses __weak, but ARC is disabled">;
5026 def note_arc_weak_no_runtime : Note<"declaration uses __weak, which "
5027   "the current deployment target does not support">;
5028 def note_arc_field_with_ownership : Note<
5029   "field has non-trivial ownership qualification">;
5030
5031 def err_arc_illegal_explicit_message : Error<
5032   "ARC forbids explicit message send of %0">;
5033 def err_arc_unused_init_message : Error<
5034   "the result of a delegate init call must be immediately returned "
5035   "or assigned to 'self'">;
5036 def err_arc_mismatched_cast : Error<
5037   "%select{implicit conversion|cast}0 of "
5038   "%select{%2|a non-Objective-C pointer type %2|a block pointer|"
5039   "an Objective-C pointer|an indirect pointer to an Objective-C pointer}1"
5040   " to %3 is disallowed with ARC">;
5041 def err_arc_nolifetime_behavior : Error<
5042   "explicit ownership qualifier on cast result has no effect">;
5043 def err_arc_objc_object_in_tag : Error<
5044   "ARC forbids %select{Objective-C objects|blocks}0 in "
5045   "%select{struct|interface|union|<<ERROR>>|enum}1">;
5046 def err_arc_objc_property_default_assign_on_object : Error<
5047   "ARC forbids synthesizing a property of an Objective-C object "
5048   "with unspecified ownership or storage attribute">;
5049 def err_arc_illegal_selector : Error<
5050   "ARC forbids use of %0 in a @selector">;
5051 def err_arc_illegal_method_def : Error<
5052   "ARC forbids %select{implementation|synthesis}0 of %1">;
5053 def warn_arc_strong_pointer_objc_pointer : Warning<
5054   "method parameter of type %0 with no explicit ownership">,
5055   InGroup<DiagGroup<"explicit-ownership-type">>, DefaultIgnore;
5056   
5057 } // end "ARC Restrictions" category
5058   
5059 def err_arc_lost_method_convention : Error<
5060   "method was declared as %select{an 'alloc'|a 'copy'|an 'init'|a 'new'}0 "
5061   "method, but its implementation doesn't match because %select{"
5062   "its result type is not an object pointer|"
5063   "its result type is unrelated to its receiver type}1">;
5064 def note_arc_lost_method_convention : Note<"declaration in interface">;
5065 def err_arc_gained_method_convention : Error<
5066   "method implementation does not match its declaration">;
5067 def note_arc_gained_method_convention : Note<
5068   "declaration in interface is not in the '%select{alloc|copy|init|new}0' "
5069   "family because %select{its result type is not an object pointer|"
5070   "its result type is unrelated to its receiver type}1">;
5071 def err_typecheck_arc_assign_self : Error<
5072   "cannot assign to 'self' outside of a method in the init family">;
5073 def err_typecheck_arc_assign_self_class_method : Error<
5074   "cannot assign to 'self' in a class method">;
5075 def err_typecheck_arr_assign_enumeration : Error<
5076   "fast enumeration variables cannot be modified in ARC by default; "
5077   "declare the variable __strong to allow this">;
5078 def warn_arc_retained_assign : Warning<
5079   "assigning retained object to %select{weak|unsafe_unretained}0 "
5080   "%select{property|variable}1"
5081   "; object will be released after assignment">,
5082   InGroup<ARCUnsafeRetainedAssign>;
5083 def warn_arc_retained_property_assign : Warning<
5084   "assigning retained object to unsafe property"
5085   "; object will be released after assignment">,
5086   InGroup<ARCUnsafeRetainedAssign>;
5087 def warn_arc_literal_assign : Warning<
5088   "assigning %select{array literal|dictionary literal|numeric literal|boxed expression|<should not happen>|block literal}0"
5089   " to a weak %select{property|variable}1"
5090   "; object will be released after assignment">,
5091   InGroup<ARCUnsafeRetainedAssign>;
5092 def err_arc_new_array_without_ownership : Error<
5093   "'new' cannot allocate an array of %0 with no explicit ownership">;
5094 def err_arc_autoreleasing_var : Error<
5095   "%select{__block variables|global variables|fields|instance variables}0 cannot have "
5096   "__autoreleasing ownership">;
5097 def err_arc_autoreleasing_capture : Error<
5098   "cannot capture __autoreleasing variable in a "
5099   "%select{block|lambda by copy}0">;
5100 def err_arc_thread_ownership : Error<
5101   "thread-local variable has non-trivial ownership: type is %0">;
5102 def err_arc_indirect_no_ownership : Error<
5103   "%select{pointer|reference}1 to non-const type %0 with no explicit ownership">;
5104 def err_arc_array_param_no_ownership : Error<
5105   "must explicitly describe intended ownership of an object array parameter">;
5106 def err_arc_pseudo_dtor_inconstant_quals : Error<
5107   "pseudo-destructor destroys object of type %0 with inconsistently-qualified "
5108   "type %1">;
5109 def err_arc_init_method_unrelated_result_type : Error<
5110   "init methods must return a type related to the receiver type">;
5111 def err_arc_nonlocal_writeback : Error<
5112   "passing address of %select{non-local|non-scalar}0 object to "
5113   "__autoreleasing parameter for write-back">;
5114 def err_arc_method_not_found : Error<
5115   "no known %select{instance|class}1 method for selector %0">;
5116 def err_arc_receiver_forward_class : Error<
5117   "receiver %0 for class message is a forward declaration">;
5118 def err_arc_may_not_respond : Error<
5119   "no visible @interface for %0 declares the selector %1">;
5120 def err_arc_receiver_forward_instance : Error<
5121   "receiver type %0 for instance message is a forward declaration">;
5122 def warn_receiver_forward_instance : Warning<
5123   "receiver type %0 for instance message is a forward declaration">,
5124   InGroup<ForwardClassReceiver>, DefaultIgnore;
5125 def err_arc_collection_forward : Error<
5126   "collection expression type %0 is a forward declaration">;
5127 def err_arc_multiple_method_decl : Error< 
5128   "multiple methods named %0 found with mismatched result, "
5129   "parameter type or attributes">;
5130 def warn_arc_lifetime_result_type : Warning<
5131   "ARC %select{unused|__unsafe_unretained|__strong|__weak|__autoreleasing}0 "
5132   "lifetime qualifier on return type is ignored">,
5133   InGroup<IgnoredQualifiers>;
5134
5135 let CategoryName = "ARC Retain Cycle" in {
5136
5137 def warn_arc_retain_cycle : Warning<
5138   "capturing %0 strongly in this block is likely to lead to a retain cycle">,
5139   InGroup<ARCRetainCycles>;
5140 def note_arc_retain_cycle_owner : Note<
5141   "block will be retained by %select{the captured object|an object strongly "
5142   "retained by the captured object}0">;
5143
5144 } // end "ARC Retain Cycle" category
5145
5146 def warn_arc_object_memaccess : Warning<
5147   "%select{destination for|source of}0 this %1 call is a pointer to "
5148   "ownership-qualified type %2">, InGroup<ARCNonPodMemAccess>;
5149
5150 let CategoryName = "ARC and @properties" in {
5151
5152 def err_arc_strong_property_ownership : Error<
5153   "existing instance variable %1 for strong property %0 may not be "
5154   "%select{|__unsafe_unretained||__weak}2">;
5155 def err_arc_assign_property_ownership : Error<
5156   "existing instance variable %1 for property %0 with %select{unsafe_unretained|assign}2 "
5157   "attribute must be __unsafe_unretained">;
5158 def err_arc_inconsistent_property_ownership : Error<
5159   "%select{|unsafe_unretained|strong|weak}1 property %0 may not also be "
5160   "declared %select{|__unsafe_unretained|__strong|__weak|__autoreleasing}2">;
5161
5162 } // end "ARC and @properties" category
5163
5164 def warn_block_capture_autoreleasing : Warning<
5165   "block captures an autoreleasing out-parameter, which may result in "
5166   "use-after-free bugs">,
5167   InGroup<BlockCaptureAutoReleasing>, DefaultIgnore;
5168 def note_declare_parameter_autoreleasing : Note<
5169   "declare the parameter __autoreleasing explicitly to suppress this warning">;
5170 def note_declare_parameter_strong : Note<
5171   "declare the parameter __strong or capture a __block __strong variable to "
5172   "keep values alive across autorelease pools">;
5173
5174 def err_arc_atomic_ownership : Error<
5175   "cannot perform atomic operation on a pointer to type %0: type has "
5176   "non-trivial ownership">;
5177
5178 let CategoryName = "ARC Casting Rules" in {
5179
5180 def err_arc_bridge_cast_incompatible : Error<
5181   "incompatible types casting %0 to %1 with a %select{__bridge|"
5182   "__bridge_transfer|__bridge_retained}2 cast">;
5183 def err_arc_bridge_cast_wrong_kind : Error<
5184   "cast of %select{Objective-C|block|C}0 pointer type %1 to "
5185   "%select{Objective-C|block|C}2 pointer type %3 cannot use %select{__bridge|"
5186   "__bridge_transfer|__bridge_retained}4">;
5187 def err_arc_cast_requires_bridge : Error<
5188   "%select{cast|implicit conversion}0 of %select{Objective-C|block|C}1 "
5189   "pointer type %2 to %select{Objective-C|block|C}3 pointer type %4 "
5190   "requires a bridged cast">;
5191 def note_arc_bridge : Note<
5192   "use __bridge to convert directly (no change in ownership)">;
5193 def note_arc_cstyle_bridge : Note<
5194   "use __bridge with C-style cast to convert directly (no change in ownership)">;
5195 def note_arc_bridge_transfer : Note<
5196   "use %select{__bridge_transfer|CFBridgingRelease call}1 to transfer "
5197   "ownership of a +1 %0 into ARC">;
5198 def note_arc_cstyle_bridge_transfer : Note<
5199   "use __bridge_transfer with C-style cast to transfer "
5200   "ownership of a +1 %0 into ARC">;
5201 def note_arc_bridge_retained : Note<
5202   "use %select{__bridge_retained|CFBridgingRetain call}1 to make an "
5203   "ARC object available as a +1 %0">;
5204 def note_arc_cstyle_bridge_retained : Note<
5205   "use __bridge_retained with C-style cast to make an "
5206   "ARC object available as a +1 %0">;
5207
5208 } // ARC Casting category
5209
5210 } // ARC category name
5211
5212 def err_flexible_array_init_needs_braces : Error<
5213   "flexible array requires brace-enclosed initializer">;
5214 def err_illegal_decl_array_of_functions : Error<
5215   "'%0' declared as array of functions of type %1">;
5216 def err_illegal_decl_array_incomplete_type : Error<
5217   "array has incomplete element type %0">;
5218 def err_illegal_message_expr_incomplete_type : Error<
5219   "Objective-C message has incomplete result type %0">;
5220 def err_illegal_decl_array_of_references : Error<
5221   "'%0' declared as array of references of type %1">;
5222 def err_decl_negative_array_size : Error<
5223   "'%0' declared as an array with a negative size">;
5224 def err_array_static_outside_prototype : Error<
5225   "%0 used in array declarator outside of function prototype">;
5226 def err_array_static_not_outermost : Error<
5227   "%0 used in non-outermost array type derivation">;
5228 def err_array_star_outside_prototype : Error<
5229   "star modifier used outside of function prototype">;
5230 def err_illegal_decl_pointer_to_reference : Error<
5231   "'%0' declared as a pointer to a reference of type %1">;
5232 def err_illegal_decl_mempointer_to_reference : Error<
5233   "'%0' declared as a member pointer to a reference of type %1">;
5234 def err_illegal_decl_mempointer_to_void : Error<
5235   "'%0' declared as a member pointer to void">;
5236 def err_illegal_decl_mempointer_in_nonclass : Error<
5237   "'%0' does not point into a class">;
5238 def err_mempointer_in_nonclass_type : Error<
5239   "member pointer refers into non-class type %0">;
5240 def err_reference_to_void : Error<"cannot form a reference to 'void'">;
5241 def err_nonfunction_block_type : Error<
5242   "block pointer to non-function type is invalid">;
5243 def err_return_block_has_expr : Error<"void block should not return a value">;
5244 def err_block_return_missing_expr : Error<
5245   "non-void block should return a value">;
5246 def err_func_def_incomplete_result : Error<
5247   "incomplete result type %0 in function definition">;
5248 def err_atomic_specifier_bad_type : Error<
5249   "_Atomic cannot be applied to "
5250   "%select{incomplete |array |function |reference |atomic |qualified |}0type "
5251   "%1 %select{||||||which is not trivially copyable}0">;
5252
5253 // Expressions.
5254 def ext_sizeof_alignof_function_type : Extension<
5255   "invalid application of '%select{sizeof|alignof|vec_step}0' to a "
5256   "function type">, InGroup<PointerArith>;
5257 def ext_sizeof_alignof_void_type : Extension<
5258   "invalid application of '%select{sizeof|alignof|vec_step}0' to a void "
5259   "type">, InGroup<PointerArith>;
5260 def err_opencl_sizeof_alignof_type : Error<
5261   "invalid application of '%select{sizeof|alignof|vec_step|__builtin_omp_required_simd_align}0' to a void type">;
5262 def err_sizeof_alignof_incomplete_type : Error<
5263   "invalid application of '%select{sizeof|alignof|vec_step|__builtin_omp_required_simd_align}0' to an "
5264   "incomplete type %1">;
5265 def err_sizeof_alignof_function_type : Error<
5266   "invalid application of '%select{sizeof|alignof|vec_step|__builtin_omp_required_simd_align}0' to a "
5267   "function type">;
5268 def err_openmp_default_simd_align_expr : Error<
5269   "invalid application of '__builtin_omp_required_simd_align' to an expression, only type is allowed">;
5270 def err_sizeof_alignof_typeof_bitfield : Error<
5271   "invalid application of '%select{sizeof|alignof|typeof}0' to bit-field">;
5272 def err_alignof_member_of_incomplete_type : Error<
5273   "invalid application of 'alignof' to a field of a class still being defined">;
5274 def err_vecstep_non_scalar_vector_type : Error<
5275   "'vec_step' requires built-in scalar or vector type, %0 invalid">;
5276 def err_offsetof_incomplete_type : Error<
5277   "offsetof of incomplete type %0">;
5278 def err_offsetof_record_type : Error<
5279   "offsetof requires struct, union, or class type, %0 invalid">;
5280 def err_offsetof_array_type : Error<"offsetof requires array type, %0 invalid">;
5281 def ext_offsetof_extended_field_designator : Extension<
5282   "using extended field designator is an extension">,
5283   InGroup<DiagGroup<"extended-offsetof">>;
5284 def ext_offsetof_non_pod_type : ExtWarn<"offset of on non-POD type %0">,
5285   InGroup<InvalidOffsetof>;
5286 def ext_offsetof_non_standardlayout_type : ExtWarn<
5287   "offset of on non-standard-layout type %0">, InGroup<InvalidOffsetof>;
5288 def err_offsetof_bitfield : Error<"cannot compute offset of bit-field %0">;
5289 def err_offsetof_field_of_virtual_base : Error<
5290   "invalid application of 'offsetof' to a field of a virtual base">;
5291 def warn_sub_ptr_zero_size_types : Warning<
5292   "subtraction of pointers to type %0 of zero size has undefined behavior">,
5293   InGroup<PointerArith>;
5294
5295 def warn_floatingpoint_eq : Warning<
5296   "comparing floating point with == or != is unsafe">,
5297   InGroup<DiagGroup<"float-equal">>, DefaultIgnore;
5298
5299 def warn_remainder_division_by_zero : Warning<
5300   "%select{remainder|division}0 by zero is undefined">,
5301   InGroup<DivZero>;
5302 def warn_shift_lhs_negative : Warning<"shifting a negative signed value is undefined">,
5303   InGroup<DiagGroup<"shift-negative-value">>;
5304 def warn_shift_negative : Warning<"shift count is negative">,
5305   InGroup<DiagGroup<"shift-count-negative">>;
5306 def warn_shift_gt_typewidth : Warning<"shift count >= width of type">,
5307   InGroup<DiagGroup<"shift-count-overflow">>;
5308 def warn_shift_result_gt_typewidth : Warning<
5309   "signed shift result (%0) requires %1 bits to represent, but %2 only has "
5310   "%3 bits">, InGroup<DiagGroup<"shift-overflow">>;
5311 def warn_shift_result_sets_sign_bit : Warning<
5312   "signed shift result (%0) sets the sign bit of the shift expression's "
5313   "type (%1) and becomes negative">,
5314   InGroup<DiagGroup<"shift-sign-overflow">>, DefaultIgnore;
5315
5316 def warn_precedence_bitwise_rel : Warning<
5317   "%0 has lower precedence than %1; %1 will be evaluated first">,
5318   InGroup<Parentheses>;
5319 def note_precedence_bitwise_first : Note<
5320   "place parentheses around the %0 expression to evaluate it first">;
5321 def note_precedence_silence : Note<
5322   "place parentheses around the '%0' expression to silence this warning">;
5323
5324 def warn_precedence_conditional : Warning<
5325   "operator '?:' has lower precedence than '%0'; '%0' will be evaluated first">,
5326   InGroup<Parentheses>;
5327 def note_precedence_conditional_first : Note<
5328   "place parentheses around the '?:' expression to evaluate it first">;
5329
5330 def warn_logical_instead_of_bitwise : Warning<
5331   "use of logical '%0' with constant operand">,
5332   InGroup<DiagGroup<"constant-logical-operand">>;
5333 def note_logical_instead_of_bitwise_change_operator : Note<
5334   "use '%0' for a bitwise operation">;
5335 def note_logical_instead_of_bitwise_remove_constant : Note<
5336   "remove constant to silence this warning">;
5337
5338 def warn_bitwise_op_in_bitwise_op : Warning<
5339   "'%0' within '%1'">, InGroup<BitwiseOpParentheses>;
5340
5341 def warn_logical_and_in_logical_or : Warning<
5342   "'&&' within '||'">, InGroup<LogicalOpParentheses>;
5343
5344 def warn_overloaded_shift_in_comparison :Warning<
5345   "overloaded operator %select{>>|<<}0 has higher precedence than "
5346   "comparison operator">,
5347   InGroup<OverloadedShiftOpParentheses>;
5348 def note_evaluate_comparison_first :Note<
5349   "place parentheses around comparison expression to evaluate it first">;
5350
5351 def warn_addition_in_bitshift : Warning<
5352   "operator '%0' has lower precedence than '%1'; "
5353   "'%1' will be evaluated first">, InGroup<ShiftOpParentheses>;
5354
5355 def warn_self_assignment : Warning<
5356   "explicitly assigning value of variable of type %0 to itself">,
5357   InGroup<SelfAssignment>, DefaultIgnore;
5358 def warn_self_move : Warning<
5359   "explicitly moving variable of type %0 to itself">,
5360   InGroup<SelfMove>, DefaultIgnore;
5361
5362 def warn_redundant_move_on_return : Warning<
5363   "redundant move in return statement">,
5364   InGroup<RedundantMove>, DefaultIgnore;
5365 def warn_pessimizing_move_on_return : Warning<
5366   "moving a local object in a return statement prevents copy elision">,
5367   InGroup<PessimizingMove>, DefaultIgnore;
5368 def warn_pessimizing_move_on_initialization : Warning<
5369   "moving a temporary object prevents copy elision">,
5370   InGroup<PessimizingMove>, DefaultIgnore;
5371 def note_remove_move : Note<"remove std::move call here">;
5372
5373 def warn_string_plus_int : Warning<
5374   "adding %0 to a string does not append to the string">,
5375   InGroup<StringPlusInt>;
5376 def warn_string_plus_char : Warning<
5377   "adding %0 to a string pointer does not append to the string">,
5378   InGroup<StringPlusChar>;
5379 def note_string_plus_scalar_silence : Note<
5380   "use array indexing to silence this warning">;
5381
5382 def warn_sizeof_array_param : Warning<
5383   "sizeof on array function parameter will return size of %0 instead of %1">,
5384   InGroup<SizeofArrayArgument>;
5385
5386 def warn_sizeof_array_decay : Warning<
5387   "sizeof on pointer operation will return size of %0 instead of %1">,
5388   InGroup<SizeofArrayDecay>;
5389
5390 def err_sizeof_nonfragile_interface : Error<
5391   "application of '%select{alignof|sizeof}1' to interface %0 is "
5392   "not supported on this architecture and platform">;
5393 def err_atdef_nonfragile_interface : Error<
5394   "use of @defs is not supported on this architecture and platform">;
5395 def err_subscript_nonfragile_interface : Error<
5396   "subscript requires size of interface %0, which is not constant for "
5397   "this architecture and platform">;
5398
5399 def err_arithmetic_nonfragile_interface : Error<
5400   "arithmetic on pointer to interface %0, which is not a constant size for "
5401   "this architecture and platform">;
5402
5403
5404 def ext_subscript_non_lvalue : Extension<
5405   "ISO C90 does not allow subscripting non-lvalue array">;
5406 def err_typecheck_subscript_value : Error<
5407   "subscripted value is not an array, pointer, or vector">;
5408 def err_typecheck_subscript_not_integer : Error<
5409   "array subscript is not an integer">;
5410 def err_subscript_function_type : Error<
5411   "subscript of pointer to function type %0">;
5412 def err_subscript_incomplete_type : Error<
5413   "subscript of pointer to incomplete type %0">;
5414 def err_dereference_incomplete_type : Error<
5415   "dereference of pointer to incomplete type %0">;
5416 def ext_gnu_subscript_void_type : Extension<
5417   "subscript of a pointer to void is a GNU extension">, InGroup<PointerArith>;
5418 def err_typecheck_member_reference_struct_union : Error<
5419   "member reference base type %0 is not a structure or union">;
5420 def err_typecheck_member_reference_ivar : Error<
5421   "%0 does not have a member named %1">;
5422 def err_arc_weak_ivar_access : Error<
5423   "dereferencing a __weak pointer is not allowed due to possible "
5424   "null value caused by race condition, assign it to strong variable first">;
5425 def err_typecheck_member_reference_arrow : Error<
5426   "member reference type %0 is not a pointer">;
5427 def err_typecheck_member_reference_suggestion : Error<
5428   "member reference type %0 is %select{a|not a}1 pointer; did you mean to use '%select{->|.}1'?">;
5429 def note_typecheck_member_reference_suggestion : Note<
5430   "did you mean to use '.' instead?">;
5431 def note_member_reference_arrow_from_operator_arrow : Note<
5432   "'->' applied to return value of the operator->() declared here">;
5433 def err_typecheck_member_reference_type : Error<
5434   "cannot refer to type member %0 in %1 with '%select{.|->}2'">;
5435 def err_typecheck_member_reference_unknown : Error<
5436   "cannot refer to member %0 in %1 with '%select{.|->}2'">;
5437 def err_member_reference_needs_call : Error<
5438   "base of member reference is a function; perhaps you meant to call "
5439   "it%select{| with no arguments}0?">;
5440 def warn_subscript_is_char : Warning<"array subscript is of type 'char'">,
5441   InGroup<CharSubscript>, DefaultIgnore;
5442
5443 def err_typecheck_incomplete_tag : Error<"incomplete definition of type %0">;
5444 def err_no_member : Error<"no member named %0 in %1">;
5445 def err_no_member_overloaded_arrow : Error<
5446   "no member named %0 in %1; did you mean to use '->' instead of '.'?">;
5447
5448 def err_member_not_yet_instantiated : Error<
5449   "no member %0 in %1; it has not yet been instantiated">;
5450 def note_non_instantiated_member_here : Note<
5451   "not-yet-instantiated member is declared here">;
5452
5453 def err_enumerator_does_not_exist : Error<
5454   "enumerator %0 does not exist in instantiation of %1">;
5455 def note_enum_specialized_here : Note<
5456   "enum %0 was explicitly specialized here">;
5457
5458 def err_member_redeclared : Error<"class member cannot be redeclared">;
5459 def ext_member_redeclared : ExtWarn<"class member cannot be redeclared">,
5460   InGroup<RedeclaredClassMember>;
5461 def err_member_redeclared_in_instantiation : Error<
5462   "multiple overloads of %0 instantiate to the same signature %1">;
5463 def err_member_name_of_class : Error<"member %0 has the same name as its class">;
5464 def err_member_def_undefined_record : Error<
5465   "out-of-line definition of %0 from class %1 without definition">;
5466 def err_member_decl_does_not_match : Error<
5467   "out-of-line %select{declaration|definition}2 of %0 "
5468   "does not match any declaration in %1">;
5469 def err_friend_decl_with_def_arg_must_be_def : Error<
5470   "friend declaration specifying a default argument must be a definition">;
5471 def err_friend_decl_with_def_arg_redeclared : Error<
5472   "friend declaration specifying a default argument must be the only declaration">;
5473 def err_friend_decl_does_not_match : Error<
5474   "friend declaration of %0 does not match any declaration in %1">;
5475 def err_member_decl_does_not_match_suggest : Error<
5476   "out-of-line %select{declaration|definition}2 of %0 "
5477   "does not match any declaration in %1; did you mean %3?">;
5478 def err_member_def_does_not_match_ret_type : Error<
5479   "return type of out-of-line definition of %q0 differs from "
5480   "that in the declaration">;
5481 def err_nonstatic_member_out_of_line : Error<
5482   "non-static data member defined out-of-line">;
5483 def err_qualified_typedef_declarator : Error<
5484   "typedef declarator cannot be qualified">;
5485 def err_qualified_param_declarator : Error<
5486   "parameter declarator cannot be qualified">;
5487 def ext_out_of_line_declaration : ExtWarn<
5488   "out-of-line declaration of a member must be a definition">,
5489   InGroup<OutOfLineDeclaration>, DefaultError;
5490 def err_member_extra_qualification : Error<
5491   "extra qualification on member %0">;
5492 def warn_member_extra_qualification : Warning<
5493   err_member_extra_qualification.Text>, InGroup<MicrosoftExtraQualification>;
5494 def warn_namespace_member_extra_qualification : Warning<
5495   "extra qualification on member %0">,
5496   InGroup<DiagGroup<"extra-qualification">>;
5497 def err_member_qualification : Error<
5498   "non-friend class member %0 cannot have a qualified name">;  
5499 def note_member_def_close_match : Note<"member declaration nearly matches">;
5500 def note_member_def_close_const_match : Note<
5501   "member declaration does not match because "
5502   "it %select{is|is not}0 const qualified">;
5503 def note_member_def_close_param_match : Note<
5504   "type of %ordinal0 parameter of member declaration does not match definition"
5505   "%diff{ ($ vs $)|}1,2">;
5506 def note_local_decl_close_match : Note<"local declaration nearly matches">;
5507 def note_local_decl_close_param_match : Note<
5508   "type of %ordinal0 parameter of local declaration does not match definition"
5509   "%diff{ ($ vs $)|}1,2">;
5510 def err_typecheck_ivar_variable_size : Error<
5511   "instance variables must have a constant size">;
5512 def err_ivar_reference_type : Error<
5513   "instance variables cannot be of reference type">;
5514 def err_typecheck_illegal_increment_decrement : Error<
5515   "cannot %select{decrement|increment}1 value of type %0">;
5516 def err_typecheck_expect_int : Error<
5517   "used type %0 where integer is required">;
5518 def err_typecheck_arithmetic_incomplete_type : Error<
5519   "arithmetic on a pointer to an incomplete type %0">;
5520 def err_typecheck_pointer_arith_function_type : Error<
5521   "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 "
5522   "function type%select{|s}2 %1%select{| and %3}2">;
5523 def err_typecheck_pointer_arith_void_type : Error<
5524   "arithmetic on%select{ a|}0 pointer%select{|s}0 to void">;
5525 def err_typecheck_decl_incomplete_type : Error<
5526   "variable has incomplete type %0">;
5527 def ext_typecheck_decl_incomplete_type : ExtWarn<
5528   "tentative definition of variable with internal linkage has incomplete non-array type %0">,
5529   InGroup<DiagGroup<"tentative-definition-incomplete-type">>;
5530 def err_tentative_def_incomplete_type : Error<
5531   "tentative definition has type %0 that is never completed">;
5532 def warn_tentative_incomplete_array : Warning<
5533   "tentative array definition assumed to have one element">;
5534 def err_typecheck_incomplete_array_needs_initializer : Error<
5535   "definition of variable with array type needs an explicit size "
5536   "or an initializer">;
5537 def err_array_init_not_init_list : Error<
5538   "array initializer must be an initializer "
5539   "list%select{| or string literal| or wide string literal}0">;
5540 def err_array_init_narrow_string_into_wchar : Error<
5541   "initializing wide char array with non-wide string literal">;
5542 def err_array_init_wide_string_into_char : Error<
5543   "initializing char array with wide string literal">;
5544 def err_array_init_incompat_wide_string_into_wchar : Error<
5545   "initializing wide char array with incompatible wide string literal">;
5546 def err_array_init_different_type : Error<
5547   "cannot initialize array %diff{of type $ with array of type $|"
5548   "with different type of array}0,1">;
5549 def err_array_init_non_constant_array : Error<
5550   "cannot initialize array %diff{of type $ with non-constant array of type $|"
5551   "with different type of array}0,1">;
5552 def ext_array_init_copy : Extension<
5553   "initialization of an array "
5554   "%diff{of type $ from a compound literal of type $|"
5555   "from a compound literal}0,1 is a GNU extension">, InGroup<GNUCompoundLiteralInitializer>;
5556 // This is intentionally not disabled by -Wno-gnu.
5557 def ext_array_init_parens : ExtWarn<
5558   "parenthesized initialization of a member array is a GNU extension">,
5559   InGroup<DiagGroup<"gnu-array-member-paren-init">>, DefaultError;
5560 def warn_deprecated_string_literal_conversion : Warning<
5561   "conversion from string literal to %0 is deprecated">,
5562   InGroup<CXX11CompatDeprecatedWritableStr>;
5563 def ext_deprecated_string_literal_conversion : ExtWarn<
5564   "ISO C++11 does not allow conversion from string literal to %0">,
5565   InGroup<WritableStrings>, SFINAEFailure;
5566 def err_realimag_invalid_type : Error<"invalid type %0 to %1 operator">;
5567 def err_typecheck_sclass_fscope : Error<
5568   "illegal storage class on file-scoped variable">;
5569 def warn_standalone_specifier : Warning<"'%0' ignored on this declaration">,
5570   InGroup<MissingDeclarations>;
5571 def ext_standalone_specifier : ExtWarn<"'%0' is not permitted on a declaration "
5572   "of a type">, InGroup<MissingDeclarations>;
5573 def err_standalone_class_nested_name_specifier : Error<
5574   "forward declaration of %select{class|struct|interface|union|enum}0 cannot "
5575   "have a nested name specifier">;
5576 def err_typecheck_sclass_func : Error<"illegal storage class on function">;
5577 def err_static_block_func : Error<
5578   "function declared in block scope cannot have 'static' storage class">;
5579 def err_typecheck_address_of : Error<"address of %select{bit-field"
5580   "|vector element|property expression|register variable}0 requested">;
5581 def ext_typecheck_addrof_void : Extension<
5582   "ISO C forbids taking the address of an expression of type 'void'">;
5583 def err_unqualified_pointer_member_function : Error<
5584   "must explicitly qualify name of member function when taking its address">;
5585 def err_invalid_form_pointer_member_function : Error<
5586   "cannot create a non-constant pointer to member function">;
5587 def err_address_of_function_with_pass_object_size_params: Error<
5588   "cannot take address of function %0 because parameter %1 has "
5589   "pass_object_size attribute">;
5590 def err_parens_pointer_member_function : Error<
5591   "cannot parenthesize the name of a method when forming a member pointer">;
5592 def err_typecheck_invalid_lvalue_addrof_addrof_function : Error<
5593   "extra '&' taking address of overloaded function">;
5594 def err_typecheck_invalid_lvalue_addrof : Error<
5595   "cannot take the address of an rvalue of type %0">;
5596 def ext_typecheck_addrof_temporary : ExtWarn<
5597   "taking the address of a temporary object of type %0">, 
5598   InGroup<AddressOfTemporary>, DefaultError;
5599 def err_typecheck_addrof_temporary : Error<
5600   "taking the address of a temporary object of type %0">;
5601 def err_typecheck_addrof_dtor : Error<
5602   "taking the address of a destructor">;
5603 def err_typecheck_unary_expr : Error<
5604   "invalid argument type %0 to unary expression">;
5605 def err_typecheck_indirection_requires_pointer : Error<
5606   "indirection requires pointer operand (%0 invalid)">;
5607 def ext_typecheck_indirection_through_void_pointer : ExtWarn<
5608   "ISO C++ does not allow indirection on operand of type %0">,
5609   InGroup<DiagGroup<"void-ptr-dereference">>;
5610 def warn_indirection_through_null : Warning<
5611   "indirection of non-volatile null pointer will be deleted, not trap">,
5612   InGroup<NullDereference>;
5613 def warn_binding_null_to_reference : Warning<
5614   "binding dereferenced null pointer to reference has undefined behavior">,
5615   InGroup<NullDereference>;
5616 def note_indirection_through_null : Note<
5617   "consider using __builtin_trap() or qualifying pointer with 'volatile'">;
5618 def warn_pointer_indirection_from_incompatible_type : Warning<
5619   "dereference of type %1 that was reinterpret_cast from type %0 has undefined "
5620   "behavior">,
5621   InGroup<UndefinedReinterpretCast>, DefaultIgnore;
5622 def warn_taking_address_of_packed_member : Warning<
5623   "taking address of packed member %0 of class or structure %q1 may result in an unaligned pointer value">,
5624   InGroup<DiagGroup<"address-of-packed-member">>;
5625
5626 def err_objc_object_assignment : Error<
5627   "cannot assign to class object (%0 invalid)">;
5628 def err_typecheck_invalid_operands : Error<
5629   "invalid operands to binary expression (%0 and %1)">;
5630 def err_typecheck_sub_ptr_compatible : Error<
5631   "%diff{$ and $ are not pointers to compatible types|"
5632   "pointers to incompatible types}0,1">;
5633 def ext_typecheck_ordered_comparison_of_pointer_integer : ExtWarn<
5634   "ordered comparison between pointer and integer (%0 and %1)">;
5635 def ext_typecheck_ordered_comparison_of_pointer_and_zero : Extension<
5636   "ordered comparison between pointer and zero (%0 and %1) is an extension">;
5637 def err_typecheck_ordered_comparison_of_pointer_and_zero : Error<
5638   "ordered comparison between pointer and zero (%0 and %1)">;
5639 def ext_typecheck_ordered_comparison_of_function_pointers : ExtWarn<
5640   "ordered comparison of function pointers (%0 and %1)">;
5641 def ext_typecheck_comparison_of_fptr_to_void : Extension<
5642   "equality comparison between function pointer and void pointer (%0 and %1)">;
5643 def err_typecheck_comparison_of_fptr_to_void : Error<
5644   "equality comparison between function pointer and void pointer (%0 and %1)">;
5645 def ext_typecheck_comparison_of_pointer_integer : ExtWarn<
5646   "comparison between pointer and integer (%0 and %1)">;
5647 def err_typecheck_comparison_of_pointer_integer : Error<
5648   "comparison between pointer and integer (%0 and %1)">;
5649 def ext_typecheck_comparison_of_distinct_pointers : ExtWarn<
5650   "comparison of distinct pointer types%diff{ ($ and $)|}0,1">,
5651   InGroup<CompareDistinctPointerType>;
5652 def ext_typecheck_cond_incompatible_operands : ExtWarn<
5653   "incompatible operand types (%0 and %1)">;
5654 def err_cond_voidptr_arc : Error <
5655   "operands to conditional of types%diff{ $ and $|}0,1 are incompatible "
5656   "in ARC mode">;
5657 def err_typecheck_comparison_of_distinct_pointers : Error<
5658   "comparison of distinct pointer types%diff{ ($ and $)|}0,1">;
5659 def err_typecheck_op_on_nonoverlapping_address_space_pointers : Error<
5660   "%select{comparison between %diff{ ($ and $)|}0,1"
5661   "|arithmetic operation with operands of type %diff{ ($ and $)|}0,1"
5662   "|conditional operator with the second and third operands of type "
5663   "%diff{ ($ and $)|}0,1}2"
5664   " which are pointers to non-overlapping address spaces">;
5665
5666 def err_typecheck_assign_const : Error<
5667   "%select{"
5668   "cannot assign to return value because function %1 returns a const value|"
5669   "cannot assign to variable %1 with const-qualified type %2|"
5670   "cannot assign to %select{non-|}1static data member %2 "
5671   "with const-qualified type %3|"
5672   "cannot assign to non-static data member within const member function %1|"
5673   "read-only variable is not assignable}0">;
5674
5675 def note_typecheck_assign_const : Note<
5676   "%select{"
5677   "function %1 which returns const-qualified type %2 declared here|"
5678   "variable %1 declared const here|"
5679   "%select{non-|}1static data member %2 declared const here|"
5680   "member function %q1 is declared const here}0">;
5681
5682 def warn_mixed_sign_comparison : Warning<
5683   "comparison of integers of different signs: %0 and %1">,
5684   InGroup<SignCompare>, DefaultIgnore;
5685 def warn_lunsigned_always_true_comparison : Warning<
5686   "comparison of unsigned%select{| enum}2 expression %0 is always %1">,
5687   InGroup<TautologicalCompare>;
5688 def warn_out_of_range_compare : Warning<
5689   "comparison of %select{constant %0|true|false}1 with " 
5690   "%select{expression of type %2|boolean expression}3 is always "
5691   "%select{false|true}4">, InGroup<TautologicalOutOfRangeCompare>;
5692 def warn_runsigned_always_true_comparison : Warning<
5693   "comparison of %0 unsigned%select{| enum}2 expression is always %1">,
5694   InGroup<TautologicalCompare>;
5695 def warn_comparison_of_mixed_enum_types : Warning<
5696   "comparison of two values with different enumeration types"
5697   "%diff{ ($ and $)|}0,1">,
5698   InGroup<DiagGroup<"enum-compare">>;
5699 def warn_null_in_arithmetic_operation : Warning<
5700   "use of NULL in arithmetic operation">,
5701   InGroup<NullArithmetic>;
5702 def warn_null_in_comparison_operation : Warning<
5703   "comparison between NULL and non-pointer "
5704   "%select{(%1 and NULL)|(NULL and %1)}0">,
5705   InGroup<NullArithmetic>;
5706 def err_shift_rhs_only_vector : Error<
5707   "requested shift is a vector of type %0 but the first operand is not a "
5708   "vector (%1)">;
5709
5710 def warn_logical_not_on_lhs_of_check : Warning<
5711   "logical not is only applied to the left hand side of this "
5712   "%select{comparison|bitwise operator}0">,
5713   InGroup<LogicalNotParentheses>;
5714 def note_logical_not_fix : Note<
5715   "add parentheses after the '!' to evaluate the "
5716   "%select{comparison|bitwise operator}0 first">;
5717 def note_logical_not_silence_with_parens : Note<
5718   "add parentheses around left hand side expression to silence this warning">;
5719
5720 def err_invalid_this_use : Error<
5721   "invalid use of 'this' outside of a non-static member function">;
5722 def err_this_static_member_func : Error<
5723   "'this' cannot be%select{| implicitly}0 used in a static member function "
5724   "declaration">;
5725 def err_invalid_member_use_in_static_method : Error<
5726   "invalid use of member %0 in static member function">;
5727 def err_invalid_qualified_function_type : Error<
5728   "%select{static |non-}0member function %select{of type %2 |}1"
5729   "cannot have '%3' qualifier">;
5730 def err_compound_qualified_function_type : Error<
5731   "%select{block pointer|pointer|reference}0 to function type %select{%2 |}1"
5732   "cannot have '%3' qualifier">;
5733
5734 def err_ref_qualifier_overload : Error<
5735   "cannot overload a member function %select{without a ref-qualifier|with "
5736   "ref-qualifier '&'|with ref-qualifier '&&'}0 with a member function %select{"
5737   "without a ref-qualifier|with ref-qualifier '&'|with ref-qualifier '&&'}1">;
5738
5739 def err_invalid_non_static_member_use : Error<
5740   "invalid use of non-static data member %0">;
5741 def err_nested_non_static_member_use : Error<
5742   "%select{call to non-static member function|use of non-static data member}0 "
5743   "%2 of %1 from nested type %3">;
5744 def warn_cxx98_compat_non_static_member_use : Warning<
5745   "use of non-static data member %0 in an unevaluated context is "
5746   "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
5747 def err_invalid_incomplete_type_use : Error<
5748   "invalid use of incomplete type %0">;
5749 def err_builtin_func_cast_more_than_one_arg : Error<
5750   "function-style cast to a builtin type can only take one argument">;
5751 def err_value_init_for_array_type : Error<
5752   "array types cannot be value-initialized">;
5753 def err_value_init_for_function_type : Error<
5754   "function types cannot be value-initialized">;
5755 def warn_format_nonliteral_noargs : Warning<
5756   "format string is not a string literal (potentially insecure)">,
5757   InGroup<FormatSecurity>;
5758 def warn_format_nonliteral : Warning<
5759   "format string is not a string literal">,
5760   InGroup<FormatNonLiteral>, DefaultIgnore;
5761
5762 def err_unexpected_interface : Error<
5763   "unexpected interface name %0: expected expression">;
5764 def err_ref_non_value : Error<"%0 does not refer to a value">;
5765 def err_ref_vm_type : Error<
5766   "cannot refer to declaration with a variably modified type inside block">;
5767 def err_ref_flexarray_type : Error<
5768   "cannot refer to declaration of structure variable with flexible array member "
5769   "inside block">;
5770 def err_ref_array_type : Error<
5771   "cannot refer to declaration with an array type inside block">;
5772 def err_property_not_found : Error<
5773   "property %0 not found on object of type %1">;
5774 def err_invalid_property_name : Error<
5775   "%0 is not a valid property name (accessing an object of type %1)">;
5776 def err_getter_not_found : Error<
5777   "no getter method for read from property">;
5778 def err_objc_subscript_method_not_found : Error<
5779   "expected method to %select{read|write}1 %select{dictionary|array}2 element not "
5780   "found on object of type %0">;
5781 def err_objc_subscript_index_type : Error<
5782   "method index parameter type %0 is not integral type">;
5783 def err_objc_subscript_key_type : Error<
5784   "method key parameter type %0 is not object type">;
5785 def err_objc_subscript_dic_object_type : Error<
5786   "method object parameter type %0 is not object type">;
5787 def err_objc_subscript_object_type : Error<
5788   "cannot assign to this %select{dictionary|array}1 because assigning method's "
5789   "2nd parameter of type %0 is not an Objective-C pointer type">;
5790 def err_objc_subscript_base_type : Error<
5791   "%select{dictionary|array}1 subscript base type %0 is not an Objective-C object">;
5792 def err_objc_multiple_subscript_type_conversion : Error<
5793   "indexing expression is invalid because subscript type %0 has "
5794   "multiple type conversion functions">;
5795 def err_objc_subscript_type_conversion : Error<
5796   "indexing expression is invalid because subscript type %0 is not an integral"
5797   " or Objective-C pointer type">;
5798 def err_objc_subscript_pointer : Error<
5799   "indexing expression is invalid because subscript type %0 is not an"
5800   " Objective-C pointer">;
5801 def err_objc_indexing_method_result_type : Error<
5802   "method for accessing %select{dictionary|array}1 element must have Objective-C"
5803   " object return type instead of %0">;
5804 def err_objc_index_incomplete_class_type : Error<
5805   "Objective-C index expression has incomplete class type %0">;
5806 def err_illegal_container_subscripting_op : Error<
5807   "illegal operation on Objective-C container subscripting">;
5808 def err_property_not_found_forward_class : Error<
5809   "property %0 cannot be found in forward class object %1">;
5810 def err_property_not_as_forward_class : Error<
5811   "property %0 refers to an incomplete Objective-C class %1 "
5812   "(with no @interface available)">;
5813 def note_forward_class : Note<
5814   "forward declaration of class here">;
5815 def err_duplicate_property : Error<
5816   "property has a previous declaration">;
5817 def ext_gnu_void_ptr : Extension<
5818   "arithmetic on%select{ a|}0 pointer%select{|s}0 to void is a GNU extension">,
5819   InGroup<PointerArith>;
5820 def ext_gnu_ptr_func_arith : Extension<
5821   "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 function "
5822   "type%select{|s}2 %1%select{| and %3}2 is a GNU extension">,
5823   InGroup<PointerArith>;
5824 def err_readonly_message_assignment : Error<
5825   "assigning to 'readonly' return result of an Objective-C message not allowed">;
5826 def ext_integer_increment_complex : Extension<
5827   "ISO C does not support '++'/'--' on complex integer type %0">;
5828 def ext_integer_complement_complex : Extension<
5829   "ISO C does not support '~' for complex conjugation of %0">;
5830 def err_nosetter_property_assignment : Error<
5831   "%select{assignment to readonly property|"
5832   "no setter method %1 for assignment to property}0">;
5833 def err_nosetter_property_incdec : Error<
5834   "%select{%select{increment|decrement}1 of readonly property|"
5835   "no setter method %2 for %select{increment|decrement}1 of property}0">;
5836 def err_nogetter_property_compound_assignment : Error<
5837   "a getter method is needed to perform a compound assignment on a property">;
5838 def err_nogetter_property_incdec : Error<
5839   "no getter method %1 for %select{increment|decrement}0 of property">;
5840 def err_no_subobject_property_setting : Error<
5841   "expression is not assignable">;
5842 def err_qualified_objc_access : Error<
5843   "%select{property|instance variable}0 access cannot be qualified with '%1'">;
5844   
5845 def ext_freestanding_complex : Extension<
5846   "complex numbers are an extension in a freestanding C99 implementation">;
5847
5848 // FIXME: Remove when we support imaginary.
5849 def err_imaginary_not_supported : Error<"imaginary types are not supported">;
5850
5851 // Obj-c expressions
5852 def warn_root_inst_method_not_found : Warning<
5853   "instance method %0 is being used on 'Class' which is not in the root class">,
5854   InGroup<MethodAccess>;
5855 def warn_class_method_not_found : Warning<
5856   "class method %objcclass0 not found (return type defaults to 'id')">,
5857   InGroup<MethodAccess>;
5858 def warn_instance_method_on_class_found : Warning<
5859   "instance method %0 found instead of class method %1">,
5860   InGroup<MethodAccess>;
5861 def warn_inst_method_not_found : Warning<
5862   "instance method %objcinstance0 not found (return type defaults to 'id')">,
5863   InGroup<MethodAccess>;
5864 def warn_instance_method_not_found_with_typo : Warning<
5865   "instance method %objcinstance0 not found (return type defaults to 'id')"
5866   "; did you mean %objcinstance2?">, InGroup<MethodAccess>;
5867 def warn_class_method_not_found_with_typo : Warning<
5868   "class method %objcclass0 not found (return type defaults to 'id')"
5869   "; did you mean %objcclass2?">, InGroup<MethodAccess>;
5870 def err_method_not_found_with_typo : Error<
5871   "%select{instance|class}1 method %0 not found "
5872   "; did you mean %2?">;
5873 def err_no_super_class_message : Error<
5874   "no @interface declaration found in class messaging of %0">;
5875 def err_root_class_cannot_use_super : Error<
5876   "%0 cannot use 'super' because it is a root class">;
5877 def err_invalid_receiver_to_message_super : Error<
5878   "'super' is only valid in a method body">;
5879 def err_invalid_receiver_class_message : Error<
5880   "receiver type %0 is not an Objective-C class">;
5881 def err_missing_open_square_message_send : Error<
5882   "missing '[' at start of message send expression">;
5883 def warn_bad_receiver_type : Warning<
5884   "receiver type %0 is not 'id' or interface pointer, consider "
5885   "casting it to 'id'">,InGroup<ObjCReceiver>;
5886 def err_bad_receiver_type : Error<"bad receiver type %0">;
5887 def err_incomplete_receiver_type : Error<"incomplete receiver type %0">;
5888 def err_unknown_receiver_suggest : Error<
5889   "unknown receiver %0; did you mean %1?">;
5890 def err_objc_throw_expects_object : Error<
5891   "@throw requires an Objective-C object type (%0 invalid)">;
5892 def err_objc_synchronized_expects_object : Error<
5893   "@synchronized requires an Objective-C object type (%0 invalid)">;
5894 def err_rethrow_used_outside_catch : Error<
5895   "@throw (rethrow) used outside of a @catch block">;
5896 def err_attribute_multiple_objc_gc : Error<
5897   "multiple garbage collection attributes specified for type">;
5898 def err_catch_param_not_objc_type : Error<
5899   "@catch parameter is not a pointer to an interface type">;
5900 def err_illegal_qualifiers_on_catch_parm : Error<
5901   "illegal qualifiers on @catch parameter">;
5902 def err_storage_spec_on_catch_parm : Error<
5903   "@catch parameter cannot have storage specifier '%0'">;
5904 def warn_register_objc_catch_parm : Warning<
5905   "'register' storage specifier on @catch parameter will be ignored">;
5906 def err_qualified_objc_catch_parm : Error<
5907   "@catch parameter declarator cannot be qualified">;
5908 def warn_objc_pointer_cxx_catch_fragile : Warning<
5909   "cannot catch an exception thrown with @throw in C++ in the non-unified "
5910   "exception model">, InGroup<ObjCNonUnifiedException>;
5911 def err_objc_object_catch : Error<
5912   "cannot catch an Objective-C object by value">;
5913 def err_incomplete_type_objc_at_encode : Error<
5914   "'@encode' of incomplete type %0">;
5915 def warn_objc_circular_container : Warning<
5916   "adding '%0' to '%1' might cause circular dependency in container">,
5917   InGroup<DiagGroup<"objc-circular-container">>;
5918 def note_objc_circular_container_declared_here : Note<"'%0' declared here">;
5919
5920 def warn_setter_getter_impl_required : Warning<
5921   "property %0 requires method %1 to be defined - "
5922   "use @synthesize, @dynamic or provide a method implementation "
5923   "in this class implementation">,
5924   InGroup<ObjCPropertyImpl>;
5925 def warn_setter_getter_impl_required_in_category : Warning<
5926   "property %0 requires method %1 to be defined - "
5927   "use @dynamic or provide a method implementation in this category">,
5928   InGroup<ObjCPropertyImpl>;
5929 def note_parameter_named_here : Note<
5930   "passing argument to parameter %0 here">;
5931 def note_parameter_here : Note<
5932   "passing argument to parameter here">;
5933 def note_method_return_type_change : Note<
5934   "compiler has implicitly changed method %0 return type">;
5935
5936 def warn_impl_required_for_class_property : Warning<
5937   "class property %0 requires method %1 to be defined - "
5938   "use @dynamic or provide a method implementation "
5939   "in this class implementation">,
5940   InGroup<ObjCPropertyImpl>;
5941 def warn_impl_required_in_category_for_class_property : Warning<
5942   "class property %0 requires method %1 to be defined - "
5943   "use @dynamic or provide a method implementation in this category">,
5944   InGroup<ObjCPropertyImpl>;
5945
5946 // C++ casts
5947 // These messages adhere to the TryCast pattern: %0 is an int specifying the
5948 // cast type, %1 is the source type, %2 is the destination type.
5949 def err_bad_reinterpret_cast_overload : Error<
5950   "reinterpret_cast cannot resolve overloaded function %0 to type %1">;
5951
5952 def warn_reinterpret_different_from_static : Warning<
5953   "'reinterpret_cast' %select{from|to}3 class %0 %select{to|from}3 its "
5954   "%select{virtual base|base at non-zero offset}2 %1 behaves differently from "
5955   "'static_cast'">, InGroup<ReinterpretBaseClass>;
5956 def note_reinterpret_updowncast_use_static: Note<
5957   "use 'static_cast' to adjust the pointer correctly while "
5958   "%select{upcasting|downcasting}0">;
5959
5960 def err_bad_static_cast_overload : Error<
5961   "address of overloaded function %0 cannot be static_cast to type %1">;
5962
5963 def err_bad_cstyle_cast_overload : Error<
5964   "address of overloaded function %0 cannot be cast to type %1">;
5965
5966
5967 def err_bad_cxx_cast_generic : Error<
5968   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
5969   "functional-style cast}0 from %1 to %2 is not allowed">;
5970 def err_bad_cxx_cast_unrelated_class : Error<
5971   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
5972   "functional-style cast}0 from %1 to %2, which are not related by "
5973   "inheritance, is not allowed">;
5974 def note_type_incomplete : Note<"%0 is incomplete">;
5975 def err_bad_cxx_cast_rvalue : Error<
5976   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
5977   "functional-style cast}0 from rvalue to reference type %2">;
5978 def err_bad_cxx_cast_bitfield : Error<
5979   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
5980   "functional-style cast}0 from bit-field lvalue to reference type %2">;
5981 def err_bad_cxx_cast_qualifiers_away : Error<
5982   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
5983   "functional-style cast}0 from %1 to %2 casts away qualifiers">;
5984 def err_bad_const_cast_dest : Error<
5985   "%select{const_cast||||C-style cast|functional-style cast}0 to %2, "
5986   "which is not a reference, pointer-to-object, or pointer-to-data-member">;
5987 def ext_cast_fn_obj : Extension<
5988   "cast between pointer-to-function and pointer-to-object is an extension">;
5989 def ext_ms_cast_fn_obj : ExtWarn<
5990   "static_cast between pointer-to-function and pointer-to-object is a "
5991   "Microsoft extension">, InGroup<MicrosoftCast>;
5992 def warn_cxx98_compat_cast_fn_obj : Warning<
5993   "cast between pointer-to-function and pointer-to-object is incompatible with C++98">,
5994   InGroup<CXX98CompatPedantic>, DefaultIgnore;
5995 def err_bad_reinterpret_cast_small_int : Error<
5996   "cast from pointer to smaller type %2 loses information">;
5997 def err_bad_cxx_cast_vector_to_scalar_different_size : Error<
5998   "%select{||reinterpret_cast||C-style cast|}0 from vector %1 " 
5999   "to scalar %2 of different size">;
6000 def err_bad_cxx_cast_scalar_to_vector_different_size : Error<
6001   "%select{||reinterpret_cast||C-style cast|}0 from scalar %1 " 
6002   "to vector %2 of different size">;
6003 def err_bad_cxx_cast_vector_to_vector_different_size : Error<
6004   "%select{||reinterpret_cast||C-style cast|}0 from vector %1 " 
6005   "to vector %2 of different size">;
6006 def err_bad_lvalue_to_rvalue_cast : Error<
6007   "cannot cast from lvalue of type %1 to rvalue reference type %2; types are "
6008   "not compatible">;
6009 def err_bad_rvalue_to_rvalue_cast : Error<
6010   "cannot cast from rvalue of type %1 to rvalue reference type %2; types are "
6011   "not compatible">;
6012 def err_bad_static_cast_pointer_nonpointer : Error<
6013   "cannot cast from type %1 to pointer type %2">;
6014 def err_bad_static_cast_member_pointer_nonmp : Error<
6015   "cannot cast from type %1 to member pointer type %2">;
6016 def err_bad_cxx_cast_member_pointer_size : Error<
6017   "cannot %select{||reinterpret_cast||C-style cast|}0 from member pointer "
6018   "type %1 to member pointer type %2 of different size">;
6019 def err_bad_reinterpret_cast_reference : Error<
6020   "reinterpret_cast of a %0 to %1 needs its address, which is not allowed">;
6021 def warn_undefined_reinterpret_cast : Warning<
6022   "reinterpret_cast from %0 to %1 has undefined behavior">,
6023   InGroup<UndefinedReinterpretCast>, DefaultIgnore;
6024
6025 // These messages don't adhere to the pattern.
6026 // FIXME: Display the path somehow better.
6027 def err_ambiguous_base_to_derived_cast : Error<
6028   "ambiguous cast from base %0 to derived %1:%2">;
6029 def err_static_downcast_via_virtual : Error<
6030   "cannot cast %0 to %1 via virtual base %2">;
6031 def err_downcast_from_inaccessible_base : Error<
6032   "cannot cast %select{private|protected}2 base class %1 to %0">;
6033 def err_upcast_to_inaccessible_base : Error<
6034   "cannot cast %0 to its %select{private|protected}2 base class %1">;
6035 def err_bad_dynamic_cast_not_ref_or_ptr : Error<
6036   "%0 is not a reference or pointer">;
6037 def err_bad_dynamic_cast_not_class : Error<"%0 is not a class">;
6038 def err_bad_dynamic_cast_incomplete : Error<"%0 is an incomplete type">;
6039 def err_bad_dynamic_cast_not_ptr : Error<"%0 is not a pointer">;
6040 def err_bad_dynamic_cast_not_polymorphic : Error<"%0 is not polymorphic">;
6041
6042 // Other C++ expressions
6043 def err_need_header_before_typeid : Error<
6044   "you need to include <typeinfo> before using the 'typeid' operator">;
6045 def err_need_header_before_ms_uuidof : Error<
6046   "you need to include <guiddef.h> before using the '__uuidof' operator">;
6047 def err_ms___leave_not_in___try : Error<
6048   "'__leave' statement not in __try block">;
6049 def err_uuidof_without_guid : Error<
6050   "cannot call operator __uuidof on a type with no GUID">;
6051 def err_uuidof_with_multiple_guids : Error<
6052   "cannot call operator __uuidof on a type with multiple GUIDs">;
6053 def err_incomplete_typeid : Error<"'typeid' of incomplete type %0">;
6054 def err_variably_modified_typeid : Error<"'typeid' of variably modified type %0">;
6055 def err_static_illegal_in_new : Error<
6056   "the 'static' modifier for the array size is not legal in new expressions">;
6057 def err_array_new_needs_size : Error<
6058   "array size must be specified in new expressions">;
6059 def err_bad_new_type : Error<
6060   "cannot allocate %select{function|reference}1 type %0 with new">;
6061 def err_new_incomplete_type : Error<
6062   "allocation of incomplete type %0">;
6063 def err_new_array_nonconst : Error<
6064   "only the first dimension of an allocated array may have dynamic size">;
6065 def err_new_array_init_args : Error<
6066   "array 'new' cannot have initialization arguments">;
6067 def ext_new_paren_array_nonconst : ExtWarn<
6068   "when type is in parentheses, array cannot have dynamic size">;
6069 def err_placement_new_non_placement_delete : Error<
6070   "'new' expression with placement arguments refers to non-placement "
6071   "'operator delete'">;
6072 def err_array_size_not_integral : Error<
6073   "array size expression must have integral or %select{|unscoped }0"
6074   "enumeration type, not %1">;
6075 def err_array_size_incomplete_type : Error<
6076   "array size expression has incomplete class type %0">;
6077 def err_array_size_explicit_conversion : Error<
6078   "array size expression of type %0 requires explicit conversion to type %1">;
6079 def note_array_size_conversion : Note<
6080   "conversion to %select{integral|enumeration}0 type %1 declared here">;
6081 def err_array_size_ambiguous_conversion : Error<
6082   "ambiguous conversion of array size expression of type %0 to an integral or "
6083   "enumeration type">;
6084 def ext_array_size_conversion : Extension<
6085   "implicit conversion from array size expression of type %0 to "
6086   "%select{integral|enumeration}1 type %2 is a C++11 extension">,
6087   InGroup<CXX11>;
6088 def warn_cxx98_compat_array_size_conversion : Warning<
6089   "implicit conversion from array size expression of type %0 to "
6090   "%select{integral|enumeration}1 type %2 is incompatible with C++98">,
6091   InGroup<CXX98CompatPedantic>, DefaultIgnore;
6092 def err_address_space_qualified_new : Error<
6093   "'new' cannot allocate objects of type %0 in address space '%1'">;
6094 def err_address_space_qualified_delete : Error<
6095   "'delete' cannot delete objects of type %0 in address space '%1'">;
6096
6097 def err_default_init_const : Error<
6098   "default initialization of an object of const type %0"
6099   "%select{| without a user-provided default constructor}1">;
6100 def ext_default_init_const : ExtWarn<
6101   "default initialization of an object of const type %0"
6102   "%select{| without a user-provided default constructor}1 "
6103   "is a Microsoft extension">,
6104   InGroup<MicrosoftConstInit>;
6105 def err_delete_operand : Error<"cannot delete expression of type %0">;
6106 def ext_delete_void_ptr_operand : ExtWarn<
6107   "cannot delete expression with pointer-to-'void' type %0">,
6108   InGroup<DeleteIncomplete>;
6109 def err_ambiguous_delete_operand : Error<
6110   "ambiguous conversion of delete expression of type %0 to a pointer">;
6111 def warn_delete_incomplete : Warning<
6112   "deleting pointer to incomplete type %0 may cause undefined behavior">,
6113   InGroup<DeleteIncomplete>;
6114 def err_delete_incomplete_class_type : Error<
6115   "deleting incomplete class type %0; no conversions to pointer type">;
6116 def err_delete_explicit_conversion : Error<
6117   "converting delete expression from type %0 to type %1 invokes an explicit "
6118   "conversion function">;
6119 def note_delete_conversion : Note<"conversion to pointer type %0">;
6120 def warn_delete_array_type : Warning<
6121   "'delete' applied to a pointer-to-array type %0 treated as 'delete[]'">;
6122 def warn_mismatched_delete_new : Warning<
6123   "'delete%select{|[]}0' applied to a pointer that was allocated with "
6124   "'new%select{[]|}0'; did you mean 'delete%select{[]|}0'?">,
6125   InGroup<DiagGroup<"mismatched-new-delete">>;
6126 def note_allocated_here : Note<"allocated with 'new%select{[]|}0' here">;
6127 def err_no_suitable_delete_member_function_found : Error<
6128   "no suitable member %0 in %1">;
6129 def err_ambiguous_suitable_delete_member_function_found : Error<
6130   "multiple suitable %0 functions in %1">;
6131 def warn_ambiguous_suitable_delete_function_found : Warning<
6132   "multiple suitable %0 functions for %1; no 'operator delete' function "
6133   "will be invoked if initialization throws an exception">,
6134   InGroup<DiagGroup<"ambiguous-delete">>;
6135 def note_member_declared_here : Note<
6136   "member %0 declared here">;
6137 def err_decrement_bool : Error<"cannot decrement expression of type bool">;
6138 def warn_increment_bool : Warning<
6139   "incrementing expression of type bool is deprecated and "
6140   "incompatible with C++1z">, InGroup<DeprecatedIncrementBool>;
6141 def ext_increment_bool : ExtWarn<
6142   "ISO C++1z does not allow incrementing expression of type bool">,
6143   DefaultError, InGroup<IncrementBool>;
6144 def err_increment_decrement_enum : Error<
6145   "cannot %select{decrement|increment}0 expression of enum type %1">;
6146 def err_catch_incomplete_ptr : Error<
6147   "cannot catch pointer to incomplete type %0">;
6148 def err_catch_incomplete_ref : Error<
6149   "cannot catch reference to incomplete type %0">;
6150 def err_catch_incomplete : Error<"cannot catch incomplete type %0">;
6151 def err_catch_rvalue_ref : Error<"cannot catch exceptions by rvalue reference">;
6152 def err_catch_variably_modified : Error<
6153   "cannot catch variably modified type %0">;
6154 def err_qualified_catch_declarator : Error<
6155   "exception declarator cannot be qualified">;
6156 def err_early_catch_all : Error<"catch-all handler must come last">;
6157 def err_bad_memptr_rhs : Error<
6158   "right hand operand to %0 has non-pointer-to-member type %1">;
6159 def err_bad_memptr_lhs : Error<
6160   "left hand operand to %0 must be a %select{|pointer to }1class "
6161   "compatible with the right hand operand, but is %2">;
6162 def warn_exception_caught_by_earlier_handler : Warning<
6163   "exception of type %0 will be caught by earlier handler">,
6164   InGroup<Exceptions>;
6165 def note_previous_exception_handler : Note<"for type %0">;
6166 def err_exceptions_disabled : Error<
6167   "cannot use '%0' with exceptions disabled">;
6168 def err_objc_exceptions_disabled : Error<
6169   "cannot use '%0' with Objective-C exceptions disabled">;
6170 def err_seh_try_outside_functions : Error<
6171   "cannot use SEH '__try' in blocks, captured regions, or Obj-C method decls">;
6172 def err_mixing_cxx_try_seh_try : Error<
6173   "cannot use C++ 'try' in the same function as SEH '__try'">;
6174 def err_seh_try_unsupported : Error<
6175   "SEH '__try' is not supported on this target">;
6176 def note_conflicting_try_here : Note<
6177   "conflicting %0 here">;
6178 def warn_jump_out_of_seh_finally : Warning<
6179   "jump out of __finally block has undefined behavior">,
6180   InGroup<DiagGroup<"jump-seh-finally">>;
6181 def warn_non_virtual_dtor : Warning<
6182   "%0 has virtual functions but non-virtual destructor">,
6183   InGroup<NonVirtualDtor>, DefaultIgnore;
6184 def warn_delete_non_virtual_dtor : Warning<
6185   "%select{delete|destructor}0 called on non-final %1 that has "
6186   "virtual functions but non-virtual destructor">,
6187   InGroup<DeleteNonVirtualDtor>, DefaultIgnore;
6188 def note_delete_non_virtual : Note<
6189   "qualify call to silence this warning">;
6190 def warn_delete_abstract_non_virtual_dtor : Warning<
6191   "%select{delete|destructor}0 called on %1 that is abstract but has "
6192   "non-virtual destructor">, InGroup<DeleteNonVirtualDtor>;
6193 def warn_overloaded_virtual : Warning<
6194   "%q0 hides overloaded virtual %select{function|functions}1">,
6195   InGroup<OverloadedVirtual>, DefaultIgnore;
6196 def note_hidden_overloaded_virtual_declared_here : Note<
6197   "hidden overloaded virtual function %q0 declared here"
6198   "%select{|: different classes%diff{ ($ vs $)|}2,3"
6199   "|: different number of parameters (%2 vs %3)"
6200   "|: type mismatch at %ordinal2 parameter%diff{ ($ vs $)|}3,4"
6201   "|: different return type%diff{ ($ vs $)|}2,3"
6202   "|: different qualifiers ("
6203   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
6204   "volatile and restrict|const, volatile, and restrict}2 vs "
6205   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
6206   "volatile and restrict|const, volatile, and restrict}3)"
6207   "|: different exception specifications}1">;
6208 def warn_using_directive_in_header : Warning<
6209   "using namespace directive in global context in header">,
6210   InGroup<HeaderHygiene>, DefaultIgnore;
6211 def warn_overaligned_type : Warning<
6212   "type %0 requires %1 bytes of alignment and the default allocator only "
6213   "guarantees %2 bytes">,
6214   InGroup<OveralignedType>, DefaultIgnore;
6215
6216 def err_conditional_void_nonvoid : Error<
6217   "%select{left|right}1 operand to ? is void, but %select{right|left}1 operand "
6218   "is of type %0">;
6219 def err_conditional_ambiguous : Error<
6220   "conditional expression is ambiguous; "
6221   "%diff{$ can be converted to $ and vice versa|"
6222   "types can be convert to each other}0,1">;
6223 def err_conditional_ambiguous_ovl : Error<
6224   "conditional expression is ambiguous; %diff{$ and $|types}0,1 "
6225   "can be converted to several common types">;
6226 def err_conditional_vector_size : Error<
6227   "vector condition type %0 and result type %1 do not have the same number "
6228   "of elements">;
6229 def err_conditional_vector_element_size : Error<
6230   "vector condition type %0 and result type %1 do not have elements of the "
6231   "same size">;
6232
6233 def err_throw_incomplete : Error<
6234   "cannot throw object of incomplete type %0">;
6235 def err_throw_incomplete_ptr : Error<
6236   "cannot throw pointer to object of incomplete type %0">;
6237 def err_return_in_constructor_handler : Error<
6238   "return in the catch of a function try block of a constructor is illegal">;
6239 def warn_cdtor_function_try_handler_mem_expr : Warning<
6240   "cannot refer to a non-static member from the handler of a "
6241   "%select{constructor|destructor}0 function try block">, InGroup<Exceptions>;
6242
6243 let CategoryName = "Lambda Issue" in {
6244   def err_capture_more_than_once : Error<
6245     "%0 can appear only once in a capture list">;
6246   def err_reference_capture_with_reference_default : Error<
6247     "'&' cannot precede a capture when the capture default is '&'">;
6248   def err_this_capture_with_copy_default : Error<
6249     "'this' cannot be explicitly captured when the capture default is '='">;
6250   def err_copy_capture_with_copy_default : Error<
6251     "'&' must precede a capture when the capture default is '='">;
6252   def err_capture_does_not_name_variable : Error<
6253     "%0 in capture list does not name a variable">;
6254   def err_capture_non_automatic_variable : Error<
6255     "%0 cannot be captured because it does not have automatic storage "
6256     "duration">;
6257   def err_this_capture : Error<
6258     "'this' cannot be %select{implicitly |}0captured in this context">;
6259   def err_lambda_capture_anonymous_var : Error<
6260     "unnamed variable cannot be implicitly captured in a lambda expression">;
6261   def err_lambda_capture_flexarray_type : Error<
6262     "variable %0 with flexible array member cannot be captured in "
6263     "a lambda expression">;
6264   def err_lambda_impcap : Error<
6265     "variable %0 cannot be implicitly captured in a lambda with no "
6266     "capture-default specified">;
6267   def note_lambda_decl : Note<"lambda expression begins here">;
6268   def err_lambda_unevaluated_operand : Error<
6269     "lambda expression in an unevaluated operand">;
6270   def err_lambda_in_constant_expression : Error<
6271     "a lambda expression may not appear inside of a constant expression">;
6272   def err_lambda_return_init_list : Error<
6273     "cannot deduce lambda return type from initializer list">;
6274   def err_lambda_capture_default_arg : Error<
6275     "lambda expression in default argument cannot capture any entity">;
6276   def err_lambda_incomplete_result : Error<
6277     "incomplete result type %0 in lambda expression">;
6278   def err_noreturn_lambda_has_return_expr : Error<
6279     "lambda declared 'noreturn' should not return">;
6280   def warn_maybe_falloff_nonvoid_lambda : Warning<
6281     "control may reach end of non-void lambda">,
6282     InGroup<ReturnType>;
6283   def warn_falloff_nonvoid_lambda : Warning<
6284     "control reaches end of non-void lambda">,
6285     InGroup<ReturnType>;
6286   def err_access_lambda_capture : Error<
6287     // The ERRORs represent other special members that aren't constructors, in
6288     // hopes that someone will bother noticing and reporting if they appear
6289     "capture of variable '%0' as type %1 calls %select{private|protected}3 "
6290     "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}2constructor">,
6291     AccessControl;
6292   def note_lambda_to_block_conv : Note<
6293     "implicit capture of lambda object due to conversion to block pointer "
6294     "here">;
6295   def note_var_explicitly_captured_here : Note<"variable %0 is"
6296     "%select{| explicitly}1 captured here">;
6297
6298   // C++14 lambda init-captures.
6299   def warn_cxx11_compat_init_capture : Warning<
6300     "initialized lambda captures are incompatible with C++ standards "
6301     "before C++14">, InGroup<CXXPre14Compat>, DefaultIgnore;
6302   def ext_init_capture : ExtWarn<
6303     "initialized lambda captures are a C++14 extension">, InGroup<CXX14>;
6304   def err_init_capture_no_expression : Error<
6305     "initializer missing for lambda capture %0">;
6306   def err_init_capture_multiple_expressions : Error<
6307     "initializer for lambda capture %0 contains multiple expressions">;
6308   def err_init_capture_paren_braces : Error<
6309     "cannot deduce type for lambda capture %1 from "
6310     "%select{parenthesized|nested}0 initializer list">;
6311   def err_init_capture_deduction_failure : Error<
6312     "cannot deduce type for lambda capture %0 from initializer of type %2">;
6313   def err_init_capture_deduction_failure_from_init_list : Error<
6314     "cannot deduce type for lambda capture %0 from initializer list">;
6315
6316   // C++1z '*this' captures.
6317   def warn_cxx14_compat_star_this_lambda_capture : Warning<
6318     "by value capture of '*this' is incompatible with C++ standards before C++1z">,
6319      InGroup<CXXPre1zCompat>, DefaultIgnore;
6320   def ext_star_this_lambda_capture_cxx1z : ExtWarn<
6321     "capture of '*this' by copy is a C++1z extension">, InGroup<CXX1z>;
6322 }
6323
6324 def err_return_in_captured_stmt : Error<
6325   "cannot return from %0">;
6326 def err_capture_block_variable : Error<
6327   "__block variable %0 cannot be captured in a "
6328   "%select{lambda expression|captured statement}1">;
6329
6330 def err_operator_arrow_circular : Error<
6331   "circular pointer delegation detected">;
6332 def err_operator_arrow_depth_exceeded : Error<
6333   "use of 'operator->' on type %0 would invoke a sequence of more than %1 "
6334   "'operator->' calls">;
6335 def note_operator_arrow_here : Note<
6336   "'operator->' declared here produces an object of type %0">;
6337 def note_operator_arrows_suppressed : Note<
6338   "(skipping %0 'operator->'%s0 in backtrace)">;
6339 def note_operator_arrow_depth : Note<
6340   "use -foperator-arrow-depth=N to increase 'operator->' limit">;
6341
6342 def err_pseudo_dtor_base_not_scalar : Error<
6343   "object expression of non-scalar type %0 cannot be used in a "
6344   "pseudo-destructor expression">;
6345 def ext_pseudo_dtor_on_void : ExtWarn<
6346   "pseudo-destructors on type void are a Microsoft extension">,
6347   InGroup<MicrosoftVoidPseudoDtor>;
6348 def err_pseudo_dtor_type_mismatch : Error<
6349   "the type of object expression "
6350   "%diff{($) does not match the type being destroyed ($)|"
6351   "does not match the type being destroyed}0,1 "
6352   "in pseudo-destructor expression">;
6353 def err_pseudo_dtor_call_with_args : Error<
6354   "call to pseudo-destructor cannot have any arguments">;
6355 def err_dtor_expr_without_call : Error<
6356   "reference to %select{destructor|pseudo-destructor}0 must be called"
6357   "%select{|; did you mean to call it with no arguments?}1">;
6358 def err_pseudo_dtor_destructor_non_type : Error<
6359   "%0 does not refer to a type name in pseudo-destructor expression; expected "
6360   "the name of type %1">;
6361 def err_invalid_use_of_function_type : Error<
6362   "a function type is not allowed here">;
6363 def err_invalid_use_of_array_type : Error<"an array type is not allowed here">;
6364 def err_typecheck_bool_condition : Error<
6365   "value of type %0 is not contextually convertible to 'bool'">;
6366 def err_typecheck_ambiguous_condition : Error<
6367   "conversion %diff{from $ to $|between types}0,1 is ambiguous">;
6368 def err_typecheck_nonviable_condition : Error<
6369   "no viable conversion%select{%diff{ from $ to $|}1,2|"
6370   "%diff{ from returned value of type $ to function return type $|}1,2}0">;
6371 def err_typecheck_nonviable_condition_incomplete : Error<
6372   "no viable conversion%diff{ from $ to incomplete type $|}0,1">;
6373 def err_typecheck_deleted_function : Error<
6374   "conversion function %diff{from $ to $|between types}0,1 "
6375   "invokes a deleted function">;
6376   
6377 def err_expected_class_or_namespace : Error<"%0 is not a class"
6378   "%select{ or namespace|, namespace, or enumeration}1">;
6379 def err_invalid_declarator_scope : Error<"cannot define or redeclare %0 here "
6380   "because namespace %1 does not enclose namespace %2">;
6381 def err_invalid_declarator_global_scope : Error<
6382   "definition or redeclaration of %0 cannot name the global scope">;
6383 def err_invalid_declarator_in_function : Error<
6384   "definition or redeclaration of %0 not allowed inside a function">;
6385 def err_invalid_declarator_in_block : Error<
6386   "definition or redeclaration of %0 not allowed inside a block">;
6387 def err_not_tag_in_scope : Error<
6388   "no %select{struct|interface|union|class|enum}0 named %1 in %2">;
6389
6390 def err_no_typeid_with_fno_rtti : Error<
6391   "cannot use typeid with -fno-rtti">;
6392 def err_no_dynamic_cast_with_fno_rtti : Error<
6393   "cannot use dynamic_cast with -fno-rtti">;
6394
6395 def err_cannot_form_pointer_to_member_of_reference_type : Error<
6396   "cannot form a pointer-to-member to member %0 of reference type %1">;
6397 def err_incomplete_object_call : Error<
6398   "incomplete type in call to object of type %0">;
6399
6400 def warn_condition_is_assignment : Warning<"using the result of an "
6401   "assignment as a condition without parentheses">,
6402   InGroup<Parentheses>;
6403 // Completely identical except off by default.
6404 def warn_condition_is_idiomatic_assignment : Warning<"using the result "
6405   "of an assignment as a condition without parentheses">,
6406   InGroup<DiagGroup<"idiomatic-parentheses">>, DefaultIgnore;
6407 def note_condition_assign_to_comparison : Note<
6408   "use '==' to turn this assignment into an equality comparison">;
6409 def note_condition_or_assign_to_comparison : Note<
6410   "use '!=' to turn this compound assignment into an inequality comparison">;
6411 def note_condition_assign_silence : Note<
6412   "place parentheses around the assignment to silence this warning">;
6413
6414 def warn_equality_with_extra_parens : Warning<"equality comparison with "
6415   "extraneous parentheses">, InGroup<ParenthesesOnEquality>;
6416 def note_equality_comparison_to_assign : Note<
6417   "use '=' to turn this equality comparison into an assignment">;
6418 def note_equality_comparison_silence : Note<
6419   "remove extraneous parentheses around the comparison to silence this warning">;
6420
6421 // assignment related diagnostics (also for argument passing, returning, etc).
6422 // In most of these diagnostics the %2 is a value from the
6423 // Sema::AssignmentAction enumeration
6424 def err_typecheck_convert_incompatible : Error<
6425   "%select{%diff{assigning to $ from incompatible type $|"
6426   "assigning to type from incompatible type}0,1"
6427   "|%diff{passing $ to parameter of incompatible type $|"
6428   "passing type to parameter of incompatible type}0,1"
6429   "|%diff{returning $ from a function with incompatible result type $|"
6430   "returning type from a function with incompatible result type}0,1"
6431   "|%diff{converting $ to incompatible type $|"
6432   "converting type to incompatible type}0,1"
6433   "|%diff{initializing $ with an expression of incompatible type $|"
6434   "initializing type with an expression of incompatible type}0,1"
6435   "|%diff{sending $ to parameter of incompatible type $|"
6436   "sending type to parameter of incompatible type}0,1"
6437   "|%diff{casting $ to incompatible type $|"
6438   "casting type to incompatible type}0,1}2"
6439   "%select{|; dereference with *|"
6440   "; take the address with &|"
6441   "; remove *|"
6442   "; remove &}3"
6443   "%select{|: different classes%diff{ ($ vs $)|}5,6"
6444   "|: different number of parameters (%5 vs %6)"
6445   "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7"
6446   "|: different return type%diff{ ($ vs $)|}5,6"
6447   "|: different qualifiers ("
6448   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
6449   "volatile and restrict|const, volatile, and restrict}5 vs "
6450   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
6451   "volatile and restrict|const, volatile, and restrict}6)"
6452   "|: different exception specifications}4">;
6453 def err_typecheck_missing_return_type_incompatible : Error<
6454   "%diff{return type $ must match previous return type $|"
6455   "return type must match previous return type}0,1 when %select{block "
6456   "literal|lambda expression}2 has unspecified explicit return type">;
6457
6458 def note_incomplete_class_and_qualified_id : Note<
6459   "conformance of forward class %0 to protocol %1 can not be confirmed">;
6460 def warn_incompatible_qualified_id : Warning<
6461   "%select{%diff{assigning to $ from incompatible type $|"
6462   "assigning to type from incompatible type}0,1"
6463   "|%diff{passing $ to parameter of incompatible type $|"
6464   "passing type to parameter of incompatible type}0,1"
6465   "|%diff{returning $ from a function with incompatible result type $|"
6466   "returning type from a function with incompatible result type}0,1"
6467   "|%diff{converting $ to incompatible type $|"
6468   "converting type to incompatible type}0,1"
6469   "|%diff{initializing $ with an expression of incompatible type $|"
6470   "initializing type with an expression of incompatible type}0,1"
6471   "|%diff{sending $ to parameter of incompatible type $|"
6472   "sending type to parameter of incompatible type}0,1"
6473   "|%diff{casting $ to incompatible type $|"
6474   "casting type to incompatible type}0,1}2">;
6475 def ext_typecheck_convert_pointer_int : ExtWarn<
6476   "incompatible pointer to integer conversion "
6477   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6478   "|%diff{passing $ to parameter of type $|"
6479   "passing to parameter of different type}0,1"
6480   "|%diff{returning $ from a function with result type $|"
6481   "returning from function with different return type}0,1"
6482   "|%diff{converting $ to type $|converting between types}0,1"
6483   "|%diff{initializing $ with an expression of type $|"
6484   "initializing with expression of different type}0,1"
6485   "|%diff{sending $ to parameter of type $|"
6486   "sending to parameter of different type}0,1"
6487   "|%diff{casting $ to type $|casting between types}0,1}2"
6488   "%select{|; dereference with *|"
6489   "; take the address with &|"
6490   "; remove *|"
6491   "; remove &}3">,
6492   InGroup<IntConversion>;
6493 def ext_typecheck_convert_int_pointer : ExtWarn<
6494   "incompatible integer to pointer conversion "
6495   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6496   "|%diff{passing $ to parameter of type $|"
6497   "passing to parameter of different type}0,1"
6498   "|%diff{returning $ from a function with result type $|"
6499   "returning from function with different return type}0,1"
6500   "|%diff{converting $ to type $|converting between types}0,1"
6501   "|%diff{initializing $ with an expression of type $|"
6502   "initializing with expression of different type}0,1"
6503   "|%diff{sending $ to parameter of type $|"
6504   "sending to parameter of different type}0,1"
6505   "|%diff{casting $ to type $|casting between types}0,1}2"
6506   "%select{|; dereference with *|"
6507   "; take the address with &|"
6508   "; remove *|"
6509   "; remove &}3">,
6510   InGroup<IntConversion>;
6511 def ext_typecheck_convert_pointer_void_func : Extension<
6512   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6513   "|%diff{passing $ to parameter of type $|"
6514   "passing to parameter of different type}0,1"
6515   "|%diff{returning $ from a function with result type $|"
6516   "returning from function with different return type}0,1"
6517   "|%diff{converting $ to type $|converting between types}0,1"
6518   "|%diff{initializing $ with an expression of type $|"
6519   "initializing with expression of different type}0,1"
6520   "|%diff{sending $ to parameter of type $|"
6521   "sending to parameter of different type}0,1"
6522   "|%diff{casting $ to type $|casting between types}0,1}2"
6523   " converts between void pointer and function pointer">;
6524 def ext_typecheck_convert_incompatible_pointer_sign : ExtWarn<
6525   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6526   "|%diff{passing $ to parameter of type $|"
6527   "passing to parameter of different type}0,1"
6528   "|%diff{returning $ from a function with result type $|"
6529   "returning from function with different return type}0,1"
6530   "|%diff{converting $ to type $|converting between types}0,1"
6531   "|%diff{initializing $ with an expression of type $|"
6532   "initializing with expression of different type}0,1"
6533   "|%diff{sending $ to parameter of type $|"
6534   "sending to parameter of different type}0,1"
6535   "|%diff{casting $ to type $|casting between types}0,1}2"
6536   " converts between pointers to integer types with different sign">,
6537   InGroup<DiagGroup<"pointer-sign">>;
6538 def ext_typecheck_convert_incompatible_pointer : ExtWarn<
6539   "incompatible pointer types "
6540   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6541   "|%diff{passing $ to parameter of type $|"
6542   "passing to parameter of different type}0,1"
6543   "|%diff{returning $ from a function with result type $|"
6544   "returning from function with different return type}0,1"
6545   "|%diff{converting $ to type $|converting between types}0,1"
6546   "|%diff{initializing $ with an expression of type $|"
6547   "initializing with expression of different type}0,1"
6548   "|%diff{sending $ to parameter of type $|"
6549   "sending to parameter of different type}0,1"
6550   "|%diff{casting $ to type $|casting between types}0,1}2"
6551   "%select{|; dereference with *|"
6552   "; take the address with &|"
6553   "; remove *|"
6554   "; remove &}3">,
6555   InGroup<IncompatiblePointerTypes>;
6556 def ext_typecheck_convert_incompatible_function_pointer : ExtWarn<
6557   "incompatible function pointer types "
6558   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6559   "|%diff{passing $ to parameter of type $|"
6560   "passing to parameter of different type}0,1"
6561   "|%diff{returning $ from a function with result type $|"
6562   "returning from function with different return type}0,1"
6563   "|%diff{converting $ to type $|converting between types}0,1"
6564   "|%diff{initializing $ with an expression of type $|"
6565   "initializing with expression of different type}0,1"
6566   "|%diff{sending $ to parameter of type $|"
6567   "sending to parameter of different type}0,1"
6568   "|%diff{casting $ to type $|casting between types}0,1}2"
6569   "%select{|; dereference with *|"
6570   "; take the address with &|"
6571   "; remove *|"
6572   "; remove &}3">,
6573   InGroup<IncompatibleFunctionPointerTypes>;
6574 def ext_typecheck_convert_discards_qualifiers : ExtWarn<
6575   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6576   "|%diff{passing $ to parameter of type $|"
6577   "passing to parameter of different type}0,1"
6578   "|%diff{returning $ from a function with result type $|"
6579   "returning from function with different return type}0,1"
6580   "|%diff{converting $ to type $|converting between types}0,1"
6581   "|%diff{initializing $ with an expression of type $|"
6582   "initializing with expression of different type}0,1"
6583   "|%diff{sending $ to parameter of type $|"
6584   "sending to parameter of different type}0,1"
6585   "|%diff{casting $ to type $|casting between types}0,1}2"
6586   " discards qualifiers">,
6587   InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
6588 def ext_nested_pointer_qualifier_mismatch : ExtWarn<
6589   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6590   "|%diff{passing $ to parameter of type $|"
6591   "passing to parameter of different type}0,1"
6592   "|%diff{returning $ from a function with result type $|"
6593   "returning from function with different return type}0,1"
6594   "|%diff{converting $ to type $|converting between types}0,1"
6595   "|%diff{initializing $ with an expression of type $|"
6596   "initializing with expression of different type}0,1"
6597   "|%diff{sending $ to parameter of type $|"
6598   "sending to parameter of different type}0,1"
6599   "|%diff{casting $ to type $|casting between types}0,1}2"
6600   " discards qualifiers in nested pointer types">,
6601   InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
6602 def warn_incompatible_vectors : Warning<
6603   "incompatible vector types "
6604   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6605   "|%diff{passing $ to parameter of type $|"
6606   "passing to parameter of different type}0,1"
6607   "|%diff{returning $ from a function with result type $|"
6608   "returning from function with different return type}0,1"
6609   "|%diff{converting $ to type $|converting between types}0,1"
6610   "|%diff{initializing $ with an expression of type $|"
6611   "initializing with expression of different type}0,1"
6612   "|%diff{sending $ to parameter of type $|"
6613   "sending to parameter of different type}0,1"
6614   "|%diff{casting $ to type $|casting between types}0,1}2">,
6615   InGroup<VectorConversion>, DefaultIgnore;
6616 def err_int_to_block_pointer : Error<
6617   "invalid block pointer conversion "
6618   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6619   "|%diff{passing $ to parameter of type $|"
6620   "passing to parameter of different type}0,1"
6621   "|%diff{returning $ from a function with result type $|"
6622   "returning from function with different return type}0,1"
6623   "|%diff{converting $ to type $|converting between types}0,1"
6624   "|%diff{initializing $ with an expression of type $|"
6625   "initializing with expression of different type}0,1"
6626   "|%diff{sending $ to parameter of type $|"
6627   "sending to parameter of different type}0,1"
6628   "|%diff{casting $ to type $|casting between types}0,1}2">;
6629 def err_typecheck_convert_incompatible_block_pointer : Error<
6630   "incompatible block pointer types "
6631   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6632   "|%diff{passing $ to parameter of type $|"
6633   "passing to parameter of different type}0,1"
6634   "|%diff{returning $ from a function with result type $|"
6635   "returning from function with different return type}0,1"
6636   "|%diff{converting $ to type $|converting between types}0,1"
6637   "|%diff{initializing $ with an expression of type $|"
6638   "initializing with expression of different type}0,1"
6639   "|%diff{sending $ to parameter of type $|"
6640   "sending to parameter of different type}0,1"
6641   "|%diff{casting $ to type $|casting between types}0,1}2">;
6642 def err_typecheck_incompatible_address_space : Error<
6643   "%select{%diff{assigning $ to $|assigning to different types}1,0"
6644   "|%diff{passing $ to parameter of type $|"
6645   "passing to parameter of different type}0,1"
6646   "|%diff{returning $ from a function with result type $|"
6647   "returning from function with different return type}0,1"
6648   "|%diff{converting $ to type $|converting between types}0,1"
6649   "|%diff{initializing $ with an expression of type $|"
6650   "initializing with expression of different type}0,1"
6651   "|%diff{sending $ to parameter of type $|"
6652   "sending to parameter of different type}0,1"
6653   "|%diff{casting $ to type $|casting between types}0,1}2"
6654   " changes address space of pointer">;
6655 def err_typecheck_incompatible_ownership : Error<
6656   "%select{%diff{assigning $ to $|assigning to different types}1,0"
6657   "|%diff{passing $ to parameter of type $|"
6658   "passing to parameter of different type}0,1"
6659   "|%diff{returning $ from a function with result type $|"
6660   "returning from function with different return type}0,1"
6661   "|%diff{converting $ to type $|converting between types}0,1"
6662   "|%diff{initializing $ with an expression of type $|"
6663   "initializing with expression of different type}0,1"
6664   "|%diff{sending $ to parameter of type $|"
6665   "sending to parameter of different type}0,1"
6666   "|%diff{casting $ to type $|casting between types}0,1}2"
6667   " changes retain/release properties of pointer">;
6668 def err_typecheck_comparison_of_distinct_blocks : Error<
6669   "comparison of distinct block types%diff{ ($ and $)|}0,1">;
6670
6671 def err_typecheck_array_not_modifiable_lvalue : Error<
6672   "array type %0 is not assignable">;
6673 def err_typecheck_non_object_not_modifiable_lvalue : Error<
6674   "non-object type %0 is not assignable">;
6675 def err_typecheck_expression_not_modifiable_lvalue : Error<
6676   "expression is not assignable">;
6677 def err_typecheck_incomplete_type_not_modifiable_lvalue : Error<
6678   "incomplete type %0 is not assignable">;
6679 def err_typecheck_lvalue_casts_not_supported : Error<
6680   "assignment to cast is illegal, lvalue casts are not supported">;
6681
6682 def err_typecheck_duplicate_vector_components_not_mlvalue : Error<
6683   "vector is not assignable (contains duplicate components)">;
6684 def err_block_decl_ref_not_modifiable_lvalue : Error<
6685   "variable is not assignable (missing __block type specifier)">;
6686 def err_lambda_decl_ref_not_modifiable_lvalue : Error<
6687   "cannot assign to a variable captured by copy in a non-mutable lambda">;
6688 def err_typecheck_call_not_function : Error<
6689   "called object type %0 is not a function or function pointer">;
6690 def err_call_incomplete_return : Error<
6691   "calling function with incomplete return type %0">;
6692 def err_call_function_incomplete_return : Error<
6693   "calling %0 with incomplete return type %1">;
6694 def err_call_incomplete_argument : Error<
6695   "argument type %0 is incomplete">;
6696 def err_typecheck_call_too_few_args : Error<
6697   "too few %select{|||execution configuration }0arguments to "
6698   "%select{function|block|method|kernel function}0 call, "
6699   "expected %1, have %2">;
6700 def err_typecheck_call_too_few_args_one : Error<
6701   "too few %select{|||execution configuration }0arguments to "
6702   "%select{function|block|method|kernel function}0 call, "
6703   "single argument %1 was not specified">;
6704 def err_typecheck_call_too_few_args_at_least : Error<
6705   "too few %select{|||execution configuration }0arguments to "
6706   "%select{function|block|method|kernel function}0 call, "
6707   "expected at least %1, have %2">;
6708 def err_typecheck_call_too_few_args_at_least_one : Error<
6709   "too few %select{|||execution configuration }0arguments to "
6710   "%select{function|block|method|kernel function}0 call, "
6711   "at least argument %1 must be specified">;
6712 def err_typecheck_call_too_few_args_suggest : Error<
6713   "too few %select{|||execution configuration }0arguments to "
6714   "%select{function|block|method|kernel function}0 call, "
6715   "expected %1, have %2; did you mean %3?">;
6716 def err_typecheck_call_too_few_args_at_least_suggest : Error<
6717   "too few %select{|||execution configuration }0arguments to "
6718   "%select{function|block|method|kernel function}0 call, "
6719   "expected at least %1, have %2; did you mean %3?">;
6720 def err_typecheck_call_too_many_args : Error<
6721   "too many %select{|||execution configuration }0arguments to "
6722   "%select{function|block|method|kernel function}0 call, "
6723   "expected %1, have %2">;
6724 def err_typecheck_call_too_many_args_one : Error<
6725   "too many %select{|||execution configuration }0arguments to "
6726   "%select{function|block|method|kernel function}0 call, "
6727   "expected single argument %1, have %2 arguments">;
6728 def err_typecheck_call_too_many_args_at_most : Error<
6729   "too many %select{|||execution configuration }0arguments to "
6730   "%select{function|block|method|kernel function}0 call, "
6731   "expected at most %1, have %2">;
6732 def err_typecheck_call_too_many_args_at_most_one : Error<
6733   "too many %select{|||execution configuration }0arguments to "
6734   "%select{function|block|method|kernel function}0 call, "
6735   "expected at most single argument %1, have %2 arguments">;
6736 def err_typecheck_call_too_many_args_suggest : Error<
6737   "too many %select{|||execution configuration }0arguments to "
6738   "%select{function|block|method|kernel function}0 call, "
6739   "expected %1, have %2; did you mean %3?">;
6740 def err_typecheck_call_too_many_args_at_most_suggest : Error<
6741   "too many %select{|||execution configuration }0arguments to "
6742   "%select{function|block|method|kernel function}0 call, "
6743   "expected at most %1, have %2; did you mean %3?">;
6744   
6745 def err_arc_typecheck_convert_incompatible_pointer : Error<
6746   "incompatible pointer types passing retainable parameter of type %0"
6747   "to a CF function expecting %1 type">;
6748   
6749 def err_builtin_fn_use : Error<"builtin functions must be directly called">;
6750
6751 def warn_call_wrong_number_of_arguments : Warning<
6752   "too %select{few|many}0 arguments in call to %1">;
6753 def err_atomic_builtin_must_be_pointer : Error<
6754   "address argument to atomic builtin must be a pointer (%0 invalid)">;
6755 def err_atomic_builtin_must_be_pointer_intptr : Error<
6756   "address argument to atomic builtin must be a pointer to integer or pointer"
6757   " (%0 invalid)">;
6758 def err_atomic_builtin_must_be_pointer_intfltptr : Error<
6759   "address argument to atomic builtin must be a pointer to integer,"
6760   " floating-point or pointer (%0 invalid)">;
6761 def err_atomic_builtin_pointer_size : Error<
6762   "address argument to atomic builtin must be a pointer to 1,2,4,8 or 16 byte "
6763   "type (%0 invalid)">;
6764 def err_atomic_exclusive_builtin_pointer_size : Error<
6765   "address argument to load or store exclusive builtin must be a pointer to"
6766   " 1,2,4 or 8 byte type (%0 invalid)">;
6767 def err_atomic_op_needs_atomic : Error<
6768   "address argument to atomic operation must be a pointer to _Atomic "
6769   "type (%0 invalid)">;
6770 def err_atomic_op_needs_non_const_atomic : Error<
6771   "address argument to atomic operation must be a pointer to non-const _Atomic "
6772   "type (%0 invalid)">;
6773 def err_atomic_op_needs_non_const_pointer : Error<
6774   "address argument to atomic operation must be a pointer to non-const "
6775   "type (%0 invalid)">;
6776 def err_atomic_op_needs_trivial_copy : Error<
6777   "address argument to atomic operation must be a pointer to a "
6778   "trivially-copyable type (%0 invalid)">;
6779 def err_atomic_op_needs_atomic_int_or_ptr : Error<
6780   "address argument to atomic operation must be a pointer to %select{|atomic }0"
6781   "integer or pointer (%1 invalid)">;
6782 def err_atomic_op_bitwise_needs_atomic_int : Error<
6783   "address argument to bitwise atomic operation must be a pointer to "
6784   "%select{|atomic }0integer (%1 invalid)">;
6785 def warn_atomic_op_has_invalid_memory_order : Warning<
6786   "memory order argument to atomic operation is invalid">,
6787   InGroup<DiagGroup<"atomic-memory-ordering">>;
6788
6789 def err_overflow_builtin_must_be_int : Error<
6790   "operand argument to overflow builtin must be an integer (%0 invalid)">;
6791 def err_overflow_builtin_must_be_ptr_int : Error<
6792   "result argument to overflow builtin must be a pointer "
6793   "to a non-const integer (%0 invalid)">;
6794
6795 def err_atomic_load_store_uses_lib : Error<
6796   "atomic %select{load|store}0 requires runtime support that is not "
6797   "available for this target">;
6798
6799 def err_nontemporal_builtin_must_be_pointer : Error<
6800   "address argument to nontemporal builtin must be a pointer (%0 invalid)">;
6801 def err_nontemporal_builtin_must_be_pointer_intfltptr_or_vector : Error<
6802   "address argument to nontemporal builtin must be a pointer to integer, float, "
6803   "pointer, or a vector of such types (%0 invalid)">;
6804
6805 def err_deleted_function_use : Error<"attempt to use a deleted function">;
6806 def err_deleted_inherited_ctor_use : Error<
6807   "constructor inherited by %0 from base class %1 is implicitly deleted">;
6808
6809 def note_called_by : Note<"called by %0">;
6810 def err_kern_type_not_void_return : Error<
6811   "kernel function type %0 must have void return type">;
6812 def err_kern_is_nonstatic_method : Error<
6813   "kernel function %0 must be a free function or static member function">;
6814 def err_config_scalar_return : Error<
6815   "CUDA special function 'cudaConfigureCall' must have scalar return type">;
6816 def err_kern_call_not_global_function : Error<
6817   "kernel call to non-global function %0">;
6818 def err_global_call_not_config : Error<
6819   "call to global function %0 not configured">;
6820 def err_ref_bad_target : Error<
6821   "reference to %select{__device__|__global__|__host__|__host__ __device__}0 "
6822   "function %1 in %select{__device__|__global__|__host__|__host__ __device__}2 function">;
6823 def err_ref_bad_target_global_initializer : Error<
6824   "reference to %select{__device__|__global__|__host__|__host__ __device__}0 "
6825   "function %1 in global initializer">;
6826 def warn_kern_is_method : Extension<
6827   "kernel function %0 is a member function; this may not be accepted by nvcc">,
6828   InGroup<CudaCompat>;
6829 def warn_kern_is_inline : Warning<
6830   "ignored 'inline' attribute on kernel function %0">,
6831   InGroup<CudaCompat>;
6832 def err_variadic_device_fn : Error<
6833   "CUDA device code does not support variadic functions">;
6834 def err_va_arg_in_device : Error<
6835   "CUDA device code does not support va_arg">;
6836 def err_alias_not_supported_on_nvptx : Error<"CUDA does not support aliases">;
6837 def err_cuda_unattributed_constexpr_cannot_overload_device : Error<
6838   "constexpr function '%0' without __host__ or __device__ attributes cannot "
6839   "overload __device__ function with same signature.  Add a __host__ "
6840   "attribute, or build with -fno-cuda-host-device-constexpr.">;
6841 def note_cuda_conflicting_device_function_declared_here : Note<
6842   "conflicting __device__ function declared here">;
6843 def err_cuda_device_exceptions : Error<
6844   "cannot use '%0' in "
6845   "%select{__device__|__global__|__host__|__host__ __device__}1 function">;
6846 def err_dynamic_var_init : Error<
6847     "dynamic initialization is not supported for "
6848     "__device__, __constant__, and __shared__ variables.">;
6849 def err_shared_var_init : Error<
6850     "initialization is not supported for __shared__ variables.">;
6851 def err_device_static_local_var : Error<
6852     "within a %select{__device__|__global__|__host__|__host__ __device__}0 "
6853     "function, only __shared__ variables may be marked 'static'">;
6854 def err_cuda_vla : Error<
6855     "cannot use variable-length arrays in "
6856     "%select{__device__|__global__|__host__|__host__ __device__}0 functions">;
6857 def err_cuda_extern_shared : Error<"__shared__ variable %0 cannot be 'extern'">;
6858 def err_cuda_host_shared : Error<
6859     "__shared__ local variables not allowed in "
6860     "%select{__device__|__global__|__host__|__host__ __device__}0 functions">;
6861 def err_cuda_nonglobal_constant : Error<"__constant__ variables must be global">;
6862 def err_cuda_ovl_target : Error<
6863   "%select{__device__|__global__|__host__|__host__ __device__}0 function %1 "
6864   "cannot overload %select{__device__|__global__|__host__|__host__ __device__}2 function %3">;
6865 def note_cuda_ovl_candidate_target_mismatch : Note<
6866     "candidate template ignored: target attributes do not match">;
6867
6868 def warn_non_pod_vararg_with_format_string : Warning<
6869   "cannot pass %select{non-POD|non-trivial}0 object of type %1 to variadic "
6870   "%select{function|block|method|constructor}2; expected type from format "
6871   "string was %3">, InGroup<NonPODVarargs>, DefaultError;
6872 // The arguments to this diagnostic should match the warning above.
6873 def err_cannot_pass_objc_interface_to_vararg_format : Error<
6874   "cannot pass object with interface type %1 by value to variadic "
6875   "%select{function|block|method|constructor}2; expected type from format "
6876   "string was %3">;
6877
6878 def err_cannot_pass_objc_interface_to_vararg : Error<
6879   "cannot pass object with interface type %0 by value through variadic "
6880   "%select{function|block|method|constructor}1">;
6881 def warn_cannot_pass_non_pod_arg_to_vararg : Warning<
6882   "cannot pass object of %select{non-POD|non-trivial}0 type %1 through variadic"
6883   " %select{function|block|method|constructor}2; call will abort at runtime">,
6884   InGroup<NonPODVarargs>, DefaultError;
6885 def warn_cxx98_compat_pass_non_pod_arg_to_vararg : Warning<
6886   "passing object of trivial but non-POD type %0 through variadic"
6887   " %select{function|block|method|constructor}1 is incompatible with C++98">,
6888   InGroup<CXX98Compat>, DefaultIgnore;
6889 def warn_pass_class_arg_to_vararg : Warning<
6890   "passing object of class type %0 through variadic "
6891   "%select{function|block|method|constructor}1"
6892   "%select{|; did you mean to call '%3'?}2">,
6893   InGroup<ClassVarargs>, DefaultIgnore;
6894 def err_cannot_pass_to_vararg : Error<
6895   "cannot pass %select{expression of type %1|initializer list}0 to variadic "
6896   "%select{function|block|method|constructor}2">;
6897 def err_cannot_pass_to_vararg_format : Error<
6898   "cannot pass %select{expression of type %1|initializer list}0 to variadic "
6899   "%select{function|block|method|constructor}2; expected type from format "
6900   "string was %3">;
6901
6902 def err_typecheck_call_invalid_ordered_compare : Error<
6903   "ordered compare requires two args of floating point type"
6904   "%diff{ ($ and $)|}0,1">;
6905 def err_typecheck_call_invalid_unary_fp : Error<
6906   "floating point classification requires argument of floating point type "
6907   "(passed in %0)">;
6908 def err_typecheck_cond_expect_int_float : Error<
6909   "used type %0 where integer or floating point type is required">;
6910 def err_typecheck_cond_expect_scalar : Error<
6911   "used type %0 where arithmetic or pointer type is required">;
6912 def err_typecheck_cond_expect_nonfloat : Error<
6913   "used type %0 where floating point type is not allowed">;
6914 def ext_typecheck_cond_one_void : Extension<
6915   "C99 forbids conditional expressions with only one void side">;
6916 def err_typecheck_cast_to_incomplete : Error<
6917   "cast to incomplete type %0">;
6918 def ext_typecheck_cast_nonscalar : Extension<
6919   "C99 forbids casting nonscalar type %0 to the same type">;
6920 def ext_typecheck_cast_to_union : Extension<
6921   "cast to union type is a GNU extension">,
6922   InGroup<GNUUnionCast>;
6923 def err_typecheck_cast_to_union_no_type : Error<
6924   "cast to union type from type %0 not present in union">;
6925 def err_cast_pointer_from_non_pointer_int : Error<
6926   "operand of type %0 cannot be cast to a pointer type">;
6927 def warn_cast_pointer_from_sel : Warning<
6928   "cast of type %0 to %1 is deprecated; use sel_getName instead">,
6929   InGroup<SelTypeCast>;
6930 def warn_function_def_in_objc_container : Warning<
6931   "function definition inside an Objective-C container is deprecated">,
6932   InGroup<FunctionDefInObjCContainer>;
6933
6934 def warn_cast_calling_conv : Warning<
6935   "cast between incompatible calling conventions '%0' and '%1'; "
6936   "calls through this pointer may abort at runtime">,
6937   InGroup<DiagGroup<"cast-calling-convention">>;
6938 def note_change_calling_conv_fixit : Note<
6939   "consider defining %0 with the '%1' calling convention">;
6940 def warn_bad_function_cast : Warning<
6941   "cast from function call of type %0 to non-matching type %1">,
6942   InGroup<BadFunctionCast>, DefaultIgnore;
6943 def err_cast_pointer_to_non_pointer_int : Error<
6944   "pointer cannot be cast to type %0">;
6945 def err_typecheck_expect_scalar_operand : Error<
6946   "operand of type %0 where arithmetic or pointer type is required">;
6947 def err_typecheck_cond_incompatible_operands : Error<
6948   "incompatible operand types%diff{ ($ and $)|}0,1">;
6949 def err_cast_selector_expr : Error<
6950   "cannot type cast @selector expression">;
6951 def ext_typecheck_cond_incompatible_pointers : ExtWarn<
6952   "pointer type mismatch%diff{ ($ and $)|}0,1">,
6953   InGroup<DiagGroup<"pointer-type-mismatch">>;
6954 def ext_typecheck_cond_pointer_integer_mismatch : ExtWarn<
6955   "pointer/integer type mismatch in conditional expression"
6956   "%diff{ ($ and $)|}0,1">,
6957   InGroup<DiagGroup<"conditional-type-mismatch">>;
6958 def err_typecheck_choose_expr_requires_constant : Error<
6959   "'__builtin_choose_expr' requires a constant expression">;
6960 def warn_unused_expr : Warning<"expression result unused">,
6961   InGroup<UnusedValue>;
6962 def warn_unused_voidptr : Warning<
6963   "expression result unused; should this cast be to 'void'?">,
6964   InGroup<UnusedValue>;
6965 def warn_unused_property_expr : Warning<
6966  "property access result unused - getters should not be used for side effects">,
6967   InGroup<UnusedGetterReturnValue>;
6968 def warn_unused_container_subscript_expr : Warning<
6969  "container access result unused - container access should not be used for side effects">,
6970   InGroup<UnusedValue>;
6971 def warn_unused_call : Warning<
6972   "ignoring return value of function declared with %0 attribute">,
6973   InGroup<UnusedValue>;
6974 def warn_side_effects_unevaluated_context : Warning<
6975   "expression with side effects has no effect in an unevaluated context">,
6976   InGroup<UnevaluatedExpression>;
6977 def warn_side_effects_typeid : Warning<
6978   "expression with side effects will be evaluated despite being used as an "
6979   "operand to 'typeid'">, InGroup<PotentiallyEvaluatedExpression>;
6980 def warn_unused_result : Warning<
6981   "ignoring return value of function declared with %0 attribute">,
6982   InGroup<UnusedResult>;
6983 def warn_unused_volatile : Warning<
6984   "expression result unused; assign into a variable to force a volatile load">,
6985   InGroup<DiagGroup<"unused-volatile-lvalue">>;
6986
6987 def ext_cxx14_attr : Extension<
6988   "use of the %0 attribute is a C++14 extension">, InGroup<CXX14>;
6989 def ext_cxx1z_attr : Extension<
6990   "use of the %0 attribute is a C++1z extension">, InGroup<CXX1z>;
6991
6992 def warn_unused_comparison : Warning<
6993   "%select{%select{|in}1equality|relational}0 comparison result unused">,
6994   InGroup<UnusedComparison>;
6995 def note_inequality_comparison_to_or_assign : Note<
6996   "use '|=' to turn this inequality comparison into an or-assignment">;
6997
6998 def err_incomplete_type_used_in_type_trait_expr : Error<
6999   "incomplete type %0 used in type trait expression">;
7000
7001 def err_require_constant_init_failed : Error<
7002   "variable does not have a constant initializer">;
7003 def note_declared_required_constant_init_here : Note<
7004   "required by 'require_constant_initializer' attribute here">;
7005
7006 def err_dimension_expr_not_constant_integer : Error<
7007   "dimension expression does not evaluate to a constant unsigned int">;
7008
7009 def err_typecheck_cond_incompatible_operands_null : Error<
7010   "non-pointer operand type %0 incompatible with %select{NULL|nullptr}1">;
7011 def ext_empty_struct_union : Extension<
7012   "empty %select{struct|union}0 is a GNU extension">, InGroup<GNUEmptyStruct>;
7013 def ext_no_named_members_in_struct_union : Extension<
7014   "%select{struct|union}0 without named members is a GNU extension">, InGroup<GNUEmptyStruct>;
7015 def warn_zero_size_struct_union_compat : Warning<"%select{|empty }0"
7016   "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">,
7017   InGroup<CXXCompat>, DefaultIgnore;
7018 def warn_zero_size_struct_union_in_extern_c : Warning<"%select{|empty }0"
7019   "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">,
7020   InGroup<ExternCCompat>;
7021 def warn_cast_qual : Warning<"cast from %0 to %1 drops %select{const and "
7022   "volatile qualifiers|const qualifier|volatile qualifier}2">,
7023   InGroup<CastQual>, DefaultIgnore;
7024 def warn_cast_qual2 : Warning<"cast from %0 to %1 must have all intermediate "
7025   "pointers const qualified to be safe">, InGroup<CastQual>, DefaultIgnore;
7026 def warn_redefine_extname_not_applied : Warning<
7027   "#pragma redefine_extname is applicable to external C declarations only; "
7028   "not applied to %select{function|variable}0 %1">,
7029   InGroup<Pragmas>;
7030 } // End of general sema category.
7031
7032 // inline asm.
7033 let CategoryName = "Inline Assembly Issue" in {
7034   def err_asm_invalid_lvalue_in_output : Error<"invalid lvalue in asm output">;
7035   def err_asm_invalid_output_constraint : Error<
7036     "invalid output constraint '%0' in asm">;
7037   def err_asm_invalid_lvalue_in_input : Error<
7038     "invalid lvalue in asm input for constraint '%0'">;
7039   def err_asm_invalid_input_constraint : Error<
7040     "invalid input constraint '%0' in asm">;
7041   def err_asm_immediate_expected : Error<"constraint '%0' expects "
7042     "an integer constant expression">;
7043   def err_asm_invalid_type_in_input : Error<
7044     "invalid type %0 in asm input for constraint '%1'">;
7045   def err_asm_tying_incompatible_types : Error<
7046     "unsupported inline asm: input with type "
7047     "%diff{$ matching output with type $|}0,1">;
7048   def err_asm_unexpected_constraint_alternatives : Error<
7049     "asm constraint has an unexpected number of alternatives: %0 vs %1">;
7050   def err_asm_incomplete_type : Error<"asm operand has incomplete type %0">;
7051   def err_asm_unknown_register_name : Error<"unknown register name '%0' in asm">;
7052   def err_asm_invalid_global_var_reg : Error<"register '%0' unsuitable for "
7053     "global register variables on this target">;
7054   def err_asm_register_size_mismatch : Error<"size of register '%0' does not "
7055     "match variable size">;
7056   def err_asm_bad_register_type : Error<"bad type for named register variable">;
7057   def err_asm_invalid_input_size : Error<
7058     "invalid input size for constraint '%0'">;
7059   def err_asm_invalid_output_size : Error<
7060     "invalid output size for constraint '%0'">;
7061   def err_invalid_asm_cast_lvalue : Error<
7062     "invalid use of a cast in a inline asm context requiring an l-value: "
7063     "remove the cast or build with -fheinous-gnu-extensions">;
7064   def err_invalid_asm_value_for_constraint
7065       : Error <"value '%0' out of range for constraint '%1'">;
7066   def err_asm_non_addr_value_in_memory_constraint : Error <
7067     "reference to a %select{bit-field|vector element|global register variable}0"
7068     " in asm %select{input|output}1 with a memory constraint '%2'">;
7069   def err_asm_input_duplicate_match : Error<
7070     "more than one input constraint matches the same output '%0'">;
7071
7072   def warn_asm_label_on_auto_decl : Warning<
7073     "ignored asm label '%0' on automatic variable">;
7074   def warn_invalid_asm_cast_lvalue : Warning<
7075     "invalid use of a cast in an inline asm context requiring an l-value: "
7076     "accepted due to -fheinous-gnu-extensions, but clang may remove support "
7077     "for this in the future">;
7078   def warn_asm_mismatched_size_modifier : Warning<
7079     "value size does not match register size specified by the constraint "
7080     "and modifier">,
7081     InGroup<ASMOperandWidths>;
7082
7083   def note_asm_missing_constraint_modifier : Note<
7084     "use constraint modifier \"%0\"">;
7085   def note_asm_input_duplicate_first : Note<
7086     "constraint '%0' is already present here">;
7087 }
7088
7089   def error_inoutput_conflict_with_clobber : Error<
7090     "asm-specifier for input or output variable conflicts with asm"
7091     " clobber list">;
7092
7093 let CategoryName = "Semantic Issue" in {
7094
7095 def err_invalid_conversion_between_vectors : Error<
7096   "invalid conversion between vector type%diff{ $ and $|}0,1 of different "
7097   "size">;
7098 def err_invalid_conversion_between_vector_and_integer : Error<
7099   "invalid conversion between vector type %0 and integer type %1 "
7100   "of different size">;
7101
7102 def err_opencl_function_pointer_variable : Error<
7103   "pointers to functions are not allowed">;
7104
7105 def err_opencl_taking_function_address : Error<
7106   "taking address of function is not allowed">;
7107
7108 def err_invalid_conversion_between_vector_and_scalar : Error<
7109   "invalid conversion between vector type %0 and scalar type %1">;
7110
7111 // C++ member initializers.
7112 def err_only_constructors_take_base_inits : Error<
7113   "only constructors take base initializers">;
7114
7115 def err_multiple_mem_initialization : Error <
7116   "multiple initializations given for non-static member %0">;
7117 def err_multiple_mem_union_initialization : Error <
7118   "initializing multiple members of union">;
7119 def err_multiple_base_initialization : Error <
7120   "multiple initializations given for base %0">;
7121
7122 def err_mem_init_not_member_or_class : Error<
7123   "member initializer %0 does not name a non-static data member or base "
7124   "class">;
7125
7126 def warn_initializer_out_of_order : Warning<
7127   "%select{field|base class}0 %1 will be initialized after "
7128   "%select{field|base}2 %3">,
7129   InGroup<Reorder>, DefaultIgnore;
7130 def warn_abstract_vbase_init_ignored : Warning<
7131   "initializer for virtual base class %0 of abstract class %1 "
7132   "will never be used">,
7133   InGroup<DiagGroup<"abstract-vbase-init">>, DefaultIgnore;
7134
7135 def err_base_init_does_not_name_class : Error<
7136   "constructor initializer %0 does not name a class">;
7137 def err_base_init_direct_and_virtual : Error<
7138   "base class initializer %0 names both a direct base class and an "
7139   "inherited virtual base class">;
7140 def err_not_direct_base_or_virtual : Error<
7141   "type %0 is not a direct or virtual base of %1">;
7142
7143 def err_in_class_initializer_non_const : Error<
7144   "non-const static data member must be initialized out of line">;
7145 def err_in_class_initializer_volatile : Error<
7146   "static const volatile data member must be initialized out of line">;
7147 def err_in_class_initializer_bad_type : Error<
7148   "static data member of type %0 must be initialized out of line">;
7149 def ext_in_class_initializer_float_type : ExtWarn<
7150   "in-class initializer for static data member of type %0 is a GNU extension">,
7151   InGroup<GNUStaticFloatInit>;
7152 def ext_in_class_initializer_float_type_cxx11 : ExtWarn<
7153   "in-class initializer for static data member of type %0 requires "
7154   "'constexpr' specifier">, InGroup<StaticFloatInit>, DefaultError;
7155 def note_in_class_initializer_float_type_cxx11 : Note<"add 'constexpr'">;
7156 def err_in_class_initializer_literal_type : Error<
7157   "in-class initializer for static data member of type %0 requires "
7158   "'constexpr' specifier">;
7159 def err_in_class_initializer_non_constant : Error<
7160   "in-class initializer for static data member is not a constant expression">;
7161 def err_in_class_initializer_not_yet_parsed : Error<
7162   "default member initializer for %1 needed within definition of enclosing "
7163   "class %0 outside of member functions">;
7164 def note_in_class_initializer_not_yet_parsed : Note<
7165   "default member initializer declared here">;
7166 def err_in_class_initializer_cycle
7167     : Error<"default member initializer for %0 uses itself">;
7168 def err_exception_spec_cycle
7169     : Error<"exception specification of %0 uses itself">;
7170
7171 def ext_in_class_initializer_non_constant : Extension<
7172   "in-class initializer for static data member is not a constant expression; "
7173   "folding it to a constant is a GNU extension">, InGroup<GNUFoldingConstant>;
7174
7175 def err_thread_dynamic_init : Error<
7176   "initializer for thread-local variable must be a constant expression">;
7177 def err_thread_nontrivial_dtor : Error<
7178   "type of thread-local variable has non-trivial destruction">;
7179 def note_use_thread_local : Note<
7180   "use 'thread_local' to allow this">;
7181
7182 // C++ anonymous unions and GNU anonymous structs/unions
7183 def ext_anonymous_union : Extension<
7184   "anonymous unions are a C11 extension">, InGroup<C11>;
7185 def ext_gnu_anonymous_struct : Extension<
7186   "anonymous structs are a GNU extension">, InGroup<GNUAnonymousStruct>;
7187 def ext_c11_anonymous_struct : Extension<
7188   "anonymous structs are a C11 extension">, InGroup<C11>;
7189 def err_anonymous_union_not_static : Error<
7190   "anonymous unions at namespace or global scope must be declared 'static'">;
7191 def err_anonymous_union_with_storage_spec : Error<
7192   "anonymous union at class scope must not have a storage specifier">;
7193 def err_anonymous_struct_not_member : Error<
7194   "anonymous %select{structs|structs and classes}0 must be "
7195   "%select{struct or union|class}0 members">;
7196 def err_anonymous_record_member_redecl : Error<
7197   "member of anonymous %select{struct|union}0 redeclares %1">;
7198 def err_anonymous_record_with_type : Error<
7199   "types cannot be declared in an anonymous %select{struct|union}0">;
7200 def ext_anonymous_record_with_type : Extension<
7201   "types declared in an anonymous %select{struct|union}0 are a Microsoft "
7202   "extension">, InGroup<MicrosoftAnonTag>;
7203 def ext_anonymous_record_with_anonymous_type : Extension<
7204   "anonymous types declared in an anonymous %select{struct|union}0 "
7205   "are an extension">, InGroup<DiagGroup<"nested-anon-types">>;
7206 def err_anonymous_record_with_function : Error<
7207   "functions cannot be declared in an anonymous %select{struct|union}0">;
7208 def err_anonymous_record_with_static : Error<
7209   "static members cannot be declared in an anonymous %select{struct|union}0">;
7210 def err_anonymous_record_bad_member : Error<
7211   "anonymous %select{struct|union}0 can only contain non-static data members">;
7212 def err_anonymous_record_nonpublic_member : Error<
7213   "anonymous %select{struct|union}0 cannot contain a "
7214   "%select{private|protected}1 data member">;
7215 def ext_ms_anonymous_record : ExtWarn<
7216   "anonymous %select{structs|unions}0 are a Microsoft extension">,
7217   InGroup<MicrosoftAnonTag>;
7218
7219 // C++ local classes
7220 def err_reference_to_local_in_enclosing_context : Error<
7221   "reference to local %select{variable|binding}1 %0 declared in enclosing "
7222   "%select{%3|block literal|lambda expression|context}2">;
7223
7224 def err_static_data_member_not_allowed_in_local_class : Error<
7225   "static data member %0 not allowed in local class %1">; 
7226   
7227 // C++ derived classes
7228 def err_base_clause_on_union : Error<"unions cannot have base classes">;
7229 def err_base_must_be_class : Error<"base specifier must name a class">;
7230 def err_union_as_base_class : Error<"unions cannot be base classes">;
7231 def err_circular_inheritance : Error<
7232   "circular inheritance between %0 and %1">;
7233 def err_base_class_has_flexible_array_member : Error<
7234   "base class %0 has a flexible array member">;
7235 def err_incomplete_base_class : Error<"base class has incomplete type">;
7236 def err_duplicate_base_class : Error<
7237   "base class %0 specified more than once as a direct base class">;
7238 def warn_inaccessible_base_class : Warning<
7239   "direct base %0 is inaccessible due to ambiguity:%1">,
7240   InGroup<DiagGroup<"inaccessible-base">>;
7241 // FIXME: better way to display derivation?  Pass entire thing into diagclient?
7242 def err_ambiguous_derived_to_base_conv : Error<
7243   "ambiguous conversion from derived class %0 to base class %1:%2">;
7244 def err_ambiguous_memptr_conv : Error<
7245   "ambiguous conversion from pointer to member of %select{base|derived}0 "
7246   "class %1 to pointer to member of %select{derived|base}0 class %2:%3">;
7247
7248 def err_memptr_conv_via_virtual : Error<
7249   "conversion from pointer to member of class %0 to pointer to member "
7250   "of class %1 via virtual base %2 is not allowed">;
7251
7252 // C++ member name lookup
7253 def err_ambiguous_member_multiple_subobjects : Error<
7254   "non-static member %0 found in multiple base-class subobjects of type %1:%2">;
7255 def err_ambiguous_member_multiple_subobject_types : Error<
7256   "member %0 found in multiple base classes of different types">;
7257 def note_ambiguous_member_found : Note<"member found by ambiguous name lookup">;
7258 def err_ambiguous_reference : Error<"reference to %0 is ambiguous">;
7259 def note_ambiguous_candidate : Note<"candidate found by name lookup is %q0">;
7260 def err_ambiguous_tag_hiding : Error<"a type named %0 is hidden by a "
7261   "declaration in a different namespace">;
7262 def note_hidden_tag : Note<"type declaration hidden">;
7263 def note_hiding_object : Note<"declaration hides type">;
7264
7265 // C++ operator overloading
7266 def err_operator_overload_needs_class_or_enum : Error<
7267   "overloaded %0 must have at least one parameter of class "
7268   "or enumeration type">;
7269
7270 def err_operator_overload_variadic : Error<"overloaded %0 cannot be variadic">;
7271 def err_operator_overload_static : Error<
7272   "overloaded %0 cannot be a static member function">;
7273 def err_operator_overload_default_arg : Error<
7274   "parameter of overloaded %0 cannot have a default argument">;
7275 def err_operator_overload_must_be : Error<
7276   "overloaded %0 must be a %select{unary|binary|unary or binary}2 operator "
7277   "(has %1 parameter%s1)">;
7278
7279 def err_operator_overload_must_be_member : Error<
7280   "overloaded %0 must be a non-static member function">;
7281 def err_operator_overload_post_incdec_must_be_int : Error<
7282   "parameter of overloaded post-%select{increment|decrement}1 operator must "
7283   "have type 'int' (not %0)">;
7284
7285 // C++ allocation and deallocation functions.
7286 def err_operator_new_delete_declared_in_namespace : Error<
7287   "%0 cannot be declared inside a namespace">;
7288 def err_operator_new_delete_declared_static : Error<
7289   "%0 cannot be declared static in global scope">;
7290 def ext_operator_new_delete_declared_inline : ExtWarn<
7291   "replacement function %0 cannot be declared 'inline'">,
7292   InGroup<DiagGroup<"inline-new-delete">>;
7293 def err_operator_new_delete_invalid_result_type : Error<
7294   "%0 must return type %1">;
7295 def err_operator_new_delete_dependent_result_type : Error<
7296   "%0 cannot have a dependent return type; use %1 instead">;
7297 def err_operator_new_delete_too_few_parameters : Error<
7298   "%0 must have at least one parameter">;
7299 def err_operator_new_delete_template_too_few_parameters : Error<
7300   "%0 template must have at least two parameters">;
7301 def warn_operator_new_returns_null : Warning<
7302   "%0 should not return a null pointer unless it is declared 'throw()'"
7303   "%select{| or 'noexcept'}1">, InGroup<OperatorNewReturnsNull>;
7304
7305 def err_operator_new_dependent_param_type : Error<
7306   "%0 cannot take a dependent type as first parameter; "
7307   "use size_t (%1) instead">;
7308 def err_operator_new_param_type : Error<
7309   "%0 takes type size_t (%1) as first parameter">;
7310 def err_operator_new_default_arg: Error<
7311   "parameter of %0 cannot have a default argument">;
7312 def err_operator_delete_dependent_param_type : Error<
7313   "%0 cannot take a dependent type as first parameter; use %1 instead">;
7314 def err_operator_delete_param_type : Error<
7315   "first parameter of %0 must have type %1">;
7316
7317 // C++ literal operators
7318 def err_literal_operator_outside_namespace : Error<
7319   "literal operator %0 must be in a namespace or global scope">;
7320 def err_literal_operator_id_outside_namespace : Error<
7321   "non-namespace scope '%0' cannot have a literal operator member">;
7322 def err_literal_operator_default_argument : Error<
7323   "literal operator cannot have a default argument">;
7324 def err_literal_operator_bad_param_count : Error<
7325   "non-template literal operator must have one or two parameters">;
7326 def err_literal_operator_invalid_param : Error<
7327   "parameter of literal operator must have type 'unsigned long long', 'long double', 'char', 'wchar_t', 'char16_t', 'char32_t', or 'const char *'">;
7328 def err_literal_operator_param : Error<
7329   "invalid literal operator parameter type %0, did you mean %1?">;
7330 def err_literal_operator_template_with_params : Error<
7331   "literal operator template cannot have any parameters">;
7332 def err_literal_operator_template : Error<
7333   "template parameter list for literal operator must be either 'char...' or 'typename T, T...'">;
7334 def err_literal_operator_extern_c : Error<
7335   "literal operator must have C++ linkage">;
7336 def ext_string_literal_operator_template : ExtWarn<
7337   "string literal operator templates are a GNU extension">,
7338   InGroup<GNUStringLiteralOperatorTemplate>;
7339 def warn_user_literal_reserved : Warning<
7340   "user-defined literal suffixes not starting with '_' are reserved"
7341   "%select{; no literal will invoke this operator|}0">,
7342   InGroup<UserDefinedLiterals>;
7343
7344 // C++ conversion functions
7345 def err_conv_function_not_member : Error<
7346   "conversion function must be a non-static member function">;
7347 def err_conv_function_return_type : Error<
7348   "conversion function cannot have a return type">;
7349 def err_conv_function_with_params : Error<
7350   "conversion function cannot have any parameters">;
7351 def err_conv_function_variadic : Error<
7352   "conversion function cannot be variadic">;
7353 def err_conv_function_to_array : Error<
7354   "conversion function cannot convert to an array type">;
7355 def err_conv_function_to_function : Error<
7356   "conversion function cannot convert to a function type">;
7357 def err_conv_function_with_complex_decl : Error<
7358   "cannot specify any part of a return type in the "
7359   "declaration of a conversion function"
7360   "%select{"
7361   "; put the complete type after 'operator'|"
7362   "; use a typedef to declare a conversion to %1|"
7363   "; use an alias template to declare a conversion to %1|"
7364   "}0">;
7365 def err_conv_function_redeclared : Error<
7366   "conversion function cannot be redeclared">;
7367 def warn_conv_to_self_not_used : Warning<
7368   "conversion function converting %0 to itself will never be used">;
7369 def warn_conv_to_base_not_used : Warning<
7370   "conversion function converting %0 to its base class %1 will never be used">;
7371 def warn_conv_to_void_not_used : Warning<
7372   "conversion function converting %0 to %1 will never be used">;
7373
7374 def warn_not_compound_assign : Warning<
7375   "use of unary operator that may be intended as compound assignment (%0=)">;
7376
7377 // C++11 explicit conversion operators
7378 def ext_explicit_conversion_functions : ExtWarn<
7379   "explicit conversion functions are a C++11 extension">, InGroup<CXX11>;
7380 def warn_cxx98_compat_explicit_conversion_functions : Warning<
7381   "explicit conversion functions are incompatible with C++98">,
7382   InGroup<CXX98Compat>, DefaultIgnore;
7383
7384 // C++11 defaulted functions
7385 def err_defaulted_special_member_params : Error<
7386   "an explicitly-defaulted %select{|copy |move }0constructor cannot "
7387   "have default arguments">;
7388 def err_defaulted_special_member_variadic : Error<
7389   "an explicitly-defaulted %select{|copy |move }0constructor cannot "
7390   "be variadic">;
7391 def err_defaulted_special_member_return_type : Error<
7392   "explicitly-defaulted %select{copy|move}0 assignment operator must "
7393   "return %1">;
7394 def err_defaulted_special_member_quals : Error<
7395   "an explicitly-defaulted %select{copy|move}0 assignment operator may not "
7396   "have 'const'%select{, 'constexpr'|}1 or 'volatile' qualifiers">;
7397 def err_defaulted_special_member_volatile_param : Error<
7398   "the parameter for an explicitly-defaulted %select{<<ERROR>>|"
7399   "copy constructor|move constructor|copy assignment operator|"
7400   "move assignment operator|<<ERROR>>}0 may not be volatile">;
7401 def err_defaulted_special_member_move_const_param : Error<
7402   "the parameter for an explicitly-defaulted move "
7403   "%select{constructor|assignment operator}0 may not be const">;
7404 def err_defaulted_special_member_copy_const_param : Error<
7405   "the parameter for this explicitly-defaulted copy "
7406   "%select{constructor|assignment operator}0 is const, but a member or base "
7407   "requires it to be non-const">;
7408 def err_defaulted_copy_assign_not_ref : Error<
7409   "the parameter for an explicitly-defaulted copy assignment operator must be an "
7410   "lvalue reference type">;
7411 def err_incorrect_defaulted_exception_spec : Error<
7412   "exception specification of explicitly defaulted %select{default constructor|"
7413   "copy constructor|move constructor|copy assignment operator|move assignment "
7414   "operator|destructor}0 does not match the "
7415   "calculated one">;
7416 def err_incorrect_defaulted_constexpr : Error<
7417   "defaulted definition of %select{default constructor|copy constructor|"
7418   "move constructor|copy assignment operator|move assignment operator}0 "
7419   "is not constexpr">;
7420 def err_out_of_line_default_deletes : Error<
7421   "defaulting this %select{default constructor|copy constructor|move "
7422   "constructor|copy assignment operator|move assignment operator|destructor}0 "
7423   "would delete it after its first declaration">;
7424 def warn_vbase_moved_multiple_times : Warning<
7425   "defaulted move assignment operator of %0 will move assign virtual base "
7426   "class %1 multiple times">, InGroup<DiagGroup<"multiple-move-vbase">>;
7427 def note_vbase_moved_here : Note<
7428   "%select{%1 is a virtual base class of base class %2 declared here|"
7429   "virtual base class %1 declared here}0">;
7430
7431 def ext_implicit_exception_spec_mismatch : ExtWarn<
7432   "function previously declared with an %select{explicit|implicit}0 exception "
7433   "specification redeclared with an %select{implicit|explicit}0 exception "
7434   "specification">, InGroup<DiagGroup<"implicit-exception-spec-mismatch">>;
7435
7436 def warn_ptr_arith_precedes_bounds : Warning<
7437   "the pointer decremented by %0 refers before the beginning of the array">,
7438   InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore;
7439 def warn_ptr_arith_exceeds_bounds : Warning<
7440   "the pointer incremented by %0 refers past the end of the array (that "
7441   "contains %1 element%s2)">,
7442   InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore;
7443 def warn_array_index_precedes_bounds : Warning<
7444   "array index %0 is before the beginning of the array">,
7445   InGroup<ArrayBounds>;
7446 def warn_array_index_exceeds_bounds : Warning<
7447   "array index %0 is past the end of the array (which contains %1 "
7448   "element%s2)">, InGroup<ArrayBounds>;
7449 def note_array_index_out_of_bounds : Note<
7450   "array %0 declared here">;
7451
7452 def warn_printf_insufficient_data_args : Warning<
7453   "more '%%' conversions than data arguments">, InGroup<Format>;
7454 def warn_printf_data_arg_not_used : Warning<
7455   "data argument not used by format string">, InGroup<FormatExtraArgs>;
7456 def warn_format_invalid_conversion : Warning<
7457   "invalid conversion specifier '%0'">, InGroup<FormatInvalidSpecifier>;
7458 def warn_printf_incomplete_specifier : Warning<
7459   "incomplete format specifier">, InGroup<Format>;
7460 def warn_missing_format_string : Warning<
7461   "format string missing">, InGroup<Format>;
7462 def warn_scanf_nonzero_width : Warning<
7463   "zero field width in scanf format string is unused">,
7464   InGroup<Format>;
7465 def warn_format_conversion_argument_type_mismatch : Warning<
7466   "format specifies type %0 but the argument has "
7467   "%select{type|underlying type}2 %1">,
7468   InGroup<Format>;
7469 def warn_format_conversion_argument_type_mismatch_pedantic : Extension<
7470   "format specifies type %0 but the argument has "
7471   "%select{type|underlying type}2 %1">,
7472   InGroup<FormatPedantic>;
7473 def warn_format_argument_needs_cast : Warning<
7474   "%select{values of type|enum values with underlying type}2 '%0' should not "
7475   "be used as format arguments; add an explicit cast to %1 instead">,
7476   InGroup<Format>;
7477 def warn_printf_positional_arg_exceeds_data_args : Warning <
7478   "data argument position '%0' exceeds the number of data arguments (%1)">,
7479   InGroup<Format>;
7480 def warn_format_zero_positional_specifier : Warning<
7481   "position arguments in format strings start counting at 1 (not 0)">,
7482   InGroup<Format>;
7483 def warn_format_invalid_positional_specifier : Warning<
7484   "invalid position specified for %select{field width|field precision}0">,
7485   InGroup<Format>;
7486 def warn_format_mix_positional_nonpositional_args : Warning<
7487   "cannot mix positional and non-positional arguments in format string">,
7488   InGroup<Format>;
7489 def warn_static_array_too_small : Warning<
7490   "array argument is too small; contains %0 elements, callee requires at least %1">,
7491   InGroup<ArrayBounds>;
7492 def note_callee_static_array : Note<
7493   "callee declares array parameter as static here">;
7494 def warn_empty_format_string : Warning<
7495   "format string is empty">, InGroup<FormatZeroLength>;
7496 def warn_format_string_is_wide_literal : Warning<
7497   "format string should not be a wide string">, InGroup<Format>;
7498 def warn_printf_format_string_contains_null_char : Warning<
7499   "format string contains '\\0' within the string body">, InGroup<Format>;
7500 def warn_printf_format_string_not_null_terminated : Warning<
7501   "format string is not null-terminated">, InGroup<Format>;
7502 def warn_printf_asterisk_missing_arg : Warning<
7503   "'%select{*|.*}0' specified field %select{width|precision}0 is missing a matching 'int' argument">,
7504   InGroup<Format>;
7505 def warn_printf_asterisk_wrong_type : Warning<
7506   "field %select{width|precision}0 should have type %1, but argument has type %2">,
7507   InGroup<Format>;
7508 def warn_printf_nonsensical_optional_amount: Warning<
7509   "%select{field width|precision}0 used with '%1' conversion specifier, resulting in undefined behavior">,
7510   InGroup<Format>;
7511 def warn_printf_nonsensical_flag: Warning<
7512   "flag '%0' results in undefined behavior with '%1' conversion specifier">,
7513   InGroup<Format>;
7514 def warn_format_nonsensical_length: Warning<
7515   "length modifier '%0' results in undefined behavior or no effect with '%1' conversion specifier">,
7516   InGroup<Format>;
7517 def warn_format_non_standard_positional_arg: Warning<
7518   "positional arguments are not supported by ISO C">, InGroup<FormatNonStandard>, DefaultIgnore;
7519 def warn_format_non_standard: Warning<
7520   "'%0' %select{length modifier|conversion specifier}1 is not supported by ISO C">,
7521   InGroup<FormatNonStandard>, DefaultIgnore;
7522 def warn_format_non_standard_conversion_spec: Warning<
7523   "using length modifier '%0' with conversion specifier '%1' is not supported by ISO C">,
7524   InGroup<FormatNonStandard>, DefaultIgnore;
7525 def warn_format_invalid_annotation : Warning<
7526   "using '%0' format specifier annotation outside of os_log()/os_trace()">,
7527   InGroup<Format>;
7528 def warn_format_P_no_precision : Warning<
7529   "using '%%P' format specifier without precision">,
7530   InGroup<Format>;
7531 def warn_printf_ignored_flag: Warning<
7532   "flag '%0' is ignored when flag '%1' is present">,
7533   InGroup<Format>;
7534 def warn_printf_empty_objc_flag: Warning<
7535   "missing object format flag">,
7536   InGroup<Format>;
7537 def warn_printf_ObjCflags_without_ObjCConversion: Warning<
7538   "object format flags cannot be used with '%0' conversion specifier">,
7539   InGroup<Format>;
7540 def warn_printf_invalid_objc_flag: Warning<
7541     "'%0' is not a valid object format flag">,
7542     InGroup<Format>;
7543 def warn_scanf_scanlist_incomplete : Warning<
7544   "no closing ']' for '%%[' in scanf format string">,
7545   InGroup<Format>;
7546 def note_format_string_defined : Note<"format string is defined here">;
7547 def note_format_fix_specifier : Note<"did you mean to use '%0'?">;
7548 def note_printf_c_str: Note<"did you mean to call the %0 method?">;
7549 def note_format_security_fixit: Note<
7550   "treat the string as an argument to avoid this">;
7551
7552 def warn_null_arg : Warning<
7553   "null passed to a callee that requires a non-null argument">,
7554   InGroup<NonNull>;
7555 def warn_null_ret : Warning<
7556   "null returned from %select{function|method}0 that requires a non-null return value">,
7557   InGroup<NonNull>;
7558
7559 // CHECK: returning address/reference of stack memory
7560 def warn_ret_stack_addr_ref : Warning<
7561   "%select{address of|reference to}0 stack memory associated with local "
7562   "variable %1 returned">,
7563   InGroup<ReturnStackAddress>;
7564 def warn_ret_local_temp_addr_ref : Warning<
7565   "returning %select{address of|reference to}0 local temporary object">,
7566   InGroup<ReturnStackAddress>;
7567 def warn_ret_addr_label : Warning<
7568   "returning address of label, which is local">,
7569   InGroup<ReturnStackAddress>;
7570 def err_ret_local_block : Error<
7571   "returning block that lives on the local stack">;
7572 def note_ref_var_local_bind : Note<
7573   "binding reference variable %0 here">;
7574
7575 // Check for initializing a member variable with the address or a reference to
7576 // a constructor parameter.
7577 def warn_bind_ref_member_to_parameter : Warning<
7578   "binding reference member %0 to stack allocated parameter %1">,
7579   InGroup<DanglingField>;
7580 def warn_init_ptr_member_to_parameter_addr : Warning<
7581   "initializing pointer member %0 with the stack address of parameter %1">,
7582   InGroup<DanglingField>;
7583 def warn_bind_ref_member_to_temporary : Warning<
7584   "binding reference %select{|subobject of }1member %0 to a temporary value">,
7585   InGroup<DanglingField>;
7586 def note_ref_or_ptr_member_declared_here : Note<
7587   "%select{reference|pointer}0 member declared here">;
7588 def note_ref_subobject_of_member_declared_here : Note<
7589   "member with reference subobject declared here">;
7590
7591 // For non-floating point, expressions of the form x == x or x != x
7592 // should result in a warning, since these always evaluate to a constant.
7593 // Array comparisons have similar warnings
7594 def warn_comparison_always : Warning<
7595   "%select{self-|array }0comparison always evaluates to %select{false|true|a constant}1">,
7596   InGroup<TautologicalCompare>;
7597 def warn_comparison_bitwise_always : Warning<
7598   "bitwise comparison always evaluates to %select{false|true}0">,
7599   InGroup<TautologicalCompare>;
7600 def warn_tautological_overlap_comparison : Warning<
7601   "overlapping comparisons always evaluate to %select{false|true}0">,
7602   InGroup<TautologicalOverlapCompare>, DefaultIgnore;
7603
7604 def warn_stringcompare : Warning<
7605   "result of comparison against %select{a string literal|@encode}0 is "
7606   "unspecified (use strncmp instead)">,
7607   InGroup<StringCompare>;
7608
7609 def warn_identity_field_assign : Warning<
7610   "assigning %select{field|instance variable}0 to itself">,
7611   InGroup<SelfAssignmentField>;
7612
7613 // Type safety attributes
7614 def err_type_tag_for_datatype_not_ice : Error<
7615   "'type_tag_for_datatype' attribute requires the initializer to be "
7616   "an %select{integer|integral}0 constant expression">;
7617 def err_type_tag_for_datatype_too_large : Error<
7618   "'type_tag_for_datatype' attribute requires the initializer to be "
7619   "an %select{integer|integral}0 constant expression "
7620   "that can be represented by a 64 bit integer">;
7621 def warn_type_tag_for_datatype_wrong_kind : Warning<
7622   "this type tag was not designed to be used with this function">,
7623   InGroup<TypeSafety>;
7624 def warn_type_safety_type_mismatch : Warning<
7625   "argument type %0 doesn't match specified %1 type tag "
7626   "%select{that requires %3|}2">, InGroup<TypeSafety>;
7627 def warn_type_safety_null_pointer_required : Warning<
7628   "specified %0 type tag requires a null pointer">, InGroup<TypeSafety>;
7629
7630 // Generic selections.
7631 def err_assoc_type_incomplete : Error<
7632   "type %0 in generic association incomplete">;
7633 def err_assoc_type_nonobject : Error<
7634   "type %0 in generic association not an object type">;
7635 def err_assoc_type_variably_modified : Error<
7636   "type %0 in generic association is a variably modified type">;
7637 def err_assoc_compatible_types : Error<
7638   "type %0 in generic association compatible with previously specified type %1">;
7639 def note_compat_assoc : Note<
7640   "compatible type %0 specified here">;
7641 def err_generic_sel_no_match : Error<
7642   "controlling expression type %0 not compatible with any generic association type">;
7643 def err_generic_sel_multi_match : Error<
7644   "controlling expression type %0 compatible with %1 generic association types">;
7645
7646
7647 // Blocks
7648 def err_blocks_disable : Error<"blocks support disabled - compile with -fblocks"
7649   " or %select{pick a deployment target that supports them|for OpenCL 2.0 or above}0">;
7650 def err_block_returning_array_function : Error<
7651   "block cannot return %select{array|function}0 type %1">;
7652
7653 // Builtin annotation
7654 def err_builtin_annotation_first_arg : Error<
7655   "first argument to __builtin_annotation must be an integer">;
7656 def err_builtin_annotation_second_arg : Error<
7657   "second argument to __builtin_annotation must be a non-wide string constant">;
7658
7659 // CFString checking
7660 def err_cfstring_literal_not_string_constant : Error<
7661   "CFString literal is not a string constant">;
7662 def warn_cfstring_truncated : Warning<
7663   "input conversion stopped due to an input byte that does not "
7664   "belong to the input codeset UTF-8">,
7665   InGroup<DiagGroup<"CFString-literal">>;
7666
7667 // os_log checking
7668 // TODO: separate diagnostic for os_trace()
7669 def err_os_log_format_not_string_constant : Error<
7670   "os_log() format argument is not a string constant">;
7671 def err_os_log_argument_too_big : Error<
7672   "os_log() argument %0 is too big (%1 bytes, max %2)">;
7673 def warn_os_log_format_narg : Error<
7674  "os_log() '%%n' format specifier is not allowed">, DefaultError;
7675
7676 // Statements.
7677 def err_continue_not_in_loop : Error<
7678   "'continue' statement not in loop statement">;
7679 def err_break_not_in_loop_or_switch : Error<
7680   "'break' statement not in loop or switch statement">;
7681 def warn_loop_ctrl_binds_to_inner : Warning<
7682   "'%0' is bound to current loop, GCC binds it to the enclosing loop">,
7683   InGroup<GccCompat>;
7684 def warn_break_binds_to_switch : Warning<
7685   "'break' is bound to loop, GCC binds it to switch">,
7686   InGroup<GccCompat>;
7687 def err_default_not_in_switch : Error<
7688   "'default' statement not in switch statement">;
7689 def err_case_not_in_switch : Error<"'case' statement not in switch statement">;
7690 def warn_bool_switch_condition : Warning<
7691   "switch condition has boolean value">, InGroup<SwitchBool>;
7692 def warn_case_value_overflow : Warning<
7693   "overflow converting case value to switch condition type (%0 to %1)">,
7694   InGroup<Switch>;
7695 def err_duplicate_case : Error<"duplicate case value '%0'">;
7696 def err_duplicate_case_differing_expr : Error<
7697   "duplicate case value: '%0' and '%1' both equal '%2'">;
7698 def warn_case_empty_range : Warning<"empty case range specified">;
7699 def warn_missing_case_for_condition :
7700   Warning<"no case matching constant switch condition '%0'">;
7701
7702 def warn_def_missing_case : Warning<"%plural{"
7703   "1:enumeration value %1 not explicitly handled in switch|"
7704   "2:enumeration values %1 and %2 not explicitly handled in switch|"
7705   "3:enumeration values %1, %2, and %3 not explicitly handled in switch|"
7706   ":%0 enumeration values not explicitly handled in switch: %1, %2, %3...}0">,
7707   InGroup<SwitchEnum>, DefaultIgnore;
7708
7709 def warn_missing_case : Warning<"%plural{"
7710   "1:enumeration value %1 not handled in switch|"
7711   "2:enumeration values %1 and %2 not handled in switch|"
7712   "3:enumeration values %1, %2, and %3 not handled in switch|"
7713   ":%0 enumeration values not handled in switch: %1, %2, %3...}0">,
7714   InGroup<Switch>;
7715
7716 def warn_unannotated_fallthrough : Warning<
7717   "unannotated fall-through between switch labels">,
7718   InGroup<ImplicitFallthrough>, DefaultIgnore;
7719 def warn_unannotated_fallthrough_per_function : Warning<
7720   "unannotated fall-through between switch labels in partly-annotated "
7721   "function">, InGroup<ImplicitFallthroughPerFunction>, DefaultIgnore;
7722 def note_insert_fallthrough_fixit : Note<
7723   "insert '%0;' to silence this warning">;
7724 def note_insert_break_fixit : Note<
7725   "insert 'break;' to avoid fall-through">;
7726 def err_fallthrough_attr_wrong_target : Error<
7727   "%0 attribute is only allowed on empty statements">;
7728 def note_fallthrough_insert_semi_fixit : Note<"did you forget ';'?">;
7729 def err_fallthrough_attr_outside_switch : Error<
7730   "fallthrough annotation is outside switch statement">;
7731 def err_fallthrough_attr_invalid_placement : Error<
7732   "fallthrough annotation does not directly precede switch label">;
7733 def warn_fallthrough_attr_unreachable : Warning<
7734   "fallthrough annotation in unreachable code">,
7735   InGroup<ImplicitFallthrough>, DefaultIgnore;
7736
7737 def warn_unreachable_default : Warning<
7738   "default label in switch which covers all enumeration values">,
7739   InGroup<CoveredSwitchDefault>, DefaultIgnore;
7740 def warn_not_in_enum : Warning<"case value not in enumerated type %0">,
7741   InGroup<Switch>;
7742 def warn_not_in_enum_assignment : Warning<"integer constant not in range "
7743   "of enumerated type %0">, InGroup<DiagGroup<"assign-enum">>, DefaultIgnore;
7744 def err_typecheck_statement_requires_scalar : Error<
7745   "statement requires expression of scalar type (%0 invalid)">;
7746 def err_typecheck_statement_requires_integer : Error<
7747   "statement requires expression of integer type (%0 invalid)">;
7748 def err_multiple_default_labels_defined : Error<
7749   "multiple default labels in one switch">;
7750 def err_switch_multiple_conversions : Error<
7751   "multiple conversions from switch condition type %0 to an integral or "
7752   "enumeration type">;
7753 def note_switch_conversion : Note<
7754   "conversion to %select{integral|enumeration}0 type %1">;
7755 def err_switch_explicit_conversion : Error<
7756   "switch condition type %0 requires explicit conversion to %1">;
7757 def err_switch_incomplete_class_type : Error<
7758   "switch condition has incomplete class type %0">;
7759
7760 def warn_empty_if_body : Warning<
7761   "if statement has empty body">, InGroup<EmptyBody>;
7762 def warn_empty_for_body : Warning<
7763   "for loop has empty body">, InGroup<EmptyBody>;
7764 def warn_empty_range_based_for_body : Warning<
7765   "range-based for loop has empty body">, InGroup<EmptyBody>;
7766 def warn_empty_while_body : Warning<
7767   "while loop has empty body">, InGroup<EmptyBody>;
7768 def warn_empty_switch_body : Warning<
7769   "switch statement has empty body">, InGroup<EmptyBody>;
7770 def note_empty_body_on_separate_line : Note<
7771   "put the semicolon on a separate line to silence this warning">;
7772
7773 def err_va_start_used_in_non_variadic_function : Error<
7774   "'va_start' used in function with fixed args">;
7775 def err_va_start_used_in_wrong_abi_function : Error<
7776   "'va_start' used in %select{System V|Win64}0 ABI function">;
7777 def err_ms_va_start_used_in_sysv_function : Error<
7778   "'__builtin_ms_va_start' used in System V ABI function">;
7779 def warn_second_arg_of_va_start_not_last_named_param : Warning<
7780   "second argument to 'va_start' is not the last named parameter">,
7781   InGroup<Varargs>;
7782 def warn_va_start_type_is_undefined : Warning<
7783   "passing %select{an object that undergoes default argument promotion|"
7784   "an object of reference type|a parameter declared with the 'register' "
7785   "keyword}0 to 'va_start' has undefined behavior">, InGroup<Varargs>;
7786 def err_first_argument_to_va_arg_not_of_type_va_list : Error<
7787   "first argument to 'va_arg' is of type %0 and not 'va_list'">;
7788 def err_second_parameter_to_va_arg_incomplete: Error<
7789   "second argument to 'va_arg' is of incomplete type %0">;
7790 def err_second_parameter_to_va_arg_abstract: Error<
7791   "second argument to 'va_arg' is of abstract type %0">;
7792 def warn_second_parameter_to_va_arg_not_pod : Warning<
7793   "second argument to 'va_arg' is of non-POD type %0">,
7794   InGroup<NonPODVarargs>, DefaultError;
7795 def warn_second_parameter_to_va_arg_ownership_qualified : Warning<
7796   "second argument to 'va_arg' is of ARC ownership-qualified type %0">,
7797   InGroup<NonPODVarargs>, DefaultError;
7798 def warn_second_parameter_to_va_arg_never_compatible : Warning<
7799   "second argument to 'va_arg' is of promotable type %0; this va_arg has "
7800   "undefined behavior because arguments will be promoted to %1">, InGroup<Varargs>;
7801
7802 def warn_return_missing_expr : Warning<
7803   "non-void %select{function|method}1 %0 should return a value">, DefaultError,
7804   InGroup<ReturnType>;
7805 def ext_return_missing_expr : ExtWarn<
7806   "non-void %select{function|method}1 %0 should return a value">, DefaultError,
7807   InGroup<ReturnType>;
7808 def ext_return_has_expr : ExtWarn<
7809   "%select{void function|void method|constructor|destructor}1 %0 "
7810   "should not return a value">,
7811   DefaultError, InGroup<ReturnType>;
7812 def ext_return_has_void_expr : Extension<
7813   "void %select{function|method|block}1 %0 should not return void expression">;
7814 def err_return_init_list : Error<
7815   "%select{void function|void method|constructor|destructor}1 %0 "
7816   "must not return a value">;
7817 def err_ctor_dtor_returns_void : Error<
7818   "%select{constructor|destructor}1 %0 must not return void expression">;
7819 def warn_noreturn_function_has_return_expr : Warning<
7820   "function %0 declared 'noreturn' should not return">,
7821   InGroup<InvalidNoreturn>;
7822 def warn_falloff_noreturn_function : Warning<
7823   "function declared 'noreturn' should not return">,
7824   InGroup<InvalidNoreturn>;
7825 def err_noreturn_block_has_return_expr : Error<
7826   "block declared 'noreturn' should not return">;
7827 def err_noreturn_missing_on_first_decl : Error<
7828   "function declared '[[noreturn]]' after its first declaration">;
7829 def note_noreturn_missing_first_decl : Note<
7830   "declaration missing '[[noreturn]]' attribute is here">;
7831 def err_carries_dependency_missing_on_first_decl : Error<
7832   "%select{function|parameter}0 declared '[[carries_dependency]]' "
7833   "after its first declaration">;
7834 def note_carries_dependency_missing_first_decl : Note<
7835   "declaration missing '[[carries_dependency]]' attribute is here">;
7836 def err_carries_dependency_param_not_function_decl : Error<
7837   "'[[carries_dependency]]' attribute only allowed on parameter in a function "
7838   "declaration or lambda">;
7839 def err_block_on_nonlocal : Error<
7840   "__block attribute not allowed, only allowed on local variables">;
7841 def err_block_on_vm : Error<
7842   "__block attribute not allowed on declaration with a variably modified type">;
7843
7844 def err_shufflevector_non_vector : Error<
7845   "first two arguments to __builtin_shufflevector must be vectors">;
7846 def err_shufflevector_incompatible_vector : Error<
7847   "first two arguments to __builtin_shufflevector must have the same type">;
7848 def err_shufflevector_nonconstant_argument : Error<
7849   "index for __builtin_shufflevector must be a constant integer">;
7850 def err_shufflevector_argument_too_large : Error<
7851   "index for __builtin_shufflevector must be less than the total number "
7852   "of vector elements">;
7853
7854 def err_convertvector_non_vector : Error<
7855   "first argument to __builtin_convertvector must be a vector">;
7856 def err_convertvector_non_vector_type : Error<
7857   "second argument to __builtin_convertvector must be a vector type">;
7858 def err_convertvector_incompatible_vector : Error<
7859   "first two arguments to __builtin_convertvector must have the same number of elements">;
7860
7861 def err_first_argument_to_cwsc_not_call : Error<
7862   "first argument to __builtin_call_with_static_chain must be a non-member call expression">;
7863 def err_first_argument_to_cwsc_block_call : Error<
7864   "first argument to __builtin_call_with_static_chain must not be a block call">;
7865 def err_first_argument_to_cwsc_builtin_call : Error<
7866   "first argument to __builtin_call_with_static_chain must not be a builtin call">;
7867 def err_first_argument_to_cwsc_pdtor_call : Error<
7868   "first argument to __builtin_call_with_static_chain must not be a pseudo-destructor call">;
7869 def err_second_argument_to_cwsc_not_pointer : Error<
7870   "second argument to __builtin_call_with_static_chain must be of pointer type">;
7871
7872 def err_vector_incorrect_num_initializers : Error<
7873   "%select{too many|too few}0 elements in vector initialization (expected %1 elements, have %2)">;
7874 def err_altivec_empty_initializer : Error<"expected initializer">;
7875
7876 def err_invalid_neon_type_code : Error<
7877   "incompatible constant for this __builtin_neon function">; 
7878 def err_argument_invalid_range : Error<
7879   "argument should be a value from %0 to %1">;
7880 def err_argument_not_multiple : Error<
7881   "argument should be a multiple of %0">;
7882 def warn_neon_vector_initializer_non_portable : Warning<
7883   "vector initializers are not compatible with NEON intrinsics in big endian "
7884   "mode">, InGroup<DiagGroup<"nonportable-vector-initialization">>;
7885 def note_neon_vector_initializer_non_portable : Note<
7886   "consider using vld1_%0%1() to initialize a vector from memory, or "
7887   "vcreate_%0%1() to initialize from an integer constant">;
7888 def note_neon_vector_initializer_non_portable_q : Note<
7889   "consider using vld1q_%0%1() to initialize a vector from memory, or "
7890   "vcombine_%0%1(vcreate_%0%1(), vcreate_%0%1()) to initialize from integer "
7891   "constants">;
7892 def err_systemz_invalid_tabort_code : Error<
7893   "invalid transaction abort code">;
7894 def err_64_bit_builtin_32_bit_tgt : Error<
7895   "this builtin is only available on 64-bit targets">;
7896 def err_ppc_builtin_only_on_pwr7 : Error<
7897   "this builtin is only valid on POWER7 or later CPUs">;
7898 def err_x86_builtin_32_bit_tgt : Error<
7899   "this builtin is only available on x86-64 targets">;
7900 def err_x86_builtin_invalid_rounding : Error<
7901   "invalid rounding argument">;
7902
7903 def err_builtin_longjmp_unsupported : Error<
7904   "__builtin_longjmp is not supported for the current target">;
7905 def err_builtin_setjmp_unsupported : Error<
7906   "__builtin_setjmp is not supported for the current target">;
7907
7908 def err_builtin_longjmp_invalid_val : Error<
7909   "argument to __builtin_longjmp must be a constant 1">;
7910 def err_builtin_requires_language : Error<"'%0' is only available in %1">;
7911
7912 def err_constant_integer_arg_type : Error<
7913   "argument to %0 must be a constant integer">;
7914
7915 def ext_mixed_decls_code : Extension<
7916   "ISO C90 forbids mixing declarations and code">,
7917   InGroup<DiagGroup<"declaration-after-statement">>;
7918   
7919 def err_non_local_variable_decl_in_for : Error<
7920   "declaration of non-local variable in 'for' loop">;
7921 def err_non_variable_decl_in_for : Error<
7922   "non-variable declaration in 'for' loop">;
7923 def err_toomany_element_decls : Error<
7924   "only one element declaration is allowed">;
7925 def err_selector_element_not_lvalue : Error<
7926   "selector element is not a valid lvalue">;
7927 def err_selector_element_type : Error<
7928   "selector element type %0 is not a valid object">;
7929 def err_selector_element_const_type : Error<
7930   "selector element of type %0 cannot be a constant l-value expression">;
7931 def err_collection_expr_type : Error<
7932   "the type %0 is not a pointer to a fast-enumerable object">;
7933 def warn_collection_expr_type : Warning<
7934   "collection expression type %0 may not respond to %1">;
7935
7936 def err_invalid_conversion_between_ext_vectors : Error<
7937   "invalid conversion between ext-vector type %0 and %1">;
7938
7939 def warn_duplicate_attribute_exact : Warning<
7940   "attribute %0 is already applied">, InGroup<IgnoredAttributes>;
7941
7942 def warn_duplicate_attribute : Warning<
7943   "attribute %0 is already applied with different parameters">,
7944   InGroup<IgnoredAttributes>;
7945
7946 def warn_sync_fetch_and_nand_semantics_change : Warning<
7947   "the semantics of this intrinsic changed with GCC "
7948   "version 4.4 - the newer semantics are provided here">,
7949   InGroup<DiagGroup<"sync-fetch-and-nand-semantics-changed">>;
7950
7951 // Type
7952 def ext_invalid_sign_spec : Extension<"'%0' cannot be signed or unsigned">;
7953 def warn_receiver_forward_class : Warning<
7954     "receiver %0 is a forward class and corresponding @interface may not exist">,
7955     InGroup<ForwardClassReceiver>;
7956 def note_method_sent_forward_class : Note<"method %0 is used for the forward class">;
7957 def ext_missing_declspec : ExtWarn<
7958   "declaration specifier missing, defaulting to 'int'">;
7959 def ext_missing_type_specifier : ExtWarn<
7960   "type specifier missing, defaults to 'int'">,
7961   InGroup<ImplicitInt>;
7962 def err_decimal_unsupported : Error<
7963   "GNU decimal type extension not supported">;
7964 def err_missing_type_specifier : Error<
7965   "C++ requires a type specifier for all declarations">;
7966 def err_objc_array_of_interfaces : Error<
7967   "array of interface %0 is invalid (probably should be an array of pointers)">;
7968 def ext_c99_array_usage : Extension<
7969   "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 "
7970   "feature">, InGroup<C99>;
7971 def err_c99_array_usage_cxx : Error<
7972   "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 "
7973   "feature, not permitted in C++">;
7974 def err_type_unsupported : Error<
7975   "%0 is not supported on this target">;
7976 def err_nsconsumed_attribute_mismatch : Error<
7977   "overriding method has mismatched ns_consumed attribute on its"
7978   " parameter">;
7979 def err_nsreturns_retained_attribute_mismatch : Error<
7980   "overriding method has mismatched ns_returns_%select{not_retained|retained}0"
7981   " attributes">;
7982   
7983 def note_getter_unavailable : Note<
7984   "or because setter is declared here, but no getter method %0 is found">;
7985 def err_invalid_protocol_qualifiers : Error<
7986   "invalid protocol qualifiers on non-ObjC type">;
7987 def warn_ivar_use_hidden : Warning<
7988   "local declaration of %0 hides instance variable">,
7989    InGroup<ShadowIvar>;
7990 def warn_direct_initialize_call : Warning<
7991   "explicit call to +initialize results in duplicate call to +initialize">,
7992    InGroup<ExplicitInitializeCall>;
7993 def warn_direct_super_initialize_call : Warning<
7994   "explicit call to [super initialize] should only be in implementation "
7995   "of +initialize">,
7996    InGroup<ExplicitInitializeCall>;
7997 def err_ivar_use_in_class_method : Error<
7998   "instance variable %0 accessed in class method">;
7999 def err_private_ivar_access : Error<"instance variable %0 is private">,
8000   AccessControl;
8001 def err_protected_ivar_access : Error<"instance variable %0 is protected">,
8002   AccessControl;
8003 def warn_maynot_respond : Warning<"%0 may not respond to %1">;
8004 def ext_typecheck_base_super : Warning<
8005   "method parameter type "
8006   "%diff{$ does not match super class method parameter type $|"
8007   "does not match super class method parameter type}0,1">,
8008    InGroup<SuperSubClassMismatch>, DefaultIgnore;
8009 def warn_missing_method_return_type : Warning<
8010   "method has no return type specified; defaults to 'id'">,
8011   InGroup<MissingMethodReturnType>, DefaultIgnore;
8012 def warn_direct_ivar_access : Warning<"instance variable %0 is being "
8013   "directly accessed">, InGroup<DiagGroup<"direct-ivar-access">>, DefaultIgnore;
8014
8015 // Spell-checking diagnostics
8016 def err_unknown_typename : Error<
8017   "unknown type name %0">;
8018 def err_unknown_type_or_class_name_suggest : Error<
8019   "unknown %select{type|class}1 name %0; did you mean %2?">;
8020 def err_unknown_typename_suggest : Error<
8021   "unknown type name %0; did you mean %1?">;
8022 def err_unknown_nested_typename_suggest : Error<
8023   "no type named %0 in %1; did you mean %select{|simply }2%3?">;
8024 def err_no_member_suggest : Error<"no member named %0 in %1; did you mean %select{|simply }2%3?">;
8025 def err_undeclared_use_suggest : Error<
8026   "use of undeclared %0; did you mean %1?">;
8027 def err_undeclared_var_use_suggest : Error<
8028   "use of undeclared identifier %0; did you mean %1?">;
8029 def err_no_template_suggest : Error<"no template named %0; did you mean %1?">;
8030 def err_no_member_template_suggest : Error<
8031   "no template named %0 in %1; did you mean %select{|simply }2%3?">;
8032 def err_mem_init_not_member_or_class_suggest : Error<
8033   "initializer %0 does not name a non-static data member or base "
8034   "class; did you mean the %select{base class|member}1 %2?">;
8035 def err_field_designator_unknown_suggest : Error<
8036   "field designator %0 does not refer to any field in type %1; did you mean "
8037   "%2?">;
8038 def err_typecheck_member_reference_ivar_suggest : Error<
8039   "%0 does not have a member named %1; did you mean %2?">;
8040 def err_property_not_found_suggest : Error<
8041   "property %0 not found on object of type %1; did you mean %2?">;
8042 def err_class_property_found : Error<
8043   "property %0 is a class property; did you mean to access it with class '%1'?">;
8044 def err_ivar_access_using_property_syntax_suggest : Error<
8045   "property %0 not found on object of type %1; did you mean to access instance variable %2?">;
8046 def warn_property_access_suggest : Warning<
8047 "property %0 not found on object of type %1; did you mean to access property %2?">,
8048 InGroup<PropertyAccessDotSyntax>;
8049 def err_property_found_suggest : Error<
8050   "property %0 found on object of type %1; did you mean to access "
8051   "it with the \".\" operator?">;
8052 def err_undef_interface_suggest : Error<
8053   "cannot find interface declaration for %0; did you mean %1?">;
8054 def warn_undef_interface_suggest : Warning<
8055   "cannot find interface declaration for %0; did you mean %1?">;
8056 def err_undef_superclass_suggest : Error<
8057   "cannot find interface declaration for %0, superclass of %1; did you mean "
8058   "%2?">;
8059 def err_undeclared_protocol_suggest : Error<
8060   "cannot find protocol declaration for %0; did you mean %1?">;
8061 def note_base_class_specified_here : Note<
8062   "base class %0 specified here">;
8063 def err_using_directive_suggest : Error<
8064   "no namespace named %0; did you mean %1?">;
8065 def err_using_directive_member_suggest : Error<
8066   "no namespace named %0 in %1; did you mean %select{|simply }2%3?">;
8067 def note_namespace_defined_here : Note<"namespace %0 defined here">;
8068 def err_sizeof_pack_no_pack_name_suggest : Error<
8069   "%0 does not refer to the name of a parameter pack; did you mean %1?">;
8070 def note_parameter_pack_here : Note<"parameter pack %0 declared here">;
8071
8072 def err_uncasted_use_of_unknown_any : Error<
8073   "%0 has unknown type; cast it to its declared type to use it">;
8074 def err_uncasted_call_of_unknown_any : Error<
8075   "%0 has unknown return type; cast the call to its declared return type">;
8076 def err_uncasted_send_to_unknown_any_method : Error<
8077   "no known method %select{%objcinstance1|%objcclass1}0; cast the "
8078   "message send to the method's return type">;
8079 def err_unsupported_unknown_any_decl : Error<
8080   "%0 has unknown type, which is not supported for this kind of declaration">;
8081 def err_unsupported_unknown_any_expr : Error<
8082   "unsupported expression with unknown type">;
8083 def err_unsupported_unknown_any_call : Error<
8084   "call to unsupported expression with unknown type">;
8085 def err_unknown_any_addrof : Error<
8086   "the address of a declaration with unknown type "
8087   "can only be cast to a pointer type">;
8088 def err_unknown_any_addrof_call : Error<
8089   "address-of operator cannot be applied to a call to a function with "
8090   "unknown return type">;
8091 def err_unknown_any_var_function_type : Error<
8092   "variable %0 with unknown type cannot be given a function type">;
8093 def err_unknown_any_function : Error<
8094   "function %0 with unknown type must be given a function type">;
8095
8096 def err_filter_expression_integral : Error<
8097   "filter expression type should be an integral value not %0">;
8098
8099 def err_non_asm_stmt_in_naked_function : Error<
8100   "non-ASM statement in naked function is not supported">;
8101 def err_asm_naked_this_ref : Error<
8102   "'this' pointer references not allowed in naked functions">;
8103 def err_asm_naked_parm_ref : Error<
8104   "parameter references not allowed in naked functions">;
8105
8106 // OpenCL warnings and errors.
8107 def err_invalid_astype_of_different_size : Error<
8108   "invalid reinterpretation: sizes of %0 and %1 must match">;
8109 def err_static_kernel : Error<
8110   "kernel functions cannot be declared static">;
8111 def err_opencl_ptrptr_kernel_param : Error<
8112   "kernel parameter cannot be declared as a pointer to a pointer">;
8113 def err_kernel_arg_address_space : Error<
8114   "pointer arguments to kernel functions must reside in '__global', "
8115   "'__constant' or '__local' address space">;
8116 def err_opencl_function_variable : Error<
8117   "%select{non-kernel function|function scope}0 variable cannot be declared in %1 address space">;
8118 def err_static_function_scope : Error<
8119   "variables in function scope cannot be declared static">;
8120 def err_opencl_bitfields : Error<
8121   "bit-fields are not supported in OpenCL">;
8122 def err_opencl_vla : Error<
8123   "variable length arrays are not supported in OpenCL">;
8124 def err_bad_kernel_param_type : Error<
8125   "%0 cannot be used as the type of a kernel parameter">;
8126 def err_record_with_pointers_kernel_param : Error<
8127   "%select{struct|union}0 kernel parameters may not contain pointers">;
8128 def note_within_field_of_type : Note<
8129   "within field of type %0 declared here">;
8130 def note_illegal_field_declared_here : Note<
8131   "field of illegal %select{type|pointer type}0 %1 declared here">;
8132 def err_opencl_type_struct_or_union_field : Error<
8133   "the %0 type cannot be used to declare a structure or union field">;
8134 def err_event_t_addr_space_qual : Error<
8135   "the event_t type can only be used with __private address space qualifier">;
8136 def err_expected_kernel_void_return_type : Error<
8137   "kernel must have void return type">;
8138 def err_sampler_initializer_not_integer : Error<
8139   "sampler_t initialization requires 32-bit integer, not %0">;
8140 def warn_sampler_initializer_invalid_bits : Warning<
8141   "sampler initializer has invalid %0 bits">, InGroup<SpirCompat>, DefaultIgnore;
8142 def err_sampler_argument_required : Error<
8143   "sampler_t variable required - got %0">;
8144 def err_wrong_sampler_addressspace: Error<
8145   "sampler type cannot be used with the __local and __global address space qualifiers">;
8146 def err_opencl_cast_non_zero_to_event_t : Error<
8147   "cannot cast non-zero value '%0' to 'event_t'">;
8148 def err_opencl_global_invalid_addr_space : Error<
8149   "%select{program scope|static local|extern}0 variable must reside in %1 address space">;
8150 def err_missing_actual_pipe_type : Error<
8151   "missing actual type specifier for pipe">;
8152 def err_reference_pipe_type : Error <
8153   "pipes packet types cannot be of reference type">;
8154 def err_opencl_no_main : Error<"%select{function|kernel}0 cannot be called 'main'">;
8155 def err_opencl_kernel_attr :
8156   Error<"attribute %0 can only be applied to a kernel function">;
8157 def err_opencl_return_value_with_address_space : Error<
8158   "return value cannot be qualified with address space">;
8159 def err_opencl_constant_no_init : Error<
8160   "variable in constant address space must be initialized">;
8161 def err_atomic_init_constant : Error<
8162   "atomic variable can only be assigned to a compile time constant"
8163   " in the declaration statement in the program scope">;
8164 def err_opencl_implicit_vector_conversion : Error<
8165   "implicit conversions between vector types (%0 and %1) are not permitted">;
8166 def err_opencl_invalid_type_array : Error<
8167   "array of %0 type is invalid in OpenCL">;
8168 def err_opencl_ternary_with_block : Error<
8169   "block type cannot be used as expression in ternary expression in OpenCL">;
8170 def err_opencl_pointer_to_type : Error<
8171   "pointer to type %0 is invalid in OpenCL">;
8172 def err_opencl_type_can_only_be_used_as_function_parameter : Error <
8173   "type %0 can only be used as a function parameter in OpenCL">;
8174 def warn_opencl_attr_deprecated_ignored : Warning <
8175   "%0 attribute is deprecated and ignored in OpenCL version %1">,
8176   InGroup<IgnoredAttributes>;
8177 def err_opencl_variadic_function : Error<
8178   "invalid prototype, variadic arguments are not allowed in OpenCL">;
8179 def err_opencl_requires_extension : Error<
8180   "use of %select{type |declaration}0%1 requires %2 extension to be enabled">;
8181
8182 // OpenCL v2.0 s6.13.6 -- Builtin Pipe Functions
8183 def err_opencl_builtin_pipe_first_arg : Error<
8184   "first argument to %0 must be a pipe type">;
8185 def err_opencl_builtin_pipe_arg_num : Error<
8186   "invalid number of arguments to function: %0">;
8187 def err_opencl_builtin_pipe_invalid_arg : Error<
8188   "invalid argument type to function %0 (expecting %1 having %2)">;
8189 def err_opencl_builtin_pipe_invalid_access_modifier : Error<
8190   "invalid pipe access modifier (expecting %0)">;
8191
8192 // OpenCL access qualifier
8193 def err_opencl_invalid_access_qualifier : Error<
8194   "access qualifier can only be used for pipe and image type">;
8195 def err_opencl_invalid_read_write : Error<
8196   "access qualifier %0 can not be used for %1 %select{|prior to OpenCL version 2.0}2">;
8197 def err_opencl_multiple_access_qualifiers : Error<
8198   "multiple access qualifiers">;
8199 def note_opencl_typedef_access_qualifier : Note<
8200   "previously declared '%0' here">;
8201
8202 // OpenCL Section 6.8.g
8203 def err_opencl_unknown_type_specifier : Error<
8204   "OpenCL version %0 does not support the '%1' %select{type qualifier|storage class specifier}2">;
8205
8206 // OpenCL v2.0 s6.12.5 Blocks restrictions
8207 def err_opencl_block_storage_type : Error<
8208   "the __block storage type is not permitted">;
8209 def err_opencl_invalid_block_declaration : Error<
8210   "invalid block variable declaration - must be %select{const qualified|initialized}0">;
8211 def err_opencl_extern_block_declaration : Error<
8212   "invalid block variable declaration - using 'extern' storage class is disallowed">;
8213
8214 // OpenCL v2.0 s6.13.9 - Address space qualifier functions. 
8215 def err_opencl_builtin_to_addr_arg_num : Error<
8216   "invalid number of arguments to function: %0">;
8217 def err_opencl_builtin_to_addr_invalid_arg : Error<
8218   "invalid argument %0 to function: %1, expecting a generic pointer argument">;
8219
8220 // OpenCL v2.0 s6.13.17 Enqueue kernel restrictions.
8221 def err_opencl_enqueue_kernel_incorrect_args : Error<
8222   "illegal call to enqueue_kernel, incorrect argument types">;
8223 def err_opencl_enqueue_kernel_expected_type : Error<
8224   "illegal call to enqueue_kernel, expected %0 argument type">;
8225 def err_opencl_enqueue_kernel_local_size_args : Error<
8226   "mismatch in number of block parameters and local size arguments passed">;
8227 def err_opencl_enqueue_kernel_invalid_local_size_type : Error<
8228   "illegal call to enqueue_kernel, parameter needs to be specified as integer type">;
8229 def err_opencl_enqueue_kernel_blocks_non_local_void_args : Error<
8230   "blocks used in device side enqueue are expected to have parameters of type 'local void*'">;
8231 def err_opencl_enqueue_kernel_blocks_no_args : Error<
8232   "blocks in this form of device side enqueue call are expected to have have no parameters">;
8233
8234 // OpenCL v2.2 s2.1.2.3 - Vector Component Access
8235 def ext_opencl_ext_vector_type_rgba_selector: ExtWarn<
8236   "vector component name '%0' is an OpenCL version 2.2 feature">,
8237   InGroup<OpenCLUnsupportedRGBA>;
8238 } // end of sema category
8239
8240 let CategoryName = "OpenMP Issue" in {
8241 // OpenMP support.
8242 def err_omp_expected_var_arg : Error<
8243   "%0 is not a global variable, static local variable or static data member">;
8244 def err_omp_expected_var_arg_suggest : Error<
8245   "%0 is not a global variable, static local variable or static data member; "
8246   "did you mean %1">;
8247 def err_omp_global_var_arg : Error<
8248   "arguments of '#pragma omp %0' must have %select{global storage|static storage duration}1">;
8249 def err_omp_ref_type_arg : Error<
8250   "arguments of '#pragma omp %0' cannot be of reference type %1">;
8251 def err_omp_region_not_file_context : Error<
8252   "directive must be at file or namespace scope">;
8253 def err_omp_var_scope : Error<
8254   "'#pragma omp %0' must appear in the scope of the %q1 variable declaration">;
8255 def err_omp_var_used : Error<
8256   "'#pragma omp %0' must precede all references to variable %q1">;
8257 def err_omp_var_thread_local : Error<
8258   "variable %0 cannot be threadprivate because it is %select{thread-local|a global named register variable}1">;
8259 def err_omp_private_incomplete_type : Error<
8260   "a private variable with incomplete type %0">;
8261 def err_omp_firstprivate_incomplete_type : Error<
8262   "a firstprivate variable with incomplete type %0">;
8263 def err_omp_lastprivate_incomplete_type : Error<
8264   "a lastprivate variable with incomplete type %0">;
8265 def err_omp_reduction_incomplete_type : Error<
8266   "a reduction list item with incomplete type %0">;
8267 def err_omp_unexpected_clause_value : Error<
8268   "expected %0 in OpenMP clause '%1'">;
8269 def err_omp_expected_var_name_member_expr : Error<
8270   "expected variable name%select{| or data member of current class}0">;
8271 def err_omp_expected_var_name_member_expr_or_array_item : Error<
8272   "expected variable name%select{|, data member of current class}0, array element or array section">;
8273 def err_omp_expected_named_var_member_or_array_expression: Error<
8274   "expected expression containing only member accesses and/or array sections based on named variables">;
8275 def err_omp_bit_fields_forbidden_in_clause : Error<
8276   "bit fields cannot be used to specify storage in a '%0' clause">;
8277 def err_array_section_does_not_specify_contiguous_storage : Error<
8278   "array section does not specify contiguous storage">;
8279 def err_omp_union_type_not_allowed : Error<
8280   "mapped storage cannot be derived from a union">;
8281 def err_omp_expected_access_to_data_field : Error<
8282   "expected access to data field">;
8283 def err_omp_multiple_array_items_in_map_clause : Error<
8284   "multiple array elements associated with the same variable are not allowed in map clauses of the same construct">;
8285 def err_omp_pointer_mapped_along_with_derived_section : Error<
8286   "pointer cannot be mapped along with a section derived from itself">;
8287 def err_omp_original_storage_is_shared_and_does_not_contain : Error<
8288   "original storage of expression in data environment is shared but data environment do not fully contain mapped expression storage">;
8289 def err_omp_same_pointer_derreferenced : Error<
8290   "same pointer derreferenced in multiple different ways in map clause expressions">;
8291 def note_omp_task_predetermined_firstprivate_here : Note<
8292   "predetermined as a firstprivate in a task construct here">;
8293 def err_omp_threadprivate_incomplete_type : Error<
8294   "threadprivate variable with incomplete type %0">;
8295 def err_omp_no_dsa_for_variable : Error<
8296   "variable %0 must have explicitly specified data sharing attributes">;
8297 def err_omp_wrong_dsa : Error<
8298   "%0 variable cannot be %1">;
8299 def err_omp_variably_modified_type_not_supported : Error<
8300   "arguments of OpenMP clause '%0' in '#pragma omp %2' directive cannot be of variably-modified type %1">;
8301 def note_omp_explicit_dsa : Note<
8302   "defined as %0">;
8303 def note_omp_predetermined_dsa : Note<
8304   "%select{static data member is predetermined as shared|"
8305   "variable with static storage duration is predetermined as shared|"
8306   "loop iteration variable is predetermined as private|"
8307   "loop iteration variable is predetermined as linear|"
8308   "loop iteration variable is predetermined as lastprivate|"
8309   "constant variable is predetermined as shared|"
8310   "global variable is predetermined as shared|"
8311   "non-shared variable in a task construct is predetermined as firstprivate|"
8312   "variable with automatic storage duration is predetermined as private}0"
8313   "%select{|; perhaps you forget to enclose 'omp %2' directive into a parallel or another task region?}1">;
8314 def note_omp_implicit_dsa : Note<
8315   "implicitly determined as %0">;
8316 def err_omp_loop_var_dsa : Error<
8317   "loop iteration variable in the associated loop of 'omp %1' directive may not be %0, predetermined as %2">;
8318 def err_omp_not_for : Error<
8319   "%select{statement after '#pragma omp %1' must be a for loop|"
8320   "expected %2 for loops after '#pragma omp %1'%select{|, but found only %4}3}0">;
8321 def note_omp_collapse_ordered_expr : Note<
8322   "as specified in %select{'collapse'|'ordered'|'collapse' and 'ordered'}0 clause%select{||s}0">;
8323 def err_omp_negative_expression_in_clause : Error<
8324   "argument to '%0' clause must be a %select{non-negative|strictly positive}1 integer value">;
8325 def err_omp_not_integral : Error<
8326   "expression must have integral or unscoped enumeration "
8327   "type, not %0">;
8328 def err_omp_threadprivate_in_target : Error<
8329   "threadprivate variables cannot be used in target constructs">;
8330 def err_omp_incomplete_type : Error<
8331   "expression has incomplete class type %0">;
8332 def err_omp_explicit_conversion : Error<
8333   "expression requires explicit conversion from %0 to %1">;
8334 def note_omp_conversion_here : Note<
8335   "conversion to %select{integral|enumeration}0 type %1 declared here">;
8336 def err_omp_ambiguous_conversion : Error<
8337   "ambiguous conversion from type %0 to an integral or unscoped "
8338   "enumeration type">;
8339 def err_omp_required_access : Error<
8340   "%0 variable must be %1">;
8341 def err_omp_const_variable : Error<
8342   "const-qualified variable cannot be %0">;
8343 def err_omp_const_reduction_list_item : Error<
8344   "const-qualified list item cannot be reduction">;
8345 def err_omp_linear_incomplete_type : Error<
8346   "a linear variable with incomplete type %0">;
8347 def err_omp_linear_expected_int_or_ptr : Error<
8348   "argument of a linear clause should be of integral or pointer "
8349   "type, not %0">;
8350 def warn_omp_linear_step_zero : Warning<
8351   "zero linear step (%0 %select{|and other variables in clause }1should probably be const)">,
8352   InGroup<OpenMPClauses>;
8353 def warn_omp_alignment_not_power_of_two : Warning<
8354   "aligned clause will be ignored because the requested alignment is not a power of 2">,
8355   InGroup<OpenMPClauses>;
8356 def err_omp_enclosed_declare_target : Error<
8357   "declare target region may not be enclosed within another declare target region">;
8358 def err_omp_invalid_target_decl : Error<
8359   "%0 used in declare target directive is not a variable or a function name">;
8360 def err_omp_declare_target_multiple : Error<
8361   "%0 appears multiple times in clauses on the same declare target directive">;
8362 def err_omp_declare_target_to_and_link : Error<
8363   "%0 must not appear in both clauses 'to' and 'link'">;
8364 def warn_omp_not_in_target_context : Warning<
8365   "declaration is not declared in any declare target region">,
8366   InGroup<OpenMPTarget>;
8367 def err_omp_aligned_expected_array_or_ptr : Error<
8368   "argument of aligned clause should be array"
8369   "%select{ or pointer|, pointer, reference to array or reference to pointer}1"
8370   ", not %0">;
8371 def err_omp_aligned_twice : Error<
8372   "%select{a variable|a parameter|'this'}0 cannot appear in more than one aligned clause">;
8373 def err_omp_local_var_in_threadprivate_init : Error<
8374   "variable with local storage in initial value of threadprivate variable">;
8375 def err_omp_loop_not_canonical_init : Error<
8376   "initialization clause of OpenMP for loop is not in canonical form "
8377   "('var = init' or 'T var = init')">;
8378 def ext_omp_loop_not_canonical_init : ExtWarn<
8379   "initialization clause of OpenMP for loop is not in canonical form "
8380   "('var = init' or 'T var = init')">, InGroup<OpenMPLoopForm>;
8381 def err_omp_loop_not_canonical_cond : Error<
8382   "condition of OpenMP for loop must be a relational comparison "
8383   "('<', '<=', '>', or '>=') of loop variable %0">;
8384 def err_omp_loop_not_canonical_incr : Error<
8385   "increment clause of OpenMP for loop must perform simple addition "
8386   "or subtraction on loop variable %0">;
8387 def err_omp_loop_variable_type : Error<
8388   "variable must be of integer or %select{pointer|random access iterator}0 type">;
8389 def err_omp_loop_incr_not_compatible : Error<
8390   "increment expression must cause %0 to %select{decrease|increase}1 "
8391   "on each iteration of OpenMP for loop">;
8392 def note_omp_loop_cond_requres_compatible_incr : Note<
8393   "loop step is expected to be %select{negative|positive}0 due to this condition">;
8394 def err_omp_loop_diff_cxx : Error<
8395   "could not calculate number of iterations calling 'operator-' with "
8396   "upper and lower loop bounds">;
8397 def err_omp_loop_cannot_use_stmt : Error<
8398   "'%0' statement cannot be used in OpenMP for loop">;
8399 def err_omp_simd_region_cannot_use_stmt : Error<
8400   "'%0' statement cannot be used in OpenMP simd region">;
8401 def warn_omp_loop_64_bit_var : Warning<
8402   "OpenMP loop iteration variable cannot have more than 64 bits size and will be narrowed">,
8403   InGroup<OpenMPLoopForm>;
8404 def err_omp_unknown_reduction_identifier : Error<
8405   "incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', "
8406   "'&&', '||', 'min' or 'max' or declare reduction for type %0">;
8407 def err_omp_not_resolved_reduction_identifier : Error<
8408   "unable to resolve declare reduction construct for type %0">;
8409 def err_omp_reduction_ref_type_arg : Error<
8410   "argument of OpenMP clause 'reduction' must reference the same object in all threads">;
8411 def err_omp_clause_not_arithmetic_type_arg : Error<
8412   "arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of %select{scalar|arithmetic}0 type">;
8413 def err_omp_clause_floating_type_arg : Error<
8414   "arguments of OpenMP clause 'reduction' with bitwise operators cannot be of floating type">;
8415 def err_omp_once_referenced : Error<
8416   "variable can appear only once in OpenMP '%0' clause">;
8417 def err_omp_once_referenced_in_target_update : Error<
8418   "variable can appear only once in OpenMP 'target update' construct">;
8419 def note_omp_referenced : Note<
8420   "previously referenced here">;
8421 def err_omp_reduction_in_task : Error<
8422   "reduction variables may not be accessed in an explicit task">;
8423 def err_omp_reduction_id_not_compatible : Error<
8424   "list item of type %0 is not valid for specified reduction operation: unable to provide default initialization value">;
8425 def err_omp_prohibited_region : Error<
8426   "region cannot be%select{| closely}0 nested inside '%1' region"
8427   "%select{|; perhaps you forget to enclose 'omp %3' directive into a parallel region?|"
8428   "; perhaps you forget to enclose 'omp %3' directive into a for or a parallel for region with 'ordered' clause?|"
8429   "; perhaps you forget to enclose 'omp %3' directive into a target region?|"
8430   "; perhaps you forget to enclose 'omp %3' directive into a teams region?}2">;
8431 def err_omp_prohibited_region_simd : Error<
8432   "OpenMP constructs may not be nested inside a simd region">;
8433 def err_omp_prohibited_region_atomic : Error<
8434   "OpenMP constructs may not be nested inside an atomic region">;
8435 def err_omp_prohibited_region_critical_same_name : Error<
8436   "cannot nest 'critical' regions having the same name %0">;
8437 def note_omp_previous_critical_region : Note<
8438   "previous 'critical' region starts here">;
8439 def err_omp_sections_not_compound_stmt : Error<
8440   "the statement for '#pragma omp sections' must be a compound statement">;
8441 def err_omp_parallel_sections_not_compound_stmt : Error<
8442   "the statement for '#pragma omp parallel sections' must be a compound statement">;
8443 def err_omp_orphaned_section_directive : Error<
8444   "%select{orphaned 'omp section' directives are prohibited, it|'omp section' directive}0"
8445   " must be closely nested to a sections region%select{|, not a %1 region}0">;
8446 def err_omp_sections_substmt_not_section : Error<
8447   "statement in 'omp sections' directive must be enclosed into a section region">;
8448 def err_omp_parallel_sections_substmt_not_section : Error<
8449   "statement in 'omp parallel sections' directive must be enclosed into a section region">;
8450 def err_omp_parallel_reduction_in_task_firstprivate : Error<
8451   "argument of a reduction clause of a %0 construct must not appear in a firstprivate clause on a task construct">;
8452 def err_omp_atomic_read_not_expression_statement : Error<
8453   "the statement for 'atomic read' must be an expression statement of form 'v = x;',"
8454   " where v and x are both lvalue expressions with scalar type">;
8455 def note_omp_atomic_read_write: Note<
8456   "%select{expected an expression statement|expected built-in assignment operator|expected expression of scalar type|expected lvalue expression}0">;
8457 def err_omp_atomic_write_not_expression_statement : Error<
8458   "the statement for 'atomic write' must be an expression statement of form 'x = expr;',"
8459   " where x is a lvalue expression with scalar type">;
8460 def err_omp_atomic_update_not_expression_statement : Error<
8461   "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',"
8462   " where x is an l-value expression with scalar type">;
8463 def err_omp_atomic_not_expression_statement : Error<
8464   "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',"
8465   " where x is an l-value expression with scalar type">;
8466 def note_omp_atomic_update: Note<
8467   "%select{expected an expression statement|expected built-in binary or unary operator|expected unary decrement/increment operation|"
8468   "expected expression of scalar type|expected assignment expression|expected built-in binary operator|"
8469   "expected one of '+', '*', '-', '/', '&', '^', '%|', '<<', or '>>' built-in operations|expected in right hand side of expression}0">;
8470 def err_omp_atomic_capture_not_expression_statement : Error<
8471   "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',"
8472   " where x and v are both l-value expressions with scalar type">;
8473 def err_omp_atomic_capture_not_compound_statement : Error<
8474   "the statement for 'atomic capture' must be a compound statement of form '{v = x; x binop= expr;}', '{x binop= expr; v = x;}',"
8475   " '{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;}',"
8476   " '{v = x; x++;}', '{v = x; ++x;}', '{++x; v = x;}', '{x++; v = x;}', '{v = x; x--;}', '{v = x; --x;}', '{--x; v = x;}', '{x--; v = x;}'"
8477   " where x is an l-value expression with scalar type">;
8478 def note_omp_atomic_capture: Note<
8479   "%select{expected assignment expression|expected compound statement|expected exactly two expression statements|expected in right hand side of the first expression}0">;
8480 def err_omp_atomic_several_clauses : Error<
8481   "directive '#pragma omp atomic' cannot contain more than one 'read', 'write', 'update' or 'capture' clause">;
8482 def note_omp_atomic_previous_clause : Note<
8483   "'%0' clause used here">;
8484 def err_omp_target_contains_not_only_teams : Error<
8485   "target construct with nested teams region contains statements outside of the teams construct">;
8486 def note_omp_nested_teams_construct_here : Note<
8487   "nested teams construct here">;
8488 def note_omp_nested_statement_here : Note<
8489   "%select{statement|directive}0 outside teams construct here">;
8490 def err_omp_single_copyprivate_with_nowait : Error<
8491   "the 'copyprivate' clause must not be used with the 'nowait' clause">;
8492 def note_omp_nowait_clause_here : Note<
8493   "'nowait' clause is here">;
8494 def err_omp_single_decl_in_declare_simd : Error<
8495   "single declaration is expected after 'declare simd' directive">;
8496 def err_omp_function_expected : Error<
8497   "'#pragma omp declare simd' can only be applied to functions">;
8498 def err_omp_wrong_cancel_region : Error<
8499   "one of 'for', 'parallel', 'sections' or 'taskgroup' is expected">;
8500 def err_omp_parent_cancel_region_nowait : Error<
8501   "parent region for 'omp %select{cancellation point/cancel}0' construct cannot be nowait">;
8502 def err_omp_parent_cancel_region_ordered : Error<
8503   "parent region for 'omp %select{cancellation point/cancel}0' construct cannot be ordered">;
8504 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">;
8505 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">;
8506 def err_omp_declare_reduction_redefinition : Error<"redefinition of user-defined reduction for type %0">;
8507 def err_omp_array_section_use : Error<"OpenMP array section is not allowed here">;
8508 def err_omp_typecheck_section_value : Error<
8509   "subscripted value is not an array or pointer">;
8510 def err_omp_typecheck_section_not_integer : Error<
8511   "array section %select{lower bound|length}0 is not an integer">;
8512 def err_omp_section_function_type : Error<
8513   "section of pointer to function type %0">;
8514 def warn_omp_section_is_char : Warning<"array section %select{lower bound|length}0 is of type 'char'">,
8515   InGroup<CharSubscript>, DefaultIgnore;
8516 def err_omp_section_incomplete_type : Error<
8517   "section of pointer to incomplete type %0">;
8518 def err_omp_section_not_subset_of_array : Error<
8519   "array section must be a subset of the original array">;
8520 def err_omp_section_length_negative : Error<
8521   "section length is evaluated to a negative value %0">;
8522 def err_omp_section_length_undefined : Error<
8523   "section length is unspecified and cannot be inferred because subscripted value is %select{not an array|an array of unknown bound}0">;
8524 def err_omp_wrong_linear_modifier : Error<
8525   "expected %select{'val' modifier|one of 'ref', val' or 'uval' modifiers}0">;
8526 def err_omp_wrong_linear_modifier_non_reference : Error<
8527   "variable of non-reference type %0 can be used only with 'val' modifier, but used with '%1'">;
8528 def err_omp_wrong_simdlen_safelen_values : Error<
8529   "the value of 'simdlen' parameter must be less than or equal to the value of the 'safelen' parameter">;
8530 def err_omp_wrong_if_directive_name_modifier : Error<
8531   "directive name modifier '%0' is not allowed for '#pragma omp %1'">;
8532 def err_omp_no_more_if_clause : Error<
8533   "no more 'if' clause is allowed">;
8534 def err_omp_unnamed_if_clause : Error<
8535   "expected %select{|one of}0 %1 directive name modifier%select{|s}0">;
8536 def note_omp_previous_named_if_clause : Note<
8537   "previous clause with directive name modifier specified here">;
8538 def err_omp_ordered_directive_with_param : Error<
8539   "'ordered' directive %select{without any clauses|with 'threads' clause}0 cannot be closely nested inside ordered region with specified parameter">;
8540 def err_omp_ordered_directive_without_param : Error<
8541   "'ordered' directive with 'depend' clause cannot be closely nested inside ordered region without specified parameter">;
8542 def note_omp_ordered_param : Note<
8543   "'ordered' clause with specified parameter">;
8544 def err_omp_expected_base_var_name : Error<
8545   "expected variable name as a base of the array %select{subscript|section}0">;
8546 def err_omp_map_shared_storage : Error<
8547   "variable already marked as mapped in current construct">;
8548 def err_omp_not_mappable_type : Error<
8549   "type %0 is not mappable to target">;
8550 def err_omp_invalid_map_type_for_directive : Error<
8551   "%select{map type '%1' is not allowed|map type must be specified}0 for '#pragma omp %2'">;
8552 def err_omp_no_map_for_directive : Error<
8553   "expected at least one map clause for '#pragma omp %0'">;
8554 def note_omp_polymorphic_in_target : Note<
8555   "mappable type cannot be polymorphic">;
8556 def note_omp_static_member_in_target : Note<
8557   "mappable type cannot contain static members">;
8558 def err_omp_threadprivate_in_clause : Error<
8559   "threadprivate variables are not allowed in '%0' clause">;
8560 def err_omp_wrong_ordered_loop_count : Error<
8561   "the parameter of the 'ordered' clause must be greater than or equal to the parameter of the 'collapse' clause">;
8562 def note_collapse_loop_count : Note<
8563   "parameter of the 'collapse' clause">;
8564 def err_omp_grainsize_num_tasks_mutually_exclusive : Error<
8565   "'%0' and '%1' clause are mutually exclusive and may not appear on the same directive">;
8566 def note_omp_previous_grainsize_num_tasks : Note<
8567   "'%0' clause is specified here">;
8568 def err_omp_hint_clause_no_name : Error<
8569   "the name of the construct must be specified in presence of 'hint' clause">;
8570 def err_omp_critical_with_hint : Error<
8571   "constructs with the same name must have a 'hint' clause with the same value">;
8572 def note_omp_critical_hint_here : Note<
8573   "%select{|previous }0'hint' clause with value '%1'">;
8574 def note_omp_critical_no_hint : Note<
8575   "%select{|previous }0directive with no 'hint' clause specified">;
8576 def err_omp_firstprivate_distribute_private_teams : Error<
8577   "private variable in '#pragma omp teams' cannot be firstprivate in '#pragma omp distribute'">;
8578 def err_omp_firstprivate_and_lastprivate_in_distribute : Error<
8579   "lastprivate variable cannot be firstprivate in '#pragma omp distribute'">;
8580 def err_omp_firstprivate_distribute_in_teams_reduction : Error<
8581   "reduction variable in '#pragma omp teams' cannot be firstprivate in '#pragma omp distribute'">;
8582 def err_omp_depend_clause_thread_simd : Error<
8583   "'depend' clauses cannot be mixed with '%0' clause">;
8584 def err_omp_depend_sink_expected_loop_iteration : Error<
8585   "expected %0 loop iteration variable">;
8586 def err_omp_depend_sink_unexpected_expr : Error<
8587   "unexpected expression: number of expressions is larger than the number of associated loops">;
8588 def err_omp_depend_sink_expected_plus_minus : Error<
8589   "expected '+' or '-' operation">;
8590 def err_omp_depend_sink_source_not_allowed : Error<
8591   "'depend(%select{source|sink:vec}0)' clause%select{|s}0 cannot be mixed with 'depend(%select{sink:vec|source}0)' clause%select{s|}0">;
8592 def err_omp_linear_ordered : Error<
8593   "'linear' clause cannot be specified along with 'ordered' clause with a parameter">;
8594 def err_omp_unexpected_schedule_modifier : Error<
8595   "modifier '%0' cannot be used along with modifier '%1'">;
8596 def err_omp_schedule_nonmonotonic_static : Error<
8597   "'nonmonotonic' modifier can only be specified with 'dynamic' or 'guided' schedule kind">;
8598 def err_omp_schedule_nonmonotonic_ordered : Error<
8599   "'schedule' clause with 'nonmonotonic' modifier cannot be specified if an 'ordered' clause is specified">;
8600 def err_omp_ordered_simd : Error<
8601   "'ordered' clause with a parameter can not be specified in '#pragma omp %0' directive">;
8602 def err_omp_variable_in_given_clause_and_dsa : Error<
8603   "%0 variable cannot be in a %1 clause in '#pragma omp %2' directive">;
8604 def err_omp_param_or_this_in_clause : Error<
8605   "expected reference to one of the parameters of function %0%select{| or 'this'}1">;
8606 def err_omp_expected_uniform_param : Error<
8607   "expected a reference to a parameter specified in a 'uniform' clause">;
8608 def err_omp_expected_int_param : Error<
8609   "expected a reference to an integer-typed parameter">;
8610 def err_omp_at_least_one_motion_clause_required : Error<
8611   "expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'">;
8612 def err_omp_usedeviceptr_not_a_pointer : Error<
8613   "expected pointer or reference to pointer in 'use_device_ptr' clause">;
8614 def err_omp_argument_type_isdeviceptr : Error <
8615   "expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'">;
8616 def warn_omp_nesting_simd : Warning<
8617   "OpenMP only allows an ordered construct with the simd clause nested in a simd construct">,
8618   InGroup<SourceUsesOpenMP>;
8619 def err_omp_orphaned_device_directive : Error<
8620   "orphaned 'omp %0' directives are prohibited"
8621   "; perhaps you forget to enclose the directive into a %select{|||target |teams }1region?">;
8622 } // end of OpenMP category
8623
8624 let CategoryName = "Related Result Type Issue" in {
8625 // Objective-C related result type compatibility
8626 def warn_related_result_type_compatibility_class : Warning<
8627   "method is expected to return an instance of its class type "
8628   "%diff{$, but is declared to return $|"
8629   ", but is declared to return different type}0,1">;
8630 def warn_related_result_type_compatibility_protocol : Warning<
8631   "protocol method is expected to return an instance of the implementing "
8632   "class, but is declared to return %0">;
8633 def note_related_result_type_family : Note<
8634   "%select{overridden|current}0 method is part of the '%select{|alloc|copy|init|"
8635   "mutableCopy|new|autorelease|dealloc|finalize|release|retain|retainCount|"
8636   "self}1' method family%select{| and is expected to return an instance of its "
8637   "class type}0">;
8638 def note_related_result_type_overridden : Note<
8639   "overridden method returns an instance of its class type">;
8640 def note_related_result_type_inferred : Note<
8641   "%select{class|instance}0 method %1 is assumed to return an instance of "
8642   "its receiver type (%2)">;
8643 def note_related_result_type_explicit : Note<
8644   "%select{overridden|current}0 method is explicitly declared 'instancetype'"
8645   "%select{| and is expected to return an instance of its class type}0">;
8646 def err_invalid_type_for_program_scope_var : Error<
8647   "the %0 type cannot be used to declare a program scope variable">;
8648
8649 }
8650
8651 let CategoryName = "Modules Issue" in {
8652 def err_module_interface_implementation_mismatch : Error<
8653   "%select{'module'|'module partition'|'module implementation'}0 declaration "
8654   "found while %select{not |not |}0building module interface">;
8655 def err_current_module_name_mismatch : Error<
8656   "module name '%0' specified on command line does not match name of module">;
8657 def err_module_redefinition : Error<
8658   "redefinition of module '%0'">;
8659 def note_prev_module_definition : Note<"previously defined here">;
8660 def note_prev_module_definition_from_ast_file : Note<"module loaded from '%0'">;
8661 def err_module_private_specialization : Error<
8662   "%select{template|partial|member}0 specialization cannot be "
8663   "declared __module_private__">;
8664 def err_module_private_local : Error<
8665   "%select{local variable|parameter|typedef}0 %1 cannot be declared "
8666   "__module_private__">;
8667 def err_module_private_local_class : Error<
8668   "local %select{struct|interface|union|class|enum}0 cannot be declared "
8669   "__module_private__">;
8670 def err_module_unimported_use : Error<
8671   "%select{declaration|definition|default argument|"
8672   "explicit specialization|partial specialization}0 of %1 must be imported "
8673   "from module '%2' before it is required">;
8674 def err_module_unimported_use_header : Error<
8675   "missing '#include %3'; "
8676   "%select{declaration|definition|default argument|"
8677   "explicit specialization|partial specialization}0 of %1 must be imported "
8678   "from module '%2' before it is required">;
8679 def err_module_unimported_use_multiple : Error<
8680   "%select{declaration|definition|default argument|"
8681   "explicit specialization|partial specialization}0 of %1 must be imported "
8682   "from one of the following modules before it is required:%2">;
8683 def ext_module_import_in_extern_c : ExtWarn<
8684   "import of C++ module '%0' appears within extern \"C\" language linkage "
8685   "specification">, DefaultError,
8686   InGroup<DiagGroup<"module-import-in-extern-c">>;
8687 def err_module_import_not_at_top_level_fatal : Error<
8688   "import of module '%0' appears within %1">, DefaultFatal;
8689 def ext_module_import_not_at_top_level_noop : ExtWarn<
8690   "redundant #include of module '%0' appears within %1">, DefaultError,
8691   InGroup<DiagGroup<"modules-import-nested-redundant">>;
8692 def note_module_import_not_at_top_level : Note<"%0 begins here">;
8693 def err_module_self_import : Error<
8694   "import of module '%0' appears within same top-level module '%1'">;
8695 def err_module_import_in_implementation : Error<
8696   "@import of module '%0' in implementation of '%1'; use #import">;
8697 def err_export_within_export : Error<
8698   "export declaration appears within another export declaration">;
8699
8700 def ext_equivalent_internal_linkage_decl_in_modules : ExtWarn<
8701   "ambiguous use of internal linkage declaration %0 defined in multiple modules">,
8702   InGroup<DiagGroup<"modules-ambiguous-internal-linkage">>;
8703 def note_equivalent_internal_linkage_decl : Note<
8704   "declared here%select{ in module '%1'|}0">;
8705 }
8706
8707 let CategoryName = "Coroutines Issue" in {
8708 def err_return_in_coroutine : Error<
8709   "return statement not allowed in coroutine; did you mean 'co_return'?">;
8710 def note_declared_coroutine_here : Note<
8711   "function is a coroutine due to use of "
8712   "'%select{co_await|co_yield|co_return}0' here">;
8713 def err_coroutine_objc_method : Error<
8714   "Objective-C methods as coroutines are not yet supported">;
8715 def err_coroutine_unevaluated_context : Error<
8716   "'%0' cannot be used in an unevaluated context">;
8717 def err_coroutine_outside_function : Error<
8718   "'%0' cannot be used outside a function">;
8719 def err_coroutine_invalid_func_context : Error<
8720   "'%1' cannot be used in %select{a constructor|a destructor"
8721   "|a copy assignment operator|a move assignment operator|the 'main' function"
8722   "|a constexpr function|a function with a deduced return type"
8723   "|a varargs function}0">;
8724 def err_implied_std_coroutine_traits_not_found : Error<
8725   "you need to include <experimental/coroutine> before defining a coroutine">;
8726 def err_malformed_std_coroutine_traits : Error<
8727   "'std::experimental::coroutine_traits' must be a class template">;
8728 def err_implied_std_coroutine_traits_promise_type_not_found : Error<
8729   "this function cannot be a coroutine: %q0 has no member named 'promise_type'">;
8730 def err_implied_std_coroutine_traits_promise_type_not_class : Error<
8731   "this function cannot be a coroutine: %0 is not a class">;
8732 def err_coroutine_traits_missing_specialization : Error<
8733   "this function cannot be a coroutine: missing definition of "
8734   "specialization %q0">;
8735 def err_implied_std_current_exception_not_found : Error<
8736   "you need to include <exception> before defining a coroutine that implicitly "
8737   "uses 'set_exception'">;
8738 def err_malformed_std_current_exception : Error<
8739   "'std::current_exception' must be a function">;
8740 def err_coroutine_promise_return_ill_formed : Error<
8741   "%0 declares both 'return_value' and 'return_void'">;
8742 }
8743
8744 let CategoryName = "Documentation Issue" in {
8745 def warn_not_a_doxygen_trailing_member_comment : Warning<
8746   "not a Doxygen trailing comment">, InGroup<Documentation>, DefaultIgnore;
8747 } // end of documentation issue category
8748
8749 let CategoryName = "Instrumentation Issue" in {
8750 def warn_profile_data_out_of_date : Warning<
8751   "profile data may be out of date: of %0 function%s0, %1 %plural{1:has|:have}1"
8752   " no data and %2 %plural{1:has|:have}2 mismatched data that will be ignored">,
8753   InGroup<ProfileInstrOutOfDate>;
8754 def warn_profile_data_unprofiled : Warning<
8755   "no profile data available for file \"%0\"">,
8756   InGroup<ProfileInstrUnprofiled>;
8757
8758 } // end of instrumentation issue category
8759
8760 let CategoryName = "Nullability Issue" in {
8761
8762 def warn_mismatched_nullability_attr : Warning<
8763   "nullability specifier %0 conflicts with existing specifier %1">,
8764   InGroup<Nullability>;
8765
8766 def warn_nullability_declspec : Warning<
8767   "nullability specifier %0 cannot be applied "
8768   "to non-pointer type %1; did you mean to apply the specifier to the "
8769   "%select{pointer|block pointer|member pointer|function pointer|"
8770   "member function pointer}2?">,
8771   InGroup<NullabilityDeclSpec>,
8772   DefaultError;
8773
8774 def note_nullability_here : Note<"%0 specified here">;
8775
8776 def err_nullability_nonpointer : Error<
8777   "nullability specifier %0 cannot be applied to non-pointer type %1">;
8778
8779 def warn_nullability_lost : Warning<
8780   "implicit conversion from nullable pointer %0 to non-nullable pointer "
8781   "type %1">,
8782   InGroup<NullableToNonNullConversion>, DefaultIgnore;
8783
8784 def err_nullability_cs_multilevel : Error<
8785   "nullability keyword %0 cannot be applied to multi-level pointer type %1">;
8786 def note_nullability_type_specifier : Note<
8787   "use nullability type specifier %0 to affect the innermost "
8788   "pointer type of %1">;
8789
8790 def warn_null_resettable_setter : Warning<
8791   "synthesized setter %0 for null_resettable property %1 does not handle nil">,
8792   InGroup<Nullability>;
8793
8794 def warn_nullability_missing : Warning<
8795   "%select{pointer|block pointer|member pointer}0 is missing a nullability "
8796   "type specifier (_Nonnull, _Nullable, or _Null_unspecified)">,
8797   InGroup<NullabilityCompleteness>;
8798 def warn_nullability_missing_array : Warning<
8799   "array parameter is missing a nullability type specifier (_Nonnull, "
8800   "_Nullable, or _Null_unspecified)">,
8801   InGroup<NullabilityCompletenessOnArrays>;
8802 def note_nullability_fix_it : Note<
8803   "insert '%select{_Nonnull|_Nullable|_Null_unspecified}0' if the "
8804   "%select{pointer|block pointer|member pointer|array parameter}1 "
8805   "%select{should never be null|may be null|should not declare nullability}0">;
8806
8807 def warn_nullability_inferred_on_nested_type : Warning<
8808   "inferring '_Nonnull' for pointer type within %select{array|reference}0 is "
8809   "deprecated">,
8810   InGroup<NullabilityInferredOnNestedType>;
8811
8812 def err_objc_type_arg_explicit_nullability : Error<
8813   "type argument %0 cannot explicitly specify nullability">;
8814
8815 def err_objc_type_param_bound_explicit_nullability : Error<
8816   "type parameter %0 bound %1 cannot explicitly specify nullability">;
8817
8818 }
8819
8820 let CategoryName = "Generics Issue" in {
8821
8822 def err_objc_type_param_bound_nonobject : Error<
8823   "type bound %0 for type parameter %1 is not an Objective-C pointer type">;
8824
8825 def err_objc_type_param_bound_missing_pointer : Error<
8826   "missing '*' in type bound %0 for type parameter %1">;
8827 def err_objc_type_param_bound_qualified : Error<
8828   "type bound %1 for type parameter %0 cannot be qualified with '%2'">;
8829
8830 def err_objc_type_param_redecl : Error<
8831   "redeclaration of type parameter %0">;
8832
8833 def err_objc_type_param_arity_mismatch : Error<
8834   "%select{forward class declaration|class definition|category|extension}0 has "
8835   "too %select{few|many}1 type parameters (expected %2, have %3)">;
8836
8837 def err_objc_type_param_bound_conflict : Error<
8838   "type bound %0 for type parameter %1 conflicts with "
8839   "%select{implicit|previous}2 bound %3%select{for type parameter %5|}4">;
8840
8841 def err_objc_type_param_variance_conflict : Error<
8842   "%select{in|co|contra}0variant type parameter %1 conflicts with previous "
8843   "%select{in|co|contra}2variant type parameter %3">;
8844
8845 def note_objc_type_param_here : Note<"type parameter %0 declared here">;
8846
8847 def err_objc_type_param_bound_missing : Error<
8848   "missing type bound %0 for type parameter %1 in %select{@interface|@class}2">;
8849
8850 def err_objc_parameterized_category_nonclass : Error<
8851   "%select{extension|category}0 of non-parameterized class %1 cannot have type "
8852   "parameters">;
8853
8854 def err_objc_parameterized_forward_class : Error<
8855   "forward declaration of non-parameterized class %0 cannot have type "
8856   "parameters">;
8857
8858 def err_objc_parameterized_forward_class_first : Error<
8859   "class %0 previously declared with type parameters">;
8860
8861 def err_objc_type_arg_missing_star : Error<
8862   "type argument %0 must be a pointer (requires a '*')">;
8863 def err_objc_type_arg_qualified : Error<
8864   "type argument %0 cannot be qualified with '%1'">;
8865
8866 def err_objc_type_arg_missing : Error<
8867   "no type or protocol named %0">;
8868
8869 def err_objc_type_args_and_protocols : Error<
8870   "angle brackets contain both a %select{type|protocol}0 (%1) and a "
8871   "%select{protocol|type}0 (%2)">;
8872
8873 def err_objc_type_args_non_class : Error<
8874   "type arguments cannot be applied to non-class type %0">;
8875
8876 def err_objc_type_args_non_parameterized_class : Error<
8877   "type arguments cannot be applied to non-parameterized class %0">;
8878
8879 def err_objc_type_args_specialized_class : Error<
8880   "type arguments cannot be applied to already-specialized class type %0">;
8881
8882 def err_objc_type_args_wrong_arity : Error<
8883   "too %select{many|few}0 type arguments for class %1 (have %2, expected %3)">;
8884 }
8885
8886 def err_objc_type_arg_not_id_compatible : Error<
8887   "type argument %0 is neither an Objective-C object nor a block type">;
8888
8889 def err_objc_type_arg_does_not_match_bound : Error<
8890   "type argument %0 does not satisfy the bound (%1) of type parameter %2">;
8891
8892 def warn_objc_redundant_qualified_class_type : Warning<
8893   "parameterized class %0 already conforms to the protocols listed; did you "
8894   "forget a '*'?">, InGroup<ObjCProtocolQualifiers>;
8895
8896 def warn_block_literal_attributes_on_omitted_return_type : Warning<
8897   "attribute %0 ignored, because it cannot be applied to omitted return type">,
8898   InGroup<IgnoredAttributes>;
8899
8900 def warn_block_literal_qualifiers_on_omitted_return_type : Warning<
8901   "'%0' qualifier on omitted return type %1 has no effect">,
8902   InGroup<IgnoredQualifiers>;
8903
8904 def ext_warn_gnu_final : ExtWarn<
8905   "__final is a GNU extension, consider using C++11 final">,
8906   InGroup<GccCompat>;
8907
8908 } // end of sema component.