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