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