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