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