]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td
MFC r227737:
[FreeBSD/stable/9.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 // Constant expressions
18 def err_expr_not_ice : Error<
19   "expression is not an integer constant expression">;
20 def ext_expr_not_ice : Extension<
21   "expression is not integer constant expression "
22   "(but is allowed as an extension)">;
23
24 // Semantic analysis of constant literals.
25 def ext_predef_outside_function : Warning<
26   "predefined identifier is only valid inside function">,
27   InGroup<DiagGroup<"predefined-identifier-outside-function">>;
28 def warn_float_overflow : Warning<
29   "magnitude of floating-point constant too large for type %0; maximum is %1">,
30    InGroup<LiteralRange>;
31 def warn_float_underflow : Warning<
32   "magnitude of floating-point constant too small for type %0; minimum is %1">,
33   InGroup<LiteralRange>;
34 def warn_double_const_requires_fp64 : Warning<
35   "double precision constant requires cl_khr_fp64, casting to single precision">;
36
37 // C99 variable-length arrays
38 def ext_vla : Extension<
39   "variable length arrays are a C99 feature, accepted as an extension">,
40   InGroup<VLA>;
41 def err_vla_non_pod : Error<"variable length array of non-POD element type %0">;
42 def err_vla_in_sfinae : Error<
43   "variable length array cannot be formed during template argument deduction">;
44 def err_array_star_in_function_definition : Error<
45   "variable length array must be bound in function definition">;
46 def err_vla_decl_in_file_scope : Error<
47   "variable length array declaration not allowed at file scope">;
48 def err_vla_decl_has_static_storage : Error<
49   "variable length array declaration can not have 'static' storage duration">;
50 def err_vla_decl_has_extern_linkage : Error<
51   "variable length array declaration can not have 'extern' linkage">;
52 def ext_vla_folded_to_constant : Extension<
53   "variable length array folded to constant array as an extension">;
54
55 // C99 variably modified types
56 def err_variably_modified_template_arg : Error<
57   "variably modified type %0 cannot be used as a template argument">;
58 def err_variably_modified_nontype_template_param : Error<
59   "non-type template parameter of variably modified type %0">;
60 def err_variably_modified_new_type : Error<
61   "'new' cannot allocate object of variably modified type %0">;
62
63 // C99 Designated Initializers
64 def ext_designated_init : Extension<
65   "designated initializers are a C99 feature">;
66 def ext_designated_init_cxx : Extension<
67   "designated initializers are a C99 feature, accepted in C++ as an extension">;
68 def err_array_designator_negative : Error<
69   "array designator value '%0' is negative">;
70 def err_array_designator_empty_range : Error<
71   "array designator range [%0, %1] is empty">;
72 def err_array_designator_non_array : Error<
73   "array designator cannot initialize non-array type %0">;
74 def err_array_designator_too_large : Error<
75   "array designator index (%0) exceeds array bounds (%1)">;
76 def err_field_designator_non_aggr : Error<
77   "field designator cannot initialize a "
78   "%select{non-struct, non-union|non-class}0 type %1">;
79 def err_field_designator_unknown : Error<
80   "field designator %0 does not refer to any field in type %1">;
81 def err_field_designator_nonfield : Error<
82   "field designator %0 does not refer to a non-static data member">;
83 def note_field_designator_found : Note<"field designator refers here">;
84 def err_designator_for_scalar_init : Error<
85   "designator in initializer for scalar type %0">;
86 def warn_subobject_initializer_overrides : Warning<
87   "subobject initialization overrides initialization of other fields "
88   "within its enclosing subobject">, InGroup<InitializerOverrides>;
89 def warn_initializer_overrides : Warning<
90   "initializer overrides prior initialization of this subobject">,
91   InGroup<InitializerOverrides>;
92 def note_previous_initializer : Note<
93   "previous initialization %select{|with side effects }0is here"
94   "%select{| (side effects may not occur at run time)}0">;
95 def err_designator_into_flexible_array_member : Error<
96   "designator into flexible array member subobject">;
97 def note_flexible_array_member : Note<
98   "initialized flexible array member %0 is here">;
99 def ext_flexible_array_init : Extension<
100   "flexible array initialization is a GNU extension">, InGroup<GNU>;
101
102 // Declarations.
103 def ext_anon_param_requires_type_specifier : Extension<
104   "type specifier required for unnamed parameter, defaults to int">;
105 def err_bad_variable_name : Error<
106   "%0 cannot be the name of a variable or data member">;
107 def err_bad_parameter_name : Error<
108   "'%0' cannot be the name of a parameter">;
109 def err_parameter_name_omitted : Error<"parameter name omitted">;
110 def warn_unused_parameter : Warning<"unused parameter %0">,
111   InGroup<UnusedParameter>, DefaultIgnore;
112 def warn_unused_variable : Warning<"unused variable %0">,
113   InGroup<UnusedVariable>, DefaultIgnore;
114 def warn_unused_exception_param : Warning<"unused exception parameter %0">,
115   InGroup<UnusedExceptionParameter>, DefaultIgnore;
116 def warn_decl_in_param_list : Warning<
117   "declaration of %0 will not be visible outside of this function">;
118 def warn_unused_function : Warning<"unused function %0">,
119   InGroup<UnusedFunction>, DefaultIgnore;
120 def warn_unused_member_function : Warning<"unused member function %0">,
121   InGroup<UnusedMemberFunction>, DefaultIgnore;
122 def warn_used_but_marked_unused: Warning<"%0 was marked unused but was used">,
123   InGroup<UsedButMarkedUnused>, DefaultIgnore;
124 def warn_unneeded_internal_decl : Warning<
125   "%select{function|variable}0 %1 is not needed and will not be emitted">,
126   InGroup<UnneededInternalDecl>, DefaultIgnore;
127 def warn_unneeded_member_function : Warning<
128   "member function %0 is not needed and will not be emitted">,
129   InGroup<UnneededMemberFunction>, DefaultIgnore;
130
131 def warn_parameter_size: Warning<
132   "%0 is a large (%1 bytes) pass-by-value argument; "
133   "pass it by reference instead ?">, InGroup<LargeByValueCopy>;
134 def warn_return_value_size: Warning<
135   "return value of %0 is a large (%1 bytes) pass-by-value object; "
136   "pass it by reference instead ?">, InGroup<LargeByValueCopy>;
137
138 def warn_implicit_function_decl : Warning<
139   "implicit declaration of function %0">,
140   InGroup<ImplicitFunctionDeclare>, DefaultIgnore;
141 def ext_implicit_function_decl : ExtWarn<
142   "implicit declaration of function %0 is invalid in C99">,
143   InGroup<ImplicitFunctionDeclare>;
144
145 def err_ellipsis_first_arg : Error<
146   "ISO C requires a named argument before '...'">;
147 def err_declarator_need_ident : Error<"declarator requires an identifier">;
148 def err_bad_language : Error<"unknown linkage language">;
149 def warn_use_out_of_scope_declaration : Warning<
150   "use of out-of-scope declaration of %0">;
151 def err_inline_non_function : Error<
152   "'inline' can only appear on functions">;
153 def warn_qual_return_type : Warning< 
154   "'%0' type qualifier%s1 on return type %plural{1:has|:have}1 no effect">,
155   InGroup<IgnoredQualifiers>, DefaultIgnore;
156
157 def warn_decl_shadow :
158   Warning<"declaration shadows a %select{"
159           "local variable|"
160           "variable in %2|"
161           "static data member of %2|"
162           "field of %2}1">,
163   InGroup<Shadow>, DefaultIgnore;
164
165 // C++ using declarations
166 def err_using_requires_qualname : Error<
167   "using declaration requires a qualified name">;
168 def err_using_typename_non_type : Error<
169   "'typename' keyword used on a non-type">;
170 def err_using_dependent_value_is_type : Error<
171   "dependent using declaration resolved to type without 'typename'">;
172 def err_using_decl_nested_name_specifier_is_not_class : Error<
173   "using declaration in class refers into '%0', which is not a class">;
174 def err_using_decl_nested_name_specifier_is_current_class : Error<
175   "using declaration refers to its own class">;
176 def err_using_decl_nested_name_specifier_is_not_base_class : Error<
177   "using declaration refers into '%0', which is not a base class of %1">;
178 def err_using_decl_constructor_not_in_direct_base : Error<
179   "%0 is not a direct base of %1, can not inherit constructors">;
180 def err_using_decl_constructor_conflict : Error<
181   "can not inherit constructor, already inherited constructor with "
182   "the same signature">;
183 def note_using_decl_constructor_conflict_current_ctor : Note<
184   "conflicting constructor">;
185 def note_using_decl_constructor_conflict_previous_ctor : Note<
186   "previous constructor">;
187 def note_using_decl_constructor_conflict_previous_using : Note<
188   "previously inherited here">;
189 def err_using_decl_can_not_refer_to_class_member : Error<
190   "using declaration can not refer to class member">;
191 def err_using_decl_can_not_refer_to_namespace : Error<
192   "using declaration can not refer to namespace">;
193 def err_using_decl_constructor : Error<
194   "using declaration can not refer to a constructor">;
195 def err_using_decl_destructor : Error<
196   "using declaration can not refer to a destructor">;
197 def err_using_decl_template_id : Error<
198   "using declaration can not refer to a template specialization">;
199 def note_using_decl_target : Note<"target of using declaration">;
200 def note_using_decl_conflict : Note<"conflicting declaration">;
201 def err_using_decl_redeclaration : Error<"redeclaration of using decl">;
202 def err_using_decl_conflict : Error<
203   "target of using declaration conflicts with declaration already in scope">;
204 def err_using_decl_conflict_reverse : Error<
205   "declaration conflicts with target of using declaration already in scope">;
206 def note_using_decl : Note<"%select{|previous }0using declaration">;
207
208 def warn_access_decl_deprecated : Warning<
209   "access declarations are deprecated; use using declarations instead">,
210   InGroup<Deprecated>;
211
212 def warn_global_constructor : Warning<
213   "declaration requires a global constructor">,
214   InGroup<GlobalConstructors>, DefaultIgnore;
215 def warn_global_destructor : Warning<
216   "declaration requires a global destructor">,
217    InGroup<GlobalConstructors>, DefaultIgnore;
218 def warn_exit_time_destructor : Warning<
219   "declaration requires an exit-time destructor">,
220   InGroup<ExitTimeDestructors>, DefaultIgnore;
221
222 def err_invalid_thread : Error<
223   "'__thread' is only allowed on variable declarations">;
224 def err_thread_non_global : Error<
225   "'__thread' variables must have global storage">;
226 def err_thread_unsupported : Error<
227   "thread-local storage is unsupported for the current target">;
228
229 def warn_maybe_falloff_nonvoid_function : Warning<
230   "control may reach end of non-void function">,
231   InGroup<ReturnType>;
232 def warn_falloff_nonvoid_function : Warning<
233   "control reaches end of non-void function">,
234   InGroup<ReturnType>;
235 def err_maybe_falloff_nonvoid_block : Error<
236   "control may reach end of non-void block">;
237 def err_falloff_nonvoid_block : Error<
238   "control reaches end of non-void block">;
239 def warn_suggest_noreturn_function : Warning<
240   "%select{function|method}0 %1 could be declared with attribute 'noreturn'">,
241   InGroup<DiagGroup<"missing-noreturn">>, DefaultIgnore;
242 def warn_suggest_noreturn_block : Warning<
243   "block could be declared with attribute 'noreturn'">,
244   InGroup<DiagGroup<"missing-noreturn">>, DefaultIgnore;
245 def warn_unreachable : Warning<"will never be executed">,
246   InGroup<DiagGroup<"unreachable-code">>, DefaultIgnore;
247
248 /// Built-in functions.
249 def ext_implicit_lib_function_decl : ExtWarn<
250   "implicitly declaring C library function '%0' with type %1">;
251 def note_please_include_header : Note<
252   "please include the header <%0> or explicitly provide a "
253   "declaration for '%1'">;
254 def note_previous_builtin_declaration : Note<"%0 is a builtin with type %1">;
255 def warn_implicit_decl_requires_stdio : Warning<
256   "declaration of built-in function '%0' requires inclusion of the header "
257   "<stdio.h>">,
258   InGroup<BuiltinRequiresHeader>;
259 def warn_implicit_decl_requires_setjmp : Warning<
260   "declaration of built-in function '%0' requires inclusion of the header "
261   "<setjmp.h>">,
262   InGroup<BuiltinRequiresHeader>;
263 def warn_implicit_decl_requires_ucontext : Warning<
264   "declaration of built-in function '%0' requires inclusion of the header "
265   "<ucontext.h>">,
266   InGroup<BuiltinRequiresHeader>;
267 def warn_redecl_library_builtin : Warning<
268   "incompatible redeclaration of library function %0">;
269 def err_builtin_definition : Error<"definition of builtin function %0">;
270 def err_types_compatible_p_in_cplusplus : Error<
271   "__builtin_types_compatible_p is not valid in C++">;
272 def warn_builtin_unknown : Warning<"use of unknown builtin %0">, DefaultError;
273 def warn_dyn_class_memaccess : Warning<
274   "%select{destination for|source of|first operand of|second operand of}0 this "
275   "%1 call is a pointer to dynamic class %2; vtable pointer will be "
276   "%select{overwritten|copied|moved|compared}3">,
277   InGroup<DiagGroup<"dynamic-class-memaccess">>;
278 def note_bad_memaccess_silence : Note<
279   "explicitly cast the pointer to silence this warning">;
280 def warn_sizeof_pointer_expr_memaccess : Warning<
281   "argument to 'sizeof' in %0 call is the same expression as the "
282   "%select{destination|source}1; did you mean to "
283   "%select{dereference it|remove the addressof|provide an explicit length}2?">,
284   InGroup<DiagGroup<"sizeof-pointer-memaccess">>;
285 def warn_sizeof_pointer_type_memaccess : Warning<
286   "argument to 'sizeof' in %0 call is the same pointer type %1 as the "
287   "%select{destination|source}2; expected %3 or an explicit length">,
288   InGroup<DiagGroup<"sizeof-pointer-memaccess">>;
289 def warn_strlcpycat_wrong_size : Warning<
290   "size argument in %0 call appears to be size of the source; expected the size of "
291   "the destination">,
292   InGroup<DiagGroup<"strlcpy-strlcat-size">>;
293 def note_strlcpycat_wrong_size : Note<
294   "change size argument to be the size of the destination">;
295
296 /// main()
297 // static/inline main() are not errors in C, just in C++.
298 def warn_static_main : Warning<"'main' should not be declared static">,
299     InGroup<Main>;
300 def err_static_main : Error<"'main' is not allowed to be declared static">;
301 def err_inline_main : Error<"'main' is not allowed to be declared inline">;
302 def err_main_template_decl : Error<"'main' cannot be a template">;
303 def err_main_returns_nonint : Error<"'main' must return 'int'">;
304 def err_main_surplus_args : Error<"too many parameters (%0) for 'main': "
305     "must be 0, 2, or 3">;
306 def warn_main_one_arg : Warning<"only one parameter on 'main' declaration">,
307     InGroup<Main>;
308 def err_main_arg_wrong : Error<"%select{first|second|third|fourth}0 "
309     "parameter of 'main' (%select{argument count|argument array|environment|"
310     "platform-specific data}0) must be of type %1">;
311
312 /// parser diagnostics
313 def ext_typedef_without_a_name : ExtWarn<"typedef requires a name">,
314   InGroup<MissingDeclarations>;
315 def err_typedef_not_identifier : Error<"typedef name must be an identifier">;
316 def err_statically_allocated_object : Error<
317   "interface type cannot be statically allocated">;
318 def err_object_cannot_be_passed_returned_by_value : Error<
319   "interface type %1 cannot be %select{returned|passed}0 by value"
320   "; did you forget * in %1">;
321 def err_parameters_retval_cannot_have_fp16_type : Error<
322   "%select{parameters|function return value}0 cannot have __fp16 type; did you forget * ?">;
323 def warn_enum_value_overflow : Warning<"overflow in enumeration value">;
324 def warn_pragma_options_align_unsupported_option : Warning<
325   "unsupported alignment option in '#pragma options align'">;
326 def warn_pragma_options_align_reset_failed : Warning<
327   "#pragma options align=reset failed: %0">;
328 def err_pragma_options_align_mac68k_target_unsupported : Error<
329   "mac68k alignment pragma is not supported on this target">;
330 def warn_pragma_pack_invalid_alignment : Warning<
331   "expected #pragma pack parameter to be '1', '2', '4', '8', or '16'">;
332 // Follow the MSVC implementation.
333 def warn_pragma_pack_show : Warning<"value of #pragma pack(show) == %0">;
334 def warn_pragma_pack_pop_identifer_and_alignment : Warning<
335   "specifying both a name and alignment to 'pop' is undefined">;
336 def warn_pragma_pack_pop_failed : Warning<"#pragma pack(pop, ...) failed: %0">;
337
338 def warn_pragma_unused_undeclared_var : Warning<
339   "undeclared variable %0 used as an argument for '#pragma unused'">;
340 def warn_pragma_unused_expected_var_arg : Warning<
341   "only variables can be arguments to '#pragma unused'">;
342 def err_unsupported_pragma_weak : Error<
343   "using '#pragma weak' to refer to an undeclared identifier is not yet supported">;
344
345 /// Objective-C parser diagnostics
346 def err_duplicate_class_def : Error<
347   "duplicate interface definition for class %0">;
348 def err_undef_superclass : Error<
349   "cannot find interface declaration for %0, superclass of %1">;
350 def err_forward_superclass : Error<
351   "attempting to use the forward class %0 as superclass of %1">;
352 def err_no_nsconstant_string_class : Error<
353   "cannot find interface declaration for %0">;
354 def err_recursive_superclass : Error<
355   "trying to recursively use %0 as superclass of %1">;
356 def warn_previous_alias_decl : Warning<"previously declared alias is ignored">;
357 def err_conflicting_aliasing_type : Error<"conflicting types for alias %0">;
358 def warn_undef_interface : Warning<"cannot find interface declaration for %0">;
359 def warn_duplicate_protocol_def : Warning<"duplicate protocol definition of %0 is ignored">;
360 def err_protocol_has_circular_dependency : Error<
361   "protocol has circular dependency">;
362 def err_undeclared_protocol : Error<"cannot find protocol declaration for %0">;
363 def warn_undef_protocolref : Warning<"cannot find protocol definition for %0">;
364 def warn_readonly_property : Warning<
365   "attribute 'readonly' of property %0 restricts attribute "
366   "'readwrite' of property inherited from %1">;
367
368 def warn_property_attribute : Warning<
369   "property %0 '%1' attribute does not match the property inherited from %2">;
370 def warn_property_types_are_incompatible : Warning<
371   "property type %0 is incompatible with type %1 inherited from %2">;
372 def err_undef_interface : Error<"cannot find interface declaration for %0">;
373 def err_class_extension_after_impl : Error<
374   "cannot declare class extension for %0 after class implementation">;
375 def note_implementation_declared : Note<
376   "class implementation is declared here">;
377 def note_class_declared : Note<
378   "class is declared here">;
379 def warn_dup_category_def : Warning<
380   "duplicate definition of category %1 on interface %0">;
381 def err_conflicting_super_class : Error<"conflicting super class name %0">;
382 def err_dup_implementation_class : Error<"reimplementation of class %0">;
383 def err_dup_implementation_category : Error<
384   "reimplementation of category %1 for class %0">;
385 def err_conflicting_ivar_type : Error<
386   "instance variable %0 has conflicting type: %1 vs %2">;
387 def err_duplicate_ivar_declaration : Error<
388   "instance variable is already declared">;
389 def warn_on_superclass_use : Warning<
390   "class implementation may not have super class">;
391 def err_conflicting_ivar_bitwidth : Error<
392   "instance variable %0 has conflicting bit-field width">;
393 def err_conflicting_ivar_name : Error<
394   "conflicting instance variable names: %0 vs %1">;
395 def err_inconsistant_ivar_count : Error<
396   "inconsistent number of instance variables specified">;
397 def warn_incomplete_impl : Warning<"incomplete implementation">,
398   InGroup<DiagGroup<"incomplete-implementation">>;
399 def note_undef_method_impl : Note<"method definition for %0 not found">;
400 def note_required_for_protocol_at : 
401   Note<"required for direct or indirect protocol %0">;
402
403 def warn_conflicting_overriding_ret_types : Warning<
404   "conflicting return type in "
405   "declaration of %0: %1 vs %2">,
406   InGroup<OverridingMethodMismatch>, DefaultIgnore;
407
408 def warn_conflicting_ret_types : Warning<
409   "conflicting return type in "
410   "implementation of %0: %1 vs %2">;
411
412 def warn_conflicting_overriding_ret_type_modifiers : Warning<
413   "conflicting distributed object modifiers on return type "
414   "in declaration of %0">,
415   InGroup<OverridingMethodMismatch>, DefaultIgnore;
416
417 def warn_conflicting_ret_type_modifiers : Warning<
418   "conflicting distributed object modifiers on return type "
419   "in implementation of %0">,
420   InGroup<DiagGroup<"distributed-object-modifiers">>;
421
422 def warn_non_covariant_overriding_ret_types : Warning<
423   "conflicting return type in "
424   "declaration of %0: %1 vs %2">,
425   InGroup<OverridingMethodMismatch>, DefaultIgnore;
426
427 def warn_non_covariant_ret_types : Warning<
428   "conflicting return type in "
429   "implementation of %0: %1 vs %2">,
430   InGroup<DiagGroup<"method-signatures">>, DefaultIgnore;
431
432 def warn_conflicting_overriding_param_types : Warning<
433   "conflicting parameter types in "
434   "declaration of %0: %1 vs %2">,
435   InGroup<OverridingMethodMismatch>, DefaultIgnore;
436
437 def warn_conflicting_param_types : Warning<
438   "conflicting parameter types in "
439   "implementation of %0: %1 vs %2">;
440 def warn_conflicting_param_modifiers : Warning<
441   "conflicting distributed object modifiers on parameter type "
442   "in implementation of %0">,
443   InGroup<DiagGroup<"distributed-object-modifiers">>;
444
445 def warn_conflicting_overriding_param_modifiers : Warning<
446   "conflicting distributed object modifiers on parameter type "
447   "in declaration of %0">,
448   InGroup<OverridingMethodMismatch>, DefaultIgnore;
449
450 def warn_non_contravariant_overriding_param_types : Warning<
451   "conflicting parameter types in "
452   "declaration of %0: %1 vs %2">,
453   InGroup<OverridingMethodMismatch>, DefaultIgnore;
454
455 def warn_non_contravariant_param_types : Warning<
456   "conflicting parameter types in "
457   "implementation of %0: %1 vs %2">,
458   InGroup<DiagGroup<"method-signatures">>, DefaultIgnore;
459
460 def warn_conflicting_overriding_variadic :Warning<
461   "conflicting variadic declaration of method and its "
462   "implementation">,
463   InGroup<OverridingMethodMismatch>, DefaultIgnore;
464
465 def warn_conflicting_variadic :Warning<
466   "conflicting variadic declaration of method and its "
467   "implementation">;
468
469 def warn_category_method_impl_match:Warning<
470   "category is implementing a method which will also be implemented"
471   " by its primary class">, InGroup<ObjCProtocolMethodImpl>;
472
473 def warn_implements_nscopying : Warning<
474 "default assign attribute on property %0 which implements "
475 "NSCopying protocol is not appropriate with -fobjc-gc[-only]">;
476
477 def warn_multiple_method_decl : Warning<"multiple methods named %0 found">;
478 def warn_strict_multiple_method_decl : Warning<
479   "multiple methods named %0 found">, InGroup<StrictSelector>, DefaultIgnore;
480 def warn_accessor_property_type_mismatch : Warning<
481   "type of property %0 does not match type of accessor %1">;
482 def note_declared_at : Note<"declared here">;
483 def note_method_declared_at : Note<"method declared here">;
484 def err_setter_type_void : Error<"type of setter must be void">;
485 def err_duplicate_method_decl : Error<"duplicate declaration of method %0">;
486 def err_missing_atend : Error<"'@end' is missing in implementation context">;
487 def err_objc_var_decl_inclass : 
488     Error<"cannot declare variable inside @interface or @protocol">;
489 def error_missing_method_context : Error<
490   "missing context for method declaration">;
491 def err_objc_property_attr_mutually_exclusive : Error<
492   "property attributes '%0' and '%1' are mutually exclusive">;
493 def err_objc_property_requires_object : Error<
494   "property with '%0' attribute must be of object type">;
495 def warn_objc_property_no_assignment_attribute : Warning<
496   "no 'assign', 'retain', or 'copy' attribute is specified - "
497   "'assign' is assumed">;
498 def warn_objc_property_default_assign_on_object : Warning<
499   "default property attribute 'assign' not appropriate for non-gc object">;
500 def warn_property_attr_mismatch : Warning<
501   "property attribute in continuation class does not match the primary class">;
502 def warn_objc_property_copy_missing_on_block : Warning<
503     "'copy' attribute must be specified for the block property "
504     "when -fobjc-gc-only is specified">;
505 def warn_objc_property_retain_of_block : Warning<
506     "retain'ed block property does not copy the block "
507     "- use copy attribute instead">, InGroup<ObjCRetainBlockProperty>;
508 def warn_atomic_property_rule : Warning<
509   "writable atomic property %0 cannot pair a synthesized %select{getter|setter}1 "
510   "with a user defined %select{getter|setter}2">,
511   InGroup<DiagGroup<"atomic-property-with-user-defined-accessor">>;
512 def note_atomic_property_fixup_suggest : Note<"setter and getter must both be "
513   "synthesized, or both be user defined,or the property must be nonatomic">;
514 def warn_atomic_property_nontrivial_assign_op : Warning<
515   "atomic property of type %0 synthesizing setter using non-trivial assignment"
516   " operator">, InGroup<DiagGroup<"objc-property-atomic-setter-synthesis">>;
517 def warn_owning_getter_rule : Warning<
518   "property's synthesized getter follows Cocoa naming"
519   " convention for returning 'owned' objects">,
520   InGroup<DiagGroup<"objc-property-matches-cocoa-ownership-rule">>;
521 def warn_property_getter_owning_mismatch : Warning<
522   "property declared as returning non-retained objects"
523   "; getter returning retained objects">;
524 def err_ownin_getter_rule : Error<
525   "property's synthesized getter follows Cocoa naming"
526   " convention for returning 'owned' objects">;
527 def warn_default_atomic_custom_getter_setter : Warning<
528   "atomic by default property %0 has a user defined %select{getter|setter}1 "
529   "(property should be marked 'atomic' if this is intended)">,
530   InGroup<CustomAtomic>, DefaultIgnore;
531 def err_use_continuation_class : Error<
532   "illegal redeclaration of property in continuation class %0"
533   " (attribute must be 'readwrite', while its primary must be 'readonly')">;
534 def warn_type_mismatch_continuation_class : Warning<
535   "type of property %0 in continuation class does not match "
536   "property type in primary class">, InGroup<ObjCContinuationPropertyType>;
537 def err_use_continuation_class_redeclaration_readwrite : Error<
538   "illegal redeclaration of 'readwrite' property in continuation class %0"
539   " (perhaps you intended this to be a 'readwrite' redeclaration of a "
540   "'readonly' public property?)">;
541 def err_continuation_class : Error<"continuation class has no primary class">;
542 def err_property_type : Error<"property cannot have array or function type %0">;
543 def error_missing_property_context : Error<
544   "missing context for property implementation declaration">;
545 def error_bad_property_decl : Error<
546   "property implementation must have its declaration in interface %0">;
547 def error_category_property : Error<
548   "property declared in category %0 cannot be implemented in "
549   "class implementation">;
550 def note_property_declare : Note<
551   "property declared here">;
552 def error_synthesize_category_decl : Error<
553   "@synthesize not allowed in a category's implementation">;
554 def error_reference_property : Error<
555   "property of reference type is not supported">;
556 def error_missing_property_interface : Error<
557   "property implementation in a category with no category declaration">;
558 def error_bad_category_property_decl : Error<
559   "property implementation must have its declaration in the category %0">;
560 def error_bad_property_context : Error<
561   "property implementation must be in a class or category implementation">;
562 def error_missing_property_ivar_decl : Error<
563   "synthesized property %0 must either be named the same as a compatible"
564   " ivar or must explicitly name an ivar">;
565 def error_synthesize_weak_non_arc_or_gc : Error<
566   "@synthesize of 'weak' property is only allowed in ARC or GC mode">;
567 def err_arc_perform_selector_retains : Error<
568   "performSelector names a selector which retains the object">;
569 def warn_arc_perform_selector_leaks : Warning<
570   "performSelector may cause a leak because its selector is unknown">,
571   InGroup<DiagGroup<"arc-performSelector-leaks">>;
572 def err_gc_weak_property_strong_type : Error<
573   "weak attribute declared on a __strong type property in GC mode">;
574
575 def error_synthesized_ivar_yet_not_supported : Error<
576   "instance variable synthesis not yet supported"
577   " (need to declare %0 explicitly)">;
578
579 def error_property_ivar_type : Error<
580   "type of property %0 (%1) does not match type of ivar %2 (%3)">;
581 def error_ivar_in_superclass_use : Error<
582   "property %0 attempting to use ivar %1 declared in super class %2">;
583 def error_weak_property : Error<
584   "existing ivar %1 for __weak property %0 must be __weak">;
585 def error_strong_property : Error<
586   "existing ivar %1 for strong property %0 may not be __weak">;
587 def error_dynamic_property_ivar_decl : Error<
588   "dynamic property can not have ivar specification">;
589 def error_duplicate_ivar_use : Error<
590   "synthesized properties %0 and %1 both claim ivar %2">;
591 def error_property_implemented : Error<"property %0 is already implemented">;
592 def warn_objc_property_attr_mutually_exclusive : Warning<
593   "property attributes '%0' and '%1' are mutually exclusive">,
594   InGroup<ReadOnlySetterAttrs>, DefaultIgnore;
595 def warn_objc_missing_super_dealloc : Warning<
596   "method possibly missing a [super dealloc] call">,
597   InGroup<ObjCMissingSuperCalls>;
598 def warn_objc_missing_super_finalize : Warning<
599   "method possibly missing a [super finalize] call">,
600   InGroup<ObjCMissingSuperCalls>;
601 def warn_undeclared_selector : Warning<
602   "undeclared selector %0">, InGroup<UndeclaredSelector>, DefaultIgnore;
603 def warn_implicit_atomic_property : Warning<
604   "property is assumed atomic by default">, InGroup<ImplicitAtomic>, DefaultIgnore;
605 def warn_auto_implicit_atomic_property : Warning<
606   "property is assumed atomic when auto-synthesizing the property">, 
607   InGroup<ImplicitAtomic>, DefaultIgnore;
608 def warn_unimplemented_selector:  Warning<
609   "unimplemented selector %0">, InGroup<Selector>, DefaultIgnore;
610 def warn_unimplemented_protocol_method : Warning<
611   "method in protocol not implemented">, InGroup<Protocol>;
612
613 // C++ declarations
614 def err_static_assert_expression_is_not_constant : Error<
615   "static_assert expression is not an integral constant expression">;
616 def err_static_assert_failed : Error<"static_assert failed \"%0\"">;
617
618 def warn_inline_namespace_reopened_noninline : Warning<
619   "inline namespace cannot be re-opened as a non-inline namespace">;
620 def err_inline_namespace_mismatch : Error<
621   "%select{|non-}0inline namespace "
622   "cannot be reopened as %select{non-|}0inline">;
623
624 def err_unexpected_friend : Error<
625   "friends can only be classes or functions">;
626 def ext_enum_friend : ExtWarn<
627   "enumeration type %0 cannot be a friend">;
628 def ext_nonclass_type_friend : ExtWarn<
629   "non-class friend type %0 is a C++11 extension">, InGroup<CXX11>;
630 def err_friend_is_member : Error<
631   "friends cannot be members of the declaring class">;
632 def ext_unelaborated_friend_type : ExtWarn<
633   "specify '%select{struct|union|class|enum}0' to befriend %1; accepted "
634   "as a C++11 extension">, InGroup<CXX11>;
635 def err_qualified_friend_not_found : Error<
636   "no function named %0 with type %1 was found in the specified scope">;
637 def err_introducing_special_friend : Error<
638   "must use a qualified name when declaring a %select{constructor|"
639   "destructor|conversion operator}0 as a friend">;
640 def err_tagless_friend_type_template : Error<
641   "friend type templates must use an elaborated type">;
642 def err_no_matching_local_friend : Error<
643   "no matching function found in local scope">;
644 def err_no_matching_local_friend_suggest : Error<
645   "no matching function %0 found in local scope; did you mean %2">;
646 def err_partial_specialization_friend : Error<
647   "partial specialization cannot be declared as a friend">;
648 def err_qualified_friend_def : Error<
649   "friend function definition cannot be qualified with '%0'">;
650 def err_friend_def_in_local_class : Error<
651   "friend function cannot be defined in a local class">;
652   
653 def err_abstract_type_in_decl : Error<
654   "%select{return|parameter|variable|field}0 type %1 is an abstract class">;
655 def err_allocation_of_abstract_type : Error<
656   "allocating an object of abstract class type %0">;
657 def err_throw_abstract_type : Error<
658   "cannot throw an object of abstract type %0">;
659 def err_array_of_abstract_type : Error<"array of abstract class type %0">;
660
661 def err_multiple_final_overriders : Error<
662   "virtual function %q0 has more than one final overrider in %1">; 
663 def note_final_overrider : Note<"final overrider of %q0 in %1">;
664
665 def err_type_defined_in_type_specifier : Error<
666   "%0 can not be defined in a type specifier">;
667 def err_type_defined_in_result_type : Error<
668   "%0 can not be defined in the result type of a function">;
669 def err_type_defined_in_param_type : Error<
670   "%0 can not be defined in a parameter type">;
671 def err_type_defined_in_alias_template : Error<
672   "%0 can not be defined in a type alias template">;
673
674 def note_pure_virtual_function : Note<
675   "unimplemented pure virtual method %0 in %1">;
676
677 def err_deleted_decl_not_first : Error<
678   "deleted definition must be first declaration">;
679
680 def warn_weak_vtable : Warning<
681   "%0 has no out-of-line virtual method definitions; its vtable will be "
682   "emitted in every translation unit">,
683   InGroup<DiagGroup<"weak-vtables">>, DefaultIgnore;
684
685 def ext_using_undefined_std : ExtWarn<
686   "using directive refers to implicitly-defined namespace 'std'">;
687   
688 // C++ exception specifications
689 def err_exception_spec_in_typedef : Error<
690   "exception specifications are not allowed in %select{typedefs|type aliases}0">;
691 def err_distant_exception_spec : Error<
692   "exception specifications are not allowed beyond a single level "
693   "of indirection">;
694 def err_incomplete_in_exception_spec : Error<
695   "%select{|pointer to |reference to }0incomplete type %1 is not allowed "
696   "in exception specification">;
697 def err_mismatched_exception_spec : Error<
698   "exception specification in declaration does not match previous declaration">;
699 def warn_mismatched_exception_spec : ExtWarn<
700   "exception specification in declaration does not match previous declaration">;
701 def err_override_exception_spec : Error<
702   "exception specification of overriding function is more lax than "
703   "base version">;
704 def warn_override_exception_spec : ExtWarn<
705   "exception specification of overriding function is more lax than "
706   "base version">, InGroup<Microsoft>;
707 def err_incompatible_exception_specs : Error<
708   "target exception specification is not superset of source">;
709 def err_deep_exception_specs_differ : Error<
710   "exception specifications of %select{return|argument}0 types differ">;
711 def warn_missing_exception_specification : Warning<
712   "%0 is missing exception specification '%1'">;
713 def err_noexcept_needs_constant_expression : Error<
714   "argument to noexcept specifier must be a constant expression">;
715 def err_exception_spec_unknown : Error<
716   "exception specification is not available until end of class definition">;
717
718 // C++ access checking
719 def err_class_redeclared_with_different_access : Error<
720   "%0 redeclared with '%1' access">;
721 def err_access : Error<
722   "%1 is a %select{private|protected}0 member of %3">, AccessControl;
723 def war_ms_using_declaration_inaccessible : ExtWarn<
724   "using declaration refers to inaccessible member '%0', which refers "
725   "to accessible member '%1', accepted for Microsoft compatibility">,
726     AccessControl, InGroup<Microsoft>;
727 def err_access_ctor : Error<
728   "calling a %select{private|protected}0 constructor of class %2">, 
729   AccessControl;
730 def ext_rvalue_to_reference_access_ctor : ExtWarn<
731   "C++98 requires an accessible copy constructor for class %2 when binding "
732   "a reference to a temporary; was %select{private|protected}0">,
733   AccessControl, InGroup<BindToTemporaryCopy>;
734 def err_access_base_ctor : Error<
735   // The ERRORs represent other special members that aren't constructors, in
736   // hopes that someone will bother noticing and reporting if they appear
737   "%select{base class|inherited virtual base class}0 %1 has %select{private|"
738   "protected}3 %select{default |copy |move |*ERROR* |*ERROR* "
739   "|*ERROR*|}2constructor">, AccessControl;
740 def err_access_field_ctor : Error<
741   // The ERRORs represent other special members that aren't constructors, in
742   // hopes that someone will bother noticing and reporting if they appear
743   "field of type %0 has %select{private|protected}2 "
744   "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}1constructor">,
745   AccessControl;
746
747 def err_access_ctor_field :
748     Error<"field of type %1 has %select{private|protected}2 constructor">,
749     AccessControl;
750 def err_access_dtor : Error<
751   "calling a %select{private|protected}1 destructor of class %0">, 
752   AccessControl;
753 def err_access_dtor_base :
754     Error<"base class %0 has %select{private|protected}1 destructor">,
755     AccessControl;
756 def err_access_dtor_vbase :
757     Error<"inherited virtual base class %0 has "
758     "%select{private|protected}1 destructor">,
759     AccessControl;
760 def err_access_dtor_temp :
761     Error<"temporary of type %0 has %select{private|protected}1 destructor">,
762     AccessControl;
763 def err_access_dtor_exception :
764     Error<"exception object of type %0 has %select{private|protected}1 "
765           "destructor">, AccessControl;
766 def err_access_dtor_field :
767     Error<"field of type %1 has %select{private|protected}2 destructor">,
768     AccessControl;
769 def err_access_dtor_var :
770     Error<"variable of type %1 has %select{private|protected}2 destructor">,
771     AccessControl;
772 def err_access_assign_field :
773     Error<"field of type %1 has %select{private|protected}2 copy assignment"
774           " operator">,
775     AccessControl;
776 def err_access_assign_base :
777     Error<"base class %0 has %select{private|protected}1 copy assignment"
778           " operator">,
779     AccessControl;
780 def err_access_copy_field :
781     Error<"field of type %1 has %select{private|protected}2 copy constructor">,
782     AccessControl;
783 def err_access_copy_base :
784     Error<"base class %0 has %select{private|protected}1 copy constructor">,
785     AccessControl;
786 def err_access_dtor_ivar :
787     Error<"instance variable of type %0 has %select{private|protected}1 "
788           "destructor">,
789     AccessControl;
790 def note_previous_access_declaration : Note<
791   "previously declared '%1' here">;
792 def err_access_outside_class : Error<
793   "access to %select{private|protected}0 member outside any class context">,
794   AccessControl;
795 def note_access_natural : Note<
796   "%select{|implicitly }1declared %select{private|protected}0 here">;
797 def note_access_constrained_by_path : Note<
798   "constrained by %select{|implicitly }1%select{private|protected}0"
799   " inheritance here">;
800 def note_access_protected_restricted : Note<
801   "object type %select{|%1 }0must derive from context type %2">;
802   
803 // C++ name lookup
804 def err_incomplete_nested_name_spec : Error<
805   "incomplete type %0 named in nested name specifier">;
806 def err_dependent_nested_name_spec : Error<
807   "nested name specifier for a declaration cannot depend on a template "
808   "parameter">;
809 def err_nested_name_member_ref_lookup_ambiguous : Error<
810   "lookup of %0 in member access expression is ambiguous">;
811 def ext_nested_name_member_ref_lookup_ambiguous : ExtWarn<
812   "lookup of %0 in member access expression is ambiguous; using member of %1">,
813   InGroup<AmbigMemberTemplate>;
814 def note_ambig_member_ref_object_type : Note<
815   "lookup in the object type %0 refers here">;
816 def note_ambig_member_ref_scope : Note<
817   "lookup from the current scope refers here">;
818 def err_qualified_member_nonclass : Error<
819   "qualified member access refers to a member in %0">;
820 def err_incomplete_member_access : Error<
821   "member access into incomplete type %0">;
822 def err_incomplete_type : Error<
823   "incomplete type %0 where a complete type is required">;
824   
825 // C++ class members
826 def err_storageclass_invalid_for_member : Error<
827   "storage class specified for a member declaration">;
828 def err_mutable_function : Error<"'mutable' cannot be applied to functions">;
829 def err_mutable_reference : Error<"'mutable' cannot be applied to references">;
830 def err_mutable_const : Error<"'mutable' and 'const' cannot be mixed">;
831 def err_mutable_nonmember : Error<
832   "'mutable' can only be applied to member variables">;
833 def err_virtual_non_function : Error<
834   "'virtual' can only appear on non-static member functions">;
835 def err_virtual_out_of_class : Error<
836   "'virtual' can only be specified inside the class definition">;
837 def err_virtual_member_function_template : Error<
838   "'virtual' can not be specified on member function templates">;
839 def err_static_overrides_virtual : Error<
840   "'static' member function %0 overrides a virtual function in a base class">;
841 def err_explicit_non_function : Error<
842   "'explicit' can only appear on non-static member functions">;
843 def err_explicit_out_of_class : Error<
844   "'explicit' can only be specified inside the class definition">;
845 def err_explicit_non_ctor_or_conv_function : Error<
846   "'explicit' can only be applied to a constructor or conversion function">;
847 def err_static_not_bitfield : Error<"static member %0 cannot be a bit-field">;
848 def err_static_out_of_line : Error<
849   "'static' can only be specified inside the class definition">;
850 def err_typedef_not_bitfield : Error<"typedef member %0 cannot be a bit-field">;
851 def err_not_integral_type_bitfield : Error<
852   "bit-field %0 has non-integral type %1">;
853 def err_not_integral_type_anon_bitfield : Error<
854   "anonymous bit-field has non-integral type %0">;
855 def err_member_function_initialization : Error<
856   "initializer on function does not look like a pure-specifier">;
857 def err_non_virtual_pure : Error<
858   "%0 is not virtual and cannot be declared pure">;
859 def warn_pure_function_definition : ExtWarn<
860   "function definition with pure-specifier is a Microsoft extension">,
861   InGroup<Microsoft>;
862 def err_implicit_object_parameter_init : Error<
863   "cannot initialize object parameter of type %0 with an expression "
864   "of type %1">;
865 def err_qualified_member_of_unrelated : Error<
866   "%q0 is not a member of class %1">;
867
868 def warn_call_to_pure_virtual_member_function_from_ctor_dtor : Warning<
869   "call to pure virtual member function %0; overrides of %0 in subclasses are "
870   "not available in the %select{constructor|destructor}1 of %2">;
871
872 def note_field_decl : Note<"member is declared here">;
873 def note_ivar_decl : Note<"ivar is declared here">;
874 def note_bitfield_decl : Note<"bit-field is declared here">;
875 def note_previous_decl : Note<"%0 declared here">;
876 def note_member_synthesized_at : Note<
877   "implicit default %select{constructor|copy constructor|move constructor|copy "
878   "assignment operator|move assignment operator|destructor}0 for %1 first "
879   "required here">;
880 def err_missing_default_ctor : Error<
881   "%select{|implicit default }0constructor for %1 must explicitly initialize "
882   "the %select{base class|member}2 %3 which does not have a default "
883   "constructor">;
884 def err_illegal_union_or_anon_struct_member : Error<
885   "%select{anonymous struct|union}0 member %1 has a non-trivial "
886   "%select{constructor|copy constructor|move constructor|copy assignment "
887   "operator|move assignment operator|destructor}2">;
888 def note_nontrivial_has_virtual : Note<
889   "because type %0 has a virtual %select{member function|base class}1">;
890 def note_nontrivial_has_nontrivial : Note<
891   "because type %0 has a %select{member|base class}1 with a non-trivial "
892   "%select{constructor|copy constructor|move constructor|copy assignment "
893   "operator|move assignment operator|destructor}2">;
894 def note_nontrivial_user_defined : Note<
895   "because type %0 has a user-declared %select{constructor|copy constructor|"
896   "move constructor|copy assignment operator|move assignment operator|"
897   "destructor}1">;
898 def err_static_data_member_not_allowed_in_union_or_anon_struct : Error<
899   "static data member %0 not allowed in %select{anonymous struct|union}1">; 
900 def err_union_member_of_reference_type : Error<
901   "union member %0 has reference type %1">;
902 def ext_anonymous_struct_union_qualified : Extension<
903   "anonymous %select{struct|union}0 cannot be '%select{const|volatile|"
904   "restrict}1'">;
905 def err_different_return_type_for_overriding_virtual_function : Error<
906   "virtual function %0 has a different return type (%1) than the "
907   "function it overrides (which has return type %2)">;
908 def note_overridden_virtual_function : Note<
909   "overridden virtual function is here">;
910
911 def err_covariant_return_inaccessible_base : Error<
912   "invalid covariant return for virtual function: %1 is a "
913   "%select{private|protected}2 base class of %0">, AccessControl;
914 def err_covariant_return_ambiguous_derived_to_base_conv : Error<
915   "return type of virtual function %3 is not covariant with the return type of "
916   "the function it overrides (ambiguous conversion from derived class "
917   "%0 to base class %1:%2)">;
918 def err_covariant_return_not_derived : Error<
919   "return type of virtual function %0 is not covariant with the return type of "
920   "the function it overrides (%1 is not derived from %2)">;
921 def err_covariant_return_incomplete : Error<
922   "return type of virtual function %0 is not covariant with the return type of "
923   "the function it overrides (%1 is incomplete)">;
924 def err_covariant_return_type_different_qualifications : Error<
925   "return type of virtual function %0 is not covariant with the return type of "
926   "the function it overrides (%1 has different qualifiers than %2)">;
927 def err_covariant_return_type_class_type_more_qualified : Error<
928   "return type of virtual function %0 is not covariant with the return type of "
929   "the function it overrides (class type %1 is more qualified than class "
930   "type %2">;
931   
932 // C++ constructors
933 def err_constructor_cannot_be : Error<"constructor cannot be declared '%0'">;
934 def err_invalid_qualified_constructor : Error<
935   "'%0' qualifier is not allowed on a constructor">;
936 def err_ref_qualifier_constructor : Error<
937   "ref-qualifier '%select{&&|&}0' is not allowed on a constructor">;
938
939 def err_constructor_return_type : Error<
940   "constructor cannot have a return type">;
941 def err_constructor_redeclared : Error<"constructor cannot be redeclared">;
942 def err_constructor_byvalue_arg : Error<
943   "copy constructor must pass its first argument by reference">;
944 def warn_no_constructor_for_refconst : Warning<
945   "%select{struct|union|class|enum}0 %1 does not declare any constructor to "
946   "initialize its non-modifiable members">;
947 def note_refconst_member_not_initialized : Note<
948   "%select{const|reference}0 member %1 will never be initialized">;
949 def ext_ms_explicit_constructor_call : ExtWarn<
950   "explicit constructor calls are a Microsoft extension">, InGroup<Microsoft>;
951
952 // C++ destructors
953 def err_destructor_not_member : Error<
954   "destructor must be a non-static member function">;
955 def err_destructor_cannot_be : Error<"destructor cannot be declared '%0'">;
956 def err_invalid_qualified_destructor : Error<
957   "'%0' qualifier is not allowed on a destructor">;
958 def err_ref_qualifier_destructor : Error<
959   "ref-qualifier '%select{&&|&}0' is not allowed on a destructor">;
960 def err_destructor_return_type : Error<"destructor cannot have a return type">;
961 def err_destructor_redeclared : Error<"destructor cannot be redeclared">;
962 def err_destructor_with_params : Error<"destructor cannot have any parameters">;
963 def err_destructor_variadic : Error<"destructor cannot be variadic">;
964 def err_destructor_typedef_name : Error<
965   "destructor cannot be declared using a %select{typedef|type alias}1 %0 of the class name">;
966 def err_destructor_name : Error<
967   "expected the class name after '~' to name the enclosing class">;
968 def err_destructor_class_name : Error<
969   "expected the class name after '~' to name a destructor">;
970 def err_ident_in_dtor_not_a_type : Error<
971   "identifier %0 in object destruction expression does not name a type">;
972 def err_destructor_expr_type_mismatch : Error<
973   "destructor type %0 in object destruction expression does not match the "
974   "type %1 of the object being destroyed">;
975 def note_destructor_type_here : Note<
976   "type %0 is declared here">;
977
978 def err_destructor_template : Error<
979   "destructor cannot be declared as a template">;
980
981 // C++ initialization
982 def err_init_conversion_failed : Error<
983   "cannot initialize %select{a variable|a parameter|return object|an "
984   "exception object|a member subobject|an array element|a new value|a value|a "
985   "base class|a constructor delegation|a vector element}0 of type %1 with an "
986   "%select{rvalue|lvalue}2 of type %3">;
987
988 def err_lvalue_to_rvalue_ref : Error<"rvalue reference to type %0 cannot bind "
989   "to lvalue of type %1">;
990 def err_invalid_initialization : Error<
991 "invalid initialization of reference of type %0 from expression of type %1">;
992 def err_lvalue_to_rvalue_ambig_ref : Error<"rvalue reference cannot bind to lvalue "
993                                            "due to multiple conversion functions">;
994 def err_not_reference_to_const_init : Error<
995   "%select{non-const|volatile}0 lvalue reference to type %1 cannot be "
996   "initialized with a %select{value|temporary}2 of type %3">;
997 def err_lvalue_reference_bind_to_temporary : Error<
998   "%select{non-const|volatile}0 lvalue reference to type %1 cannot bind to a "
999   "temporary of type %2">;
1000 def err_lvalue_reference_bind_to_unrelated : Error<
1001   "%select{non-const|volatile}0 lvalue reference to type %1 cannot bind to a "
1002   "value of unrelated type %2">;
1003 def err_reference_bind_drops_quals : Error<
1004   "binding of reference to type %0 to a value of type %1 drops qualifiers">;
1005 def err_reference_bind_failed : Error<
1006   "reference to type %0 could not bind to an %select{rvalue|lvalue}1 of type "
1007   "%2">;
1008 def err_reference_bind_init_list : Error<
1009   "reference to type %0 cannot bind to an initializer list">;
1010 def err_init_list_bad_dest_type : Error<
1011   "%select{|non-aggregate }0type %1 cannot be initialized with an initializer "
1012   "list">;
1013 def err_member_function_call_bad_cvr : Error<"member function %0 not viable: "
1014     "'this' argument has type %1, but function is not marked "
1015     "%select{const|restrict|const or restrict|volatile|const or volatile|"
1016     "volatile or restrict|const, volatile, or restrict}2">;
1017
1018 def err_reference_init_drops_quals : Error<
1019   "initialization of reference to type %0 with a %select{value|temporary}1 of type %2 drops "
1020   "qualifiers">;
1021 def err_reference_bind_to_bitfield : Error<
1022   "%select{non-const|volatile}0 reference cannot bind to bit-field %1">;
1023 def err_reference_bind_to_vector_element : Error<
1024   "%select{non-const|volatile}0 reference cannot bind to vector element">;
1025 def err_reference_var_requires_init : Error<
1026   "declaration of reference variable %0 requires an initializer">;
1027 def err_const_var_requires_init : Error<
1028   "declaration of const variable '%0' requires an initializer">;
1029 def err_reference_without_init : Error<
1030   "reference to type %0 requires an initializer">;
1031 def err_reference_has_multiple_inits : Error<
1032   "reference cannot be initialized with multiple values">;
1033 def err_init_non_aggr_init_list : Error<
1034   "initialization of non-aggregate type %0 with an initializer list">;
1035 def err_init_reference_member_uninitialized : Error<
1036   "reference member of type %0 uninitialized">;
1037 def note_uninit_reference_member : Note<
1038   "uninitialized reference member is here">;
1039 def warn_field_is_uninit : Warning<"field is uninitialized when used here">,
1040   InGroup<Uninitialized>;
1041 def warn_uninit_self_reference_in_init : Warning<
1042   "variable %0 is uninitialized when used within its own initialization">,
1043   InGroup<Uninitialized>;
1044 def warn_uninit_var : Warning<
1045   "variable %0 is uninitialized when used here">,
1046   InGroup<Uninitialized>, DefaultIgnore;
1047 def warn_maybe_uninit_var :
1048   Warning<"variable %0 may be uninitialized when used here">,
1049     InGroup<UninitializedMaybe>, DefaultIgnore;
1050 def note_uninit_var_def : Note<
1051   "variable %0 is declared here">;
1052 def warn_uninit_var_captured_by_block : Warning<
1053   "variable %0 is uninitialized when captured by block">,
1054   InGroup<Uninitialized>, DefaultIgnore;
1055 def warn_maybe_uninit_var_captured_by_block : Warning<
1056   "variable %0 may be uninitialized when captured by block">,
1057   InGroup<UninitializedMaybe>, DefaultIgnore;
1058 def note_var_fixit_add_initialization : Note<
1059   "initialize the variable %0 to silence this warning">;
1060 def err_init_incomplete_type : Error<"initialization of incomplete type %0">;
1061
1062 def err_temp_copy_no_viable : Error<
1063   "no viable constructor %select{copying variable|copying parameter|"
1064   "returning object|throwing object|copying member subobject|copying array "
1065   "element|allocating object|copying temporary|initializing base subobject|"
1066   "initializing vector element}0 of type %1">;
1067 def ext_rvalue_to_reference_temp_copy_no_viable : ExtWarn<
1068   "no viable constructor %select{copying variable|copying parameter|"
1069   "returning object|throwing object|copying member subobject|copying array "
1070   "element|allocating object|copying temporary|initializing base subobject|"
1071   "initializing vector element}0 of type %1; C++98 requires a copy "
1072   "constructor when binding a reference to a temporary">,
1073   InGroup<BindToTemporaryCopy>;
1074 def err_temp_copy_ambiguous : Error<
1075   "ambiguous constructor call when %select{copying variable|copying "
1076   "parameter|returning object|throwing object|copying member subobject|copying "
1077   "array element|allocating object|copying temporary|initializing base subobject|"
1078   "initializing vector element}0 of type %1">;
1079 def err_temp_copy_deleted : Error<
1080   "%select{copying variable|copying parameter|returning object|throwing "
1081   "object|copying member subobject|copying array element|allocating object|"
1082   "copying temporary|initializing base subobject|initializing vector element}0 "
1083   "of type %1 invokes deleted constructor">;
1084 def err_temp_copy_incomplete : Error<
1085   "copying a temporary object of incomplete type %0">;
1086
1087 // C++11 decltype
1088 def err_cannot_determine_declared_type_of_overloaded_function : Error<
1089     "cannot determine the type of an overloaded function">;
1090     
1091 // C++11 auto
1092 def err_auto_variable_cannot_appear_in_own_initializer : Error<
1093   "variable %0 declared with 'auto' type cannot appear in its own initializer">;
1094 def err_illegal_decl_array_of_auto : Error<
1095   "'%0' declared as array of %1">;
1096 def err_new_array_of_auto : Error<
1097   "cannot allocate array of 'auto'">;
1098 def err_auto_not_allowed : Error<
1099   "'auto' not allowed %select{in function prototype|in non-static struct member"
1100   "|in non-static union member|in non-static class member|in exception declaration"
1101   "|in template parameter|in block literal|in template argument"
1102   "|in typedef|in type alias|in function return type|here}0">;
1103 def err_auto_var_requires_init : Error<
1104   "declaration of variable %0 with type %1 requires an initializer">;
1105 def err_auto_new_requires_ctor_arg : Error<
1106   "new expression for type %0 requires a constructor argument">;
1107 def err_auto_var_init_multiple_expressions : Error<
1108   "initializer for variable %0 with type %1 contains multiple expressions">;
1109 def err_auto_new_ctor_multiple_expressions : Error<
1110   "new expression for type %0 contains multiple constructor arguments">;
1111 def err_auto_missing_trailing_return : Error<
1112   "'auto' return without trailing return type">;
1113 def err_trailing_return_without_auto : Error<
1114   "function with trailing return type must specify return type 'auto', not %0">;
1115 def err_trailing_return_in_parens : Error<
1116   "trailing return type may not be nested within parentheses">;
1117 def err_auto_var_deduction_failure : Error<
1118   "variable %0 with type %1 has incompatible initializer of type %2">;
1119 def err_auto_new_deduction_failure : Error<
1120   "new expression for type %0 has incompatible constructor argument of type %1">;
1121 def err_auto_different_deductions : Error<
1122   "'auto' deduced as %0 in declaration of %1 and deduced as %2 in declaration of %3">;
1123
1124 // C++11 override control
1125 def override_keyword_only_allowed_on_virtual_member_functions : Error<
1126   "only virtual member functions can be marked '%0'">;
1127 def err_function_marked_override_not_overriding : Error<
1128   "%0 marked 'override' but does not override any member functions">;
1129 def err_class_marked_final_used_as_base : Error<
1130   "base %0 is marked 'final'">;
1131
1132 // C++11 attributes
1133 def err_repeat_attribute : Error<"'%0' attribute cannot be repeated">;
1134
1135 // C++11 [[final]]
1136 def err_final_function_overridden : Error<
1137   "declaration of %0 overrides a 'final' function">;
1138 def err_final_base : Error<
1139   "derivation from 'final' %0">;
1140
1141 // C++11 scoped enumerations
1142 def err_enum_invalid_underlying : Error<
1143   "non-integral type %0 is an invalid underlying type">;
1144 def err_enumerator_too_large : Error<
1145   "enumerator value is not representable in the underlying type %0">;
1146 def ext_enumerator_too_large : ExtWarn<
1147   "enumerator value is not representable in the underlying type %0">,
1148   InGroup<Microsoft>;
1149 def err_enumerator_wrapped : Error<
1150   "enumerator value %0 is not representable in the underlying type %1">;
1151 def err_enum_redeclare_type_mismatch : Error<
1152   "enumeration redeclared with different underlying type %0 (was %1)">;
1153 def err_enum_redeclare_fixed_mismatch : Error<
1154   "enumeration previously declared with %select{non|}0fixed underlying type">;
1155 def err_enum_redeclare_scoped_mismatch : Error<
1156   "enumeration previously declared as %select{un|}0scoped">;
1157 def err_only_enums_have_underlying_types : Error<
1158   "only enumeration types have underlying types">;
1159 def err_incomplete_type_no_underlying_type : Error<
1160   "an incomplete enumeration type has no underlying type yet">;
1161
1162 // C++11 delegating constructors
1163 def err_delegation_0x_only : Error<
1164   "delegating constructors are permitted only in C++11">;
1165 def err_delegating_initializer_alone : Error<
1166   "an initializer for a delegating constructor must appear alone">;
1167 def warn_delegating_ctor_cycle : Warning<
1168   "constructor for %0 creates a delegation cycle">, DefaultError,
1169   InGroup<DelegatingCtorCycles>;
1170 def note_it_delegates_to : Note<
1171   "it delegates to">, InGroup<DelegatingCtorCycles>;
1172 def note_which_delegates_to : Note<
1173   "which delegates to">, InGroup<DelegatingCtorCycles>;
1174 def err_delegating_codegen_not_implemented : Error<
1175   "code generation for delegating constructors not implemented">;
1176
1177 // C++11 range-based for loop
1178 def err_for_range_decl_must_be_var : Error<
1179   "for range declaration must declare a variable">;
1180 def err_for_range_storage_class : Error<
1181   "loop variable %0 may not be declared %select{'extern'|'static'|"
1182   "'__private_extern__'|'auto'|'register'|'constexpr'}1">;
1183 def err_type_defined_in_for_range : Error<
1184   "types may not be defined in a for range declaration">;
1185 def err_for_range_deduction_failure : Error<
1186   "cannot use type %0 as a range">;
1187 def err_for_range_incomplete_type : Error<
1188   "cannot use incomplete type %0 as a range">;
1189 def err_for_range_iter_deduction_failure : Error<
1190   "cannot use type %0 as an iterator">;
1191 def err_for_range_member_begin_end_mismatch : Error<
1192   "range type %0 has '%select{begin|end}1' member but no '%select{end|begin}1' member">;
1193 def err_for_range_begin_end_types_differ : Error<
1194   "'begin' and 'end' must return the same type (got %0 and %1)">;
1195 def note_for_range_type : Note<"range has type %0">;
1196 def note_for_range_begin_end : Note<
1197   "selected '%select{begin|end}0' %select{function|template }1%2 with iterator type %3">;
1198
1199 // C++11 constexpr
1200 def err_invalid_constexpr : Error<
1201   "%select{function parameter|typedef|non-static data member}0 "
1202   "cannot be constexpr">;
1203 def err_constexpr_tag : Error<
1204   "%select{class|struct|union|enum}0 cannot be marked constexpr">;
1205 def err_constexpr_dtor : Error<"destructor cannot be marked constexpr">;
1206 def err_constexpr_no_declarators : Error<
1207   "constexpr can only be used in variable and function declarations">;
1208 def err_invalid_constexpr_var_decl : Error<
1209   "constexpr variable declaration must be a definition">;
1210 def err_constexpr_var_requires_init : Error<
1211   "declaration of constexpr variable %0 requires an initializer">;
1212 def err_constexpr_var_requires_const_init : Error<
1213   "constexpr variable %0 must be initialized by a constant expression">;
1214 def err_constexpr_redecl_mismatch : Error<
1215   "%select{non-constexpr declaration of %0 follows constexpr declaration"
1216   "|constexpr declaration of %0 follows non-constexpr declaration}1">;
1217 def note_constexpr_redecl_mismatch : Note<
1218   "previous declaration was %select{not |}0marked constexpr">;
1219 def err_constexpr_virtual : Error<"virtual function cannot be constexpr">;
1220 def note_constexpr_tmpl_virtual : Note<"function template instantiation is not "
1221   "constexpr because it is virtual">;
1222 def err_constexpr_virtual_base : Error<"constexpr constructor not allowed in "
1223   "%select{class|struct}0 with virtual base %plural{1:class|:classes}1">;
1224 def note_constexpr_tmpl_virtual_base : Note<"constructor template instantiation is "
1225   "not constexpr because %select{class|struct}0 has virtual base "
1226   "%plural{1:class|:classes}1">;
1227 def note_non_literal_virtual_base : Note<"%select{class|struct}0 with virtual "
1228   "base %plural{1:class|:classes}1 is not a literal type">;
1229 def note_constexpr_virtual_base_here : Note<"virtual base class declared here">;
1230 def err_constexpr_non_literal_return : Error<
1231   "constexpr function's return type %0 is not a literal type">;
1232 def note_constexpr_tmpl_non_literal_return : Note<
1233   "function template instantiation is not constexpr because return type %0 is "
1234   "not a literal type">;
1235 def err_constexpr_non_literal_param : Error<
1236   "constexpr %select{function|constructor}1's %ordinal0 parameter type %2 is "
1237   "not a literal type">;
1238 def note_constexpr_tmpl_non_literal_param : Note<
1239   "%select{function|constructor}1 template instantiation is not constexpr "
1240   "because %ordinal0 parameter type %2 is not a literal type">;
1241 def err_constexpr_body_invalid_stmt : Error<
1242   "statement not allowed in constexpr %select{function|constructor}0">;
1243 def err_constexpr_type_definition : Error<
1244   "types cannot be defined in a constexpr %select{function|constructor}0">;
1245 def err_constexpr_vla : Error<
1246   "variably-modified type %0 cannot be used in a constexpr "
1247   "%select{function|constructor}1">;
1248 def err_constexpr_var_declaration : Error<
1249   "variables cannot be declared in a constexpr %select{function|constructor}0">;
1250 def err_constexpr_body_no_return : Error<
1251   "no return statement in constexpr function">;
1252 def err_constexpr_body_multiple_return : Error<
1253   "multiple return statements in constexpr function">;
1254 def note_constexpr_body_previous_return : Note<
1255   "previous return statement is here">;
1256 def err_constexpr_function_try_block : Error<
1257   "function try block not allowed in constexpr %select{function|constructor}0">;
1258 def err_constexpr_union_ctor_no_init : Error<
1259   "constexpr union constructor does not initialize any member">;
1260 def err_constexpr_ctor_missing_init : Error<
1261   "constexpr constructor must initialize all members">;
1262 def note_constexpr_ctor_missing_init : Note<
1263   "member not initialized by constructor">;
1264 def err_constexpr_method_non_literal : Error<
1265   "non-literal type %0 cannot have constexpr members">;
1266 def note_non_literal_no_constexpr_ctors : Note<
1267   "%0 is not literal because it is not an aggregate and has no constexpr "
1268   "constructors other than copy or move constructors">;
1269 def note_non_literal_base_class : Note<
1270   "%0 is not literal because it has base class %1 of non-literal type">;
1271 def note_non_literal_field : Note<
1272   "%0 is not literal because it has data member %1 of non-literal type %2">;
1273 def note_non_literal_user_provided_dtor : Note<
1274   "%0 is not literal because it has a user-provided destructor">;
1275 def note_non_literal_nontrivial_dtor : Note<
1276   "%0 is not literal because it has a non-trivial destructor">;
1277 def note_non_literal_mutable_field : Note<
1278   "%0 is not literal because it has a mutable data member">;
1279  
1280 // Objective-C++
1281 def err_objc_decls_may_only_appear_in_global_scope : Error<
1282   "Objective-C declarations may only appear in global scope">;
1283 def err_nsobject_attribute : Error<
1284   "__attribute ((NSObject)) is for pointer types only">;
1285
1286 // Attributes
1287 def err_attribute_can_be_applied_only_to_symbol_declaration : Error<
1288   "%0 attribute can be applied only to symbol declaration">;
1289 def err_attributes_are_not_compatible : Error<
1290   "%0 and %1 attributes are not compatible">;
1291 def err_attribute_wrong_number_arguments : Error<
1292   "attribute %plural{0:takes no arguments|1:takes one argument|"
1293   ":requires exactly %0 arguments}0">;
1294 def err_attribute_too_many_arguments : Error<
1295   "attribute takes no more than %0 argument%s0">;
1296 def err_attribute_too_few_arguments : Error<
1297   "attribute takes at least %0 argument%s0">;
1298 def err_attribute_missing_parameter_name : Error<
1299   "attribute requires unquoted parameter">;
1300 def err_attribute_invalid_vector_type : Error<"invalid vector element type %0">;
1301 def err_attribute_bad_neon_vector_size : Error<
1302   "Neon vector size must be 64 or 128 bits">;
1303 def err_attribute_argument_not_int : Error<
1304   "'%0' attribute requires integer constant">;
1305 def err_attribute_argument_not_class : Error<
1306   "%0 attribute requires arguments that are class type or point to class type">;
1307 def err_attribute_first_argument_not_int_or_bool : Error<
1308   "%0 attribute first argument must be of int or bool type">;
1309 def err_attribute_argument_outof_range : Error<
1310   "init_priority attribute requires integer constant between "
1311   "101 and 65535 inclusive">;
1312 def err_init_priority_object_attr : Error<
1313   "can only use 'init_priority' attribute on file-scope definitions "
1314   "of objects of class type">;
1315 def err_attribute_argument_n_not_int : Error<
1316   "'%0' attribute requires parameter %1 to be an integer constant">;
1317 def err_attribute_argument_n_not_string : Error<
1318   "'%0' attribute requires parameter %1 to be a string">;
1319 def err_attribute_argument_out_of_bounds : Error<
1320   "'%0' attribute parameter %1 is out of bounds">;
1321 def err_attribute_requires_objc_interface : Error<
1322   "attribute may only be applied to an Objective-C interface">;
1323 def err_attribute_uuid_malformed_guid : Error<
1324   "uuid attribute contains a malformed GUID">;
1325 def warn_nonnull_pointers_only : Warning<
1326   "nonnull attribute only applies to pointer arguments">;
1327 def err_attribute_invalid_implicit_this_argument : Error<
1328   "'%0' attribute is invalid for the implicit this argument">;
1329 def err_ownership_type : Error<
1330   "%0 attribute only applies to %1 arguments">;
1331 def err_format_strftime_third_parameter : Error<
1332   "strftime format attribute requires 3rd parameter to be 0">;
1333 def err_format_attribute_requires_variadic : Error<
1334   "format attribute requires variadic function">;
1335 def err_format_attribute_not : Error<"format argument not %0">;
1336 def err_format_attribute_result_not : Error<"function does not return %0">;
1337 def err_format_attribute_implicit_this_format_string : Error<
1338   "format attribute cannot specify the implicit this argument as the format "
1339   "string">;
1340 def warn_unknown_method_family : Warning<"unrecognized method family">;
1341 def err_init_method_bad_return_type : Error<
1342   "init methods must return an object pointer type, not %0">;
1343 def err_attribute_invalid_size : Error<
1344   "vector size not an integral multiple of component size">;
1345 def err_attribute_zero_size : Error<"zero vector size">;
1346 def err_typecheck_vector_not_convertable : Error<
1347   "can't convert between vector values of different size (%0 and %1)">;
1348 def err_typecheck_ext_vector_not_typedef : Error<
1349   "ext_vector_type only applies to types, not variables">;
1350 def err_unsupported_vector_size : Error<
1351   "unsupported type %0 for vector_size attribute, please use on typedef">;
1352 def err_ext_vector_component_exceeds_length : Error<
1353   "vector component access exceeds type %0">;
1354 def err_ext_vector_component_name_illegal : Error<
1355   "illegal vector component name '%0'">;
1356 def err_attribute_address_space_not_int : Error<
1357   "address space attribute requires an integer constant">;
1358 def err_attribute_address_space_negative : Error<
1359   "address space is negative">;
1360 def err_attribute_address_space_too_high : Error<
1361   "address space is larger than the maximum supported (%0)">;
1362 def err_attribute_address_multiple_qualifiers : Error<
1363   "multiple address spaces specified for type">;
1364 def err_attribute_address_function_type : Error<
1365   "function type may not be qualified with an address space">;
1366 def err_as_qualified_auto_decl : Error<
1367   "automatic variable qualified with an address space">;
1368 def err_arg_with_address_space : Error<
1369   "parameter may not be qualified with an address space">;
1370 def err_attr_objc_ownership_bad_type : Error<
1371   "the type %0 cannot be retained">;
1372 def err_attr_objc_ownership_redundant : Error<
1373   "the type %0 already has retainment attributes set on it">;
1374 def err_attribute_not_string : Error<
1375   "argument to %0 attribute was not a string literal">;
1376 def err_only_annotate_after_access_spec : Error<
1377   "access specifier can only have annotation attributes">;
1378 def err_attribute_section_invalid_for_target : Error<
1379   "argument to 'section' attribute is not valid for this target: %0">;
1380 def err_attribute_section_local_variable : Error<
1381   "'section' attribute is not valid on local variables">;
1382 def err_attribute_aligned_not_power_of_two : Error<
1383   "requested alignment is not a power of 2">;
1384 def warn_redeclaration_without_attribute_prev_attribute_ignored : Warning<
1385   "'%0' redeclared without %1 attribute: previous %1 ignored">;
1386 def warn_attribute_ignored : Warning<"%0 attribute ignored">;
1387 def warn_unknown_attribute_ignored : Warning<
1388   "unknown attribute %0 ignored">, InGroup<UnknownAttributes>;
1389 def warn_attribute_precede_definition : Warning<
1390   "attribute declaration must precede definition">;
1391 def warn_attribute_void_function_method : Warning<
1392   "attribute %0 cannot be applied to "
1393   "%select{functions|Objective-C method}1 without return value">;
1394 def warn_attribute_weak_on_field : Warning<
1395   "__weak attribute cannot be specified on a field declaration">;
1396 def warn_gc_attribute_weak_on_local : Warning<
1397   "Objective-C GC does not allow weak variables on the stack">;
1398 def warn_attribute_weak_on_local : Warning<
1399   "__weak attribute cannot be specified on an automatic variable">;
1400 def warn_weak_identifier_undeclared : Warning<
1401   "weak identifier %0 never declared">;
1402 def err_attribute_weak_static : Error<
1403   "weak declaration cannot have internal linkage">;
1404 def warn_attribute_weak_import_invalid_on_definition : Warning<
1405   "'weak_import' attribute cannot be specified on a definition">;
1406 def err_attribute_weakref_not_static : Error<
1407   "weakref declaration must have internal linkage">;
1408 def err_attribute_weakref_not_global_context : Error<
1409   "weakref declaration of '%0' must be in a global context">;
1410 def err_attribute_weakref_without_alias : Error<
1411   "weakref declaration of '%0' must also have an alias attribute">;
1412 def err_alias_not_supported_on_darwin : Error <
1413   "only weak aliases are supported on darwin">;
1414 def warn_attribute_wrong_decl_type : Warning<
1415   "%0 attribute only applies to %select{functions|unions|"
1416   "variables and functions|functions and methods|parameters|"
1417   "parameters and methods|functions, methods and blocks|"
1418   "classes and virtual methods|functions, methods, and parameters|"
1419   "classes|virtual methods|class members|variables|methods|"
1420   "variables, functions and labels|fields and global variables}1">;
1421 def err_attribute_wrong_decl_type : Error<
1422   "%0 attribute only applies to %select{functions|unions|"
1423   "variables and functions|functions and methods|parameters|"
1424   "parameters and methods|functions, methods and blocks|"
1425   "classes and virtual methods|functions, methods, and parameters|"
1426   "classes|virtual methods|class members|variables|methods|structs}1">;
1427 def warn_function_attribute_wrong_type : Warning<
1428   "'%0' only applies to function types; type here is %1">;
1429 def warn_pointer_attribute_wrong_type : Warning<
1430   "'%0' only applies to pointer types; type here is %1">;
1431 def warn_objc_object_attribute_wrong_type : Warning<
1432   "'%0' only applies to objective-c object or block pointer types; type here is %1">;
1433 def warn_gnu_inline_attribute_requires_inline : Warning<
1434   "'gnu_inline' attribute requires function to be marked 'inline',"
1435   " attribute ignored">;
1436 def err_attribute_vecreturn_only_vector_member : Error<
1437   "the vecreturn attribute can only be used on a class or structure with one member, which must be a vector">;
1438 def err_attribute_vecreturn_only_pod_record : Error<
1439   "the vecreturn attribute can only be used on a POD (plain old data) class or structure (i.e. no virtual functions)">;
1440 def err_cconv_change : Error<
1441   "function declared '%0' here was previously declared "
1442   "%select{'%2'|without calling convention}1">;
1443 def err_cconv_knr : Error<
1444   "function with no prototype cannot use %0 calling convention">;
1445 def err_cconv_varargs : Error<
1446   "variadic function cannot use %0 calling convention">;
1447 def err_regparm_mismatch : Error<"function declared with with regparm(%0) "
1448   "attribute was previously declared "
1449   "%plural{0:without the regparm|:with the regparm(%1)}1 attribute">;
1450 def err_returns_retained_mismatch : Error<
1451   "function declared with the ns_returns_retained attribute "
1452   "was previously declared without the ns_returns_retained attribute">;
1453 def err_objc_precise_lifetime_bad_type : Error<
1454   "objc_precise_lifetime only applies to retainable types; type here is %0">;
1455 def warn_objc_precise_lifetime_meaningless : Error<
1456   "objc_precise_lifetime is not meaningful for "
1457   "%select{__unsafe_unretained|__autoreleasing}0 objects">;
1458 def warn_label_attribute_not_unused : Warning<
1459   "The only valid attribute for labels is 'unused'">;
1460 def err_invalid_pcs : Error<"Invalid PCS type">;
1461 def err_attribute_can_be_applied_only_to_value_decl : Error<
1462   "%0 attribute can only be applied to value declarations">;
1463 def warn_attribute_not_on_decl : Error<
1464   "%0 attribute ignored when parsing type">;
1465
1466
1467 // Availability attribute
1468 def warn_availability_unknown_platform : Warning<
1469   "unknown platform %0 in availability macro">;
1470 def warn_availability_version_ordering : Warning<
1471   "feature cannot be %select{introduced|deprecated|obsoleted}0 in %1 version "
1472   "%2 before it was %select{introduced|deprecated|obsoleted}3 in version %4; "
1473   "attribute ignored">;
1474   
1475 // Thread Safety Attributes
1476 // Errors when parsing the attributes
1477 def err_attribute_argument_out_of_range : Error<
1478   "%0 attribute parameter %1 is out of bounds: "
1479   "%plural{0:no parameters to index into|"
1480   "1:can only be 1, since there is one parameter|"
1481   ":must be between 1 and %2}2">;
1482 def err_attribute_argument_not_lockable : Error<
1483   "%0 attribute requires arguments whose type is annotated "
1484   "with 'lockable' attribute">;
1485 def err_attribute_decl_not_lockable : Error<
1486   "%0 attribute can only be applied in a context annotated "
1487   "with 'lockable' attribute">;
1488 def warn_unlock_but_no_lock : Warning<
1489   "unlocking '%0' that was not locked">,
1490   InGroup<ThreadSafety>, DefaultIgnore;
1491 def warn_double_lock : Warning<
1492   "locking '%0' that is already locked">,
1493   InGroup<ThreadSafety>, DefaultIgnore;
1494 def warn_no_unlock : Warning<
1495   "mutex '%0' is still locked at the end of function">,
1496   InGroup<ThreadSafety>, DefaultIgnore;
1497 // FIXME: improve the error message about locks not in scope
1498 def warn_lock_at_end_of_scope : Warning<
1499   "mutex '%0' is still locked at the end of its scope">,
1500   InGroup<ThreadSafety>, DefaultIgnore;
1501 def warn_expecting_lock_held_on_loop : Warning<
1502   "expecting mutex '%0' to be locked at start of each loop">,
1503   InGroup<ThreadSafety>, DefaultIgnore;
1504 def warn_lock_exclusive_and_shared : Warning<
1505   "mutex '%0' is locked exclusively and shared in the same scope">,
1506   InGroup<ThreadSafety>, DefaultIgnore;
1507 def note_lock_exclusive_and_shared : Note<
1508   "the other lock of mutex '%0' is here">,
1509   InGroup<ThreadSafety>, DefaultIgnore;
1510 def warn_variable_requires_lock : Warning<
1511   "%select{reading|writing}2 variable '%0' requires locking "
1512   "%select{'%1'|'%1' exclusively}2">,
1513   InGroup<ThreadSafety>, DefaultIgnore;
1514 def warn_var_deref_requires_lock : Warning<
1515   "%select{reading|writing}2 the value pointed to by '%0' requires locking "
1516   "%select{'%1'|'%1' exclusively}2">,
1517   InGroup<ThreadSafety>, DefaultIgnore;
1518 def warn_variable_requires_any_lock : Warning<
1519   "%select{reading|writing}1 variable '%0' requires locking "
1520   "%select{any mutex|any mutex exclusively}1">,
1521   InGroup<ThreadSafety>, DefaultIgnore;
1522 def warn_var_deref_requires_any_lock : Warning<
1523   "%select{reading|writing}1 the value pointed to by '%0' requires locking "
1524   "%select{any mutex|any mutex exclusively}1">,
1525   InGroup<ThreadSafety>, DefaultIgnore;
1526 def warn_fun_requires_lock : Warning<
1527   "calling function '%0' requires %select{shared|exclusive}2 lock on '%1'">,
1528   InGroup<ThreadSafety>, DefaultIgnore;
1529 def warn_fun_excludes_mutex : Warning<
1530   "cannot call function '%0' while mutex '%1' is locked">,
1531   InGroup<ThreadSafety>, DefaultIgnore;
1532 def warn_cannot_resolve_lock : Warning<
1533   "cannot resolve lock expression to a specific lockable object">,
1534   InGroup<ThreadSafety>, DefaultIgnore;
1535
1536
1537 def warn_impcast_vector_scalar : Warning<
1538   "implicit conversion turns vector to scalar: %0 to %1">,
1539   InGroup<DiagGroup<"conversion">>, DefaultIgnore;
1540 def warn_impcast_complex_scalar : Warning<
1541   "implicit conversion discards imaginary component: %0 to %1">,
1542   InGroup<DiagGroup<"conversion">>, DefaultIgnore;
1543 def warn_impcast_float_precision : Warning<
1544   "implicit conversion loses floating-point precision: %0 to %1">,
1545   InGroup<DiagGroup<"conversion">>, DefaultIgnore;
1546 def warn_impcast_float_integer : Warning<
1547   "implicit conversion turns floating-point number into integer: %0 to %1">,
1548   InGroup<DiagGroup<"conversion">>, DefaultIgnore;
1549 def warn_impcast_integer_sign : Warning<
1550   "implicit conversion changes signedness: %0 to %1">,
1551   InGroup<DiagGroup<"sign-conversion">>, DefaultIgnore;
1552 def warn_impcast_integer_sign_conditional : Warning<
1553   "operand of ? changes signedness: %0 to %1">,
1554   InGroup<DiagGroup<"sign-conversion">>, DefaultIgnore;
1555 def warn_impcast_integer_precision : Warning<
1556   "implicit conversion loses integer precision: %0 to %1">,
1557   InGroup<DiagGroup<"conversion">>, DefaultIgnore;
1558 def warn_impcast_integer_64_32 : Warning<
1559   "implicit conversion loses integer precision: %0 to %1">,
1560   InGroup<DiagGroup<"shorten-64-to-32">>, DefaultIgnore;
1561 def warn_impcast_integer_precision_constant : Warning<
1562   "implicit conversion from %2 to %3 changes value from %0 to %1">,
1563   InGroup<DiagGroup<"constant-conversion">>;
1564 def warn_impcast_bitfield_precision_constant : Warning<
1565   "implicit truncation from %2 to bitfield changes value from %0 to %1">,
1566   InGroup<DiagGroup<"constant-conversion">>;
1567 def warn_impcast_literal_float_to_integer : Warning<
1568   "implicit conversion turns literal floating-point number into integer: "
1569   "%0 to %1">,
1570   InGroup<DiagGroup<"literal-conversion">>, DefaultIgnore;
1571 def warn_impcast_string_literal_to_bool : Warning<
1572   "implicit conversion turns string literal into bool: %0 to %1">,
1573   InGroup<DiagGroup<"string-conversion">>, DefaultIgnore;
1574 def warn_impcast_different_enum_types : Warning<
1575   "implicit conversion from enumeration type %0 to different enumeration type "
1576   "%1">, InGroup<DiagGroup<"conversion">>;
1577 def warn_impcast_bool_to_null_pointer : Warning<
1578     "initialization of pointer of type %0 to null from a constant boolean "
1579     "expression">, InGroup<BoolConversions>;
1580 def warn_impcast_null_pointer_to_integer : Warning<
1581     "implicit conversion of NULL constant to integer">,
1582     InGroup<DiagGroup<"conversion">>, DefaultIgnore;
1583
1584 def warn_cast_align : Warning<
1585   "cast from %0 to %1 increases required alignment from %2 to %3">,
1586   InGroup<CastAlign>, DefaultIgnore;
1587
1588 def warn_attribute_ignored_for_field_of_type : Warning<
1589   "%0 attribute ignored for field of type %1">;
1590 def warn_transparent_union_attribute_field_size_align : Warning<
1591   "%select{alignment|size}0 of field %1 (%2 bits) does not match the "
1592   "%select{alignment|size}0 of the first field in transparent union; "
1593   "transparent_union attribute ignored">;
1594 def note_transparent_union_first_field_size_align : Note<
1595   "%select{alignment|size}0 of first field is %1 bits">;
1596 def warn_transparent_union_attribute_not_definition : Warning<
1597   "transparent_union attribute can only be applied to a union definition; "
1598   "attribute ignored">;
1599 def warn_transparent_union_attribute_floating : Warning<
1600   "first field of a transparent union cannot have %select{floating point|"
1601   "vector}0 type %1; transparent_union attribute ignored">;
1602 def warn_transparent_union_attribute_zero_fields : Warning<
1603   "transparent union definition must contain at least one field; "
1604   "transparent_union attribute ignored">;
1605 def warn_attribute_type_not_supported : Warning<
1606   "'%0' attribute argument not supported: %1">;
1607 def warn_attribute_unknown_visibility : Warning<"unknown visibility '%0'">;
1608 def err_unknown_machine_mode : Error<"unknown machine mode %0">;
1609 def err_unsupported_machine_mode : Error<"unsupported machine mode %0">;
1610 def err_mode_not_primitive : Error<
1611   "mode attribute only supported for integer and floating-point types">;
1612 def err_mode_wrong_type : Error<
1613   "type of machine mode does not match type of base type">;
1614 def err_attr_wrong_decl : Error<
1615   "'%0' attribute invalid on this declaration, requires typedef or value">;
1616 def warn_attribute_nonnull_no_pointers : Warning<
1617   "'nonnull' attribute applied to function with no pointer arguments">;
1618 def warn_attribute_malloc_pointer_only : Warning<
1619   "'malloc' attribute only applies to functions returning a pointer type">;
1620 def warn_transparent_union_nonpointer : Warning<
1621   "'transparent_union' attribute support incomplete; only supported for "
1622   "pointer unions">;
1623 def warn_attribute_sentinel_named_arguments : Warning<
1624   "'sentinel' attribute requires named arguments">;
1625 def warn_attribute_sentinel_not_variadic : Warning<
1626   "'sentinel' attribute only supported for variadic %select{functions|blocks}0">;
1627 def err_attribute_sentinel_less_than_zero : Error<
1628   "'sentinel' parameter 1 less than zero">;
1629 def err_attribute_sentinel_not_zero_or_one : Error<
1630   "'sentinel' parameter 2 not 0 or 1">;
1631 def err_attribute_cleanup_arg_not_found : Error<
1632   "'cleanup' argument %0 not found">;
1633 def err_attribute_cleanup_arg_not_function : Error<
1634   "'cleanup' argument %0 is not a function">;
1635 def err_attribute_cleanup_func_must_take_one_arg : Error<
1636   "'cleanup' function %0 must take 1 parameter">;
1637 def err_attribute_cleanup_func_arg_incompatible_type : Error<
1638   "'cleanup' function %0 parameter has type %1 which is incompatible with "
1639   "type %2">;
1640 def err_attribute_regparm_wrong_platform : Error<
1641   "'regparm' is not valid on this platform">;
1642 def err_attribute_regparm_invalid_number : Error<
1643   "'regparm' parameter must be between 0 and %0 inclusive">;
1644
1645
1646 // Clang-Specific Attributes
1647 def warn_attribute_iboutlet : Warning<
1648   "%0 attribute can only be applied to instance variables or properties">;
1649 def warn_attribute_ibaction: Warning<
1650   "ibaction attribute can only be applied to Objective-C instance methods">;
1651 def err_iboutletcollection_type : Error<
1652   "invalid type %0 as argument of iboutletcollection attribute">;
1653 def err_iboutlet_object_type : Error<
1654   "%select{ivar|property}2 with %0 attribute must "
1655   "be an object type (invalid %1)">;
1656 def err_attribute_overloadable_not_function : Error<
1657   "'overloadable' attribute can only be applied to a function">;
1658 def err_attribute_overloadable_missing : Error<
1659   "%select{overloaded function|redeclaration of}0 %1 must have the "
1660   "'overloadable' attribute">;
1661 def note_attribute_overloadable_prev_overload : Note<
1662   "previous overload of function is here">;
1663 def err_attribute_overloadable_no_prototype : Error<
1664   "'overloadable' function %0 must have a prototype">;
1665 def warn_ns_attribute_wrong_return_type : Warning<
1666   "%0 attribute only applies to %select{functions|methods}1 that "
1667   "return %select{an Objective-C object|a pointer|a non-retainable pointer}2">;
1668 def warn_ns_attribute_wrong_parameter_type : Warning<
1669   "%0 attribute only applies to %select{Objective-C object|pointer}1 "
1670   "parameters">;
1671 def err_ns_bridged_not_interface : Error<
1672   "parameter of 'ns_bridged' attribute does not name an Objective-C class">;
1673
1674 // Function Parameter Semantic Analysis.
1675 def err_param_with_void_type : Error<"argument may not have 'void' type">;
1676 def err_void_only_param : Error<
1677   "'void' must be the first and only parameter if specified">;
1678 def err_void_param_qualified : Error<
1679   "'void' as parameter must not have type qualifiers">;
1680 def err_ident_list_in_fn_declaration : Error<
1681   "a parameter list without types is only allowed in a function definition">;
1682 def ext_param_not_declared : Extension<
1683   "parameter %0 was not declared, defaulting to type 'int'">;
1684 def err_param_typedef_of_void : Error<
1685   "empty parameter list defined with a %select{typedef|type alias}0 of 'void' not allowed%select{ in C++|}0">;
1686 def err_param_default_argument : Error<
1687   "C does not support default arguments">;
1688 def err_param_default_argument_redefinition : Error<
1689   "redefinition of default argument">;
1690 def warn_param_default_argument_redefinition : ExtWarn<
1691   "redefinition of default argument">;
1692 def err_param_default_argument_missing : Error<
1693   "missing default argument on parameter">;
1694 def err_param_default_argument_missing_name : Error<
1695   "missing default argument on parameter %0">;
1696 def err_param_default_argument_references_param : Error<
1697   "default argument references parameter %0">;
1698 def err_param_default_argument_references_local : Error<
1699   "default argument references local variable %0 of enclosing function">;
1700 def err_param_default_argument_references_this : Error<
1701   "default argument references 'this'">;
1702 def err_param_default_argument_nonfunc : Error<
1703   "default arguments can only be specified for parameters in a function "
1704   "declaration">;
1705 def err_param_default_argument_template_redecl : Error<
1706   "default arguments cannot be added to a function template that has already "
1707   "been declared">;
1708 def err_param_default_argument_member_template_redecl : Error<
1709   "default arguments cannot be added to an out-of-line definition of a member "
1710   "of a %select{class template|class template partial specialization|nested "
1711   "class in a template}0">;
1712 def err_uninitialized_member_for_assign : Error<
1713   "cannot define the implicit default assignment operator for %0, because "
1714   "non-static %select{reference|const}1 member %2 can't use default "
1715   "assignment operator">;
1716 def note_first_required_here : Note<
1717   "synthesized method is first required here">;
1718 def err_uninitialized_member_in_ctor : Error<
1719   "%select{|implicit default }0constructor for %1 must explicitly initialize "
1720   "the %select{reference|const}2 member %3">;
1721 def warn_default_arg_makes_ctor_special : Warning<
1722   "addition of default argument on redeclaration makes this constructor a "
1723   "%select{default|copy|move}0 constructor">, InGroup<DefaultArgSpecialMember>;
1724 def note_previous_declaration_special : Note<
1725   // The ERRORs are in hopes that if they occur, they'll get reported.
1726   "previous declaration was %select{*ERROR*|a copy constructor|a move "
1727   "constructor|*ERROR*|*ERROR*|*ERROR*|not a special member function}0">;
1728
1729 def err_use_of_default_argument_to_function_declared_later : Error<
1730   "use of default argument to function %0 that is declared later in class %1">;
1731 def note_default_argument_declared_here : Note<
1732   "default argument declared here">;
1733
1734 def ext_param_promoted_not_compatible_with_prototype : ExtWarn<
1735   "promoted type %0 of K&R function parameter is not compatible with the "
1736   "parameter type %1 declared in a previous prototype">;
1737
1738
1739 // C++ Overloading Semantic Analysis.
1740 def err_ovl_diff_return_type : Error<
1741   "functions that differ only in their return type cannot be overloaded">;
1742 def err_ovl_static_nonstatic_member : Error<
1743   "static and non-static member functions with the same parameter types "
1744   "cannot be overloaded">;
1745
1746 def err_ovl_no_viable_function_in_call : Error<
1747   "no matching function for call to %0">;
1748 def err_ovl_no_viable_member_function_in_call : Error<
1749   "no matching member function for call to %0">;
1750 def err_ovl_ambiguous_call : Error<
1751   "call to %0 is ambiguous">;
1752 def err_ovl_deleted_call : Error<
1753   "call to %select{unavailable|deleted}0 function %1%2">;
1754 def err_ovl_ambiguous_member_call : Error<
1755   "call to member function %0 is ambiguous">;
1756 def err_ovl_deleted_member_call : Error<
1757   "call to %select{unavailable|deleted}0 member function %1%2">;
1758 def note_ovl_too_many_candidates : Note<
1759     "remaining %0 candidate%s0 omitted; "
1760     "pass -fshow-overloads=all to show them">;
1761 def note_ovl_candidate : Note<"candidate "
1762     "%select{function|function|constructor|"
1763     "function |function |constructor |"
1764     "is the implicit default constructor|"
1765     "is the implicit copy constructor|"
1766     "is the implicit move constructor|"
1767     "is the implicit copy assignment operator|"
1768     "is the implicit move assignment operator|"
1769     "is an inherited constructor}0%1">;
1770
1771 def note_ovl_candidate_inherited_constructor : Note<"inherited from here">;
1772 def note_ovl_candidate_bad_deduction : Note<
1773     "candidate template ignored: failed template argument deduction">;
1774 def note_ovl_candidate_incomplete_deduction : Note<"candidate template ignored: "
1775     "couldn't infer template argument %0">;
1776 def note_ovl_candidate_inconsistent_deduction : Note<
1777     "candidate template ignored: deduced conflicting %select{types|values|"
1778     "templates}0 for parameter %1 (%2 vs. %3)">;
1779 def note_ovl_candidate_explicit_arg_mismatch_named : Note<
1780     "candidate template ignored: invalid explicitly-specified argument "
1781     "for template parameter %0">;
1782 def note_ovl_candidate_explicit_arg_mismatch_unnamed : Note<
1783     "candidate template ignored: invalid explicitly-specified argument "
1784     "for %ordinal0 template parameter">;
1785 def note_ovl_candidate_instantiation_depth : Note<
1786     "candidate template ignored: substitution exceeded maximum template "
1787     "instantiation depth">;
1788 def note_ovl_candidate_underqualified : Note<
1789     "candidate template ignored: can't deduce a type for %0 which would "
1790     "make %2 equal %1">;
1791 def note_ovl_candidate_substitution_failure : Note<
1792     "candidate template ignored: substitution failure %0">;
1793     
1794 // Note that we don't treat templates differently for this diagnostic.
1795 def note_ovl_candidate_arity : Note<"candidate "
1796     "%select{function|function|constructor|function|function|constructor|"
1797     "constructor (the implicit default constructor)|"
1798     "constructor (the implicit copy constructor)|"
1799     "constructor (the implicit move constructor)|"
1800     "function (the implicit copy assignment operator)|"
1801     "function (the implicit move assignment operator)|"
1802     "constructor (inherited)}0 %select{|template }1"
1803     "not viable: requires%select{ at least| at most|}2 %3 argument%s3, but %4 "
1804     "%plural{1:was|:were}4 provided">;
1805
1806 def note_ovl_candidate_deleted : Note<
1807     "candidate %select{function|function|constructor|"
1808     "function |function |constructor |"
1809     "constructor (the implicit default constructor)|"
1810     "constructor (the implicit copy constructor)|"
1811     "constructor (the implicit move constructor)|"
1812     "function (the implicit copy assignment operator)|"
1813     "function (the implicit move assignment operator)|"
1814     "constructor (inherited)}0%1 "
1815     "has been explicitly %select{made unavailable|deleted}2">;
1816
1817 // Giving the index of the bad argument really clutters this message, and
1818 // it's relatively unimportant because 1) it's generally obvious which
1819 // argument(s) are of the given object type and 2) the fix is usually
1820 // to complete the type, which doesn't involve changes to the call line
1821 // anyway.  If people complain, we can change it.
1822 def note_ovl_candidate_bad_conv_incomplete : Note<"candidate "
1823     "%select{function|function|constructor|"
1824     "function |function |constructor |"
1825     "constructor (the implicit default constructor)|"
1826     "constructor (the implicit copy constructor)|"
1827     "constructor (the implicit move constructor)|"
1828     "function (the implicit copy assignment operator)|"
1829     "function (the implicit move assignment operator)|"
1830     "constructor (inherited)}0%1 "
1831     "not viable: cannot convert argument of incomplete type %2 to %3">;
1832 def note_ovl_candidate_bad_list_argument : Note<"candidate "
1833     "%select{function|function|constructor|"
1834     "function |function |constructor |"
1835     "constructor (the implicit default constructor)|"
1836     "constructor (the implicit copy constructor)|"
1837     "constructor (the implicit move constructor)|"
1838     "function (the implicit copy assignment operator)|"
1839     "function (the implicit move assignment operator)|"
1840     "constructor (inherited)}0%1 "
1841     "not viable: cannot convert initializer list argument to %3">;
1842 def note_ovl_candidate_bad_overload : Note<"candidate "
1843     "%select{function|function|constructor|"
1844     "function |function |constructor |"
1845     "constructor (the implicit default constructor)|"
1846     "constructor (the implicit copy constructor)|"
1847     "constructor (the implicit move constructor)|"
1848     "function (the implicit copy assignment operator)|"
1849     "function (the implicit move assignment operator)|"
1850     "constructor (inherited)}0%1"
1851     " not viable: no overload of %3 matching %2 for %ordinal4 argument">;
1852 def note_ovl_candidate_bad_conv : Note<"candidate "
1853     "%select{function|function|constructor|"
1854     "function |function |constructor |"
1855     "constructor (the implicit default constructor)|"
1856     "constructor (the implicit copy constructor)|"
1857     "constructor (the implicit move constructor)|"
1858     "function (the implicit copy assignment operator)|"
1859     "function (the implicit move assignment operator)|"
1860     "constructor (inherited)}0%1"
1861     " not viable: no known conversion from %2 to %3 for "
1862     "%select{%ordinal5 argument|object argument}4; "
1863     "%select{|dereference the argument with *|"
1864     "take the address of the argument with &|"
1865     "remove *|"
1866     "remove &}6">;
1867 def note_ovl_candidate_bad_arc_conv : Note<"candidate "
1868     "%select{function|function|constructor|"
1869     "function |function |constructor |"
1870     "constructor (the implicit default constructor)|"
1871     "constructor (the implicit copy constructor)|"
1872     "constructor (the implicit move constructor)|"
1873     "function (the implicit copy assignment operator)|"
1874     "function (the implicit move assignment operator)|"
1875     "constructor (inherited)}0%1"
1876     " not viable: cannot implicitly convert argument of type %2 to %3 for "
1877     "%select{%ordinal5 argument|object argument}4 under ARC">;
1878 def note_ovl_candidate_bad_addrspace : Note<"candidate "
1879     "%select{function|function|constructor|"
1880     "function |function |constructor |"
1881     "constructor (the implicit default constructor)|"
1882     "constructor (the implicit copy constructor)|"
1883     "constructor (the implicit move constructor)|"
1884     "function (the implicit copy assignment operator)|"
1885     "function (the implicit move assignment operator)|"
1886     "constructor (inherited)}0%1 not viable: "
1887     "%select{%ordinal6|'this'}5 argument (%2) is in "
1888     "address space %3, but parameter must be in address space %4">;
1889 def note_ovl_candidate_bad_gc : Note<"candidate "
1890     "%select{function|function|constructor|"
1891     "function |function |constructor |"
1892     "constructor (the implicit default constructor)|"
1893     "constructor (the implicit copy constructor)|"
1894     "constructor (the implicit move constructor)|"
1895     "function (the implicit copy assignment operator)|"
1896     "function (the implicit move assignment operator)|"
1897     "constructor (inherited)}0%1 not viable: "
1898     "%select{%ordinal6|'this'}5 argument (%2) has %select{no|__weak|__strong}3 "
1899     "ownership, but parameter has %select{no|__weak|__strong}4 ownership">;
1900 def note_ovl_candidate_bad_ownership : Note<"candidate "
1901     "%select{function|function|constructor|"
1902     "function |function |constructor |"
1903     "constructor (the implicit default constructor)|"
1904     "constructor (the implicit copy constructor)|"
1905     "constructor (the implicit move constructor)|"
1906     "function (the implicit copy assignment operator)|"
1907     "function (the implicit move assignment operator)|"
1908     "constructor (inherited)}0%1 not viable: "
1909     "%select{%ordinal6|'this'}5 argument (%2) has "
1910     "%select{no|__unsafe_unretained|__strong|__weak|__autoreleasing}3 ownership,"
1911     " but parameter has %select{no|__unsafe_unretained|__strong|__weak|"
1912     "__autoreleasing}4 ownership">;
1913 def note_ovl_candidate_bad_cvr_this : Note<"candidate "
1914     "%select{|function|||function|||||"
1915     "function (the implicit copy assignment operator)|"
1916     "function (the implicit move assignment operator)|}0 not viable: "
1917     "'this' argument has type %2, but method is not marked "
1918     "%select{const|restrict|const or restrict|volatile|const or volatile|"
1919     "volatile or restrict|const, volatile, or restrict}3">;
1920 def note_ovl_candidate_bad_cvr : Note<"candidate "
1921     "%select{function|function|constructor|"
1922     "function |function |constructor |"
1923     "constructor (the implicit default constructor)|"
1924     "constructor (the implicit copy constructor)|"
1925     "constructor (the implicit move constructor)|"
1926     "function (the implicit copy assignment operator)|"
1927     "function (the implicit move assignment operator)|"
1928     "constructor (inherited)}0%1 not viable: "
1929     "%ordinal4 argument (%2) would lose "
1930     "%select{const|restrict|const and restrict|volatile|const and volatile|"
1931     "volatile and restrict|const, volatile, and restrict}3 qualifier"
1932     "%select{||s||s|s|s}3">;
1933 def note_ovl_candidate_bad_base_to_derived_conv : Note<"candidate "
1934     "%select{function|function|constructor|"
1935     "function |function |constructor |"
1936     "constructor (the implicit default constructor)|"
1937     "constructor (the implicit copy constructor)|"
1938     "constructor (the implicit move constructor)|"
1939     "function (the implicit copy assignment operator)|"
1940     "function (the implicit move assignment operator)|"
1941     "constructor (inherited)}0%1"
1942     " not viable: cannot %select{convert from|convert from|bind}2 "
1943     "%select{base class pointer|superclass|base class object of type}2 %3 to "
1944     "%select{derived class pointer|subclass|derived class reference}2 %4 for "
1945     "%ordinal5 argument">;
1946 def note_ovl_candidate_bad_target : Note<
1947     "candidate %select{function|function|constructor|"
1948     "function |function |constructor |"
1949     "constructor (the implicit default constructor)|"
1950     "constructor (the implicit copy constructor)|"
1951     "constructor (the implicit move constructor)|"
1952     "function (the implicit copy assignment operator)|"
1953     "function (the implicit move assignment operator)|"
1954     "constructor (inherited)}0 not viable: call to "
1955     "%select{__device__|__global__|__host__|__host__ __device__}1 function from"
1956     " %select{__device__|__global__|__host__|__host__ __device__}2 function">;
1957
1958 def note_ambiguous_type_conversion: Note<
1959     "because of ambiguity in conversion of %0 to %1">;
1960 def note_ovl_builtin_binary_candidate : Note<
1961     "built-in candidate %0">;
1962 def note_ovl_builtin_unary_candidate : Note<
1963     "built-in candidate %0">;
1964 def err_ovl_no_viable_function_in_init : Error<
1965   "no matching constructor for initialization of %0">;
1966 def err_ovl_no_conversion_in_cast : Error<
1967   "cannot convert %1 to %2 without a conversion operator">;
1968 def err_ovl_no_viable_conversion_in_cast : Error<
1969   "no matching conversion for %select{|static_cast|reinterpret_cast|"
1970   "dynamic_cast|C-style cast|functional-style cast}0 from %1 to %2">;
1971 def err_ovl_ambiguous_conversion_in_cast : Error<
1972   "ambiguous conversion for %select{|static_cast|reinterpret_cast|"
1973   "dynamic_cast|C-style cast|functional-style cast}0 from %1 to %2">;
1974 def err_ovl_deleted_conversion_in_cast : Error<
1975   "%select{|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
1976   "functional-style cast}0 from %1 to %2 uses deleted function">;
1977 def err_ovl_ambiguous_init : Error<"call to constructor of %0 is ambiguous">;
1978 def err_ref_init_ambiguous : Error<
1979   "reference initialization of type %0 with initializer of type %1 is ambiguous">;
1980 def err_ovl_deleted_init : Error<
1981   "call to %select{unavailable|deleted}0 constructor of %1">;
1982 def err_ovl_ambiguous_oper_unary : Error<
1983   "use of overloaded operator '%0' is ambiguous (operand type %1)">;
1984 def err_ovl_ambiguous_oper_binary : Error<
1985   "use of overloaded operator '%0' is ambiguous (with operand types %1 and %2)">;
1986 def err_ovl_no_viable_oper : Error<"no viable overloaded '%0'">;
1987 def err_ovl_deleted_oper : Error<
1988   "overload resolution selected %select{unavailable|deleted}0 operator '%1'%2">;
1989 def err_ovl_no_viable_subscript :
1990     Error<"no viable overloaded operator[] for type %0">;
1991 def err_ovl_no_oper :
1992     Error<"type %0 does not provide a %select{subscript|call}1 operator">;
1993 def err_ovl_unresolvable : Error<
1994   "reference to overloaded function could not be resolved; "
1995   "did you mean to call it%select{| with no arguments}0?">;
1996 def err_bound_member_function : Error<
1997   "reference to non-static member function must be called"
1998   "%select{|; did you mean to call it with no arguments?}0">;
1999 def note_possible_target_of_call : Note<"possible target for call">;
2000
2001 def err_ovl_no_viable_object_call : Error<
2002   "no matching function for call to object of type %0">;
2003 def err_ovl_ambiguous_object_call : Error<
2004   "call to object of type %0 is ambiguous">;
2005 def err_ovl_deleted_object_call : Error<
2006   "call to %select{unavailable|deleted}0 function call operator in type %1%2">;
2007 def note_ovl_surrogate_cand : Note<"conversion candidate of type %0">;
2008 def err_member_call_without_object : Error<
2009   "call to non-static member function without an object argument">;
2010
2011 // C++ Address of Overloaded Function
2012 def err_addr_ovl_no_viable : Error<
2013   "address of overloaded function %0 does not match required type %1">;
2014 def err_addr_ovl_ambiguous : Error<
2015   "address of overloaded function %0 is ambiguous">;
2016 def err_addr_ovl_not_func_ptrref : Error<
2017   "address of overloaded function %0 cannot be converted to type %1">;
2018 def err_addr_ovl_no_qualifier : Error<
2019   "can't form member pointer of type %0 without '&' and class name">;
2020   
2021 // C++ Template Declarations
2022 def err_template_param_shadow : Error<
2023   "declaration of %0 shadows template parameter">;
2024 def note_template_param_here : Note<"template parameter is declared here">;
2025 def warn_template_export_unsupported : Warning<
2026   "exported templates are unsupported">;
2027 def err_template_outside_namespace_or_class_scope : Error<
2028   "templates can only be declared in namespace or class scope">;
2029 def err_template_linkage : Error<"templates must have C++ linkage">;
2030 def err_template_typedef : Error<"a typedef cannot be a template">;
2031 def err_template_unnamed_class : Error<
2032   "cannot declare a class template with no name">;
2033 def err_template_param_list_different_arity : Error<
2034   "%select{too few|too many}0 template parameters in template "
2035   "%select{|template parameter }1redeclaration">;
2036 def note_template_param_list_different_arity : Note<
2037   "%select{too few|too many}0 template parameters in template template "
2038   "argument">;
2039 def note_template_prev_declaration : Note<
2040   "previous template %select{declaration|template parameter}0 is here">;
2041 def err_template_param_different_kind : Error<
2042   "template parameter has a different kind in template "
2043   "%select{|template parameter }0redeclaration">;
2044 def note_template_param_different_kind : Note<
2045   "template parameter has a different kind in template argument">;
2046   
2047 def err_template_nontype_parm_different_type : Error<
2048   "template non-type parameter has a different type %0 in template "
2049   "%select{|template parameter }1redeclaration">;
2050
2051 def note_template_nontype_parm_different_type : Note<
2052   "template non-type parameter has a different type %0 in template argument">;
2053 def note_template_nontype_parm_prev_declaration : Note<
2054   "previous non-type template parameter with type %0 is here">;
2055 def err_template_nontype_parm_bad_type : Error<
2056   "a non-type template parameter cannot have type %0">;
2057 def err_template_param_default_arg_redefinition : Error<
2058   "template parameter redefines default argument">;
2059 def note_template_param_prev_default_arg : Note<
2060   "previous default template argument defined here">;
2061 def err_template_param_default_arg_missing : Error<
2062   "template parameter missing a default argument">;
2063 def ext_template_parameter_default_in_function_template : ExtWarn<
2064   "default template arguments for a function template are a C++11 extension">,
2065   InGroup<CXX11>;
2066 def err_template_parameter_default_template_member : Error<
2067   "cannot add a default template argument to the definition of a member of a "
2068   "class template">;
2069 def err_template_parameter_default_friend_template : Error<
2070   "default template argument not permitted on a friend template">;
2071 def err_template_template_parm_no_parms : Error<
2072   "template template parameter must have its own template parameters">;
2073
2074 def err_template_variable : Error<"variable %0 declared as a template">;
2075 def err_template_variable_noparams : Error<
2076   "extraneous 'template<>' in declaration of variable %0">;
2077 def err_template_member : Error<"member %0 declared as a template">;
2078 def err_template_member_noparams : Error<
2079   "extraneous 'template<>' in declaration of member %0">;
2080 def err_template_tag_noparams : Error<
2081   "extraneous 'template<>' in declaration of %0 %1">;
2082 def err_template_decl_ref : Error<
2083   "cannot refer to class template %0 without a template argument list">;
2084
2085 // C++ Template Argument Lists
2086 def err_template_missing_args : Error<
2087   "use of class template %0 requires template arguments">;
2088 def err_template_arg_list_different_arity : Error<
2089   "%select{too few|too many}0 template arguments for "
2090   "%select{class template|function template|template template parameter"
2091   "|template}1 %2">;
2092 def note_template_decl_here : Note<"template is declared here">;
2093 def note_member_of_template_here : Note<"member is declared here">;
2094 def err_template_arg_must_be_type : Error<
2095   "template argument for template type parameter must be a type">;
2096 def err_template_arg_must_be_expr : Error<
2097   "template argument for non-type template parameter must be an expression">;
2098 def err_template_arg_nontype_ambig : Error<
2099   "template argument for non-type template parameter is treated as type %0">;
2100 def err_template_arg_must_be_template : Error<
2101   "template argument for template template parameter must be a class template%select{| or type alias template}0">;
2102 def ext_template_arg_local_type : ExtWarn<
2103   "template argument uses local type %0">, InGroup<LocalTypeTemplateArgs>;
2104 def ext_template_arg_unnamed_type : ExtWarn<
2105   "template argument uses unnamed type">, InGroup<UnnamedTypeTemplateArgs>;
2106 def note_template_unnamed_type_here : Note<
2107   "unnamed type used in template argument was declared here">;
2108 def err_template_arg_overload_type : Error<
2109   "template argument is the type of an unresolved overloaded function">;
2110 def err_template_arg_not_class_template : Error<
2111   "template argument does not refer to a class template or template "
2112   "template parameter">;
2113 def note_template_arg_refers_here_func : Note<
2114   "template argument refers to function template %0, here">;
2115 def err_template_arg_template_params_mismatch : Error<
2116   "template template argument has different template parameters than its "
2117   "corresponding template template parameter">;
2118 def err_template_arg_not_integral_or_enumeral : Error<
2119   "non-type template argument of type %0 must have an integral or enumeration"
2120   " type">;
2121 def err_template_arg_not_ice : Error<
2122   "non-type template argument of type %0 is not an integral constant "
2123   "expression">;
2124 def err_deduced_non_type_template_arg_type_mismatch : Error<
2125   "deduced non-type template argument does not have the same type as the "
2126   "its corresponding template parameter (%0 vs %1)">;
2127 def err_template_arg_not_convertible : Error<
2128   "non-type template argument of type %0 cannot be converted to a value "
2129   "of type %1">;
2130 def warn_template_arg_negative : Warning<
2131   "non-type template argument with value '%0' converted to '%1' for unsigned "
2132   "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
2133 def warn_template_arg_too_large : Warning<
2134   "non-type template argument value '%0' truncated to '%1' for "
2135   "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
2136 def err_template_arg_no_ref_bind : Error<
2137   "non-type template parameter of reference type %0 cannot bind to template "
2138   "argument of type %1">;
2139 def err_template_arg_ref_bind_ignores_quals : Error<
2140   "reference binding of non-type template parameter of type %0 to template "
2141   "argument of type %1 ignores qualifiers">;
2142 def err_template_arg_not_decl_ref : Error<
2143   "non-type template argument does not refer to any declaration">;
2144 def err_template_arg_not_object_or_func_form : Error<
2145   "non-type template argument does not directly refer to an object or "
2146   "function">;
2147 def err_template_arg_not_address_of : Error<
2148   "non-type template argument for template parameter of pointer type %0 must "
2149   "have its address taken">;
2150 def err_template_arg_address_of_non_pointer : Error<
2151   "address taken in non-type template argument for template parameter of "
2152   "reference type %0">;
2153 def err_template_arg_reference_var : Error<
2154   "non-type template argument of reference type %0 is not an object">;
2155 def err_template_arg_field : Error<
2156   "non-type template argument refers to non-static data member %0">;
2157 def err_template_arg_method : Error<
2158   "non-type template argument refers to non-static member function %0">;
2159 def err_template_arg_function_not_extern : Error<
2160   "non-template argument refers to function %0 with internal linkage">;
2161 def err_template_arg_object_not_extern : Error<
2162   "non-template argument refers to object %0 that does not have external "
2163   "linkage">;
2164 def note_template_arg_internal_object : Note<
2165   "non-template argument refers to %select{function|object}0 here">;
2166 def note_template_arg_refers_here : Note<"non-template argument refers here">;
2167 def err_template_arg_not_object_or_func : Error<
2168   "non-type template argument does not refer to an object or function">;
2169 def err_template_arg_not_pointer_to_member_form : Error<
2170   "non-type template argument is not a pointer to member constant">;
2171 def ext_template_arg_extra_parens : ExtWarn<
2172   "address non-type template argument cannot be surrounded by parentheses">;
2173 def err_pointer_to_member_type : Error<
2174   "invalid use of pointer to member type after %select{.*|->*}0">;
2175 def err_pointer_to_member_call_drops_quals : Error<
2176   "call to pointer to member function of type %0 drops '%1' qualifier%s2">;
2177 def err_pointer_to_member_oper_value_classify: Error<
2178   "pointer-to-member function type %0 can only be called on an "
2179   "%select{rvalue|lvalue}1">;
2180
2181 // C++ template specialization
2182 def err_template_spec_unknown_kind : Error<
2183   "can only provide an explicit specialization for a class template, function "
2184   "template, or a member function, static data member, or member class of a "
2185   "class template">;
2186 def note_specialized_entity : Note<
2187   "explicitly specialized declaration is here">;
2188 def err_template_spec_decl_function_scope : Error<
2189   "explicit specialization of %0 in function scope">;
2190 def err_template_spec_decl_class_scope : Error<
2191   "explicit specialization of %0 in class scope">;
2192 def err_template_spec_decl_friend : Error<
2193   "cannot declare an explicit specialization in a friend">;
2194 def err_template_spec_decl_out_of_scope_global : Error<
2195   "%select{class template|class template partial|function template|member "
2196   "function|static data member|member class}0 specialization of %1 must "
2197   "originally be declared in the global scope">;
2198 def ext_template_spec_decl_out_of_scope_global : ExtWarn<
2199   "%select{class template|class template partial|function template|member "
2200   "function|static data member|member class}0 specialization of %1 must "
2201   "originally be declared in the global scope; accepted as a C++11 extension">,
2202   InGroup<CXX11>;
2203 def err_template_spec_decl_out_of_scope : Error<
2204   "%select{class template|class template partial|function template|member "
2205   "function|static data member|member class}0 specialization of %1 must "
2206   "originally be declared in namespace %2">;
2207 def ext_template_spec_decl_out_of_scope : ExtWarn<
2208   "%select{class template|class template partial|function template|member "
2209   "function|static data member|member class}0 specialization of %1 must "
2210   "originally be declared in namespace %2; accepted as a C++11 extension">,
2211   InGroup<CXX11>;
2212 def err_template_spec_redecl_out_of_scope : Error<
2213   "%select{class template|class template partial|function template|member "
2214   "function|static data member|member class}0 specialization of %1 not in a "
2215   "namespace enclosing %2">;
2216 def err_template_spec_redecl_global_scope : Error<
2217   "%select{class template|class template partial|function template|member "
2218   "function|static data member|member class}0 specialization of %1 must occur "
2219   "at global scope">;
2220 def err_spec_member_not_instantiated : Error<
2221   "specialization of member %q0 does not specialize an instantiated member">;
2222 def note_specialized_decl : Note<"attempt to specialize declaration here">;
2223 def err_specialization_after_instantiation : Error<
2224   "explicit specialization of %0 after instantiation">;
2225 def note_instantiation_required_here : Note<
2226   "%select{implicit|explicit}0 instantiation first required here">;
2227 def err_template_spec_friend : Error<
2228   "template specialization declaration cannot be a friend">;
2229 def err_template_spec_default_arg : Error<
2230   "default argument not permitted on an explicit "
2231   "%select{instantiation|specialization}0 of function %1">;
2232 def err_not_class_template_specialization : Error<
2233   "cannot specialize a %select{dependent template|template template "
2234   "parameter}0">;
2235 def err_function_specialization_in_class : Error<
2236   "cannot specialize a function %0 within class scope">;
2237 def ext_function_specialization_in_class : ExtWarn<
2238   "explicit specialization of %0 within class scope is a Microsoft extension">,
2239   InGroup<Microsoft>;
2240 def ext_explicit_specialization_storage_class : ExtWarn<
2241   "explicit specialization cannot have a storage class">;
2242 def err_explicit_specialization_inconsistent_storage_class : Error<
2243   "explicit specialization has extraneous, inconsistent storage class "
2244   "'%select{none|extern|static|__private_extern__|auto|register}0'">;
2245
2246 // C++ class template specializations and out-of-line definitions
2247 def err_template_spec_needs_header : Error<
2248   "template specialization requires 'template<>'">;
2249 def err_template_spec_needs_template_parameters : Error<
2250   "template specialization or definition requires a template parameter list "
2251   "corresponding to the nested type %0">;
2252 def err_template_param_list_matches_nontemplate : Error<
2253   "template parameter list matching the non-templated nested type %0 should "
2254   "be empty ('template<>')">;
2255 def err_alias_template_extra_headers : Error<
2256   "extraneous template parameter list in alias template declaration">;
2257 def err_template_spec_extra_headers : Error<
2258   "extraneous template parameter list in template specialization or "
2259   "out-of-line template definition">;
2260 def warn_template_spec_extra_headers : Warning<
2261   "extraneous template parameter list in template specialization">;
2262 def note_explicit_template_spec_does_not_need_header : Note<
2263   "'template<>' header not required for explicitly-specialized class %0 "
2264   "declared here">;
2265 def err_template_qualified_declarator_no_match : Error<
2266   "nested name specifier '%0' for declaration does not refer into a class, "
2267   "class template or class template partial specialization">;
2268 def err_specialize_member_of_template : Error<
2269   "cannot specialize (with 'template<>') a member of an unspecialized "
2270   "template">;
2271
2272 // C++ Class Template Partial Specialization
2273 def err_default_arg_in_partial_spec : Error<
2274     "default template argument in a class template partial specialization">;
2275 def err_dependent_non_type_arg_in_partial_spec : Error<
2276     "non-type template argument depends on a template parameter of the "
2277     "partial specialization">;
2278 def err_dependent_typed_non_type_arg_in_partial_spec : Error<
2279     "non-type template argument specializes a template parameter with "
2280     "dependent type %0">;
2281 def err_partial_spec_args_match_primary_template : Error<
2282     "class template partial specialization does not specialize any template "
2283     "argument; to %select{declare|define}0 the primary template, remove the "
2284     "template argument list">; 
2285 def warn_partial_specs_not_deducible : Warning<
2286     "class template partial specialization contains "
2287     "%select{a template parameter|template parameters}0 that can not be "
2288     "deduced; this partial specialization will never be used">;
2289 def note_partial_spec_unused_parameter : Note<
2290     "non-deducible template parameter %0">;
2291 def err_partial_spec_ordering_ambiguous : Error<
2292     "ambiguous partial specializations of %0">;
2293 def note_partial_spec_match : Note<"partial specialization matches %0">;
2294 def err_partial_spec_redeclared : Error<
2295   "class template partial specialization %0 cannot be redeclared">;
2296 def note_prev_partial_spec_here : Note<
2297   "previous declaration of class template partial specialization %0 is here">;
2298 def err_partial_spec_fully_specialized : Error<
2299   "partial specialization of %0 does not use any of its template parameters">;
2300   
2301 // C++ Function template specializations
2302 def err_function_template_spec_no_match : Error<
2303     "no function template matches function template specialization %0">;
2304 def err_function_template_spec_ambiguous : Error<
2305     "function template specialization %0 ambiguously refers to more than one "
2306     "function template; explicitly specify%select{|additional }1 template "
2307     "arguments to identify a particular function template">;
2308 def note_function_template_spec_matched : Note<
2309     "function template matches specialization %0">;
2310 def err_function_template_partial_spec : Error<
2311     "function template partial specialization is not allowed">;
2312
2313 // C++ Template Instantiation
2314 def err_template_recursion_depth_exceeded : Error<
2315   "recursive template instantiation exceeded maximum depth of %0">,
2316   DefaultFatal, NoSFINAE;
2317 def note_template_recursion_depth : Note<
2318   "use -ftemplate-depth-N to increase recursive template instantiation depth">;
2319
2320 def err_template_instantiate_within_definition : Error<
2321   "%select{implicit|explicit}0 instantiation of template %1 within its"
2322   " own definition">;
2323 def err_template_instantiate_undefined : Error<
2324   "%select{implicit|explicit}0 instantiation of undefined template %1">;
2325 def err_implicit_instantiate_member_undefined : Error<
2326   "implicit instantiation of undefined member %0">;
2327 def note_template_class_instantiation_here : Note<
2328   "in instantiation of template class %0 requested here">;
2329 def note_template_member_class_here : Note<
2330   "in instantiation of member class %0 requested here">;
2331 def note_template_member_function_here : Note<
2332   "in instantiation of member function %q0 requested here">;
2333 def note_function_template_spec_here : Note<
2334   "in instantiation of function template specialization %q0 requested here">;
2335 def note_template_static_data_member_def_here : Note<
2336   "in instantiation of static data member %q0 requested here">;
2337 def note_template_type_alias_instantiation_here : Note<
2338   "in instantiation of template type alias %0 requested here">;
2339   
2340 def note_default_arg_instantiation_here : Note<
2341   "in instantiation of default argument for '%0' required here">;
2342 def note_default_function_arg_instantiation_here : Note<
2343   "in instantiation of default function argument expression "
2344   "for '%0' required here">;
2345 def note_explicit_template_arg_substitution_here : Note<
2346   "while substituting explicitly-specified template arguments into function "
2347   "template %0 %1">;
2348 def note_function_template_deduction_instantiation_here : Note<
2349   "while substituting deduced template arguments into function template %0 "
2350   "%1">;
2351 def note_partial_spec_deduct_instantiation_here : Note<
2352   "during template argument deduction for class template partial "
2353   "specialization %0 %1">;
2354 def note_prior_template_arg_substitution : Note<
2355   "while substituting prior template arguments into %select{non-type|template}0"
2356   " template parameter%1 %2">;
2357 def note_template_default_arg_checking : Note<
2358   "while checking a default template argument used here">;
2359 def note_instantiation_contexts_suppressed : Note<
2360   "(skipping %0 context%s0 in backtrace; use -ftemplate-backtrace-limit=0 to "
2361   "see all)">;
2362
2363 def err_field_instantiates_to_function : Error<
2364   "data member instantiated with function type %0">;
2365 def err_variable_instantiates_to_function : Error<
2366   "%select{variable|static data member}0 instantiated with function type %1">;
2367 def err_nested_name_spec_non_tag : Error<
2368   "type %0 cannot be used prior to '::' because it has no members">;
2369
2370 // C++ Explicit Instantiation
2371 def err_explicit_instantiation_duplicate : Error<
2372     "duplicate explicit instantiation of %0">;
2373 def note_previous_explicit_instantiation : Note<
2374     "previous explicit instantiation is here">;
2375 def ext_explicit_instantiation_after_specialization : Extension<
2376     "explicit instantiation of %0 that occurs after an explicit "
2377     "specialization will be ignored (C++11 extension)">,
2378     InGroup<CXX11>;
2379 def note_previous_template_specialization : Note<
2380     "previous template specialization is here">;
2381 def err_explicit_instantiation_enum : Error<
2382     "explicit instantiation of enumeration type %0">;
2383 def err_explicit_instantiation_nontemplate_type : Error<
2384     "explicit instantiation of non-templated type %0">;
2385 def note_nontemplate_decl_here : Note<
2386     "non-templated declaration is here">;
2387 def err_explicit_instantiation_in_class : Error<
2388   "explicit instantiation of %0 in class scope">;
2389 def err_explicit_instantiation_out_of_scope : Error<
2390   "explicit instantiation of %0 not in a namespace enclosing %1">;
2391 def err_explicit_instantiation_must_be_global : Error<
2392   "explicit instantiation of %0 must occur at global scope">;
2393 def warn_explicit_instantiation_out_of_scope_0x : Warning<
2394   "explicit instantiation of %0 not in a namespace enclosing %1">, 
2395   InGroup<CXX11Compat>;
2396 def warn_explicit_instantiation_must_be_global_0x : Warning<
2397   "explicit instantiation of %0 must occur at global scope">, 
2398   InGroup<CXX11Compat>;
2399   
2400 def err_explicit_instantiation_requires_name : Error<
2401   "explicit instantiation declaration requires a name">;
2402 def err_explicit_instantiation_of_typedef : Error<
2403   "explicit instantiation of typedef %0">;
2404 def err_explicit_instantiation_storage_class : Error<
2405   "explicit instantiation cannot have a storage class">;
2406 def err_explicit_instantiation_not_known : Error<
2407   "explicit instantiation of %0 does not refer to a function template, member "
2408   "function, member class, or static data member">;
2409 def note_explicit_instantiation_here : Note<
2410   "explicit instantiation refers here">;
2411 def err_explicit_instantiation_data_member_not_instantiated : Error<
2412   "explicit instantiation refers to static data member %q0 that is not an "
2413   "instantiation">;
2414 def err_explicit_instantiation_member_function_not_instantiated : Error<
2415   "explicit instantiation refers to member function %q0 that is not an "
2416   "instantiation">;
2417 def err_explicit_instantiation_ambiguous : Error<
2418   "partial ordering for explicit instantiation of %0 is ambiguous">;
2419 def note_explicit_instantiation_candidate : Note<
2420   "explicit instantiation candidate function template here %0">;
2421 def err_explicit_instantiation_inline : Error<
2422   "explicit instantiation cannot be 'inline'">;
2423 def err_explicit_instantiation_constexpr : Error<
2424   "explicit instantiation cannot be 'constexpr'">;
2425 def ext_explicit_instantiation_without_qualified_id : Extension<
2426   "qualifier in explicit instantiation of %q0 requires a template-id "
2427   "(a typedef is not permitted)">;
2428 def err_explicit_instantiation_unqualified_wrong_namespace : Error<
2429   "explicit instantiation of %q0 must occur in %1">;
2430 def warn_explicit_instantiation_unqualified_wrong_namespace_0x : Warning<
2431   "explicit instantiation of %q0 must occur in %1">, 
2432   InGroup<CXX11Compat>;
2433 def err_explicit_instantiation_undefined_member : Error<
2434   "explicit instantiation of undefined %select{member class|member function|"
2435   "static data member}0 %1 of class template %2">;
2436 def err_explicit_instantiation_undefined_func_template : Error<
2437   "explicit instantiation of undefined function template %0">;
2438 def err_explicit_instantiation_declaration_after_definition : Error<
2439   "explicit instantiation declaration (with 'extern') follows explicit "
2440   "instantiation definition (without 'extern')">;
2441 def note_explicit_instantiation_definition_here : Note<
2442   "explicit instantiation definition is here">;
2443   
2444 // C++ typename-specifiers
2445 def err_typename_nested_not_found : Error<"no type named %0 in %1">;
2446 def err_typename_nested_not_type : Error<
2447     "typename specifier refers to non-type member %0 in %1">;
2448 def note_typename_refers_here : Note<
2449     "referenced member %0 is declared here">;
2450 def err_typename_missing : Error<
2451   "missing 'typename' prior to dependent type name '%0%1'">;
2452 def warn_typename_missing : ExtWarn<
2453   "missing 'typename' prior to dependent type name '%0%1'">,
2454   InGroup<DiagGroup<"typename-missing">>;
2455 def ext_typename_outside_of_template : ExtWarn<
2456   "'typename' occurs outside of a template">, InGroup<CXX11>;
2457 def err_typename_refers_to_using_value_decl : Error<
2458   "typename specifier refers to a dependent using declaration for a value "
2459   "%0 in %1">;
2460 def note_using_value_decl_missing_typename : Note<
2461   "add 'typename' to treat this using declaration as a type">;
2462
2463 def err_template_kw_refers_to_non_template : Error<
2464     "%0 following the 'template' keyword does not refer to a template">;
2465 def err_template_kw_refers_to_function_template : Error<
2466     "%0 following the 'template' keyword refers to a function template">;
2467 def err_template_kw_refers_to_class_template : Error<
2468     "'%0%1' instantiated to a class template, not a function template">;
2469 def note_referenced_class_template : Error<
2470     "class template declared here">;
2471 def err_template_kw_missing : Error<
2472   "missing 'template' keyword prior to dependent template name '%0%1'">;
2473 def ext_template_outside_of_template : ExtWarn<
2474   "'template' keyword outside of a template">, InGroup<CXX11>;
2475
2476 def err_non_type_template_in_nested_name_specifier : Error<
2477   "qualified name refers into a specialization of function template '%0'">;
2478 def err_template_id_not_a_type : Error<
2479   "template name refers to non-type template '%0'">;
2480 def note_template_declared_here : Note<
2481   "%select{function template|class template|type alias template|template template parameter}0 "
2482   "%1 declared here">;
2483
2484 // C++11 Variadic Templates
2485 def err_template_param_pack_default_arg : Error<
2486   "template parameter pack cannot have a default argument">;
2487 def err_template_param_pack_must_be_last_template_parameter : Error<
2488   "template parameter pack must be the last template parameter">;
2489
2490 def err_template_parameter_pack_non_pack : Error<
2491   "%select{template type|non-type template|template template}0 parameter"
2492   "%select{| pack}1 conflicts with previous %select{template type|"
2493   "non-type template|template template}0 parameter%select{ pack|}1">;
2494 def note_template_parameter_pack_non_pack : Note<
2495   "%select{template type|non-type template|template template}0 parameter"
2496   "%select{| pack}1 does not match %select{template type|non-type template"
2497   "|template template}0 parameter%select{ pack|}1 in template argument">;
2498 def note_template_parameter_pack_here : Note<
2499   "previous %select{template type|non-type template|template template}0 "
2500   "parameter%select{| pack}1 declared here">;
2501   
2502 def err_unexpanded_parameter_pack_0 : Error<
2503   "%select{expression|base type|declaration type|data member type|bit-field "
2504   "size|static assertion|fixed underlying type|enumerator value|"
2505   "using declaration|friend declaration|qualifier|initializer|default argument|"
2506   "non-type template parameter type|exception type|partial specialization}0 "
2507   "contains an unexpanded parameter pack">;
2508 def err_unexpanded_parameter_pack_1 : Error<
2509   "%select{expression|base type|declaration type|data member type|bit-field "
2510   "size|static assertion|fixed underlying type|enumerator value|"
2511   "using declaration|friend declaration|qualifier|initializer|default argument|"
2512   "non-type template parameter type|exception type|partial specialization}0 "
2513   "contains unexpanded parameter pack %1">;
2514 def err_unexpanded_parameter_pack_2 : Error<
2515   "%select{expression|base type|declaration type|data member type|bit-field "
2516   "size|static assertion|fixed underlying type|enumerator value|"
2517   "using declaration|friend declaration|qualifier|initializer|default argument|"
2518   "non-type template parameter type|exception type|partial specialization}0 "
2519   "contains unexpanded parameter packs %1 and %2">;
2520 def err_unexpanded_parameter_pack_3_or_more : Error<
2521   "%select{expression|base type|declaration type|data member type|bit-field "
2522   "size|static assertion|fixed underlying type|enumerator value|"
2523   "using declaration|friend declaration|qualifier|initializer|default argument|"
2524   "non-type template parameter type|exception type|partial specialization}0 "
2525   "contains unexpanded parameter packs %1, %2, ...">;
2526
2527 def err_pack_expansion_without_parameter_packs : Error<
2528   "pack expansion does not contain any unexpanded parameter packs">;
2529 def err_pack_expansion_length_conflict : Error<
2530   "pack expansion contains parameter packs %0 and %1 that have different "
2531   "lengths (%2 vs. %3)">;
2532 def err_pack_expansion_length_conflict_multilevel : Error<
2533   "pack expansion contains parameter pack %0 that has a different "
2534   "length (%1 vs. %2) from outer parameter packs">;
2535 def err_pack_expansion_member_init : Error<
2536   "pack expansion for initialization of member %0">;
2537
2538 def err_function_parameter_pack_without_parameter_packs : Error<
2539   "type %0 of function parameter pack does not contain any unexpanded "
2540   "parameter packs">;
2541 def err_ellipsis_in_declarator_not_parameter : Error<
2542   "only function and template parameters can be parameter packs">;
2543
2544 def err_sizeof_pack_no_pack_name : Error<
2545   "%0 does not refer to the name of a parameter pack">;
2546
2547 def err_unexpected_typedef : Error<
2548   "unexpected type name %0: expected expression">;
2549 def err_unexpected_namespace : Error<
2550   "unexpected namespace name %0: expected expression">;
2551 def err_undeclared_var_use : Error<"use of undeclared identifier %0">;
2552 def warn_found_via_dependent_bases_lookup : ExtWarn<"use of identifier %0 "
2553    "found via unqualified lookup into dependent bases of class templates is a "
2554    "Microsoft extension">, InGroup<Microsoft>;
2555 def note_dependent_var_use : Note<"must qualify identifier to find this "
2556     "declaration in dependent base class">;
2557 def err_not_found_by_two_phase_lookup : Error<"call to function %0 that is neither "
2558     "visible in the template definition nor found by argument-dependent lookup">;
2559 def note_not_found_by_two_phase_lookup : Note<"%0 should be declared prior to the "
2560     "call site%select{| or in %2| or in an associated namespace of one of its arguments}1">;
2561 def err_undeclared_use : Error<"use of undeclared %0">;
2562 def warn_deprecated : Warning<"%0 is deprecated">,
2563     InGroup<DeprecatedDeclarations>;
2564 def warn_deprecated_message : Warning<"%0 is deprecated: %1">,
2565     InGroup<DeprecatedDeclarations>;
2566 def warn_deprecated_fwdclass_message : Warning<
2567     "%0 maybe deprecated because receiver type is unknown">,
2568     InGroup<DeprecatedDeclarations>;
2569 def warn_deprecated_def : Warning<
2570     "Implementing deprecated %select{method|class|category}0">,
2571     InGroup<DeprecatedImplementations>, DefaultIgnore;
2572 def err_unavailable : Error<"%0 is unavailable">;
2573 def err_unavailable_message : Error<"%0 is unavailable: %1">;
2574 def warn_unavailable_fwdclass_message : Warning<
2575     "%0 maybe unavailable because receiver type is unknown">;
2576 def note_unavailable_here : Note<
2577   "%select{declaration|function}0 has been explicitly marked "
2578   "%select{unavailable|deleted|deprecated}1 here">;
2579 def warn_not_enough_argument : Warning<
2580   "not enough variable arguments in %0 declaration to fit a sentinel">,
2581   InGroup<Sentinel>;
2582 def warn_missing_sentinel : Warning <
2583   "missing sentinel in %select{function call|method dispatch|block call}0">,
2584   InGroup<Sentinel>;
2585 def note_sentinel_here : Note<
2586   "%select{function|method|block}0 has been explicitly marked sentinel here">;
2587 def warn_missing_prototype : Warning<
2588   "no previous prototype for function %0">,
2589   InGroup<DiagGroup<"missing-prototypes">>, DefaultIgnore;
2590 def err_redefinition : Error<"redefinition of %0">;
2591 def err_definition_of_implicitly_declared_member : Error<
2592   "definition of implicitly declared %select{default constructor|copy "
2593   "constructor|move constructor|copy assignment operator|move assignment "
2594   "operator|destructor}1">;
2595 def err_definition_of_explicitly_defaulted_member : Error<
2596   "definition of explicitly defaulted %select{default constructor|copy "
2597   "constructor|move constructor|copy assignment operator|move assignment "
2598   "operator|destructor}0">;
2599 def err_redefinition_extern_inline : Error<
2600   "redefinition of a 'extern inline' function %0 is not supported in "
2601   "%select{C99 mode|C++}1">;
2602
2603 // This should eventually be an error.
2604 def warn_undefined_internal : Warning<
2605   "%select{function|variable}0 %q1 has internal linkage but is not defined">,
2606   DiagGroup<"undefined-internal">;
2607 def note_used_here : Note<"used here">;
2608
2609 def warn_redefinition_of_typedef : Warning<
2610   "redefinition of typedef %0 is invalid in C">,
2611   InGroup<DiagGroup<"typedef-redefinition"> >, DefaultError;
2612
2613 def err_inline_declaration_block_scope : Error<
2614   "inline declaration of %0 not allowed in block scope">;
2615 def err_static_non_static : Error<
2616   "static declaration of %0 follows non-static declaration">;
2617 def warn_weak_import : Warning <
2618   "an already-declared variable is made a weak_import declaration %0">;
2619 def warn_static_non_static : ExtWarn<
2620   "static declaration of %0 follows non-static declaration">;
2621 def err_non_static_static : Error<
2622   "non-static declaration of %0 follows static declaration">;
2623 def err_extern_non_extern : Error<
2624   "extern declaration of %0 follows non-extern declaration">;
2625 def err_non_extern_extern : Error<
2626   "non-extern declaration of %0 follows extern declaration">;
2627 def err_non_thread_thread : Error<
2628   "non-thread-local declaration of %0 follows thread-local declaration">;
2629 def err_thread_non_thread : Error<
2630   "thread-local declaration of %0 follows non-thread-local declaration">;
2631 def err_redefinition_different_type : Error<
2632   "redefinition of %0 with a different type">;
2633 def err_redefinition_different_kind : Error<
2634   "redefinition of %0 as different kind of symbol">;
2635 def err_redefinition_different_typedef : Error<
2636   "%select{typedef|type alias|type alias template}0 redefinition with different types (%1 vs %2)">;
2637 def err_tag_reference_non_tag : Error<
2638   "elaborated type refers to %select{a non-tag type|a typedef|a type alias|a template|a type alias template}0">;
2639 def err_tag_reference_conflict : Error<
2640   "implicit declaration introduced by elaborated type conflicts with "
2641   "%select{a declaration|a typedef|a type alias|a template}0 of the same name">;
2642 def err_dependent_tag_decl : Error<
2643   "%select{declaration|definition}0 of %select{struct|union|class|enum}1 "
2644   "in a dependent scope">;
2645 def err_tag_definition_of_typedef : Error<
2646   "definition of type %0 conflicts with %select{typedef|type alias}1 of the same name">;
2647 def err_conflicting_types : Error<"conflicting types for %0">;
2648 def err_nested_redefinition : Error<"nested redefinition of %0">;
2649 def err_use_with_wrong_tag : Error<
2650   "use of %0 with tag type that does not match previous declaration">;
2651 def warn_struct_class_tag_mismatch : Warning<
2652     "%select{struct|class}0%select{| template}1 %2 was previously declared "
2653     "as a %select{class|struct}0%select{| template}1">,
2654     InGroup<MismatchedTags>, DefaultIgnore;
2655 def warn_struct_class_previous_tag_mismatch : Warning<
2656     "%2 defined as a %select{struct|class}0%select{| template}1 here but "
2657     "previously declared as a %select{class|struct}0%select{| template}1">,
2658      InGroup<MismatchedTags>, DefaultIgnore;
2659 def note_struct_class_suggestion : Note<
2660     "did you mean %select{struct|class}0 here?">;
2661 def ext_forward_ref_enum : Extension<
2662   "ISO C forbids forward references to 'enum' types">;
2663 def err_forward_ref_enum : Error<
2664   "ISO C++ forbids forward references to 'enum' types">;
2665 def ext_ms_forward_ref_enum : Extension<
2666   "forward references to 'enum' types are a Microsoft extension">, InGroup<Microsoft>;
2667 def ext_forward_ref_enum_def : Extension<
2668   "redeclaration of already-defined enum %0 is a GNU extension">, InGroup<GNU>;
2669   
2670 def err_redefinition_of_enumerator : Error<"redefinition of enumerator %0">;
2671 def err_duplicate_member : Error<"duplicate member %0">;
2672 def err_misplaced_ivar : Error<
2673   "ivars may not be placed in %select{categories|class extension}0">;
2674 def ext_enum_value_not_int : Extension<
2675   "ISO C restricts enumerator values to range of 'int' (%0 is too "
2676   "%select{small|large}1)">;
2677 def warn_enum_too_large : Warning<
2678   "enumeration values exceed range of largest integer">;
2679 def warn_enumerator_too_large : Warning<
2680   "enumerator value %0 is not representable in the largest integer type">;
2681   
2682 def warn_illegal_constant_array_size : Extension<
2683   "size of static array must be an integer constant expression">;
2684 def err_vm_decl_in_file_scope : Error<
2685   "variably modified type declaration not allowed at file scope">;
2686 def err_vm_decl_has_extern_linkage : Error<
2687   "variably modified type declaration can not have 'extern' linkage">;
2688 def err_typecheck_field_variable_size : Error<
2689   "fields must have a constant size: 'variable length array in structure' "
2690   "extension will never be supported">;
2691 def err_vm_func_decl : Error<
2692   "function declaration cannot have variably modified type">;
2693 def err_array_too_large : Error<
2694   "array is too large (%0 elements)">;
2695
2696 // -Wpadded, -Wpacked
2697 def warn_padded_struct_field : Warning<
2698   "padding %select{struct|class}0 %1 with %2 %select{byte|bit}3%select{|s}4 "
2699   "to align %5">, InGroup<Padded>, DefaultIgnore;
2700 def warn_padded_struct_anon_field : Warning<
2701   "padding %select{struct|class}0 %1 with %2 %select{byte|bit}3%select{|s}4 "
2702   "to align anonymous bit-field">, InGroup<Padded>, DefaultIgnore;
2703 def warn_padded_struct_size : Warning<
2704   "padding size of %0 with %1 %select{byte|bit}2%select{|s}3 "
2705   "to alignment boundary">, InGroup<Padded>, DefaultIgnore;
2706 def warn_unnecessary_packed : Warning<
2707   "packed attribute is unnecessary for %0">, InGroup<Packed>, DefaultIgnore;
2708
2709 def err_typecheck_negative_array_size : Error<"array size is negative">;
2710 def warn_typecheck_function_qualifiers : Warning<
2711   "qualifier on function type %0 has unspecified behavior">;
2712 def err_typecheck_invalid_restrict_not_pointer : Error<
2713   "restrict requires a pointer or reference (%0 is invalid)">;
2714 def err_typecheck_invalid_restrict_not_pointer_noarg : Error<
2715   "restrict requires a pointer or reference">;
2716 def err_typecheck_invalid_restrict_invalid_pointee : Error<
2717   "pointer to function type %0 may not be 'restrict' qualified">;
2718 def ext_typecheck_zero_array_size : Extension<
2719   "zero size arrays are an extension">;
2720 def err_typecheck_zero_array_size : Error<
2721   "zero-length arrays are not permitted in C++">;
2722 def err_at_least_one_initializer_needed_to_size_array : Error<
2723   "at least one initializer value required to size array">;
2724 def err_array_size_non_int : Error<"size of array has non-integer type %0">;
2725 def err_init_element_not_constant : Error<
2726   "initializer element is not a compile-time constant">;
2727 def err_local_cant_init : Error<
2728   "'__local' variable cannot have an initializer">;
2729 def err_block_extern_cant_init : Error<
2730   "'extern' variable cannot have an initializer">;
2731 def warn_extern_init : Warning<"'extern' variable has an initializer">;
2732 def err_variable_object_no_init : Error<
2733   "variable-sized object may not be initialized">;
2734 def err_array_init_list_required : Error<
2735   "initialization with '{...}' expected for array">;
2736 def err_excess_initializers : Error<
2737   "excess elements in %select{array|vector|scalar|union|struct}0 initializer">;
2738 def warn_excess_initializers : ExtWarn<
2739   "excess elements in %select{array|vector|scalar|union|struct}0 initializer">;
2740 def err_excess_initializers_in_char_array_initializer : Error<
2741   "excess elements in char array initializer">;
2742 def warn_excess_initializers_in_char_array_initializer : ExtWarn<
2743   "excess elements in char array initializer">;
2744 def err_initializer_string_for_char_array_too_long : Error<
2745   "initializer-string for char array is too long">;
2746 def warn_initializer_string_for_char_array_too_long : ExtWarn<
2747   "initializer-string for char array is too long">;
2748 def warn_missing_field_initializers : Warning<
2749   "missing field '%0' initializer">,
2750   InGroup<MissingFieldInitializers>, DefaultIgnore;
2751 def warn_braces_around_scalar_init : Warning<
2752   "braces around scalar initializer">;
2753 def warn_many_braces_around_scalar_init : ExtWarn<
2754   "too many braces around scalar initializer">;
2755 def ext_complex_component_init : Extension<
2756   "complex initialization specifying real and imaginary components "
2757   "is an extension">, InGroup<DiagGroup<"complex-component-init">>;
2758 def err_empty_scalar_initializer : Error<"scalar initializer cannot be empty">;
2759 def err_illegal_initializer : Error<
2760   "illegal initializer (only variables can be initialized)">;
2761 def err_illegal_initializer_type : Error<"illegal initializer type %0">;
2762 def err_init_list_variable_narrowing : Error<
2763   "non-constant-expression cannot be narrowed from type %0 to %1 in "
2764   "initializer list">;
2765 def err_init_list_constant_narrowing : Error<
2766   "constant expression evaluates to %0 which cannot be narrowed to type %1">;
2767 def warn_init_list_variable_narrowing : Warning<
2768   "non-constant-expression cannot be narrowed from type %0 to %1 in "
2769   "initializer list in C++11">,
2770   InGroup<CXX11Narrowing>, DefaultIgnore;
2771 def warn_init_list_constant_narrowing : Warning<
2772   "constant expression evaluates to %0 which cannot be narrowed to type %1 in "
2773   "C++11">,
2774   InGroup<CXX11Narrowing>, DefaultIgnore;
2775 def note_init_list_narrowing_override : Note<
2776   "override this message by inserting an explicit cast">;
2777 def err_init_objc_class : Error<
2778   "cannot initialize Objective-C class type %0">;
2779 def err_implicit_empty_initializer : Error<
2780   "initializer for aggregate with no elements requires explicit braces">;
2781 def err_bitfield_has_negative_width : Error<
2782   "bit-field %0 has negative width (%1)">;
2783 def err_anon_bitfield_has_negative_width : Error<
2784   "anonymous bit-field has negative width (%0)">;
2785 def err_bitfield_has_zero_width : Error<"named bit-field %0 has zero width">;
2786 def err_bitfield_width_exceeds_type_size : Error<
2787   "size of bit-field %0 (%1 bits) exceeds size of its type (%2 bits)">;
2788 def err_anon_bitfield_width_exceeds_type_size : Error<
2789   "size of anonymous bit-field (%0 bits) exceeds size of its type (%1 bits)">;
2790 def err_incorrect_number_of_vector_initializers : Error<
2791   "number of elements must be either one or match the size of the vector">;
2792   
2793 // Used by C++ which allows bit-fields that are wider than the type.
2794 def warn_bitfield_width_exceeds_type_size: Warning<
2795   "size of bit-field %0 (%1 bits) exceeds the size of its type; value will be "
2796   "truncated to %2 bits">;
2797 def warn_anon_bitfield_width_exceeds_type_size : Warning<
2798   "size of anonymous bit-field (%0 bits) exceeds size of its type; value will "
2799   "be truncated to %1 bits">;
2800
2801 def warn_missing_braces : Warning<
2802   "suggest braces around initialization of subobject">,
2803   InGroup<DiagGroup<"missing-braces">>, DefaultIgnore;
2804
2805 def err_redefinition_of_label : Error<"redefinition of label %0">;
2806 def err_undeclared_label_use : Error<"use of undeclared label %0">;
2807 def warn_unused_label : Warning<"unused label %0">,
2808   InGroup<UnusedLabel>, DefaultIgnore;
2809
2810 def err_goto_into_protected_scope : Error<"goto into protected scope">;
2811 def warn_goto_into_protected_scope : ExtWarn<"goto into protected scope">,
2812   InGroup<Microsoft>;
2813 def err_switch_into_protected_scope : Error<
2814   "switch case is in protected scope">;
2815 def err_indirect_goto_without_addrlabel : Error<
2816   "indirect goto in function with no address-of-label expressions">;
2817 def err_indirect_goto_in_protected_scope : Error<
2818   "indirect goto might cross protected scopes">;
2819 def note_indirect_goto_target : Note<"possible target of indirect goto">;
2820 def note_protected_by_variable_init : Note<
2821   "jump bypasses variable initialization">;
2822 def note_protected_by_variable_nontriv_destructor : Note<
2823   "jump bypasses variable with a non-trivial destructor">;
2824 def note_protected_by_cleanup : Note<
2825   "jump bypasses initialization of variable with __attribute__((cleanup))">;
2826 def note_protected_by_vla_typedef : Note<
2827   "jump bypasses initialization of VLA typedef">;
2828 def note_protected_by_vla_type_alias : Note<
2829   "jump bypasses initialization of VLA type alias">;
2830 def note_protected_by_vla : Note<
2831   "jump bypasses initialization of variable length array">;
2832 def note_protected_by_objc_try : Note<
2833   "jump bypasses initialization of @try block">;
2834 def note_protected_by_objc_catch : Note<
2835   "jump bypasses initialization of @catch block">;
2836 def note_protected_by_objc_finally : Note<
2837   "jump bypasses initialization of @finally block">;
2838 def note_protected_by_objc_synchronized : Note<
2839   "jump bypasses initialization of @synchronized block">;
2840 def note_protected_by_objc_autoreleasepool : Note<
2841   "jump bypasses auto release push of @autoreleasepool block">;
2842 def note_protected_by_cxx_try : Note<
2843   "jump bypasses initialization of try block">;
2844 def note_protected_by_cxx_catch : Note<
2845   "jump bypasses initialization of catch block">;
2846 def note_protected_by___block : Note<
2847   "jump bypasses setup of __block variable">;
2848 def note_protected_by_objc_ownership : Note<
2849   "jump bypasses initialization of retaining variable">;
2850 def note_enters_block_captures_cxx_obj : Note<
2851   "jump enters lifetime of block which captures a destructible c++ object">;
2852 def note_enters_block_captures_strong : Note<
2853   "jump enters lifetime of block which strongly captures a variable">;
2854 def note_enters_block_captures_weak : Note<
2855   "jump enters lifetime of block which weakly captures a variable">;
2856
2857 def note_exits_cleanup : Note<
2858   "jump exits scope of variable with __attribute__((cleanup))">;
2859 def note_exits_dtor : Note<
2860   "jump exits scope of variable with non-trivial destructor">;
2861 def note_exits___block : Note<
2862   "jump exits scope of __block variable">;
2863 def note_exits_objc_try : Note<
2864   "jump exits @try block">;
2865 def note_exits_objc_catch : Note<
2866   "jump exits @catch block">;
2867 def note_exits_objc_finally : Note<
2868   "jump exits @finally block">;
2869 def note_exits_objc_synchronized : Note<
2870   "jump exits @synchronized block">;
2871 def note_exits_cxx_try : Note<
2872   "jump exits try block">;
2873 def note_exits_cxx_catch : Note<
2874   "jump exits catch block">;
2875 def note_exits_objc_autoreleasepool : Note<
2876   "jump exits autoreleasepool block">;
2877 def note_exits_objc_ownership : Note<
2878   "jump exits scope of retaining variable">;
2879 def note_exits_block_captures_cxx_obj : Note<
2880   "jump exits lifetime of block which captures a destructible c++ object">;
2881 def note_exits_block_captures_strong : Note<
2882   "jump exits lifetime of block which strongly captures a variable">;
2883 def note_exits_block_captures_weak : Note<
2884   "jump exits lifetime of block which weakly captures a variable">;
2885
2886 def err_func_returning_array_function : Error<
2887   "function cannot return %select{array|function}0 type %1">;
2888 def err_field_declared_as_function : Error<"field %0 declared as a function">;
2889 def err_field_incomplete : Error<"field has incomplete type %0">;
2890 def ext_variable_sized_type_in_struct : ExtWarn<
2891   "field %0 with variable sized type %1 not at the end of a struct or class is"
2892   " a GNU extension">, InGroup<GNU>;
2893
2894 def err_flexible_array_empty_struct : Error<
2895   "flexible array %0 not allowed in otherwise empty struct">;
2896 def err_flexible_array_has_nonpod_type : Error<
2897   "flexible array member %0 of non-POD element type %1">;
2898 def ext_flexible_array_in_struct : Extension<
2899   "%0 may not be nested in a struct due to flexible array member">;
2900 def ext_flexible_array_in_array : Extension<
2901   "%0 may not be used as an array element due to flexible array member">;
2902 def err_flexible_array_init : Error<
2903   "initialization of flexible array member is not allowed">;
2904 def ext_flexible_array_empty_aggregate_ms : Extension<
2905   "flexible array member %0 in otherwise empty %select{struct|class}1 "
2906   "is a Microsoft extension">, InGroup<Microsoft>;
2907 def ext_flexible_array_union_ms : Extension<
2908   "flexible array member %0 in a union is a Microsoft extension">,
2909   InGroup<Microsoft>;
2910 def ext_flexible_array_empty_aggregate_gnu : Extension<
2911   "flexible array member %0 in otherwise empty %select{struct|class}1 "
2912   "is a GNU extension">, InGroup<GNU>;
2913 def ext_flexible_array_union_gnu : Extension<
2914   "flexible array member %0 in a union is a GNU extension">, InGroup<GNU>;
2915
2916 let CategoryName = "Automatic Reference Counting Issue" in {
2917
2918 // ARC-mode diagnostics.
2919 def err_arc_weak_no_runtime : Error<
2920   "the current deployment target does not support automated __weak references">;
2921 def err_arc_unsupported_weak_class : Error<
2922   "class is incompatible with __weak references">;
2923 def err_arc_weak_unavailable_assign : Error<
2924   "assignment of a weak-unavailable object to a __weak object">;
2925 def err_arc_convesion_of_weak_unavailable : Error<
2926   "%select{implicit conversion|cast}0 of weak-unavailable object of type %1 to"
2927   " a __weak object of type %2">;
2928 def err_arc_illegal_explicit_message : Error<
2929   "ARC forbids explicit message send of %0">;
2930 def err_arc_unused_init_message : Error<
2931   "the result of a delegate init call must be immediately returned "
2932   "or assigned to 'self'">;
2933 def err_arc_mismatched_cast : Error<
2934   "%select{implicit conversion|cast}0 of "
2935   "%select{%2|a non-Objective-C pointer type %2|a block pointer|"
2936   "an Objective-C pointer|an indirect pointer to an Objective-C pointer}1"
2937   " to %3 is disallowed with ARC">;
2938 def err_arc_objc_object_in_struct : Error<
2939   "ARC forbids Objective-C objects in structs or unions">;
2940 def err_arc_objc_property_default_assign_on_object : Error<
2941   "ARC forbids synthesizing a property of an Objective-C object "
2942   "with unspecified ownership or storage attribute">;
2943 def err_arc_illegal_selector : Error<
2944   "ARC forbids use of %0 in a @selector">;
2945 def err_arc_illegal_method_def : Error<
2946   "ARC forbids implementation of %0">;
2947 def err_arc_lost_method_convention : Error<
2948   "method was declared as %select{an 'alloc'|a 'copy'|an 'init'|a 'new'}0 "
2949   "method, but its implementation doesn't match because %select{"
2950   "its result type is not an object pointer|"
2951   "its result type is unrelated to its receiver type}1">;
2952 def note_arc_lost_method_convention : Note<"declaration in interface">;
2953 def err_arc_gained_method_convention : Error<
2954   "method implementation does not match its declaration">;
2955 def note_arc_gained_method_convention : Note<
2956   "declaration in interface is not in the '%select{alloc|copy|init|new}0' "
2957   "family because %select{its result type is not an object pointer|"
2958   "its result type is unrelated to its receiver type}1">;
2959 def err_typecheck_arr_assign_self : Error<
2960   "cannot assign to 'self' outside of a method in the init family">;
2961 def err_typecheck_arr_assign_enumeration : Error<
2962   "fast enumeration variables can't be modified in ARC by default; "
2963   "declare the variable __strong to allow this">;
2964 def warn_arc_non_pod_class_with_object_member : Warning<
2965   "%0 cannot be shared between ARC and non-ARC "
2966   "code; add a copy constructor, a copy assignment operator, and a destructor "
2967   "to make it ABI-compatible">, InGroup<AutomaticReferenceCountingABI>,
2968   DefaultIgnore;
2969 def warn_arc_retained_assign : Warning<
2970   "assigning retained object to %select{weak|unsafe_unretained}0 variable"
2971   "; object will be released after assignment">,
2972   InGroup<ARCUnsafeRetainedAssign>;
2973 def warn_arc_retained_property_assign : Warning<
2974   "assigning retained object to unsafe property"
2975   "; object will be released after assignment">,
2976   InGroup<ARCUnsafeRetainedAssign>;
2977 def warn_arc_trivial_member_function_with_object_member : Warning<
2978   "%0 cannot be shared between ARC and non-ARC "
2979   "code; add a non-trivial %select{copy constructor|copy assignment operator|"
2980   "destructor}1 to make it ABI-compatible">, 
2981   InGroup<AutomaticReferenceCountingABI>, DefaultIgnore;
2982 def err_arc_new_array_without_ownership : Error<
2983   "'new' cannot allocate an array of %0 with no explicit ownership">;
2984 def warn_err_new_delete_object_array : Warning<
2985   "%select{allocating|destroying}0 an array of %1; this array must not "
2986   "%select{be deleted in|have been allocated from}0 non-ARC code">,
2987   InGroup<AutomaticReferenceCountingABI>, DefaultIgnore;
2988 def err_arc_autoreleasing_var : Error<
2989   "%select{__block variables|global variables|fields|ivars}0 cannot have "
2990   "__autoreleasing ownership">;
2991 def err_arc_thread_ownership : Error<
2992   "thread-local variable has non-trivial ownership: type is %0">;
2993 def err_arc_indirect_no_ownership : Error<
2994   "%select{pointer|reference}1 to non-const type %0 with no explicit ownership">,
2995   InGroup<AutomaticReferenceCounting>;
2996 def err_arc_array_param_no_ownership : Error<
2997   "must explicitly describe intended ownership of an object array parameter">;
2998 def err_arc_pseudo_dtor_inconstant_quals : Error<
2999   "pseudo-destructor destroys object of type %0 with inconsistently-qualified "
3000   "type %1">;
3001 def err_arc_init_method_unrelated_result_type : Error<
3002   "init methods must return a type related to the receiver type">;
3003 def err_arc_nonlocal_writeback : Error<
3004   "passing address of %select{non-local|non-scalar}0 object to "
3005   "__autoreleasing parameter for write-back">;
3006 def err_arc_method_not_found : Error<
3007   "no known %select{instance|class}1 method for selector %0">;
3008 def err_arc_receiver_forward_class : Error<
3009   "receiver %0 for class message is a forward declaration">;
3010 def err_arc_may_not_respond : Error<
3011   "no visible @interface for %0 declares the selector %1">;
3012 def err_arc_receiver_forward_instance : Error<
3013   "receiver type %0 for instance message is a forward declaration">;
3014 def err_arc_collection_forward : Error<
3015   "collection expression type %0 is a forward declaration">;
3016 def err_arc_multiple_method_decl : Error< 
3017   "multiple methods named %0 found with mismatched result, "
3018   "parameter type or attributes">;
3019 def warn_arc_retain_cycle : Warning<
3020   "capturing %0 strongly in this block is likely to lead to a retain cycle">,
3021   InGroup<ARCRetainCycles>;
3022 def note_arc_retain_cycle_owner : Note<
3023   "block will be retained by %select{the captured object|an object strongly "
3024   "retained by the captured object}0">;
3025 def note_nontrivial_objc_ownership : Note<
3026   "because type %0 has %select{no|no|__strong|__weak|__autoreleasing}1 "
3027   "ownership">;
3028 def warn_arc_object_memaccess : Warning<
3029   "%select{destination for|source of}0 this %1 call is a pointer to "
3030   "ownership-qualified type %2">, InGroup<ARCNonPodMemAccess>;
3031
3032 def err_arc_strong_property_ownership : Error<
3033   "existing ivar %1 for strong property %0 may not be "
3034   "%select{|__unsafe_unretained||__weak}2">;
3035 def err_arc_assign_property_ownership : Error<
3036   "existing ivar %1 for property %0 with %select{unsafe_unretained| assign}2 "
3037   "attribute must be __unsafe_unretained">;
3038 def err_arc_inconsistent_property_ownership : Error<
3039   "%select{|unsafe_unretained|strong|weak}1 property %0 may not also be "
3040   "declared %select{|__unsafe_unretained|__strong|__weak|__autoreleasing}2">;
3041 def err_arc_atomic_ownership : Error<
3042   "cannot perform atomic operation on a pointer to type %0: type has "
3043   "non-trivial ownership">;
3044
3045 def err_arc_bridge_cast_incompatible : Error<
3046   "incompatible types casting %0 to %1 with a %select{__bridge|"
3047   "__bridge_transfer|__bridge_retained}2 cast">;
3048 def err_arc_bridge_cast_wrong_kind : Error<
3049   "cast of %select{Objective-C|block|C}0 pointer type %1 to "
3050   "%select{Objective-C|block|C}2 pointer type %3 cannot use %select{__bridge|"
3051   "__bridge_transfer|__bridge_retained}4">;
3052 def err_arc_cast_requires_bridge : Error<
3053   "cast of %select{Objective-C|block|C}0 pointer type %1 to "
3054   "%select{Objective-C|block|C}2 pointer type %3 requires a bridged cast">;
3055 def note_arc_bridge : Note<
3056   "use __bridge to convert directly (no change in ownership)">;
3057 def note_arc_bridge_transfer : Note<
3058   "use __bridge_transfer to transfer ownership of a +1 %0 into ARC">;
3059 def note_arc_bridge_retained : Note<
3060   "use __bridge_retained to make an ARC object available as a +1 %0">;
3061
3062 } // ARC category name
3063
3064 def err_flexible_array_init_needs_braces : Error<
3065   "flexible array requires brace-enclosed initializer">;
3066 def err_illegal_decl_array_of_functions : Error<
3067   "'%0' declared as array of functions of type %1">;
3068 def err_illegal_decl_array_incomplete_type : Error<
3069   "array has incomplete element type %0">;
3070 def err_illegal_message_expr_incomplete_type : Error<
3071   "objective-c message has incomplete result type %0">;
3072 def err_illegal_decl_array_of_references : Error<
3073   "'%0' declared as array of references of type %1">;
3074 def err_decl_negative_array_size : Error<
3075   "'%0' declared as an array with a negative size">;
3076 def err_array_star_outside_prototype : Error<
3077   "star modifier used outside of function prototype">;
3078 def err_illegal_decl_pointer_to_reference : Error<
3079   "'%0' declared as a pointer to a reference of type %1">;
3080 def err_illegal_decl_mempointer_to_reference : Error<
3081   "'%0' declared as a member pointer to a reference of type %1">;
3082 def err_illegal_decl_mempointer_to_void : Error<
3083   "'%0' declared as a member pointer to void">;
3084 def err_illegal_decl_mempointer_in_nonclass : Error<
3085   "'%0' does not point into a class">;
3086 def err_mempointer_in_nonclass_type : Error<
3087   "member pointer refers into non-class type %0">;
3088 def err_reference_to_void : Error<"cannot form a reference to 'void'">;
3089 def err_qualified_block_pointer_type : Error<
3090   "qualifier specification on block pointer type not allowed">;
3091 def err_nonfunction_block_type : Error<
3092   "block pointer to non-function type is invalid">;
3093 def err_return_block_has_expr : Error<"void block should not return a value">;
3094 def err_block_return_missing_expr : Error<
3095   "non-void block should return a value">;
3096 def err_block_with_return_type_requires_args : Error<
3097   "block with explicit return type requires argument list">;
3098 def err_func_def_incomplete_result : Error<
3099   "incomplete result type %0 in function definition">;
3100 def err_atomic_specifier_bad_type : Error<
3101   "_Atomic cannot be applied to "
3102   "%select{incomplete |array |function |reference |atomic |qualified |}0type "
3103   "%1 %select{||||||which is not trivially copyable}0">;
3104
3105 // Expressions.
3106 def ext_sizeof_function_type : Extension<
3107   "invalid application of 'sizeof' to a function type">, InGroup<PointerArith>;
3108 def err_sizeof_alignof_overloaded_function_type : Error<
3109   "invalid application of '%select{sizeof|__alignof|vec_step}0' to an "
3110   "overloaded function">;
3111 def ext_sizeof_void_type : Extension<
3112   "invalid application of '%select{sizeof|__alignof|vec_step}0' to a void "
3113   "type">, InGroup<PointerArith>;
3114 def err_sizeof_alignof_incomplete_type : Error<
3115   "invalid application of '%select{sizeof|__alignof|vec_step}0' to an "
3116   "incomplete type %1">;
3117 def err_sizeof_alignof_bitfield : Error<
3118   "invalid application of '%select{sizeof|__alignof}0' to bit-field">;
3119 def err_vecstep_non_scalar_vector_type : Error<
3120   "'vec_step' requires built-in scalar or vector type, %0 invalid">;
3121 def err_offsetof_incomplete_type : Error<
3122   "offsetof of incomplete type %0">;
3123 def err_offsetof_record_type : Error<
3124   "offsetof requires struct, union, or class type, %0 invalid">;
3125 def err_offsetof_array_type : Error<"offsetof requires array type, %0 invalid">;
3126 def ext_offsetof_extended_field_designator : Extension<
3127   "using extended field designator is an extension">;
3128 def warn_offsetof_non_pod_type : ExtWarn<"offset of on non-POD type %0">,
3129   InGroup<InvalidOffsetof>;
3130 def err_offsetof_bitfield : Error<"cannot compute offset of bit-field %0">;
3131
3132 def warn_floatingpoint_eq : Warning<
3133   "comparing floating point with == or != is unsafe">,
3134   InGroup<DiagGroup<"float-equal">>, DefaultIgnore;
3135
3136 def warn_division_by_zero : Warning<"division by zero is undefined">;
3137 def warn_remainder_by_zero : Warning<"remainder by zero is undefined">;
3138 def warn_shift_negative : Warning<"shift count is negative">,
3139   InGroup<DiagGroup<"shift-count-negative">>;
3140 def warn_shift_gt_typewidth : Warning<"shift count >= width of type">,
3141   InGroup<DiagGroup<"shift-count-overflow">>;
3142 def warn_shift_result_gt_typewidth : Warning<
3143   "signed shift result (%0) requires %1 bits to represent, but %2 only has "
3144   "%3 bits">, InGroup<DiagGroup<"shift-overflow">>;
3145 def warn_shift_result_sets_sign_bit : Warning<
3146   "signed shift result (%0) sets the sign bit of the shift expression's "
3147   "type (%1) and becomes negative">,
3148   InGroup<DiagGroup<"shift-sign-overflow">>, DefaultIgnore;
3149
3150 def warn_precedence_bitwise_rel : Warning<
3151   "%0 has lower precedence than %1; %1 will be evaluated first">,
3152   InGroup<Parentheses>;
3153 def note_precedence_bitwise_first : Note<
3154   "place parentheses around the %0 expression to evaluate it first">;
3155 def note_precedence_bitwise_silence : Note<
3156   "place parentheses around the %0 expression to silence this warning">;
3157
3158 def warn_precedence_conditional : Warning<
3159   "operator '?:' has lower precedence than '%0'; '%0' will be evaluated first">,
3160   InGroup<Parentheses>;
3161 def note_precedence_conditional_first : Note<
3162   "place parentheses around the '?:' expression to evaluate it first">;
3163 def note_precedence_conditional_silence : Note<
3164   "place parentheses around the '%0' expression to silence this warning">;
3165
3166 def warn_logical_instead_of_bitwise : Warning<
3167   "use of logical '%0' with constant operand">,
3168   InGroup<DiagGroup<"constant-logical-operand">>;
3169 def note_logical_instead_of_bitwise_change_operator : Note<
3170   "use '%0' for a bitwise operation">;
3171 def note_logical_instead_of_bitwise_remove_constant : Note<
3172   "remove constant to silence this warning">;
3173
3174 def warn_bitwise_and_in_bitwise_or : Warning<
3175   "'&' within '|'">, InGroup<BitwiseOpParentheses>;
3176 def note_bitwise_and_in_bitwise_or_silence : Note<
3177   "place parentheses around the '&' expression to silence this warning">;
3178
3179 def warn_logical_and_in_logical_or : Warning<
3180   "'&&' within '||'">, InGroup<LogicalOpParentheses>;
3181 def note_logical_and_in_logical_or_silence : Note<
3182   "place parentheses around the '&&' expression to silence this warning">;
3183
3184 def warn_self_assignment : Warning<
3185   "explicitly assigning a variable of type %0 to itself">,
3186   InGroup<SelfAssignment>, DefaultIgnore;
3187
3188 def warn_sizeof_array_param : Warning<
3189   "sizeof on array function parameter will return size of %0 instead of %1">,
3190   InGroup<SizeofArrayArgument>;
3191
3192 def err_sizeof_nonfragile_interface : Error<
3193   "invalid application of '%select{alignof|sizeof}1' to interface %0 in "
3194   "non-fragile ABI">;
3195 def err_atdef_nonfragile_interface : Error<
3196   "invalid application of @defs in non-fragile ABI">;
3197 def err_subscript_nonfragile_interface : Error<
3198   "subscript requires size of interface %0, which is not constant in "
3199   "non-fragile ABI">;
3200
3201 def err_arithmetic_nonfragile_interface : Error<
3202   "arithmetic on pointer to interface %0, which is not a constant size in "
3203   "non-fragile ABI">;
3204
3205
3206 def ext_subscript_non_lvalue : Extension<
3207   "ISO C90 does not allow subscripting non-lvalue array">;
3208 def err_typecheck_subscript_value : Error<
3209   "subscripted value is not an array, pointer, or vector">;
3210 def err_typecheck_subscript_not_integer : Error<
3211   "array subscript is not an integer">;
3212 def err_subscript_function_type : Error<
3213   "subscript of pointer to function type %0">;
3214 def err_subscript_incomplete_type : Error<
3215   "subscript of pointer to incomplete type %0">;
3216 def ext_gnu_subscript_void_type : Extension<
3217   "subscript of a pointer to void is a GNU extension">, InGroup<PointerArith>;
3218 def err_typecheck_member_reference_struct_union : Error<
3219   "member reference base type %0 is not a structure or union">;
3220 def err_typecheck_member_reference_ivar : Error<
3221   "%0 does not have a member named %1">;
3222 def error_arc_weak_ivar_access : Error<
3223   "dereferencing a __weak pointer is not allowed due to possible "
3224   "null value caused by race condition, assign it to strong variable first">;
3225 def err_typecheck_member_reference_arrow : Error<
3226   "member reference type %0 is not a pointer">;
3227 def err_typecheck_member_reference_suggestion : Error<
3228   "member reference type %0 is %select{a|not a}1 pointer; maybe you meant to use '%select{->|.}1'?">;
3229 def err_typecheck_member_reference_type : Error<
3230   "cannot refer to type member %0 in %1 with '%select{.|->}2'">;
3231 def err_typecheck_member_reference_unknown : Error<
3232   "cannot refer to member %0 in %1 with '%select{.|->}2'">;
3233 def err_member_reference_needs_call : Error<
3234   "base of member reference is a function; perhaps you meant to call "
3235   "it%select{| with no arguments}?">;
3236 def warn_subscript_is_char : Warning<"array subscript is of type 'char'">,
3237   InGroup<CharSubscript>, DefaultIgnore;
3238
3239 def err_typecheck_incomplete_tag : Error<"incomplete definition of type %0">;
3240 def err_no_member : Error<"no member named %0 in %1">;
3241
3242 def err_member_not_yet_instantiated : Error<
3243   "no member %0 in %1; it has not yet been instantiated">;
3244 def note_non_instantiated_member_here : Note<
3245   "not-yet-instantiated member is declared here">;
3246
3247 def err_member_redeclared : Error<"class member cannot be redeclared">;
3248 def err_member_name_of_class : Error<"member %0 has the same name as its class">;
3249 def err_member_def_undefined_record : Error<
3250   "out-of-line definition of %0 from class %1 without definition">;
3251 def err_member_def_does_not_match : Error<
3252   "out-of-line definition of %0 does not match any declaration in %1">;
3253 def err_member_def_does_not_match_suggest : Error<
3254   "out-of-line definition of %0 does not match any declaration in %1; "
3255   "did you mean %2">;
3256 def err_member_def_does_not_match_ret_type : Error<
3257   "out-of-line definition of %q0 differs from the declaration in the return type">;
3258 def err_nonstatic_member_out_of_line : Error<
3259   "non-static data member defined out-of-line">;
3260 def err_nonstatic_flexible_variable : Error<
3261   "non-static initialization of a variable with flexible array member">;
3262 def err_qualified_typedef_declarator : Error<
3263   "typedef declarator cannot be qualified">;
3264 def err_qualified_param_declarator : Error<
3265   "parameter declarator cannot be qualified">;
3266 def ext_out_of_line_declaration : ExtWarn<
3267   "out-of-line declaration of a member must be a definition">,
3268   InGroup<OutOfLineDeclaration>, DefaultError;
3269 def warn_member_extra_qualification : Warning<
3270   "extra qualification on member %0">;
3271 def err_member_qualification : Error<
3272   "non-friend class member %0 cannot have a qualified name">;  
3273 def note_member_def_close_match : Note<"member declaration nearly matches">;
3274 def note_member_def_close_const_match : Note<
3275   "member declaration does not match because "
3276   "it %select{is|is not}0 const qualified">;
3277 def note_member_def_close_param_match : Note<
3278   "type of %ordinal0 parameter of member declaration does not match "
3279   "definition (%1 vs %2)">;
3280 def err_typecheck_ivar_variable_size : Error<
3281   "instance variables must have a constant size">;
3282 def err_ivar_reference_type : Error<
3283   "instance variables cannot be of reference type">;
3284 def err_typecheck_illegal_increment_decrement : Error<
3285   "cannot %select{decrement|increment}1 value of type %0">;
3286 def err_typecheck_arithmetic_incomplete_type : Error<
3287   "arithmetic on a pointer to an incomplete type %0">;
3288 def err_typecheck_pointer_arith_function_type : Error<
3289   "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 "
3290   "function type%select{|s}2 %1%select{| and %3}2">;
3291 def err_typecheck_pointer_arith_void_type : Error<
3292   "arithmetic on%select{ a|}0 pointer%select{|s}0 to void">;
3293 def err_typecheck_decl_incomplete_type : Error<
3294   "variable has incomplete type %0">;
3295 def ext_typecheck_decl_incomplete_type : ExtWarn<
3296   "tentative definition of variable with internal linkage has incomplete non-array type %0">,
3297   InGroup<DiagGroup<"tentative-definition-incomplete-type">>;
3298 def err_tentative_def_incomplete_type : Error<
3299   "tentative definition has type %0 that is never completed">;
3300 def err_tentative_def_incomplete_type_arr : Error<
3301   "tentative definition has array of type %0 that is never completed">;
3302 def warn_tentative_incomplete_array : Warning<
3303   "tentative array definition assumed to have one element">;
3304 def err_typecheck_incomplete_array_needs_initializer : Error<
3305   "definition of variable with array type needs an explicit size "
3306   "or an initializer">;
3307 def err_array_init_not_init_list : Error<
3308   "array initializer must be an initializer "
3309   "list%select{| or string literal}0">;
3310 def err_array_init_different_type : Error<
3311   "cannot initialize array of type %0 with array of type %1">;
3312 def err_array_init_non_constant_array : Error<
3313   "cannot initialize array of type %0 with non-constant array of type %1">;
3314 def ext_array_init_copy : Extension<
3315   "initialization of an array of type %0 from a compound literal of type %1 is "
3316   "a GNU extension">;
3317 def warn_deprecated_string_literal_conversion : Warning<
3318   "conversion from string literal to %0 is deprecated">, InGroup<DeprecatedWritableStr>;
3319 def err_realimag_invalid_type : Error<"invalid type %0 to %1 operator">;
3320 def err_typecheck_sclass_fscope : Error<
3321   "illegal storage class on file-scoped variable">;
3322 def err_unsupported_global_register : Error<
3323   "global register variables are not supported">;
3324 def warn_standalone_specifier : Warning<"'%0' ignored on this declaration">;
3325 def err_typecheck_sclass_func : Error<"illegal storage class on function">;
3326 def err_static_block_func : Error<
3327   "function declared in block scope cannot have 'static' storage class">;
3328 def err_typecheck_address_of : Error<"address of %select{bit-field"
3329   "|vector element|property expression|register variable}0 requested">;
3330 def ext_typecheck_addrof_void : Extension<
3331   "ISO C forbids taking the address of an expression of type 'void'">;
3332 def err_unqualified_pointer_member_function : Error<
3333   "must explicitly qualify name of member function when taking its address">;
3334 def err_invalid_form_pointer_member_function : Error<
3335   "cannot create a non-constant pointer to member function">;
3336 def err_parens_pointer_member_function : Error<
3337   "cannot parenthesize the name of a method when forming a member pointer">;
3338 def err_typecheck_invalid_lvalue_addrof : Error<
3339   "address expression must be an lvalue or a function designator">;
3340 def ext_typecheck_addrof_class_temporary : ExtWarn<
3341   "taking the address of a temporary object of type %0">, 
3342   InGroup<DiagGroup<"address-of-temporary">>, DefaultError;
3343 def err_typecheck_addrof_class_temporary : Error<
3344   "taking the address of a temporary object of type %0">;
3345 def err_typecheck_unary_expr : Error<
3346   "invalid argument type %0 to unary expression">;
3347 def err_typecheck_indirection_requires_pointer : Error<
3348   "indirection requires pointer operand (%0 invalid)">;
3349 def warn_indirection_through_null : Warning<
3350   "indirection of non-volatile null pointer will be deleted, not trap">, InGroup<NullDereference>;
3351 def note_indirection_through_null : Note<
3352   "consider using __builtin_trap() or qualifying pointer with 'volatile'">;
3353 def warn_pointer_indirection_from_incompatible_type : Warning<
3354   "dereference of type %1 that was reinterpret_cast from type %0 has undefined "
3355   "behavior.">,
3356   InGroup<DiagGroup<"undefined-reinterpret-cast">>, DefaultIgnore;
3357
3358 def err_assignment_requires_nonfragile_object : Error<
3359   "cannot assign to class object in non-fragile ABI (%0 invalid)">;
3360 def err_direct_interface_unsupported : Error<
3361   "indirection to an interface is not supported (%0 invalid)">;
3362 def err_typecheck_invalid_operands : Error<
3363   "invalid operands to binary expression (%0 and %1)">;
3364 def err_typecheck_sub_ptr_object : Error<
3365   "subtraction of pointer %0 requires pointee to be a complete object type">;
3366 def err_typecheck_sub_ptr_compatible : Error<
3367   "%0 and %1 are not pointers to compatible types">;
3368 def ext_typecheck_ordered_comparison_of_pointer_integer : ExtWarn<
3369   "ordered comparison between pointer and integer (%0 and %1)">;
3370 def ext_typecheck_ordered_comparison_of_pointer_and_zero : Extension<
3371   "ordered comparison between pointer and zero (%0 and %1) is an extension">;
3372 def ext_typecheck_ordered_comparison_of_function_pointers : ExtWarn<
3373   "ordered comparison of function pointers (%0 and %1)">;
3374 def ext_typecheck_comparison_of_fptr_to_void : Extension<
3375   "equality comparison between function pointer and void pointer (%0 and %1)">;
3376 def err_typecheck_comparison_of_fptr_to_void : Error<
3377   "equality comparison between function pointer and void pointer (%0 and %1)">;
3378 def ext_typecheck_comparison_of_pointer_integer : ExtWarn<
3379   "comparison between pointer and integer (%0 and %1)">;
3380 def err_typecheck_comparison_of_pointer_integer : Error<
3381   "comparison between pointer and integer (%0 and %1)">;
3382 def ext_typecheck_comparison_of_distinct_pointers : ExtWarn<
3383   "comparison of distinct pointer types (%0 and %1)">;
3384 def ext_typecheck_cond_incompatible_operands : ExtWarn<
3385   "incompatible operand types (%0 and %1)">;
3386 def err_typecheck_comparison_of_distinct_pointers : Error<
3387   "comparison of distinct pointer types (%0 and %1)">;
3388 def ext_typecheck_comparison_of_distinct_pointers_nonstandard : ExtWarn<
3389   "comparison of distinct pointer types (%0 and %1) uses non-standard "
3390   "composite pointer type %2">;
3391 def err_typecheck_vector_comparison : Error<
3392   "comparison of vector types (%0 and %1) not supported yet">;
3393 def err_typecheck_assign_const : Error<"read-only variable is not assignable">;
3394 def err_stmtexpr_file_scope : Error<
3395   "statement expression not allowed at file scope">;
3396 def warn_mixed_sign_comparison : Warning<
3397   "comparison of integers of different signs: %0 and %1">,
3398   InGroup<SignCompare>, DefaultIgnore;
3399 def warn_lunsigned_always_true_comparison : Warning<
3400   "comparison of unsigned%select{| enum}2 expression %0 is always %1">,
3401   InGroup<TautologicalCompare>;
3402 def warn_runsigned_always_true_comparison : Warning<
3403   "comparison of %0 unsigned%select{| enum}2 expression is always %1">,
3404   InGroup<TautologicalCompare>;
3405 def warn_comparison_of_mixed_enum_types : Warning<
3406   "comparison of two values with different enumeration types (%0 and %1)">,
3407   InGroup<DiagGroup<"enum-compare">>;
3408 def warn_null_in_arithmetic_operation : Warning<
3409   "use of NULL in arithmetic operation">,
3410   InGroup<DiagGroup<"null-arithmetic">>;
3411 def warn_null_in_comparison_operation : Warning<
3412   "comparison between NULL and non-pointer "
3413   "%select{(%1 and NULL)|(NULL and %1)}0">,
3414   InGroup<DiagGroup<"null-arithmetic">>;
3415
3416 def err_invalid_this_use : Error<
3417   "invalid use of 'this' outside of a nonstatic member function">;
3418 def err_invalid_member_use_in_static_method : Error<
3419   "invalid use of member %0 in static member function">;
3420 def err_invalid_qualified_function_type : Error<
3421   "type qualifier is not allowed on this function">;
3422 def err_invalid_ref_qualifier_function_type : Error<
3423   "ref-qualifier '%select{&&|&}0' is only allowed on non-static member functions,"
3424   " member function pointers, and typedefs of function types">;
3425 def ext_qualified_function_type_template_arg : ExtWarn<
3426   "template argument of '%0' qualified function type is a GNU extension">, 
3427   InGroup<GNU>;
3428
3429 def err_invalid_qualified_function_pointer : Error<
3430   "type qualifier is not allowed on this function %select{pointer|reference}0">;
3431 def err_invalid_qualified_typedef_function_type_use : Error<
3432   "a qualified function type cannot be used to declare a "
3433   "%select{static member|nonmember}0 function">;
3434 def err_invalid_ref_qualifier_typedef_function_type_use : Error<
3435   "%select{static member|nonmember}0 function cannot have a ref-qualifier "
3436   "'%select{&&|&}1'">;
3437
3438 def err_ref_qualifier_overload : Error<
3439   "cannot overload a member function %select{without a ref-qualifier|with "
3440   "ref-qualifier '&'|with ref-qualifier '&&'}0 with a member function %select{"
3441   "without a ref-qualifier|with ref-qualifier '&'|with ref-qualifier '&&'}1">;
3442
3443 def err_invalid_non_static_member_use : Error<
3444   "invalid use of nonstatic data member %0">;
3445 def err_invalid_incomplete_type_use : Error<
3446   "invalid use of incomplete type %0">;
3447 def err_builtin_func_cast_more_than_one_arg : Error<
3448   "function-style cast to a builtin type can only take one argument">;
3449 def err_builtin_direct_init_more_than_one_arg : Error<
3450   "initializer of a builtin type can only take one argument">;
3451 def err_value_init_for_array_type : Error<
3452   "array types cannot be value-initialized">;
3453 def warn_format_nonliteral_noargs : Warning<
3454   "format string is not a string literal (potentially insecure)">,
3455   InGroup<FormatSecurity>;
3456 def warn_format_nonliteral : Warning<
3457   "format string is not a string literal">,
3458   InGroup<FormatNonLiteral>, DefaultIgnore;
3459
3460 def err_unexpected_interface : Error<
3461   "unexpected interface name %0: expected expression">;
3462 def err_ref_non_value : Error<"%0 does not refer to a value">;
3463 def err_ref_vm_type : Error<
3464   "cannot refer to declaration with a variably modified type inside block">;
3465 def err_ref_array_type : Error<
3466   "cannot refer to declaration with an array type inside block">;
3467 def err_property_not_found : Error<
3468   "property %0 not found on object of type %1">;
3469 def err_invalid_property_name : Error<
3470   "%0 is not a valid property name (accessing an object of type %1)">;
3471 def err_getter_not_found : Error<
3472   "expected getter method not found on object of type %0">;
3473 def err_property_not_found_forward_class : Error<
3474   "property %0 cannot be found in forward class object %1">;
3475 def err_property_not_as_forward_class : Error<
3476   "property %0 refers to an incomplete Objective-C class %1 "
3477   "(with no @interface available)">;
3478 def note_forward_class : Note<
3479   "forward class is declared here">;
3480 def err_duplicate_property : Error<
3481   "property has a previous declaration">;
3482 def ext_gnu_void_ptr : Extension<
3483   "arithmetic on%select{ a|}0 pointer%select{|s}0 to void is a GNU extension">,
3484   InGroup<PointerArith>;
3485 def ext_gnu_ptr_func_arith : Extension<
3486   "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 function "
3487   "type%select{|s}2 %1%select{| and %3}2 is a GNU extension">,
3488   InGroup<PointerArith>;
3489 def error_readonly_property_assignment : Error<
3490   "assigning to property with 'readonly' attribute not allowed">;
3491 def error_readonly_message_assignment : Error<
3492   "assigning to 'readonly' return result of an objective-c message not allowed">;
3493 def ext_integer_increment_complex : Extension<
3494   "ISO C does not support '++'/'--' on complex integer type %0">;
3495 def ext_integer_complement_complex : Extension<
3496   "ISO C does not support '~' for complex conjugation of %0">;
3497 def error_nosetter_property_assignment : Error<
3498   "setter method is needed to assign to object using property" " assignment syntax">;
3499 def error_no_subobject_property_setting : Error<
3500   "expression is not assignable">;
3501 def err_qualified_objc_access : Error<
3502   "%select{property|ivar}0 access cannot be qualified with '%1'">;
3503   
3504 def ext_freestanding_complex : Extension<
3505   "complex numbers are an extension in a freestanding C99 implementation">;
3506
3507 // FIXME: Remove when we support imaginary.
3508 def err_imaginary_not_supported : Error<"imaginary types are not supported">;
3509
3510 // Obj-c expressions
3511 def warn_root_inst_method_not_found : Warning<
3512   "instance method %0 is being used on 'Class' which is not in the root class">;
3513 def warn_class_method_not_found : Warning<
3514   "class method %objcclass0 not found (return type defaults to 'id')">;
3515 def warn_instance_method_on_class_found : Warning<
3516   "instance method %0 found instead of class method %1">;
3517 def warn_inst_method_not_found : Warning<
3518   "instance method %objcinstance0 not found (return type defaults to 'id')">;
3519 def error_no_super_class_message : Error<
3520   "no @interface declaration found in class messaging of %0">;
3521 def error_root_class_cannot_use_super : Error<
3522   "%0 cannot use 'super' because it is a root class">;
3523 def err_invalid_receiver_to_message : Error<
3524   "invalid receiver to message expression">;
3525 def err_invalid_receiver_to_message_super : Error<
3526   "'super' is only valid in a method body">;
3527 def err_invalid_receiver_class_message : Error<
3528   "receiver type %0 is not an Objective-C class">;
3529 def err_missing_open_square_message_send : Error<
3530   "missing '[' at start of message send expression">;
3531 def warn_bad_receiver_type : Warning<
3532   "receiver type %0 is not 'id' or interface pointer, consider "
3533   "casting it to 'id'">;
3534 def err_bad_receiver_type : Error<"bad receiver type %0">;
3535 def err_unknown_receiver_suggest : Error<
3536   "unknown receiver %0; did you mean %1?">;
3537 def error_objc_throw_expects_object : Error<
3538   "@throw requires an Objective-C object type (%0 invalid)">;
3539 def error_objc_synchronized_expects_object : Error<
3540   "@synchronized requires an Objective-C object type (%0 invalid)">;
3541 def error_rethrow_used_outside_catch : Error<
3542   "@throw (rethrow) used outside of a @catch block">;
3543 def err_attribute_multiple_objc_gc : Error<
3544   "multiple garbage collection attributes specified for type">;
3545 def err_catch_param_not_objc_type : Error<
3546   "@catch parameter is not a pointer to an interface type">;
3547 def err_illegal_qualifiers_on_catch_parm : Error<
3548   "illegal qualifiers on @catch parameter">;
3549 def err_storage_spec_on_catch_parm : Error<
3550   "@catch parameter cannot have storage specifier %select{|'typedef'|'extern'|"
3551   "'static'|'auto'|'register'|'__private_extern__'|'mutable'}0">;
3552 def warn_register_objc_catch_parm : Warning<
3553   "'register' storage specifier on @catch parameter will be ignored">;
3554 def err_qualified_objc_catch_parm : Error<
3555   "@catch parameter declarator cannot be qualified">;
3556 def err_objc_pointer_cxx_catch_gnu : Error<
3557   "can't catch Objective C exceptions in C++ in the GNU runtime">;
3558 def warn_objc_pointer_cxx_catch_fragile : Warning<
3559   "can not catch an exception thrown with @throw in C++ in the non-unified "
3560   "exception model">, InGroup<ObjCNonUnifiedException>;
3561 def err_objc_object_catch : Error<
3562   "can't catch an Objective C object by value">;
3563 def err_incomplete_type_objc_at_encode : Error<
3564   "'@encode' of incomplete type %0">;
3565
3566 def warn_setter_getter_impl_required : Warning<
3567   "property %0 requires method %1 to be defined - "
3568   "use @synthesize, @dynamic or provide a method implementation "
3569   "in this class implementation">;
3570 def warn_setter_getter_impl_required_in_category : Warning<
3571   "property %0 requires method %1 to be defined - "
3572   "use @dynamic or provide a method implementation in this category">;
3573 def note_property_impl_required : Note<
3574   "implementation is here">;
3575 def note_parameter_named_here : Note<
3576   "passing argument to parameter %0 here">;
3577 def note_parameter_here : Note<
3578   "passing argument to parameter here">;
3579
3580 // C++ casts
3581 // These messages adhere to the TryCast pattern: %0 is an int specifying the
3582 // cast type, %1 is the source type, %2 is the destination type.
3583 def err_bad_reinterpret_cast_overload : Error<
3584   "reinterpret_cast cannot resolve overloaded function %0 to type %1">;
3585
3586 def err_bad_static_cast_overload : Error<
3587   "address of overloaded function %0 cannot be static_cast to type %1">;
3588
3589 def err_bad_cstyle_cast_overload : Error<
3590   "address of overloaded function %0 cannot be cast to type %1">;
3591
3592
3593 def err_bad_cxx_cast_generic : Error<
3594   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
3595   "functional-style cast}0 from %1 to %2 is not allowed">;
3596 def err_bad_cxx_cast_rvalue : Error<
3597   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
3598   "functional-style cast}0 from rvalue to reference type %2">;
3599 def err_bad_cxx_cast_qualifiers_away : Error<
3600   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
3601   "functional-style cast}0 from %1 to %2 casts away qualifiers">;
3602 def err_bad_const_cast_dest : Error<
3603   "%select{const_cast||||C-style cast|functional-style cast}0 to %2, "
3604   "which is not a reference, pointer-to-object, or pointer-to-data-member">;
3605 def ext_cast_fn_obj : Extension<
3606   "cast between pointer-to-function and pointer-to-object is an extension">;
3607 def err_bad_reinterpret_cast_small_int : Error<
3608   "cast from pointer to smaller type %2 loses information">;
3609 def err_bad_cxx_cast_vector_to_scalar_different_size : Error<
3610   "%select{||reinterpret_cast||C-style cast|}0 from vector %1 " 
3611   "to scalar %2 of different size">;
3612 def err_bad_cxx_cast_scalar_to_vector_different_size : Error<
3613   "%select{||reinterpret_cast||C-style cast|}0 from scalar %1 " 
3614   "to vector %2 of different size">;
3615 def err_bad_cxx_cast_vector_to_vector_different_size : Error<
3616   "%select{||reinterpret_cast||C-style cast|}0 from vector %1 " 
3617   "to vector %2 of different size">;
3618 def err_bad_lvalue_to_rvalue_cast : Error<
3619   "cannot cast from lvalue of type %1 to rvalue reference type %2; types are "
3620   "not compatible">;
3621 def err_bad_static_cast_pointer_nonpointer : Error<
3622   "cannot cast from type %1 to pointer type %2">;
3623 def err_bad_static_cast_member_pointer_nonmp : Error<
3624   "cannot cast from type %1 to member pointer type %2">;
3625 def err_bad_cxx_cast_member_pointer_size : Error<
3626   "cannot %select{||reinterpret_cast||C-style cast|}0 from member pointer "
3627   "type %1 to member pointer type %2 of different size">;
3628 def err_bad_static_cast_incomplete : Error<"%0 is an incomplete type">;
3629 def err_bad_reinterpret_cast_reference : Error<
3630   "reinterpret_cast of a %0 to %1 needs its address which is not allowed">;
3631 def warn_undefined_reinterpret_cast : Warning<
3632   "reinterpret_cast from %0 to %1 has undefined behavior.">,
3633   InGroup<DiagGroup<"undefined-reinterpret-cast">>, DefaultIgnore;
3634
3635 // These messages don't adhere to the pattern.
3636 // FIXME: Display the path somehow better.
3637 def err_ambiguous_base_to_derived_cast : Error<
3638   "ambiguous cast from base %0 to derived %1:%2">;
3639 def err_static_downcast_via_virtual : Error<
3640   "cannot cast %0 to %1 via virtual base %2">;
3641 def err_downcast_from_inaccessible_base : Error<
3642   "cannot cast %select{private|protected}2 base class %1 to %0">;
3643 def err_upcast_to_inaccessible_base : Error<
3644   "cannot cast %0 to its %select{private|protected}2 base class %1">;
3645 def err_bad_dynamic_cast_not_ref_or_ptr : Error<
3646   "%0 is not a reference or pointer">;
3647 def err_bad_dynamic_cast_not_class : Error<"%0 is not a class">;
3648 def err_bad_dynamic_cast_incomplete : Error<"%0 is an incomplete type">;
3649 def err_bad_dynamic_cast_not_ptr : Error<"%0 is not a pointer">;
3650 def err_bad_dynamic_cast_not_polymorphic : Error<"%0 is not polymorphic">;
3651
3652 // Other C++ expressions
3653 def err_need_header_before_typeid : Error<
3654   "you need to include <typeinfo> before using the 'typeid' operator">;
3655 def err_need_header_before_ms_uuidof : Error<
3656   "you need to include <guiddef.h> before using the '__uuidof' operator">;
3657 def err_uuidof_without_guid : Error<
3658   "cannot call operator __uuidof on a type with no GUID">;
3659 def err_incomplete_typeid : Error<"'typeid' of incomplete type %0">;
3660 def err_static_illegal_in_new : Error<
3661   "the 'static' modifier for the array size is not legal in new expressions">;
3662 def err_array_new_needs_size : Error<
3663   "array size must be specified in new expressions">;
3664 def err_bad_new_type : Error<
3665   "cannot allocate %select{function|reference}1 type %0 with new">;
3666 def err_new_incomplete_type : Error<
3667   "allocation of incomplete type %0">;
3668 def err_new_array_nonconst : Error<
3669   "only the first dimension of an allocated array may have dynamic size">;
3670 def err_new_array_init_args : Error<
3671   "array 'new' cannot have initialization arguments">;
3672 def ext_new_paren_array_nonconst : ExtWarn<
3673   "when type is in parentheses, array cannot have dynamic size">;
3674 def err_placement_new_non_placement_delete : Error<
3675   "'new' expression with placement arguments refers to non-placement "
3676   "'operator delete'">;
3677 def err_array_size_not_integral : Error<
3678   "array size expression must have integral or enumerated type, not %0">;
3679 def err_array_size_incomplete_type : Error<
3680   "array size expression has incomplete class type %0">;
3681 def err_array_size_explicit_conversion : Error<
3682   "array size expression of type %0 requires explicit conversion to type %1">;
3683 def note_array_size_conversion : Note<
3684   "conversion to %select{integral|enumeration}0 type %1 declared here">;
3685 def err_array_size_ambiguous_conversion : Error<
3686   "ambiguous conversion of array size expression of type %0 to an integral or "
3687   "enumeration type">;
3688 def ext_array_size_conversion : Extension<
3689   "implicit conversion from array size expression of type %0 to "
3690   "%select{integral|enumeration}1 type %2 is a C++11 extension">,
3691   InGroup<CXX11>;
3692 def err_address_space_qualified_new : Error<
3693   "'new' cannot allocate objects of type %0 in address space '%1'">;
3694 def err_address_space_qualified_delete : Error<
3695   "'delete' cannot delete objects of type %0 in address space '%1'">;
3696
3697 def err_default_init_const : Error<
3698   "default initialization of an object of const type %0"
3699   "%select{| requires a user-provided default constructor}1">;
3700 def err_delete_operand : Error<"cannot delete expression of type %0">;
3701 def ext_delete_void_ptr_operand : ExtWarn<
3702   "cannot delete expression with pointer-to-'void' type %0">;
3703 def err_ambiguous_delete_operand : Error<"ambiguous conversion of delete "
3704                                          "expression of type %0 to a pointer">;
3705 def warn_delete_incomplete : Warning<
3706   "deleting pointer to incomplete type %0 may cause undefined behaviour">;
3707 def err_delete_incomplete_class_type : Error<
3708   "deleting incomplete class type %0; no conversions to pointer type">;
3709 def warn_delete_array_type : Warning<
3710   "'delete' applied to a pointer-to-array type %0 treated as delete[]">;
3711 def err_no_suitable_delete_member_function_found : Error<
3712   "no suitable member %0 in %1">;
3713 def err_ambiguous_suitable_delete_member_function_found : Error<
3714   "multiple suitable %0 functions in %1">;
3715 def note_member_declared_here : Note<
3716   "member %0 declared here">;
3717 def err_decrement_bool : Error<"cannot decrement expression of type bool">;
3718 def warn_increment_bool : Warning<
3719   "incrementing expression of type bool is deprecated">, InGroup<Deprecated>;
3720 def ext_catch_incomplete_ptr : ExtWarn<
3721   "ISO C++ forbids catching a pointer to incomplete type %0">;
3722 def ext_catch_incomplete_ref : ExtWarn<
3723   "ISO C++ forbids catching a reference to incomplete type %0">;
3724 def err_catch_incomplete : Error<"cannot catch incomplete type %0">;
3725 def err_catch_rvalue_ref : Error<"cannot catch exceptions by rvalue reference">;
3726 def err_qualified_catch_declarator : Error<
3727   "exception declarator cannot be qualified">;
3728 def err_early_catch_all : Error<"catch-all handler must come last">;
3729 def err_bad_memptr_rhs : Error<
3730   "right hand operand to %0 has non pointer-to-member type %1">;
3731 def err_memptr_rhs_to_incomplete : Error<
3732   "cannot dereference pointer into incomplete class type %0">;
3733 def err_bad_memptr_lhs : Error<
3734   "left hand operand to %0 must be a %select{|pointer to }1class "
3735   "compatible with the right hand operand, but is %2">;
3736 def warn_exception_caught_by_earlier_handler : Warning<
3737   "exception of type %0 will be caught by earlier handler">;
3738 def note_previous_exception_handler : Note<"for type %0">;
3739 def err_exceptions_disabled : Error<
3740   "cannot use '%0' with exceptions disabled">;
3741 def err_objc_exceptions_disabled : Error<
3742   "cannot use '%0' with Objective-C exceptions disabled">;
3743 def warn_non_virtual_dtor : Warning<
3744   "%0 has virtual functions but non-virtual destructor">,
3745   InGroup<NonVirtualDtor>, DefaultIgnore;
3746 def warn_delete_non_virtual_dtor : Warning<
3747   "delete called on %0 that has virtual functions but non-virtual destructor">,
3748   InGroup<DeleteNonVirtualDtor>, DefaultIgnore;
3749 def warn_delete_abstract_non_virtual_dtor : Warning<
3750   "delete called on %0 that is abstract but has non-virtual destructor">,
3751   InGroup<DeleteNonVirtualDtor>;
3752 def warn_overloaded_virtual : Warning<
3753   "%q0 hides overloaded virtual %select{function|functions}1">,
3754   InGroup<OverloadedVirtual>, DefaultIgnore;
3755 def note_hidden_overloaded_virtual_declared_here : Note<
3756   "hidden overloaded virtual function %q0 declared here">;
3757 def warn_using_directive_in_header : Warning<
3758   "using namespace directive in global context in header">,
3759   InGroup<HeaderHygiene>, DefaultIgnore;
3760
3761 def err_conditional_void_nonvoid : Error<
3762   "%select{left|right}1 operand to ? is void, but %select{right|left}1 operand "
3763   "is of type %0">;
3764 def err_conditional_ambiguous : Error<
3765   "conditional expression is ambiguous; %0 can be converted to %1 "
3766   "and vice versa">;
3767 def err_conditional_ambiguous_ovl : Error<
3768   "conditional expression is ambiguous; %0 and %1 can be converted to several "
3769   "common types">;
3770
3771 def err_throw_incomplete : Error<
3772   "cannot throw object of incomplete type %0">;
3773 def err_throw_incomplete_ptr : Error<
3774   "cannot throw pointer to object of incomplete type %0">;
3775 def err_return_in_constructor_handler : Error<
3776   "return in the catch of a function try block of a constructor is illegal">;
3777
3778 def err_operator_arrow_circular : Error<
3779   "circular pointer delegation detected">;
3780 def err_pseudo_dtor_base_not_scalar : Error<
3781   "object expression of non-scalar type %0 cannot be used in a "
3782   "pseudo-destructor expression">;
3783 def err_pseudo_dtor_type_mismatch : Error<
3784   "the type of object expression (%0) does not match the type being destroyed "
3785   "(%1) in pseudo-destructor expression">;
3786 def err_pseudo_dtor_call_with_args : Error<
3787   "call to pseudo-destructor cannot have any arguments">;
3788 def err_dtor_expr_without_call : Error<
3789   "%select{destructor reference|pseudo-destructor expression}0 must be "
3790   "called immediately with '()'">;
3791 def err_pseudo_dtor_destructor_non_type : Error<
3792   "%0 does not refer to a type name in pseudo-destructor expression; expected "
3793   "the name of type %1">;
3794 def err_pseudo_dtor_template : Error<
3795   "specialization of template %0 does not refer to a scalar type in pseudo-"
3796   "destructor expression">;
3797 def err_invalid_use_of_function_type : Error<
3798   "a function type is not allowed here">;
3799 def err_invalid_use_of_array_type : Error<"an array type is not allowed here">;
3800 def err_type_defined_in_condition : Error<
3801   "types may not be defined in conditions">;
3802 def err_typecheck_bool_condition : Error<
3803   "value of type %0 is not contextually convertible to 'bool'">;
3804 def err_typecheck_ambiguous_condition : Error<
3805   "conversion from %0 to %1 is ambiguous">;
3806 def err_typecheck_nonviable_condition : Error<
3807   "no viable conversion from %0 to %1">;
3808 def err_typecheck_deleted_function : Error<
3809   "conversion function from %0 to %1 invokes a deleted function">;
3810   
3811 def err_expected_class_or_namespace : Error<"expected a class or namespace">;
3812 def err_missing_qualified_for_redecl : Error<
3813   "must qualify the name %0 to declare %q1 in this scope">;
3814 def err_invalid_declarator_scope : Error<
3815   "definition or redeclaration of %0 not in a namespace enclosing %1">;
3816 def err_invalid_declarator_global_scope : Error<
3817   "definition or redeclaration of %0 cannot name the global scope">;
3818 def err_invalid_declarator_in_function : Error<
3819   "definition or redeclaration of %0 not allowed inside a function">;
3820 def err_not_tag_in_scope : Error<
3821   "no %select{struct|union|class|enum}0 named %1 in %2">;
3822
3823 def err_cannot_form_pointer_to_member_of_reference_type : Error<
3824   "cannot form a pointer-to-member to member %0 of reference type %1">;
3825 def err_incomplete_object_call : Error<
3826   "incomplete type in call to object of type %0">;
3827 def err_incomplete_pointer_to_member_return : Error<
3828   "incomplete return type %0 of pointer-to-member constant">;
3829
3830 def warn_condition_is_assignment : Warning<"using the result of an "
3831   "assignment as a condition without parentheses">,
3832   InGroup<Parentheses>;
3833 // Completely identical except off by default.
3834 def warn_condition_is_idiomatic_assignment : Warning<"using the result "
3835   "of an assignment as a condition without parentheses">,
3836   InGroup<DiagGroup<"idiomatic-parentheses">>, DefaultIgnore;
3837 def note_condition_assign_to_comparison : Note<
3838   "use '==' to turn this assignment into an equality comparison">;
3839 def note_condition_or_assign_to_comparison : Note<
3840   "use '!=' to turn this compound assignment into an inequality comparison">;
3841 def note_condition_assign_silence : Note<
3842   "place parentheses around the assignment to silence this warning">;
3843
3844 def warn_equality_with_extra_parens : Warning<"equality comparison with "
3845   "extraneous parentheses">, InGroup<ParenthesesOnEquality>;
3846 def note_equality_comparison_to_assign : Note<
3847   "use '=' to turn this equality comparison into an assignment">;
3848 def note_equality_comparison_silence : Note<
3849   "remove extraneous parentheses around the comparison to silence this warning">;
3850
3851 def warn_synthesized_ivar_access : Warning<
3852   "direct access of synthesized ivar by using property access %0">,
3853   InGroup<NonfragileAbi2>, DefaultIgnore;
3854
3855 def note_global_declared_at : Note<"global variable declared here">;
3856
3857 // assignment related diagnostics (also for argument passing, returning, etc).
3858 // In most of these diagnostics the %2 is a value from the
3859 // Sema::AssignmentAction enumeration
3860 def err_typecheck_convert_incompatible : Error<
3861   "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
3862   " %0 "
3863   "%select{from incompatible type|to parameter of incompatible type|"
3864   "from a function with incompatible result type|to incompatible type|"
3865   "with an expression of incompatible type|to parameter of incompatible type|"
3866   "to incompatible type}2 %1; "
3867   "%select{|dereference with *|"
3868   "take the address with &|"
3869   "remove *|"
3870   "remove &}3">;
3871 def warn_incompatible_qualified_id : Warning<
3872   "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
3873   " %0 "
3874   "%select{from incompatible type|to parameter of incompatible type|"
3875   "from a function with incompatible result type|to incompatible type|"
3876   "with an expression of incompatible type|to parameter of incompatible type|"
3877   "to incompatible type}2 %1">;
3878 def ext_typecheck_convert_pointer_int : ExtWarn<
3879   "incompatible pointer to integer conversion "
3880   "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
3881   " %0 "
3882   "%select{from|to parameter of type|from a function with result type|to type|"
3883   "with an expression of type|to parameter of type|to type}2 %1; "
3884   "%select{|dereference with *|"
3885   "take the address with &|"
3886   "remove *|"
3887   "remove &}3">;
3888 def ext_typecheck_convert_int_pointer : ExtWarn<
3889   "incompatible integer to pointer conversion "
3890   "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
3891   " %0 "
3892   "%select{from|to parameter of type|from a function with result type|to type|"
3893   "with an expression of type|to parameter of type|to type}2 %1; "
3894   "%select{|dereference with *|"
3895   "take the address with &|"
3896   "remove *|"
3897   "remove &}3">;
3898 def ext_typecheck_convert_pointer_void_func : Extension<
3899   "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
3900   " %0 "
3901   "%select{from|to parameter of type|from a function with result type|to type|"
3902   "with an expression of type|to parameter of type|to type}2 %1 "
3903   "converts between void pointer and function pointer">;
3904 def ext_typecheck_convert_incompatible_pointer_sign : ExtWarn<
3905   "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
3906   " %0 "
3907   "%select{from|to parameter of type|from a function with result type|to type|"
3908   "with an expression of type|to parameter of type|to type}2 %1 "
3909   "converts between pointers to integer types with different sign">,
3910   InGroup<DiagGroup<"pointer-sign">>;
3911 def ext_typecheck_convert_incompatible_pointer : ExtWarn<
3912   "incompatible pointer types "
3913   "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
3914   " %0 "
3915   "%select{from|to parameter of type|from a function with result type|to type|"
3916   "with an expression of type|to parameter of type|to type}2 %1"
3917   "%select{|dereference with *|"
3918   "take the address with &|"
3919   "remove *|"
3920   "remove &}3">,
3921   InGroup<IncompatiblePointerTypes>;
3922 def ext_typecheck_convert_discards_qualifiers : ExtWarn<
3923   "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
3924   " %0 "
3925   "%select{from|to parameter of type|from a function with result type|to type|"
3926   "with an expression of type|to parameter of type|to type}2 %1 discards "
3927   "qualifiers">,
3928   InGroup<IncompatiblePointerTypes>;
3929 def ext_nested_pointer_qualifier_mismatch : ExtWarn<
3930   "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
3931   " %0 "
3932   "%select{from|to parameter of type|from a function with result type|to type|"
3933   "with an expression of type|to parameter of type|to type}2 %1 discards "
3934   "qualifiers in nested pointer types">,
3935   InGroup<IncompatiblePointerTypes>;
3936 def warn_incompatible_vectors : Warning<
3937   "incompatible vector types "
3938   "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
3939   " %0 "
3940   "%select{from|to parameter of type|from a function with result type|to type|"
3941   "with an expression of type|to parameter of type|to type}2 %1">,
3942   InGroup<VectorConversions>, DefaultIgnore;
3943 def err_int_to_block_pointer : Error<
3944   "invalid block pointer conversion "
3945   "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
3946   " %0 "
3947   "%select{from|to parameter of type|from a function with result type|to type|"
3948   "with an expression of type|to parameter of type|to type}2 %1">;
3949 def err_typecheck_convert_incompatible_block_pointer : Error<
3950   "incompatible block pointer types "
3951   "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
3952   " %0 "
3953   "%select{from|to parameter of type|from a function with result type|to type|"
3954   "with an expression of type|to parameter of type|to type}2 %1">;
3955 def err_typecheck_incompatible_address_space : Error<
3956   "%select{assigning %1 to %0"
3957   "|passing %0 to parameter of type %1"
3958   "|returning %0 from a function with result type %1"
3959   "|converting %0 to type %1"
3960   "|initializing %0 with an expression of type %1"
3961   "|sending %0 to parameter of type %1"
3962   "|casting %0 to type %1}2"
3963   " changes address space of pointer">;
3964 def err_typecheck_incompatible_ownership : Error<
3965   "%select{assigning %1 to %0"
3966   "|passing %0 to parameter of type %1"
3967   "|returning %0 from a function with result type %1"
3968   "|converting %0 to type %1"
3969   "|initializing %0 with an expression of type %1"
3970   "|sending %0 to parameter of type %1"
3971   "|casting %0 to type %1}2"
3972   " changes retain/release properties of pointer">;
3973 def err_typecheck_convert_ambiguous : Error<
3974   "ambiguity in initializing value of type %0 with initializer of type %1">;
3975 def err_typecheck_comparison_of_distinct_blocks : Error<
3976   "comparison of distinct block types (%0 and %1)">;
3977
3978 def err_typecheck_array_not_modifiable_lvalue : Error<
3979   "array type %0 is not assignable">;
3980 def err_typecheck_non_object_not_modifiable_lvalue : Error<
3981   "non-object type %0 is not assignable">;
3982 def err_typecheck_expression_not_modifiable_lvalue : Error<
3983   "expression is not assignable">;
3984 def err_typecheck_incomplete_type_not_modifiable_lvalue : Error<
3985   "incomplete type %0 is not assignable">;
3986 def err_typecheck_lvalue_casts_not_supported : Error<
3987   "assignment to cast is illegal, lvalue casts are not supported">;
3988
3989 def err_typecheck_duplicate_vector_components_not_mlvalue : Error<
3990   "vector is not assignable (contains duplicate components)">;
3991 def err_block_decl_ref_not_modifiable_lvalue : Error<
3992   "variable is not assignable (missing __block type specifier)">;
3993 def err_typecheck_call_not_function : Error<
3994   "called object type %0 is not a function or function pointer">;
3995 def err_call_incomplete_return : Error<
3996   "calling function with incomplete return type %0">;
3997 def err_call_function_incomplete_return : Error<
3998   "calling %0 with incomplete return type %1">;
3999 def note_function_with_incomplete_return_type_declared_here : Note<
4000   "%0 declared here">;
4001 def err_call_incomplete_argument : Error<
4002   "argument type %0 is incomplete">;
4003 def err_typecheck_call_too_few_args : Error<
4004   "too few %select{|||execution configuration }0arguments to "
4005   "%select{function|block|method|kernel function}0 call, "
4006   "expected %1, have %2">;
4007 def err_typecheck_call_too_few_args_at_least : Error<
4008   "too few %select{|||execution configuration }0arguments to "
4009   "%select{function|block|method|kernel function}0 call, "
4010   "expected at least %1, have %2">;
4011 def err_typecheck_call_too_many_args : Error<
4012   "too many %select{|||execution configuration }0arguments to "
4013   "%select{function|block|method|kernel function}0 call, "
4014   "expected %1, have %2">;
4015 def err_typecheck_call_too_many_args_at_most : Error<
4016   "too many %select{|||execution configuration }0arguments to "
4017   "%select{function|block|method|kernel function}0 call, "
4018   "expected at most %1, have %2">;
4019 def note_callee_decl : Note<
4020   "%0 declared here">;
4021 def warn_call_wrong_number_of_arguments : Warning<
4022   "too %select{few|many}0 arguments in call to %1">;
4023 def err_atomic_builtin_must_be_pointer : Error<
4024   "first argument to atomic builtin must be a pointer (%0 invalid)">;
4025 def err_atomic_builtin_must_be_pointer_intptr : Error<
4026   "first argument to atomic builtin must be a pointer to integer or pointer"
4027   " (%0 invalid)">;
4028 def err_atomic_builtin_pointer_size : Error<
4029   "first argument to atomic builtin must be a pointer to 1,2,4,8 or 16 byte "
4030   "type (%0 invalid)">;
4031 def err_atomic_op_needs_atomic : Error<
4032   "first argument to atomic operation must be a pointer to _Atomic "
4033   "type (%0 invalid)">;
4034 def err_atomic_op_needs_atomic_int_or_ptr : Error<
4035   "first argument to atomic operation must be a pointer to atomic "
4036   "integer or pointer (%0 invalid)">;
4037 def err_atomic_op_logical_needs_atomic_int : Error<
4038   "first argument to logical atomic operation must be a pointer to atomic "
4039   "integer (%0 invalid)">;
4040
4041 def err_deleted_function_use : Error<"attempt to use a deleted function">;
4042
4043 def err_kern_type_not_void_return : Error<
4044   "kernel function type %0 must have void return type">;
4045 def err_config_scalar_return : Error<
4046   "CUDA special function 'cudaConfigureCall' must have scalar return type">;
4047 def err_kern_call_not_global_function : Error<
4048   "kernel call to non-global function %0">;
4049 def err_global_call_not_config : Error<
4050   "call to global function %0 not configured">;
4051 def err_ref_bad_target : Error<
4052   "reference to %select{__device__|__global__|__host__|__host__ __device__}0 "
4053   "function %1 in %select{__device__|__global__|__host__|__host__ __device__}2 function">;
4054
4055
4056 def err_cannot_pass_objc_interface_to_vararg : Error<
4057   "cannot pass object with interface type %0 by-value through variadic "
4058   "%select{function|block|method}1">;
4059
4060 def warn_cannot_pass_non_pod_arg_to_vararg : Warning<
4061   "cannot pass object of %select{non-POD|non-trivial}0 type %1 through variadic"
4062   " %select{function|block|method|constructor}2; call will abort at runtime">,
4063   InGroup<DiagGroup<"non-pod-varargs">>, DefaultError;
4064
4065 def err_typecheck_call_invalid_ordered_compare : Error<
4066   "ordered compare requires two args of floating point type (%0 and %1)">;
4067 def err_typecheck_call_invalid_unary_fp : Error<
4068   "floating point classification requires argument of floating point type "
4069   "(passed in %0)">;
4070 def err_typecheck_cond_expect_scalar : Error<
4071   "used type %0 where arithmetic or pointer type is required">;
4072 def ext_typecheck_cond_one_void : Extension<
4073   "C99 forbids conditional expressions with only one void side">;
4074 def err_typecheck_cond_expect_scalar_or_vector : Error<
4075   "used type %0 where arithmetic, pointer, or vector type is required">;
4076 def err_typecheck_cast_to_incomplete : Error<
4077   "cast to incomplete type %0">;
4078 def ext_typecheck_cast_nonscalar : Extension<
4079   "C99 forbids casting nonscalar type %0 to the same type">;
4080 def ext_typecheck_cast_to_union : Extension<"C99 forbids casts to union type">;
4081 def err_typecheck_cast_to_union_no_type : Error<
4082   "cast to union type from type %0 not present in union">;
4083 def err_cast_pointer_from_non_pointer_int : Error<
4084   "operand of type %0 cannot be cast to a pointer type">;
4085 def err_cast_pointer_to_non_pointer_int : Error<
4086   "pointer cannot be cast to type %0">;
4087 def err_typecheck_expect_scalar_operand : Error<
4088   "operand of type %0 where arithmetic or pointer type is required">;
4089 def err_typecheck_cond_incompatible_operands : Error<
4090   "incompatible operand types (%0 and %1)">;
4091 def ext_typecheck_cond_incompatible_operands_nonstandard : ExtWarn<
4092   "incompatible operand types (%0 and %1) use non-standard composite pointer "
4093   "type %2">;
4094 def err_cast_selector_expr : Error<
4095   "cannot type cast @selector expression">;
4096 def warn_typecheck_cond_incompatible_pointers : ExtWarn<
4097   "pointer type mismatch (%0 and %1)">,
4098   InGroup<DiagGroup<"pointer-type-mismatch">>;
4099 def warn_typecheck_cond_pointer_integer_mismatch : ExtWarn<
4100   "pointer/integer type mismatch in conditional expression (%0 and %1)">,
4101   InGroup<DiagGroup<"conditional-type-mismatch">>;
4102 def err_typecheck_choose_expr_requires_constant : Error<
4103   "'__builtin_choose_expr' requires a constant expression">;
4104 def ext_typecheck_expression_not_constant_but_accepted : Extension<
4105   "expression is not a constant, but is accepted as one by GNU extensions">, 
4106   InGroup<GNU>;
4107 def warn_unused_expr : Warning<"expression result unused">,
4108   InGroup<UnusedValue>;
4109 def warn_unused_voidptr : Warning<
4110   "expression result unused; should this cast be to 'void'?">,
4111   InGroup<UnusedValue>;
4112 def warn_unused_property_expr : Warning<
4113  "property access result unused - getters should not be used for side effects">,
4114   InGroup<UnusedValue>;
4115 def warn_unused_call : Warning<
4116   "ignoring return value of function declared with %0 attribute">,
4117   InGroup<UnusedValue>;
4118 def warn_unused_result : Warning<
4119   "ignoring return value of function declared with warn_unused_result "
4120   "attribute">, InGroup<DiagGroup<"unused-result">>;
4121 def warn_unused_comparison : Warning<
4122   "%select{equality|inequality}0 comparison result unused">,
4123   InGroup<UnusedComparison>;
4124 def note_inequality_comparison_to_or_assign : Note<
4125   "use '|=' to turn this inequality comparison into an or-assignment">;
4126
4127 def err_incomplete_type_used_in_type_trait_expr : Error<
4128   "incomplete type %0 used in type trait expression">;
4129 def err_dimension_expr_not_constant_integer : Error<
4130   "dimension expression does not evaluate to a constant unsigned int">;
4131 def err_expected_ident_or_lparen : Error<"expected identifier or '('">;
4132
4133 def err_typecheck_cond_incompatible_operands_null : Error<
4134   "non-pointer operand type %0 incompatible with %select{NULL|nullptr}1">;
4135 } // End of general sema category.
4136
4137 // inline asm.
4138 let CategoryName = "Inline Assembly Issue" in {
4139   def err_asm_wide_character : Error<"wide string is invalid in 'asm'">;
4140   def err_asm_invalid_lvalue_in_output : Error<"invalid lvalue in asm output">;
4141   def err_asm_invalid_output_constraint : Error<
4142     "invalid output constraint '%0' in asm">;
4143   def err_asm_invalid_lvalue_in_input : Error<
4144     "invalid lvalue in asm input for constraint '%0'">;
4145   def err_asm_invalid_input_constraint : Error<
4146     "invalid input constraint '%0' in asm">;
4147   def err_asm_invalid_type_in_input : Error<
4148     "invalid type %0 in asm input for constraint '%1'">;
4149   def err_asm_tying_incompatible_types : Error<
4150     "unsupported inline asm: input with type %0 matching output with type %1">;
4151   def err_asm_unknown_register_name : Error<"unknown register name '%0' in asm">;
4152   def warn_asm_label_on_auto_decl : Warning<
4153     "ignored asm label '%0' on automatic variable">;
4154   def err_invalid_asm_cast_lvalue : Error<
4155     "invalid use of a cast in a inline asm context requiring an l-value: "
4156     "remove the cast or build with -fheinous-gnu-extensions">;
4157
4158   def warn_invalid_asm_cast_lvalue : Warning<
4159     "invalid use of a cast in a inline asm context requiring an l-value: "
4160     "accepted due to -fheinous-gnu-extensions, but clang may remove support "
4161     "for this in the future">;
4162 }
4163
4164 let CategoryName = "Semantic Issue" in {
4165
4166 def err_invalid_conversion_between_vectors : Error<
4167   "invalid conversion between vector type %0 and %1 of different size">;
4168 def err_invalid_conversion_between_vector_and_integer : Error<
4169   "invalid conversion between vector type %0 and integer type %1 "
4170   "of different size">;
4171
4172 def err_invalid_conversion_between_vector_and_scalar : Error<
4173   "invalid conversion between vector type %0 and scalar type %1">;
4174 def err_overload_expr_requires_non_zero_constant : Error<
4175   "overload requires a non-zero constant expression as first argument">;
4176 def err_overload_incorrect_fntype : Error<
4177   "argument is not a function, or has wrong number of parameters">;
4178
4179 // C++ member initializers.
4180 def err_only_constructors_take_base_inits : Error<
4181   "only constructors take base initializers">;
4182
4183 def err_multiple_mem_initialization : Error <
4184   "multiple initializations given for non-static member %0">;
4185 def err_multiple_mem_union_initialization : Error <
4186   "initializing multiple members of anonymous union">;
4187 def err_multiple_base_initialization : Error <
4188   "multiple initializations given for base %0">;
4189
4190 def err_mem_init_not_member_or_class : Error<
4191   "member initializer %0 does not name a non-static data member or base "
4192   "class">;
4193
4194 def warn_initializer_out_of_order : Warning<
4195   "%select{field|base class}0 %1 will be initialized after "
4196   "%select{field|base}2 %3">,
4197   InGroup<Reorder>, DefaultIgnore;
4198
4199 def err_base_init_does_not_name_class : Error<
4200   "constructor initializer %0 does not name a class">;
4201 def err_base_init_direct_and_virtual : Error<
4202   "base class initializer %0 names both a direct base class and an "
4203   "inherited virtual base class">;
4204 def err_not_direct_base_or_virtual : Error<
4205   "type %0 is not a direct or virtual base of %1">;
4206
4207 def err_in_class_initializer_non_const : Error<
4208   "non-const static data member must be initialized out of line">;
4209 def err_in_class_initializer_volatile : Error<
4210   "static const volatile data member must be initialized out of line">;
4211 def err_in_class_initializer_bad_type : Error<
4212   "static data member of type %0 must be initialized out of line">;
4213 def ext_in_class_initializer_float_type : ExtWarn<
4214   "in-class initializer for static data member of type %0 is a GNU extension">,
4215   InGroup<GNU>;
4216 def note_in_class_initializer_float_type_constexpr : Note<
4217   "use 'constexpr' specifier to silence this warning">;
4218 def err_in_class_initializer_literal_type : Error<
4219   "in-class initializer for static data member of type %0 requires "
4220   "'constexpr' specifier">;
4221 def err_in_class_initializer_non_constant : Error<
4222   "in-class initializer is not a constant expression">;
4223
4224 def ext_in_class_initializer_non_constant : Extension<
4225  "in-class initializer is not a constant expression, accepted as an extension">;
4226
4227 // C++ anonymous unions and GNU anonymous structs/unions
4228 def ext_anonymous_union : Extension<
4229   "anonymous unions are a GNU extension in C">, InGroup<GNU>;
4230 def ext_anonymous_struct : Extension<
4231   "anonymous structs are a GNU extension">, InGroup<GNU>;
4232 def err_anonymous_union_not_static : Error<
4233   "anonymous unions at namespace or global scope must be declared 'static'">;
4234 def err_anonymous_union_with_storage_spec : Error<
4235   "anonymous union at class scope must not have a storage specifier">;
4236 def err_anonymous_struct_not_member : Error<
4237   "anonymous %select{structs|structs and classes}0 must be "
4238   "%select{struct or union|class}0 members">;
4239 def err_anonymous_union_member_redecl : Error<
4240   "member of anonymous union redeclares %0">;
4241 def err_anonymous_struct_member_redecl : Error<
4242   "member of anonymous struct redeclares %0">;
4243 def err_anonymous_record_with_type : Error<
4244   "types cannot be declared in an anonymous %select{struct|union}0">;
4245 def ext_anonymous_record_with_type : Extension<
4246   "types declared in an anonymous %select{struct|union}0 are a Microsoft "
4247   "extension">, InGroup<Microsoft>;
4248 def err_anonymous_record_with_function : Error<
4249   "functions cannot be declared in an anonymous %select{struct|union}0">;
4250 def err_anonymous_record_with_static : Error<
4251   "static members cannot be declared in an anonymous %select{struct|union}0">;
4252 def err_anonymous_record_bad_member : Error<
4253   "anonymous %select{struct|union}0 can only contain non-static data members">;
4254 def err_anonymous_record_nonpublic_member : Error<
4255   "anonymous %select{struct|union}0 cannot contain a "
4256   "%select{private|protected}1 data member">;
4257 def ext_ms_anonymous_struct : ExtWarn<
4258   "anonymous structs are a Microsoft extension">, InGroup<Microsoft>;
4259
4260 // C++ local classes
4261 def err_reference_to_local_var_in_enclosing_function : Error<
4262   "reference to local variable %0 declared in enclosed function %1">;
4263 def note_local_variable_declared_here : Note<
4264   "%0 declared here">;
4265 def err_static_data_member_not_allowed_in_local_class : Error<
4266   "static data member %0 not allowed in local class %1">; 
4267   
4268 // C++ derived classes
4269 def err_base_clause_on_union : Error<"unions cannot have base classes">;
4270 def err_base_must_be_class : Error<"base specifier must name a class">;
4271 def err_union_as_base_class : Error<"unions cannot be base classes">;
4272 def err_incomplete_base_class : Error<"base class has incomplete type">;
4273 def err_duplicate_base_class : Error<
4274   "base class %0 specified more than once as a direct base class">;
4275 // FIXME: better way to display derivation?  Pass entire thing into diagclient?
4276 def err_ambiguous_derived_to_base_conv : Error<
4277   "ambiguous conversion from derived class %0 to base class %1:%2">;
4278 def err_ambiguous_memptr_conv : Error<
4279   "ambiguous conversion from pointer to member of %select{base|derived}0 "
4280   "class %1 to pointer to member of %select{derived|base}0 class %2:%3">;
4281
4282 def err_memptr_conv_via_virtual : Error<
4283   "conversion from pointer to member of class %0 to pointer to member "
4284   "of class %1 via virtual base %2 is not allowed">;
4285
4286 // C++ access control
4287 def err_conv_to_inaccessible_base : Error<
4288   "conversion from %0 to inaccessible base class %1">, AccessControl;
4289 def note_inheritance_specifier_here : Note<
4290   "'%0' inheritance specifier here">;
4291 def note_inheritance_implicitly_private_here : Note<
4292   "inheritance is implicitly 'private'">;
4293
4294 // C++ member name lookup
4295 def err_ambiguous_member_multiple_subobjects : Error<
4296   "non-static member %0 found in multiple base-class subobjects of type %1:%2">;
4297 def err_ambiguous_member_multiple_subobject_types : Error<
4298   "member %0 found in multiple base classes of different types">;
4299 def note_ambiguous_member_found : Note<"member found by ambiguous name lookup">;
4300 def err_ambiguous_reference : Error<"reference to %0 is ambiguous">;
4301 def note_ambiguous_candidate : Note<"candidate found by name lookup is %q0">;
4302 def err_ambiguous_tag_hiding : Error<"a type named %0 is hidden by a "
4303   "declaration in a different namespace">;
4304 def note_hidden_tag : Note<"type declaration hidden">;
4305 def note_hiding_object : Note<"declaration hides type">;
4306
4307 // C++ operator overloading
4308 def err_operator_overload_needs_class_or_enum : Error<
4309   "overloaded %0 must have at least one parameter of class "
4310   "or enumeration type">;
4311
4312 def err_operator_overload_variadic : Error<"overloaded %0 cannot be variadic">;
4313 def err_operator_overload_static : Error<
4314   "overloaded %0 cannot be a static member function">;
4315 def err_operator_overload_default_arg : Error<
4316   "parameter of overloaded %0 cannot have a default argument">;
4317 def err_operator_overload_must_be : Error<
4318   "overloaded %0 must be a %select{unary|binary|unary or binary}2 operator "
4319   "(has %1 parameter%s1)">;
4320
4321 def err_operator_overload_must_be_member : Error<
4322   "overloaded %0 must be a non-static member function">;
4323 def err_operator_overload_post_incdec_must_be_int : Error<
4324   "parameter of overloaded post-%select{increment|decrement}1 operator must "
4325   "have type 'int' (not %0)">;
4326
4327 // C++ allocation and deallocation functions.
4328 def err_operator_new_delete_declared_in_namespace : Error<
4329   "%0 cannot be declared inside a namespace">;
4330 def err_operator_new_delete_declared_static : Error<
4331   "%0 cannot be declared static in global scope">;
4332 def err_operator_new_delete_invalid_result_type : Error<
4333   "%0 must return type %1">;
4334 def err_operator_new_delete_dependent_result_type : Error<
4335   "%0 cannot have a dependent return type; use %1 instead">;
4336 def err_operator_new_delete_too_few_parameters : Error<
4337   "%0 must have at least one parameter.">;
4338 def err_operator_new_delete_template_too_few_parameters : Error<
4339   "%0 template must have at least two parameters.">;
4340
4341 def err_operator_new_dependent_param_type : Error<
4342   "%0 cannot take a dependent type as first parameter; "
4343   "use size_t (%1) instead">;
4344 def err_operator_new_param_type : Error<
4345   "%0 takes type size_t (%1) as first parameter">;
4346 def err_operator_new_default_arg: Error<
4347   "parameter of %0 cannot have a default argument">;
4348 def err_operator_delete_dependent_param_type : Error<
4349   "%0 cannot take a dependent type as first parameter; use %1 instead">;
4350 def err_operator_delete_param_type : Error<
4351   "first parameter of %0 must have type %1">;
4352
4353 // C++ literal operators
4354 def err_literal_operator_outside_namespace : Error<
4355   "literal operator %0 must be in a namespace or global scope">;
4356 // FIXME: This diagnostic sucks
4357 def err_literal_operator_params : Error<
4358   "parameter declaration for literal operator %0 is not valid">;
4359 def warn_user_literal_hexfloat : Warning<
4360   "user-defined literal with suffix '%0' is preempted by C99 hexfloat "
4361   "extension">, InGroup<UserDefinedLiterals>;
4362 def warn_user_literal_reserved : Warning<
4363   "user-defined literals not starting with '_' are reserved by the "
4364   "implementation">, InGroup<UserDefinedLiterals>;
4365   
4366 // C++ conversion functions
4367 def err_conv_function_not_member : Error<
4368   "conversion function must be a non-static member function">;
4369 def err_conv_function_return_type : Error<
4370   "conversion function cannot have a return type">;
4371 def err_conv_function_with_params : Error<
4372   "conversion function cannot have any parameters">;
4373 def err_conv_function_variadic : Error<
4374   "conversion function cannot be variadic">;
4375 def err_conv_function_to_array : Error<
4376   "conversion function cannot convert to an array type">;
4377 def err_conv_function_to_function : Error<
4378   "conversion function cannot convert to a function type">;
4379 def err_conv_function_with_complex_decl : Error<
4380   "must use a typedef to declare a conversion to %0">;
4381 def err_conv_function_redeclared : Error<
4382   "conversion function cannot be redeclared">;
4383 def warn_conv_to_self_not_used : Warning<
4384   "conversion function converting %0 to itself will never be used">;
4385 def warn_conv_to_base_not_used : Warning<
4386   "conversion function converting %0 to its base class %1 will never be used">;
4387 def warn_conv_to_void_not_used : Warning<
4388   "conversion function converting %0 to %1 will never be used">;
4389
4390 def warn_not_compound_assign : Warning<
4391   "use of unary operator that may be intended as compound assignment (%0=)">;
4392
4393 // C++11 explicit conversion operators
4394 def warn_explicit_conversion_functions : Warning<
4395   "explicit conversion functions are a C++11 extension">, InGroup<CXX11>;
4396
4397 // C++11 defaulted functions
4398 def err_defaulted_default_ctor_params : Error<
4399   "an explicitly-defaulted default constructor must have no parameters">;
4400 def err_defaulted_copy_ctor_params : Error<
4401   "an explicitly-defaulted copy constructor must have exactly one parameter">;
4402 def err_defaulted_copy_ctor_volatile_param : Error<
4403   "the parameter for an explicitly-defaulted copy constructor may not be "
4404   "volatile">;
4405 def err_defaulted_copy_ctor_const_param : Error<
4406   "the parameter for this explicitly-defaulted copy constructor is const, but "
4407   "a member or base requires it to be non-const">;
4408 def err_defaulted_copy_assign_params : Error<
4409   "an explicitly-defaulted copy assignment operator must have exactly one "
4410   "parameter">;
4411 def err_defaulted_copy_assign_return_type : Error<
4412   "an explicitly-defaulted copy assignment operator must return an unqualified "
4413   "lvalue reference to its class type">;
4414 def err_defaulted_copy_assign_not_ref : Error<
4415   "the parameter for an explicitly-defaulted copy assignment operator must be an "
4416   "lvalue reference type">;
4417 def err_defaulted_copy_assign_volatile_param : Error<
4418   "the parameter for an explicitly-defaulted copy assignment operator may not "
4419   "be volatile">;
4420 def err_defaulted_copy_assign_const_param : Error<
4421   "the parameter for this explicitly-defaulted copy assignment operator is "
4422   "const, but a member or base requires it to be non-const">;
4423 def err_defaulted_copy_assign_quals : Error<
4424   "an explicitly-defaulted copy assignment operator may not have 'const', "
4425   "'constexpr' or 'volatile' qualifiers">;
4426 def err_defaulted_move_ctor_params : Error<
4427   "an explicitly-defaulted move constructor must have exactly one parameter">;
4428 def err_defaulted_move_ctor_volatile_param : Error<
4429   "the parameter for an explicitly-defaulted move constructor may not be "
4430   "volatile">;
4431 def err_defaulted_move_ctor_const_param : Error<
4432   "the parameter for an explicitly-defaulted move constructor may not be "
4433   "const">;
4434 def err_defaulted_move_assign_params : Error<
4435   "an explicitly-defaulted move assignment operator must have exactly one "
4436   "parameter">;
4437 def err_defaulted_move_assign_return_type : Error<
4438   "an explicitly-defaulted move assignment operator must return an unqualified "
4439   "lvalue reference to its class type">;
4440 def err_defaulted_move_assign_not_ref : Error<
4441   "the parameter for an explicitly-defaulted move assignment operator must be an "
4442   "rvalue reference type">;
4443 def err_defaulted_move_assign_volatile_param : Error<
4444   "the parameter for an explicitly-defaulted move assignment operator may not "
4445   "be volatile">;
4446 def err_defaulted_move_assign_const_param : Error<
4447   "the parameter for an explicitly-defaulted move assignment operator may not "
4448   "be const">;
4449 def err_defaulted_move_assign_quals : Error<
4450   "an explicitly-defaulted move assignment operator may not have 'const', "
4451   "'constexpr' or 'volatile' qualifiers">;
4452 def err_incorrect_defaulted_exception_spec : Error<
4453   "exception specification of explicitly defaulted %select{default constructor|"
4454   "copy constructor|move constructor|copy assignment operator|move assignment "
4455   "operator|destructor}0 does not match the "
4456   "calculated one">;
4457 def err_out_of_line_default_deletes : Error<
4458   "defaulting this %select{default constructor|copy constructor|move "
4459   "constructor|copy assignment operator|move assignment operator|destructor}0 "
4460   "would delete it after its first declaration">;
4461
4462 def warn_ptr_arith_precedes_bounds : Warning<
4463   "the pointer decremented by %0 refers before the beginning of the array">,
4464   InGroup<DiagGroup<"array-bounds-pointer-arithmetic">>, DefaultIgnore;
4465 def warn_ptr_arith_exceeds_bounds : Warning<
4466   "the pointer incremented by %0 refers past the end of the array (that "
4467   "contains %1 element%s2)">,
4468   InGroup<DiagGroup<"array-bounds-pointer-arithmetic">>, DefaultIgnore;
4469 def warn_array_index_precedes_bounds : Warning<
4470   "array index of '%0' indexes before the beginning of the array">,
4471   InGroup<DiagGroup<"array-bounds">>;
4472 def warn_array_index_exceeds_bounds : Warning<
4473   "array index of '%0' indexes past the end of an array (that contains %1 "
4474   "element%s2)">, InGroup<DiagGroup<"array-bounds">>;
4475 def note_array_index_out_of_bounds : Note<
4476   "array %0 declared here">;
4477
4478 def warn_printf_write_back : Warning<
4479   "use of '%%n' in format string discouraged (potentially insecure)">,
4480   InGroup<FormatSecurity>;
4481 def warn_printf_insufficient_data_args : Warning<
4482   "more '%%' conversions than data arguments">, InGroup<Format>;
4483 def warn_printf_data_arg_not_used : Warning<
4484   "data argument not used by format string">, InGroup<FormatExtraArgs>;
4485 def warn_format_invalid_conversion : Warning<
4486   "invalid conversion specifier '%0'">, InGroup<FormatInvalidSpecifier>;
4487 def warn_printf_incomplete_specifier : Warning<
4488   "incomplete format specifier">, InGroup<Format>;
4489 def warn_missing_format_string : Warning<
4490   "format string missing">, InGroup<Format>;
4491 def warn_scanf_nonzero_width : Warning<
4492   "zero field width in scanf format string is unused">,
4493   InGroup<Format>;
4494 def warn_printf_conversion_argument_type_mismatch : Warning<
4495   "conversion specifies type %0 but the argument has type %1">,
4496   InGroup<Format>;
4497 def warn_printf_positional_arg_exceeds_data_args : Warning <
4498   "data argument position '%0' exceeds the number of data arguments (%1)">,
4499   InGroup<Format>;
4500 def warn_format_zero_positional_specifier : Warning<
4501   "position arguments in format strings start counting at 1 (not 0)">,
4502   InGroup<Format>;
4503 def warn_format_invalid_positional_specifier : Warning<
4504   "invalid position specified for %select{field width|field precision}0">,
4505   InGroup<Format>;
4506 def warn_format_mix_positional_nonpositional_args : Warning<
4507   "cannot mix positional and non-positional arguments in format string">,
4508   InGroup<Format>;
4509 def warn_null_arg : Warning<
4510   "null passed to a callee which requires a non-null argument">,
4511   InGroup<NonNull>;
4512 def warn_empty_format_string : Warning<
4513   "format string is empty">, InGroup<FormatZeroLength>;
4514 def warn_format_string_is_wide_literal : Warning<
4515   "format string should not be a wide string">, InGroup<Format>;
4516 def warn_printf_format_string_contains_null_char : Warning<
4517   "format string contains '\\0' within the string body">, InGroup<Format>;
4518 def warn_printf_asterisk_missing_arg : Warning<
4519   "'%select{*|.*}0' specified field %select{width|precision}0 is missing a matching 'int' argument">;
4520 def warn_printf_asterisk_wrong_type : Warning<
4521   "field %select{width|precision}0 should have type %1, but argument has type %2">,
4522   InGroup<Format>;
4523 def warn_printf_nonsensical_optional_amount: Warning<
4524   "%select{field width|precision}0 used with '%1' conversion specifier, resulting in undefined behavior">,
4525   InGroup<Format>;
4526 def warn_printf_nonsensical_flag: Warning<
4527   "flag '%0' results in undefined behavior with '%1' conversion specifier">,
4528   InGroup<Format>;
4529 def warn_format_nonsensical_length: Warning<
4530   "length modifier '%0' results in undefined behavior or no effect with '%1' conversion specifier">,
4531   InGroup<Format>;
4532 def warn_printf_ignored_flag: Warning<
4533   "flag '%0' is ignored when flag '%1' is present">,
4534   InGroup<Format>;
4535 def warn_scanf_scanlist_incomplete : Warning<
4536   "no closing ']' for '%%[' in scanf format string">,
4537   InGroup<Format>;
4538   
4539 // CHECK: returning address/reference of stack memory
4540 def warn_ret_stack_addr : Warning<
4541   "address of stack memory associated with local variable %0 returned">,
4542   InGroup<DiagGroup<"return-stack-address">>;
4543 def warn_ret_stack_ref : Warning<
4544   "reference to stack memory associated with local variable %0 returned">,
4545   InGroup<DiagGroup<"return-stack-address">>;
4546 def warn_ret_local_temp_addr : Warning<
4547   "returning address of local temporary object">,
4548   InGroup<DiagGroup<"return-stack-address">>;
4549 def warn_ret_local_temp_ref : Warning<
4550   "returning reference to local temporary object">,
4551   InGroup<DiagGroup<"return-stack-address">>;
4552 def warn_ret_addr_label : Warning<
4553   "returning address of label, which is local">,
4554   InGroup<DiagGroup<"return-stack-address">>;
4555 def err_ret_local_block : Error<
4556   "returning block that lives on the local stack">;
4557 def note_ref_var_local_bind : Note<
4558   "binding reference variable %0 here">;
4559
4560 // Check for initializing a member variable with the address or a reference to
4561 // a constructor parameter.
4562 def warn_bind_ref_member_to_parameter : Warning<
4563   "binding reference member %0 to stack allocated parameter %1">,
4564   InGroup<DiagGroup<"dangling-field">>;
4565 def warn_init_ptr_member_to_parameter_addr : Warning<
4566   "initializing pointer member %0 with the stack address of parameter %1">,
4567   InGroup<DiagGroup<"dangling-field">>;
4568 def warn_bind_ref_member_to_temporary : Warning<
4569   "binding reference member %0 to a temporary value">,
4570   InGroup<DiagGroup<"dangling-field">>;
4571 def note_ref_or_ptr_member_declared_here : Note<
4572   "%select{reference|pointer}0 member declared here">;
4573
4574 // For non-floating point, expressions of the form x == x or x != x
4575 // should result in a warning, since these always evaluate to a constant.
4576 // Array comparisons have similar warnings
4577 def warn_comparison_always : Warning<
4578   "%select{self-|array }0comparison always evaluates to %select{false|true|a constant}1">,
4579   InGroup<TautologicalCompare>;
4580
4581 def warn_stringcompare : Warning<
4582   "result of comparison against %select{a string literal|@encode}0 is "
4583   "unspecified (use strncmp instead)">,
4584   InGroup<DiagGroup<"string-compare">>;
4585
4586 // Generic selections.
4587 def err_assoc_type_incomplete : Error<
4588   "type %0 in generic association incomplete">;
4589 def err_assoc_type_nonobject : Error<
4590   "type %0 in generic association not an object type">;
4591 def err_assoc_type_variably_modified : Error<
4592   "type %0 in generic association is a variably modified type">;
4593 def err_assoc_compatible_types : Error<
4594   "type %0 in generic association compatible with previously specified type %1">;
4595 def note_compat_assoc : Note<
4596   "compatible type %0 specified here">;
4597 def err_generic_sel_no_match : Error<
4598   "controlling expression type %0 not compatible with any generic association type">;
4599 def err_generic_sel_multi_match : Error<
4600   "controlling expression type %0 compatible with %1 generic association types">;
4601
4602
4603 // Blocks
4604 def err_blocks_disable : Error<"blocks support disabled - compile with -fblocks"
4605   " or pick a deployment target that supports them">;
4606 def err_expected_block_lbrace : Error<"expected '{' in block literal">;
4607 def err_return_in_block_expression : Error<
4608   "return not allowed in block expression literal">;
4609 def err_block_returning_array_function : Error<
4610   "block cannot return %select{array|function}0 type %1">;
4611
4612 // Builtin annotation string.
4613 def err_builtin_annotation_not_string_constant : Error<
4614   "__builtin_annotation requires a non wide string constant">;
4615
4616 // CFString checking
4617 def err_cfstring_literal_not_string_constant : Error<
4618   "CFString literal is not a string constant">,
4619   InGroup<DiagGroup<"CFString-literal">>;
4620 def warn_cfstring_truncated : Warning<
4621   "input conversion stopped due to an input byte that does not "
4622   "belong to the input codeset UTF-8">,
4623   InGroup<DiagGroup<"CFString-literal">>;
4624
4625 // Statements.
4626 def err_continue_not_in_loop : Error<
4627   "'continue' statement not in loop statement">;
4628 def err_break_not_in_loop_or_switch : Error<
4629   "'break' statement not in loop or switch statement">;
4630 def err_default_not_in_switch : Error<
4631   "'default' statement not in switch statement">;
4632 def err_case_not_in_switch : Error<"'case' statement not in switch statement">;
4633 def warn_bool_switch_condition : Warning<
4634   "switch condition has boolean value">;
4635 def warn_case_value_overflow : Warning<
4636   "overflow converting case value to switch condition type (%0 to %1)">,
4637   InGroup<DiagGroup<"switch">>;
4638 def err_duplicate_case : Error<"duplicate case value '%0'">;
4639 def warn_case_empty_range : Warning<"empty case range specified">;
4640 def warn_missing_case_for_condition :
4641   Warning<"no case matching constant switch condition '%0'">;
4642 def warn_missing_case1 : Warning<"enumeration value %0 not handled in switch">,
4643   InGroup<DiagGroup<"switch-enum"> >;
4644 def warn_missing_case2 : Warning<
4645   "enumeration values %0 and %1 not handled in switch">,
4646   InGroup<DiagGroup<"switch-enum"> >;
4647 def warn_missing_case3 : Warning<
4648   "enumeration values %0, %1, and %2 not handled in switch">,
4649   InGroup<DiagGroup<"switch-enum"> >;
4650 def warn_missing_cases : Warning<
4651   "%0 enumeration values not handled in switch: %1, %2, %3...">,
4652   InGroup<DiagGroup<"switch-enum"> >;
4653
4654 def warn_not_in_enum : Warning<"case value not in enumerated type %0">,
4655   InGroup<DiagGroup<"switch-enum"> >; 
4656 def err_typecheck_statement_requires_scalar : Error<
4657   "statement requires expression of scalar type (%0 invalid)">;
4658 def err_typecheck_statement_requires_integer : Error<
4659   "statement requires expression of integer type (%0 invalid)">;
4660 def err_multiple_default_labels_defined : Error<
4661   "multiple default labels in one switch">;
4662 def err_switch_multiple_conversions : Error<
4663   "multiple conversions from switch condition type %0 to an integral or "
4664   "enumeration type">;
4665 def note_switch_conversion : Note<
4666   "conversion to %select{integral|enumeration}0 type %1">;
4667 def err_switch_explicit_conversion : Error<
4668   "switch condition type %0 requires explicit conversion to %1">;
4669 def err_switch_incomplete_class_type : Error<
4670   "switch condition has incomplete class type %0">;
4671 def warn_empty_if_body : Warning<
4672   "if statement has empty body">, InGroup<EmptyBody>;
4673
4674 def err_va_start_used_in_non_variadic_function : Error<
4675   "'va_start' used in function with fixed args">;
4676 def warn_second_parameter_of_va_start_not_last_named_argument : Warning<
4677   "second parameter of 'va_start' not last named argument">;
4678 def err_first_argument_to_va_arg_not_of_type_va_list : Error<
4679   "first argument to 'va_arg' is of type %0 and not 'va_list'">;
4680 def err_second_parameter_to_va_arg_incomplete: Error<
4681   "second argument to 'va_arg' is of incomplete type %0">;
4682 def err_second_parameter_to_va_arg_abstract: Error<
4683   "second argument to 'va_arg' is of abstract type %0">;
4684 def warn_second_parameter_to_va_arg_not_pod : Warning<
4685   "second argument to 'va_arg' is of non-POD type %0">,
4686   InGroup<DiagGroup<"non-pod-varargs">>, DefaultError;
4687 def warn_second_parameter_to_va_arg_ownership_qualified : Warning<
4688   "second argument to 'va_arg' is of ARC ownership-qualified type %0">,
4689   InGroup<DiagGroup<"non-pod-varargs">>, DefaultError;
4690 def warn_second_parameter_to_va_arg_never_compatible : Warning<
4691   "second argument to 'va_arg' is of promotable type %0; this va_arg has "
4692   "undefined behavior because arguments will be promoted to %1">;
4693
4694 def warn_return_missing_expr : Warning<
4695   "non-void %select{function|method}1 %0 should return a value">, DefaultError,
4696   InGroup<ReturnType>;
4697 def ext_return_missing_expr : ExtWarn<
4698   "non-void %select{function|method}1 %0 should return a value">, DefaultError,
4699   InGroup<ReturnType>;
4700 def ext_return_has_expr : ExtWarn<
4701   "%select{void function|void method|constructor|destructor}1 %0 "
4702   "should not return a value">,
4703   DefaultError, InGroup<ReturnType>;
4704 def ext_return_has_void_expr : Extension<
4705   "void %select{function|method}1 %0 should not return void expression">;
4706 def warn_noreturn_function_has_return_expr : Warning<
4707   "function %0 declared 'noreturn' should not return">,
4708   InGroup<DiagGroup<"invalid-noreturn">>;
4709 def warn_falloff_noreturn_function : Warning<
4710   "function declared 'noreturn' should not return">,
4711   InGroup<DiagGroup<"invalid-noreturn">>;
4712 def err_noreturn_block_has_return_expr : Error<
4713   "block declared 'noreturn' should not return">;
4714 def err_block_on_nonlocal : Error<
4715   "__block attribute not allowed, only allowed on local variables">;
4716 def err_block_on_vm : Error<
4717   "__block attribute not allowed on declaration with a variably modified type">;
4718
4719 def err_shufflevector_non_vector : Error<
4720   "first two arguments to __builtin_shufflevector must be vectors">;
4721 def err_shufflevector_incompatible_vector : Error<
4722   "first two arguments to __builtin_shufflevector must have the same type">;
4723 def err_shufflevector_nonconstant_argument : Error<
4724   "index for __builtin_shufflevector must be a constant integer">;
4725 def err_shufflevector_argument_too_large : Error<
4726   "index for __builtin_shufflevector must be less than the total number "
4727   "of vector elements">;
4728
4729 def err_vector_incorrect_num_initializers : Error<
4730   "%select{too many|too few}0 elements in vector initialization (expected %1 elements, have %2)">;
4731 def err_altivec_empty_initializer : Error<"expected initializer">;
4732
4733 def err_invalid_neon_type_code : Error<
4734   "incompatible constant for this __builtin_neon function">; 
4735 def err_argument_invalid_range : Error<
4736   "argument should be a value from %0 to %1">;
4737
4738 def err_builtin_longjmp_invalid_val : Error<
4739   "argument to __builtin_longjmp must be a constant 1">;
4740
4741 def err_constant_integer_arg_type : Error<
4742   "argument to %0 must be a constant integer">;
4743
4744 def ext_mixed_decls_code : Extension<
4745   "ISO C90 forbids mixing declarations and code">,
4746   InGroup<DiagGroup<"declaration-after-statement">>;
4747   
4748 def err_non_variable_decl_in_for : Error<
4749   "declaration of non-local variable in 'for' loop">;
4750 def err_toomany_element_decls : Error<
4751   "only one element declaration is allowed">;
4752 def err_selector_element_not_lvalue : Error<
4753   "selector element is not a valid lvalue">;
4754 def err_selector_element_type : Error<
4755   "selector element type %0 is not a valid object">;
4756 def err_collection_expr_type : Error<
4757   "collection expression type %0 is not a valid object">;
4758 def warn_collection_expr_type : Warning<
4759   "collection expression type %0 may not respond to %1">;
4760
4761 def err_invalid_conversion_between_ext_vectors : Error<
4762   "invalid conversion between ext-vector type %0 and %1">;
4763
4764 // Type
4765 def ext_invalid_sign_spec : Extension<"'%0' cannot be signed or unsigned">;
4766 def warn_receiver_forward_class : Warning<
4767     "receiver %0 is a forward class and corresponding @interface may not exist">;
4768 def note_method_sent_forward_class : Note<"method %0 is used for the forward class">;
4769 def ext_missing_declspec : ExtWarn<
4770   "declaration specifier missing, defaulting to 'int'">;
4771 def ext_missing_type_specifier : ExtWarn<
4772   "type specifier missing, defaults to 'int'">,
4773   InGroup<ImplicitInt>;
4774 def err_decimal_unsupported : Error<
4775   "GNU decimal type extension not supported">;
4776 def err_missing_type_specifier : Error<
4777   "C++ requires a type specifier for all declarations">;
4778 def err_missing_param_declspec : Error<
4779   "parameter requires a declaration specifier">;
4780 def err_objc_array_of_interfaces : Error<
4781   "array of interface %0 is invalid (probably should be an array of pointers)">;
4782 def ext_c99_array_usage : Extension<
4783   "use of C99-specific array features, accepted as an extension">;
4784 def err_c99_array_usage_cxx : Error<
4785   "C99-specific array features are not permitted in C++">;
4786 def err_double_requires_fp64 : Error<
4787   "use of type 'double' requires cl_khr_fp64 extension to be enabled">;
4788 def err_nsconsumed_attribute_mismatch : Error<
4789   "overriding method has mismatched ns_consumed attribute on its"
4790   " parameter">;
4791 def err_nsreturns_retained_attribute_mismatch : Error<
4792   "overriding method has mismatched ns_returns_%select{not_retained|retained}0"
4793   " attributes">;
4794   
4795 def note_getter_unavailable : Note<
4796   "or because setter is declared here, but no getter method %0 is found">;
4797 def err_invalid_protocol_qualifiers : Error<
4798   "invalid protocol qualifiers on non-ObjC type">;
4799 def warn_ivar_use_hidden : Warning<
4800   "local declaration of %0 hides instance variable">,
4801    InGroup<DiagGroup<"shadow-ivar">>;
4802 def error_ivar_use_in_class_method : Error<
4803   "instance variable %0 accessed in class method">;
4804 def error_implicit_ivar_access : Error<
4805   "instance variable %0 cannot be accessed because 'self' has been redeclared">;
4806 def error_private_ivar_access : Error<"instance variable %0 is private">,
4807   AccessControl;
4808 def error_protected_ivar_access : Error<"instance variable %0 is protected">,
4809   AccessControl;
4810 def warn_maynot_respond : Warning<"%0 may not respond to %1">;
4811 def warn_attribute_method_def : Warning<
4812   "method attribute can only be specified on method declarations">;
4813 def ext_typecheck_base_super : Warning<
4814   "method parameter type %0 does not match "
4815   "super class method parameter type %1">, InGroup<SuperSubClassMismatch>, DefaultIgnore;
4816 def warn_missing_method_return_type : Warning<
4817   "method has no return type specified; defaults to 'id'">,
4818   InGroup<MissingMethodReturnType>, DefaultIgnore;
4819
4820 // Spell-checking diagnostics
4821 def err_unknown_typename_suggest : Error<
4822   "unknown type name %0; did you mean %1?">;
4823 def err_unknown_nested_typename_suggest : Error<
4824   "no type named %0 in %1; did you mean %2?">;
4825 def err_no_member_suggest : Error<"no member named %0 in %1; did you mean %2?">;
4826 def err_undeclared_use_suggest : Error<
4827   "use of undeclared %0; did you mean %1?">;
4828 def err_undeclared_var_use_suggest : Error<
4829   "use of undeclared identifier %0; did you mean %1?">;
4830 def err_no_template_suggest : Error<"no template named %0; did you mean %1?">;
4831 def err_no_member_template_suggest : Error<
4832   "no template named %0 in %1; did you mean %2?">;
4833 def err_mem_init_not_member_or_class_suggest : Error<
4834   "initializer %0 does not name a non-static data member or base "
4835   "class; did you mean the %select{base class|member}1 %2?">;
4836 def err_field_designator_unknown_suggest : Error<
4837   "field designator %0 does not refer to any field in type %1; did you mean "
4838   "%2?">;
4839 def err_typecheck_member_reference_ivar_suggest : Error<
4840   "%0 does not have a member named %1; did you mean %2?">;
4841 def err_property_not_found_suggest : Error<
4842   "property %0 not found on object of type %1; did you mean %2?">;
4843 def err_ivar_access_using_property_syntax_suggest : Error<
4844   "property %0 not found on object of type %1; did you mean to access ivar %2?">;
4845 def err_property_found_suggest : Error<
4846   "property %0 found on object of type %1; did you mean to access "
4847   "it with the \".\" operator?">;
4848 def err_undef_interface_suggest : Error<
4849   "cannot find interface declaration for %0; did you mean %1?">;
4850 def warn_undef_interface_suggest : Warning<
4851   "cannot find interface declaration for %0; did you mean %1?">;
4852 def err_undef_superclass_suggest : Error<
4853   "cannot find interface declaration for %0, superclass of %1; did you mean "
4854   "%2?">;
4855 def err_undeclared_protocol_suggest : Error<
4856   "cannot find protocol declaration for %0; did you mean %1?">;
4857 def note_base_class_specified_here : Note<
4858   "base class %0 specified here">;
4859 def err_using_directive_suggest : Error<
4860   "no namespace named %0; did you mean %1?">;
4861 def err_using_directive_member_suggest : Error<
4862   "no namespace named %0 in %1; did you mean %2?">;
4863 def note_namespace_defined_here : Note<"namespace %0 defined here">;
4864 def err_sizeof_pack_no_pack_name_suggest : Error<
4865   "%0 does not refer to the name of a parameter pack; did you mean %1?">;
4866 def note_parameter_pack_here : Note<"parameter pack %0 declared here">;
4867
4868 def err_uncasted_use_of_unknown_any : Error<
4869   "%0 has unknown type; cast it to its declared type to use it">;
4870 def err_uncasted_call_of_unknown_any : Error<
4871   "%0 has unknown return type; cast the call to its declared return type">;
4872 def err_uncasted_send_to_unknown_any_method : Error<
4873   "no known method %select{%objcinstance1|%objcclass1}0; cast the "
4874   "message send to the method's return type">;
4875 def err_unsupported_unknown_any_decl : Error<
4876   "%0 has unknown type, which is unsupported for this kind of declaration">;
4877 def err_unsupported_unknown_any_expr : Error<
4878   "unsupported expression with unknown type">;
4879 def err_unsupported_unknown_any_call : Error<
4880   "call to unsupported expression with unknown type">;
4881 def err_unknown_any_addrof : Error<
4882   "the address of a declaration with unknown type "
4883   "can only be cast to a pointer type">;
4884 def err_unknown_any_var_function_type : Error<
4885   "variable %0 with unknown type cannot be given a function type">;
4886 def err_unknown_any_function : Error<
4887   "function %0 with unknown type must be given a function type">;
4888
4889 def err_filter_expression_integral : Error<
4890   "filter expression type should be an integral value not %0">;
4891
4892 // OpenCL warnings and errors.
4893 def err_invalid_astype_of_different_size : Error<
4894   "invalid reinterpretation: sizes of %0 and %1 must match">;
4895
4896 } // end of sema category
4897
4898 let CategoryName = "Related Result Type Issue" in {
4899 // Objective-C related result type compatibility
4900 def warn_related_result_type_compatibility_class : Warning<
4901   "method is expected to return an instance of its class type %0, but "
4902   "is declared to return %1">;
4903 def warn_related_result_type_compatibility_protocol : Warning<
4904   "protocol method is expected to return an instance of the implementing "
4905   "class, but is declared to return %0">;
4906 def note_related_result_type_overridden_family : Note<
4907   "overridden method is part of the '%select{|alloc|copy|init|mutableCopy|"
4908   "new|autorelease|dealloc|finalize|release|retain|retainCount|self}0' method "
4909   "family">;
4910 def note_related_result_type_overridden : Note<
4911   "overridden method returns an instance of its class type">;
4912 def note_related_result_type_inferred : Note<
4913   "%select{class|instance}0 method %1 is assumed to return an instance of "
4914   "its receiver type (%2)">;
4915
4916 }
4917
4918 let CategoryName = "Modules Issue" in {
4919 def err_module_private_follows_public : Error<
4920   "__module_private__ declaration of %0 follows public declaration">;
4921 def err_module_private_specialization : Error<
4922   "%select{template|partial|member}0 specialization cannot be "
4923   "declared __module_private__">;
4924 def err_module_private_local : Error<
4925   "%select{local variable|parameter|typedef}0 %1 cannot be declared "
4926   "__module_private__">;
4927 def err_module_private_local_class : Error<
4928   "local %select{struct|union|class|enum}0 cannot be declared "
4929   "__module_private__">;
4930 }
4931
4932 } // end of sema component.
4933