Emit warnings if we are returning a reference to a local temporary.
[clang.git] / include / clang / Basic / DiagnosticSemaKinds.td
blob9404c6861d4ceb045342ec04b573433d1f066c75
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 //===----------------------------------------------------------------------===//
10 //===----------------------------------------------------------------------===//
11 // Semantic Analysis
12 //===----------------------------------------------------------------------===//
14 let Component = "Sema" in {
15 let CategoryName = "Semantic Issue" in {
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)">;
24 // Semantic analysis of constant literals.
25 def ext_predef_outside_function : Warning<
26   "predefined identifier is only valid inside function">;
27 def warn_float_overflow : Warning<
28   "magnitude of floating-point constant too large for type %0; maximum is %1">,
29    InGroup<LiteralRange>;
30 def warn_float_underflow : Warning<
31   "magnitude of floating-point constant too small for type %0; minimum is %1">,
32   InGroup<LiteralRange>;
34 // C99 variable-length arrays
35 def ext_vla : Extension<
36   "variable length arrays are a C99 feature, accepted as an extension">,
37   InGroup<VLA>;
38 def err_vla_non_pod : Error<"variable length array of non-POD element type %0">;
39 def err_vla_in_sfinae : Error<
40   "variable length array cannot be formed during template argument deduction">;
41 def err_array_star_in_function_definition : Error<
42   "variable length array must be bound in function definition">;
43 def err_vla_decl_in_file_scope : Error<
44   "variable length array declaration not allowed at file scope">;
45 def err_vla_decl_has_static_storage : Error<
46   "variable length array declaration can not have 'static' storage duration">;
47 def err_vla_decl_has_extern_linkage : Error<
48   "variable length array declaration can not have 'extern' linkage">;
50 // C99 variably modified types
51 def err_variably_modified_template_arg : Error<
52   "variably modified type %0 cannot be used as a template argument">;
53 def err_variably_modified_nontype_template_param : Error<
54   "non-type template parameter of variably modified type %0">;
55 def err_variably_modified_new_type : Error<
56   "'new' cannot allocate object of variably modified type %0">;
58 // C99 Designated Initializers
59 def err_array_designator_negative : Error<
60   "array designator value '%0' is negative">;
61 def err_array_designator_empty_range : Error<
62   "array designator range [%0, %1] is empty">;
63 def err_array_designator_non_array : Error<
64   "array designator cannot initialize non-array type %0">;
65 def err_array_designator_too_large : Error<
66   "array designator index (%0) exceeds array bounds (%1)">;
67 def err_field_designator_non_aggr : Error<
68   "field designator cannot initialize a "
69   "%select{non-struct, non-union|non-class}0 type %1">;
70 def err_field_designator_unknown : Error<
71   "field designator %0 does not refer to any field in type %1">;
72 def err_field_designator_nonfield : Error<
73   "field designator %0 does not refer to a non-static data member">;
74 def note_field_designator_found : Note<"field designator refers here">;
75 def err_designator_for_scalar_init : Error<
76   "designator in initializer for scalar type %0">;
77 def warn_subobject_initializer_overrides : Warning<
78   "subobject initialization overrides initialization of other fields "
79   "within its enclosing subobject">, InGroup<InitializerOverrides>;
80 def warn_initializer_overrides : Warning<
81   "initializer overrides prior initialization of this subobject">,
82   InGroup<InitializerOverrides>;
83 def note_previous_initializer : Note<
84   "previous initialization %select{|with side effects }0is here"
85   "%select{| (side effects may not occur at run time)}0">;
86 def err_designator_into_flexible_array_member : Error<
87   "designator into flexible array member subobject">;
88 def note_flexible_array_member : Note<
89   "initialized flexible array member %0 is here">;
90 def ext_flexible_array_init : Extension<
91   "flexible array initialization is a GNU extension">, InGroup<GNU>;
93 // Declarations.
94 def ext_anon_param_requires_type_specifier : Extension<
95   "type specifier required for unnamed parameter, defaults to int">;
96 def err_bad_variable_name : Error<
97   "'%0' cannot be the name of a variable or data member">;
98 def err_bad_parameter_name : Error<
99   "'%0' cannot be the name of a parameter">;
100 def err_parameter_name_omitted : Error<"parameter name omitted">;
101 def warn_unused_parameter : Warning<"unused parameter %0">,
102   InGroup<UnusedParameter>, DefaultIgnore;
103 def warn_unused_variable : Warning<"unused variable %0">,
104   InGroup<UnusedVariable>, DefaultIgnore;
105 def warn_unused_exception_param : Warning<"unused exception parameter %0">,
106   InGroup<UnusedExceptionParameter>, DefaultIgnore;
107 def warn_decl_in_param_list : Warning<
108   "declaration of %0 will not be visible outside of this function">;
109 def warn_unused_function : Warning<"unused function %0">,
110   InGroup<UnusedFunction>, DefaultIgnore;
111 def warn_unused_member_function : Warning<"unused member function %0">,
112   InGroup<UnusedMemberFunction>, DefaultIgnore;
113 def warn_used_but_marked_unused: Warning<"%0 was marked unused but was used">,
114   InGroup<UsedButMarkedUnused>, DefaultIgnore;
116 def warn_parameter_size: Warning<
117   "%0 is a large (%1 bytes) pass-by-value argument; "
118   "pass it by reference instead ?">, InGroup<LargeByValueCopy>;
119 def warn_return_value_size: Warning<
120   "return value of %0 is a large (%1 bytes) pass-by-value object; "
121   "pass it by reference instead ?">, InGroup<LargeByValueCopy>;
123 def warn_implicit_function_decl : Warning<
124   "implicit declaration of function %0">,
125   InGroup<ImplicitFunctionDeclare>, DefaultIgnore;
126 def ext_implicit_function_decl : ExtWarn<
127   "implicit declaration of function %0 is invalid in C99">,
128   InGroup<ImplicitFunctionDeclare>;
130 def err_ellipsis_first_arg : Error<
131   "ISO C requires a named argument before '...'">;
132 def err_declarator_need_ident : Error<"declarator requires an identifier">;
133 def err_bad_language : Error<"unknown linkage language">;
134 def warn_use_out_of_scope_declaration : Warning<
135   "use of out-of-scope declaration of %0">;
136 def err_inline_non_function : Error<
137   "'inline' can only appear on functions">;
138 def warn_qual_return_type : Warning< 
139   "'%0' type qualifier%s1 on return type %plural{1:has|:have}1 no effect">,
140   InGroup<IgnoredQualifiers>, DefaultIgnore;
142 def warn_decl_shadow :
143   Warning<"declaration shadows a %select{"
144           "local variable|"
145           "variable in %2|"
146           "static data member of %2|"
147           "field of %2}1">,
148   InGroup<Shadow>, DefaultIgnore;
150 // C++ using declarations
151 def err_using_requires_qualname : Error<
152   "using declaration requires a qualified name">;
153 def err_using_typename_non_type : Error<
154   "'typename' keyword used on a non-type">;
155 def err_using_dependent_value_is_type : Error<
156   "dependent using declaration resolved to type without 'typename'">;
157 def err_using_decl_nested_name_specifier_is_not_class : Error<
158   "using declaration in class refers into '%0', which is not a class">;
159 def err_using_decl_nested_name_specifier_is_current_class : Error<
160   "using declaration refers to its own class">;
161 def err_using_decl_nested_name_specifier_is_not_base_class : Error<
162   "using declaration refers into '%0', which is not a base class of %1">;
163 def err_using_decl_can_not_refer_to_class_member : Error<
164   "using declaration can not refer to class member">;
165 def err_using_decl_can_not_refer_to_namespace : Error<
166   "using declaration can not refer to namespace">;
167 def err_using_decl_constructor : Error<
168   "using declaration can not refer to a constructor">;
169 def err_using_decl_destructor : Error<
170   "using declaration can not refer to a destructor">;
171 def err_using_decl_template_id : Error<
172   "using declaration can not refer to a template specialization">;
173 def note_using_decl_target : Note<"target of using declaration">;
174 def note_using_decl_conflict : Note<"conflicting declaration">;
175 def err_using_decl_redeclaration : Error<"redeclaration of using decl">;
176 def err_using_decl_conflict : Error<
177   "target of using declaration conflicts with declaration already in scope">;
178 def err_using_decl_conflict_reverse : Error<
179   "declaration conflicts with target of using declaration already in scope">;
180 def note_using_decl : Note<"%select{|previous }0using declaration">;
182 def warn_access_decl_deprecated : Warning<
183   "access declarations are deprecated; use using declarations instead">,
184   InGroup<Deprecated>;
186 def warn_global_constructor : Warning<
187   "declaration requires a global constructor">,
188   InGroup<GlobalConstructors>, DefaultIgnore;
189 def warn_global_destructor : Warning<
190   "declaration requires a global destructor">,
191    InGroup<GlobalConstructors>, DefaultIgnore;
193 def err_invalid_thread : Error<
194   "'__thread' is only allowed on variable declarations">;
195 def err_thread_non_global : Error<
196   "'__thread' variables must have global storage">;
197 def err_thread_unsupported : Error<
198   "thread-local storage is unsupported for the current target">;
200 def warn_maybe_falloff_nonvoid_function : Warning<
201   "control may reach end of non-void function">,
202   InGroup<ReturnType>;
203 def warn_falloff_nonvoid_function : Warning<
204   "control reaches end of non-void function">,
205   InGroup<ReturnType>;
206 def err_maybe_falloff_nonvoid_block : Error<
207   "control may reach end of non-void block">;
208 def err_falloff_nonvoid_block : Error<
209   "control reaches end of non-void block">;
210 def warn_suggest_noreturn_function : Warning<
211   "function could be attribute 'noreturn'">,
212   InGroup<DiagGroup<"missing-noreturn">>, DefaultIgnore;
213 def warn_suggest_noreturn_block : Warning<
214   "block could be attribute 'noreturn'">,
215   InGroup<DiagGroup<"missing-noreturn">>, DefaultIgnore;
216 def warn_unreachable : Warning<"will never be executed">,
217   InGroup<DiagGroup<"unreachable-code">>, DefaultIgnore;
219 /// Built-in functions.
220 def ext_implicit_lib_function_decl : ExtWarn<
221   "implicitly declaring C library function '%0' with type %1">;
222 def note_please_include_header : Note<
223   "please include the header <%0> or explicitly provide a "
224   "declaration for '%1'">;
225 def note_previous_builtin_declaration : Note<"%0 is a builtin with type %1">;
226 def err_implicit_decl_requires_stdio : Error<
227   "implicit declaration of '%0' requires inclusion of the header <stdio.h>">;
228 def err_implicit_decl_requires_setjmp : Error<
229   "implicit declaration of '%0' requires inclusion of the header <setjmp.h>">;
230 def warn_redecl_library_builtin : Warning<
231   "incompatible redeclaration of library function %0">;
232 def err_builtin_definition : Error<"definition of builtin function %0">;
233 def err_types_compatible_p_in_cplusplus : Error<
234   "__builtin_types_compatible_p is not valid in C++">;
235 def warn_builtin_unknown : Warning<"use of unknown builtin %0">, DefaultError;
237 /// main()
238 // static/inline main() are not errors in C, just in C++.
239 def warn_unusual_main_decl : Warning<"'main' should not be declared "
240     "%select{static|inline|static or inline}0">;
241 def err_unusual_main_decl : Error<"'main' is not allowed to be declared "
242     "%select{static|inline|static or inline}0">;
243 def err_main_template_decl : Error<"'main' cannot be a template">;
244 def err_main_returns_nonint : Error<"'main' must return 'int'">;
245 def err_main_surplus_args : Error<"too many parameters (%0) for 'main': "
246     "must be 0, 2, or 3">;
247 def warn_main_one_arg : Warning<"only one parameter on 'main' declaration">;
248 def err_main_arg_wrong : Error<"%select{first|second|third|fourth}0 "
249     "parameter of 'main' (%select{argument count|argument array|environment|"
250     "platform-specific data}0) must be of type %1">;
252 /// parser diagnostics
253 def ext_typedef_without_a_name : ExtWarn<"typedef requires a name">,
254   InGroup<MissingDeclarations>;
255 def err_typedef_not_identifier : Error<"typedef name must be an identifier">;
256 def err_statically_allocated_object : Error<
257   "interface type cannot be statically allocated">;
258 def err_object_cannot_be_passed_returned_by_value : Error<
259   "interface type %1 cannot be %select{returned|passed}0 by value"
260   "; did you forget * in %1">;
261 def warn_enum_value_overflow : Warning<"overflow in enumeration value">;
262 def warn_pragma_options_align_unsupported_option : Warning<
263   "unsupported alignment option in '#pragma options align'">;
264 def warn_pragma_options_align_reset_failed : Warning<
265   "#pragma options align=reset failed: %0">;
266 def err_pragma_options_align_mac68k_target_unsupported : Error<
267   "mac68k alignment pragma is not supported on this target">;
268 def warn_pragma_pack_invalid_alignment : Warning<
269   "expected #pragma pack parameter to be '1', '2', '4', '8', or '16'">;
270 // Follow the MSVC implementation.
271 def warn_pragma_pack_show : Warning<"value of #pragma pack(show) == %0">;
272 def warn_pragma_pack_pop_identifer_and_alignment : Warning<
273   "specifying both a name and alignment to 'pop' is undefined">;
274 def warn_pragma_pack_pop_failed : Warning<"#pragma pack(pop, ...) failed: %0">;
276 def warn_pragma_unused_undeclared_var : Warning<
277   "undeclared variable %0 used as an argument for '#pragma unused'">;
278 def warn_pragma_unused_expected_localvar : Warning<
279   "only local variables can be arguments to '#pragma unused'">;
280 def err_unsupported_pragma_weak : Error<
281   "using '#pragma weak' to refer to an undeclared identifier is not yet supported">;
283 /// Objective-C parser diagnostics
284 def err_duplicate_class_def : Error<
285   "duplicate interface definition for class %0">;
286 def err_undef_superclass : Error<
287   "cannot find interface declaration for %0, superclass of %1">;
288 def err_no_nsconstant_string_class : Error<
289   "cannot find interface declaration for %0">;
290 def err_recursive_superclass : Error<
291   "trying to recursively use %0 as superclass of %1">;
292 def warn_previous_alias_decl : Warning<"previously declared alias is ignored">;
293 def err_conflicting_aliasing_type : Error<"conflicting types for alias %0">;
294 def warn_undef_interface : Warning<"cannot find interface declaration for %0">;
295 def warn_duplicate_protocol_def : Warning<"duplicate protocol definition of %0 is ignored">;
296 def err_protocol_has_circular_dependency : Error<
297   "protocol has circular dependency">;
298 def err_undeclared_protocol : Error<"cannot find protocol declaration for %0">;
299 def warn_undef_protocolref : Warning<"cannot find protocol definition for %0">;
300 def warn_readonly_property : Warning<
301   "attribute 'readonly' of property %0 restricts attribute "
302   "'readwrite' of property inherited from %1">;
304 def warn_property_attribute : Warning<
305   "property %0 '%1' attribute does not match the property inherited from %2">;
306 def warn_property_types_are_incompatible : Warning<
307   "property type %0 is incompatible with type %1 inherited from %2">;
308 def err_undef_interface : Error<"cannot find interface declaration for %0">;
309 def err_class_extension_after_impl : Error<
310   "cannot declare class extension for %0 after class implementation">;
311 def note_implementation_declared : Note<
312   "class implementation is declared here">;
313 def warn_dup_category_def : Warning<
314   "duplicate definition of category %1 on interface %0">;
315 def err_conflicting_super_class : Error<"conflicting super class name %0">;
316 def err_dup_implementation_class : Error<"reimplementation of class %0">;
317 def err_dup_implementation_category : Error<
318   "reimplementation of category %1 for class %0">;
319 def err_conflicting_ivar_type : Error<
320   "instance variable %0 has conflicting type: %1 vs %2">;
321 def err_duplicate_ivar_declaration : Error<
322   "instance variable is already declared">;
323 def warn_on_superclass_use : Warning<
324   "class implementation may not have super class">;
325 def err_conflicting_ivar_bitwidth : Error<
326   "instance variable %0 has conflicting bit-field width">;
327 def err_conflicting_ivar_name : Error<
328   "conflicting instance variable names: %0 vs %1">;
329 def err_inconsistant_ivar_count : Error<
330   "inconsistent number of instance variables specified">;
331 def warn_incomplete_impl : Warning<"incomplete implementation">;
332 def note_undef_method_impl : Note<"method definition for %0 not found">;
333 def note_required_for_protocol_at : 
334   Note<"required for direct or indirect protocol %0">;
336 def warn_conflicting_ret_types : Warning<
337   "conflicting return type in implementation of %0: %1 vs %2">;
338 def warn_non_covariant_ret_types : Warning<
339   "conflicting return type in implementation of %0: %1 vs %2">,
340   InGroup<DiagGroup<"method-signatures">>, DefaultIgnore;
342 def warn_conflicting_param_types : Warning<
343   "conflicting parameter types in implementation of %0: %1 vs %2">;
344 def warn_non_contravariant_param_types : Warning<
345   "conflicting parameter types in implementation of %0: %1 vs %2">,
346   InGroup<DiagGroup<"method-signatures">>, DefaultIgnore;
347 def warn_conflicting_variadic :Warning<
348   "conflicting variadic declaration of method and its implementation">;
350 def warn_implements_nscopying : Warning<
351 "default assign attribute on property %0 which implements "
352 "NSCopying protocol is not appropriate with -fobjc-gc[-only]">;
354 def warn_multiple_method_decl : Warning<"multiple methods named %0 found">;
355 def warn_strict_multiple_method_decl : Warning<
356   "multiple methods named %0 found">, InGroup<StrictSelector>, DefaultIgnore;
357 def warn_accessor_property_type_mismatch : Warning<
358   "type of property %0 does not match type of accessor %1">;
359 def note_declared_at : Note<"declared here">;
360 def note_method_declared_at : Note<"method declared here">;
361 def err_setter_type_void : Error<"type of setter must be void">;
362 def err_duplicate_method_decl : Error<"duplicate declaration of method %0">;
363 def warn_missing_atend : Warning<"'@end' is missing in implementation context">;
364 def err_objc_var_decl_inclass : 
365     Error<"cannot declare variable inside @interface or @protocol">;
366 def error_missing_method_context : Error<
367   "missing context for method declaration">;
368 def err_objc_property_attr_mutually_exclusive : Error<
369   "property attributes '%0' and '%1' are mutually exclusive">;
370 def err_objc_property_requires_object : Error<
371   "property with '%0' attribute must be of object type">;
372 def warn_objc_property_no_assignment_attribute : Warning<
373   "no 'assign', 'retain', or 'copy' attribute is specified - "
374   "'assign' is assumed">;
375 def warn_objc_property_default_assign_on_object : Warning<
376   "default property attribute 'assign' not appropriate for non-gc object">;
377 def warn_property_attr_mismatch : Warning<
378   "property attribute in continuation class does not match the primary class">;
379 def warn_objc_property_copy_missing_on_block : Warning<
380     "'copy' attribute must be specified for the block property "
381     "when -fobjc-gc-only is specified">;
382 def warn_atomic_property_rule : Warning<
383   "writable atomic property %0 cannot pair a synthesized setter/getter "
384   "with a user defined setter/getter">;
385 def err_use_continuation_class : Error<
386   "illegal redeclaration of property in continuation class %0"
387   " (attribute must be 'readwrite', while its primary must be 'readonly')">;
388 def err_use_continuation_class_redeclaration_readwrite : Error<
389   "illegal redeclaration of 'readwrite' property in continuation class %0"
390   " (perhaps you intended this to be a 'readwrite' redeclaration of a "
391   "'readonly' public property?)">;
392 def err_continuation_class : Error<"continuation class has no primary class">;
393 def err_property_type : Error<"property cannot have array or function type %0">;
394 def error_missing_property_context : Error<
395   "missing context for property implementation declaration">;
396 def error_bad_property_decl : Error<
397   "property implementation must have its declaration in interface %0">;
398 def error_category_property : Error<
399   "property declared in category %0 cannot be implemented in "
400   "class implementation">;
401 def note_property_declare : Note<
402   "property declared here">;
403 def error_synthesize_category_decl : Error<
404   "@synthesize not allowed in a category's implementation">;
405 def error_reference_property : Error<
406   "property of reference type is not supported">;
407 def error_missing_property_interface : Error<
408   "property implementation in a category with no category declaration">;
409 def error_bad_category_property_decl : Error<
410   "property implementation must have its declaration in the category %0">;
411 def error_bad_property_context : Error<
412   "property implementation must be in a class or category implementation">;
413 def error_missing_property_ivar_decl : Error<
414   "synthesized property %0 must either be named the same as a compatible"
415   " ivar or must explicitly name an ivar">;
417 def error_synthesized_ivar_yet_not_supported : Error<
418   "instance variable synthesis not yet supported"
419   " (need to declare %0 explicitly)">;
421 def error_property_ivar_type : Error<
422   "type of property %0 (%1) does not match type of ivar %2 (%3)">;
423 def error_ivar_in_superclass_use : Error<
424   "property %0 attempting to use ivar %1 declared in super class %2">;
425 def error_weak_property : Error<
426   "existing ivar %1 for __weak property %0 must be __weak">;
427 def error_strong_property : Error<
428   "existing ivar %1 for a __strong property %0 must be garbage collectable">;
429 def error_dynamic_property_ivar_decl : Error<
430   "dynamic property can not have ivar specification">;
431 def error_duplicate_ivar_use : Error<
432   "synthesized properties %0 and %1 both claim ivar %2">;
433 def error_property_implemented : Error<"property %0 is already implemented">;
434 def warn_objc_property_attr_mutually_exclusive : Warning<
435   "property attributes '%0' and '%1' are mutually exclusive">,
436   InGroup<ReadOnlySetterAttrs>, DefaultIgnore;
437 def warn_undeclared_selector : Warning<
438   "undeclared selector %0">, InGroup<UndeclaredSelector>, DefaultIgnore;
439 def warn_unimplemented_selector:  Warning<
440   "unimplemented selector %0">, InGroup<Selector>, DefaultIgnore;
441 def warn_unimplemented_protocol_method : Warning<
442   "method in protocol not implemented">, InGroup<Protocol>;
444 // C++ declarations
445 def err_static_assert_expression_is_not_constant : Error<
446   "static_assert expression is not an integral constant expression">;
447 def err_static_assert_failed : Error<"static_assert failed \"%0\"">;
449 def err_inline_namespace_mismatch : Error<
450   "%select{|non-}0inline namespace "
451   "cannot be reopened as %select{non-|}0inline">;
453 def err_unexpected_friend : Error<
454   "friends can only be classes or functions">;
455 def ext_enum_friend : ExtWarn<
456   "enumeration type %0 cannot be a friend">;
457 def ext_nonclass_type_friend : ExtWarn<
458   "non-class type %0 cannot be a friend">;
459 def err_friend_is_member : Error<
460   "friends cannot be members of the declaring class">;
461 def ext_unelaborated_friend_type : ExtWarn<
462   "must specify '%select{struct|union|class|enum}0' to befriend %1">;
463 def err_qualified_friend_not_found : Error<
464   "no function named %0 with type %1 was found in the specified scope">;
465 def err_introducing_special_friend : Error<
466   "must use a qualified name when declaring a %select{constructor|"
467   "destructor|conversion operator}0 as a friend">;
468 def err_tagless_friend_type_template : Error<
469   "friend type templates must use an elaborated type">;
470 def err_no_matching_local_friend : Error<
471   "no matching function found in local scope">;
473 def err_abstract_type_in_decl : Error<
474   "%select{return|parameter|variable|field}0 type %1 is an abstract class">;
475 def err_allocation_of_abstract_type : Error<
476   "allocation of an object of abstract type %0">;
477 def err_throw_abstract_type : Error<
478   "cannot throw an object of abstract type %0">;
479 def err_array_of_abstract_type : Error<"array of abstract class type %0">;
481 def err_multiple_final_overriders : Error<
482   "virtual function %q0 has more than one final overrider in %1">; 
483 def note_final_overrider : Note<"final overrider of %q0 in %1">;
485 def err_type_defined_in_type_specifier : Error<
486   "%0 can not be defined in a type specifier">;
487 def err_type_defined_in_result_type : Error<
488   "%0 can not be defined in the result type of a function">;
489 def err_type_defined_in_param_type : Error<
490   "%0 can not be defined in a parameter type">;
492 def note_pure_virtual_function : Note<
493   "pure virtual function %0">;
495 def err_deleted_non_function : Error<
496   "only functions can have deleted definitions">;
497 def err_deleted_decl_not_first : Error<
498   "deleted definition must be first declaration">;
500 def warn_weak_vtable : Warning<
501   "%0 has no out-of-line virtual method definitions; its vtable will be "
502   "emitted in every translation unit">,
503   InGroup<DiagGroup<"weak-vtables">>, DefaultIgnore;
505 def ext_using_undefined_std : ExtWarn<
506   "using directive refers to implicitly-defined namespace 'std'">;
507   
508 // C++ exception specifications
509 def err_exception_spec_in_typedef : Error<
510   "exception specifications are not allowed in typedefs">;
511 def err_distant_exception_spec : Error<
512   "exception specifications are not allowed beyond a single level "
513   "of indirection">;
514 def err_incomplete_in_exception_spec : Error<
515   "%select{|pointer to |reference to }0incomplete type %1 is not allowed "
516   "in exception specification">;
517 def err_mismatched_exception_spec : Error<
518   "exception specification in declaration does not match previous declaration">;
519 def err_override_exception_spec : Error<
520   "exception specification of overriding function is more lax than "
521   "base version">;
522 def err_incompatible_exception_specs : Error<
523   "target exception specification is not superset of source">;
524 def err_deep_exception_specs_differ : Error<
525   "exception specifications of %select{return|argument}0 types differ">;
526 def warn_missing_exception_specification : Warning<
527   "%0 is missing exception specification '%1'">;
529 // C++ access checking
530 def err_class_redeclared_with_different_access : Error<
531   "%0 redeclared with '%1' access">;
532 def err_access : Error<
533   "%1 is a %select{private|protected}0 member of %3">, NoSFINAE;
534 def err_access_ctor : Error<
535   "calling a %select{private|protected}0 constructor of class %2">, NoSFINAE;
536 def ext_rvalue_to_reference_access_ctor : ExtWarn<
537   "C++98 requires an accessible copy constructor for class %2 when binding "
538   "a reference to a temporary; was %select{private|protected}0">,
539   NoSFINAE, InGroup<BindToTemporaryCopy>;
540 def err_access_base : Error<
541   "%select{base class|inherited virtual base class}0 %1 has %select{private|"
542   "protected}3 %select{constructor|copy constructor|copy assignment operator|"
543   "destructor}2">, NoSFINAE;
544 def err_access_field: Error<
545   "field of type %0 has %select{private|protected}2 %select{constructor|copy "
546   "constructor|copy assignment operator|destructor}1">, NoSFINAE;
548 def err_access_ctor_field :
549     Error<"field of type %1 has %select{private|protected}2 constructor">,
550     NoSFINAE;
551 def err_access_dtor_base :
552     Error<"base class %0 has %select{private|protected}1 destructor">,
553     NoSFINAE;
554 def err_access_dtor_vbase :
555     Error<"inherited virtual base class %0 has "
556     "%select{private|protected}1 destructor">,
557     NoSFINAE;
558 def err_access_dtor_temp :
559     Error<"temporary of type %0 has %select{private|protected}1 destructor">,
560     NoSFINAE;
561 def err_access_dtor_exception :
562     Error<"exception object of type %0 has %select{private|protected}1 "
563           "destructor">, NoSFINAE;
564 def err_access_dtor_field :
565     Error<"field of type %1 has %select{private|protected}2 destructor">,
566     NoSFINAE;
567 def err_access_dtor_var :
568     Error<"variable of type %1 has %select{private|protected}2 destructor">,
569     NoSFINAE;
570 def err_access_assign_field :
571     Error<"field of type %1 has %select{private|protected}2 copy assignment"
572           " operator">,
573     NoSFINAE;
574 def err_access_assign_base :
575     Error<"base class %0 has %select{private|protected}1 copy assignment"
576           " operator">,
577     NoSFINAE;
578 def err_access_copy_field :
579     Error<"field of type %1 has %select{private|protected}2 copy constructor">,
580     NoSFINAE;
581 def err_access_copy_base :
582     Error<"base class %0 has %select{private|protected}1 copy constructor">,
583     NoSFINAE;
584 def err_access_dtor_ivar :
585     Error<"instance variable of type %0 has %select{private|protected}1 "
586           "destructor">,
587     NoSFINAE;
588 def note_previous_access_declaration : Note<
589   "previously declared '%1' here">;
590 def err_access_outside_class : Error<
591   "access to %select{private|protected}0 member outside any class context">;
592 def note_access_natural : Note<
593   "%select{|implicitly }1declared %select{private|protected}0 here">;
594 def note_access_constrained_by_path : Note<
595   "constrained by %select{|implicitly }1%select{private|protected}0"
596   " inheritance here">;
597 def note_access_protected_restricted : Note<
598   "object type %select{|%1 }0must derive from context type %2">;
599   
600 // C++ name lookup
601 def err_incomplete_nested_name_spec : Error<
602   "incomplete type %0 named in nested name specifier">;
603 def err_dependent_nested_name_spec : Error<
604   "nested name specifier for a declaration cannot depend on a template "
605   "parameter">;
606 def err_nested_name_member_ref_lookup_ambiguous : Error<
607   "lookup of %0 in member access expression is ambiguous">;
608 def ext_nested_name_member_ref_lookup_ambiguous : ExtWarn<
609   "lookup of %0 in member access expression is ambiguous; using member of %1">,
610   InGroup<AmbigMemberTemplate>;
611 def note_ambig_member_ref_object_type : Note<
612   "lookup in the object type %0 refers here">;
613 def note_ambig_member_ref_scope : Note<
614   "lookup from the current scope refers here">;
615 def err_qualified_member_nonclass : Error<
616   "qualified member access refers to a member in %0">;
617 def err_incomplete_member_access : Error<
618   "member access into incomplete type %0">;
619 def err_incomplete_type : Error<
620   "incomplete type %0 where a complete type is required">;
621   
622 // C++ class members
623 def err_storageclass_invalid_for_member : Error<
624   "storage class specified for a member declaration">;
625 def err_mutable_function : Error<"'mutable' cannot be applied to functions">;
626 def err_mutable_reference : Error<"'mutable' cannot be applied to references">;
627 def err_mutable_const : Error<"'mutable' and 'const' cannot be mixed">;
628 def err_mutable_nonmember : Error<
629   "'mutable' can only be applied to member variables">;
630 def err_virtual_non_function : Error<
631   "'virtual' can only appear on non-static member functions">;
632 def err_virtual_out_of_class : Error<
633   "'virtual' can only be specified inside the class definition">;
634 def err_static_overrides_virtual : Error<
635   "'static' member function %0 overrides a virtual function in a base class">;
636 def err_explicit_non_function : Error<
637   "'explicit' can only appear on non-static member functions">;
638 def err_explicit_out_of_class : Error<
639   "'explicit' can only be specified inside the class definition">;
640 def err_explicit_non_ctor_or_conv_function : Error<
641   "'explicit' can only be applied to a constructor or conversion function">;
642 def err_static_not_bitfield : Error<"static member %0 cannot be a bit-field">;
643 def err_static_out_of_line : Error<
644   "'static' can only be specified inside the class definition">;
645 def err_typedef_not_bitfield : Error<"typedef member %0 cannot be a bit-field">;
646 def err_not_integral_type_bitfield : Error<
647   "bit-field %0 has non-integral type %1">;
648 def err_not_integral_type_anon_bitfield : Error<
649   "anonymous bit-field has non-integral type %0">;
650 def err_member_initialization : Error<
651   "fields can only be initialized in constructors">;
652 def err_member_function_initialization : Error<
653   "initializer on function does not look like a pure-specifier">;
654 def err_non_virtual_pure : Error<
655   "%0 is not virtual and cannot be declared pure">;
656 def err_implicit_object_parameter_init : Error<
657   "cannot initialize object parameter of type %0 with an expression "
658   "of type %1">;
659 def err_qualified_member_of_unrelated : Error<
660   "%q0 is not a member of class %1">;
662 def note_field_decl : Note<"member is declared here">;
663 def note_ivar_decl : Note<"ivar is declared here">;
664 def note_bitfield_decl : Note<"bit-field is declared here">;
665 def note_previous_decl : Note<"%0 declared here">;
666 def note_member_synthesized_at : Note<
667   "implicit default %select{constructor|copy constructor|"
668   "copy assignment operator|destructor}0 for %1 first required here">;
669 def err_missing_default_ctor : Error<
670   "%select{|implicit default }0constructor for %1 must explicitly initialize "
671   "the %select{base class|member}2 %3 which does not have a default "
672   "constructor">;
673 def err_illegal_union_or_anon_struct_member : Error<
674   "%select{anonymous struct|union}0 member %1 has a non-trivial "
675   "%select{constructor|copy constructor|copy assignment operator|destructor}2">;
676 def note_nontrivial_has_virtual : Note<
677   "because type %0 has a virtual %select{member function|base class}1">;
678 def note_nontrivial_has_nontrivial : Note<
679   "because type %0 has a %select{member|base class}1 with a non-trivial "
680   "%select{constructor|copy constructor|copy assignment operator|destructor}2">;
681 def note_nontrivial_user_defined : Note<
682   "because type %0 has a user-declared %select{constructor|copy constructor|"
683   "copy assignment operator|destructor}1">;
684 def err_static_data_member_not_allowed_in_union_or_anon_struct : Error<
685   "static data member %0 not allowed in %select{anonymous struct|union}1">; 
686 def err_union_member_of_reference_type : Error<
687   "union member %0 has reference type %1">;
689 def err_different_return_type_for_overriding_virtual_function : Error<
690   "virtual function %0 has a different return type (%1) than the "
691   "function it overrides (which has return type %2)">;
692 def note_overridden_virtual_function : Note<
693   "overridden virtual function is here">;
695 def err_covariant_return_inaccessible_base : Error<
696   "invalid covariant return for virtual function: %1 is a "
697   "%select{private|protected}2 base class of %0">, NoSFINAE;
698 def err_covariant_return_ambiguous_derived_to_base_conv : Error<
699   "return type of virtual function %3 is not covariant with the return type of "
700   "the function it overrides (ambiguous conversion from derived class "
701   "%0 to base class %1:%2)">;
702 def err_covariant_return_not_derived : Error<
703   "return type of virtual function %0 is not covariant with the return type of "
704   "the function it overrides (%1 is not derived from %2)">;
705 def err_covariant_return_incomplete : Error<
706   "return type of virtual function %0 is not covariant with the return type of "
707   "the function it overrides (%1 is incomplete)">;
708 def err_covariant_return_type_different_qualifications : Error<
709   "return type of virtual function %0 is not covariant with the return type of "
710   "the function it overrides (%1 has different qualifiers than %2)">;
711 def err_covariant_return_type_class_type_more_qualified : Error<
712   "return type of virtual function %0 is not covariant with the return type of "
713   "the function it overrides (class type %1 is more qualified than class "
714   "type %2">;
715   
716 // C++ constructors
717 def err_constructor_cannot_be : Error<"constructor cannot be declared '%0'">;
718 def err_invalid_qualified_constructor : Error<
719   "'%0' qualifier is not allowed on a constructor">;
720 def err_constructor_return_type : Error<
721   "constructor cannot have a return type">;
722 def err_constructor_redeclared : Error<"constructor cannot be redeclared">;
723 def err_constructor_byvalue_arg : Error<
724   "copy constructor must pass its first argument by reference">;
725 def warn_no_constructor_for_refconst : Warning<
726   "%select{struct|union|class|enum}0 %1 does not declare any constructor to "
727   "initialize its non-modifiable members">;
728 def note_refconst_member_not_initialized : Note<
729   "%select{const|reference}0 member %1 will never be initialized">;
731 // C++ destructors
732 def err_destructor_not_member : Error<
733   "destructor must be a non-static member function">;
734 def err_destructor_cannot_be : Error<"destructor cannot be declared '%0'">;
735 def err_invalid_qualified_destructor : Error<
736   "'%0' qualifier is not allowed on a destructor">;
737 def err_destructor_return_type : Error<"destructor cannot have a return type">;
738 def err_destructor_redeclared : Error<"destructor cannot be redeclared">;
739 def err_destructor_with_params : Error<"destructor cannot have any parameters">;
740 def err_destructor_variadic : Error<"destructor cannot be variadic">;
741 def err_destructor_typedef_name : Error<
742   "destructor cannot be declared using a typedef %0 of the class name">;
743 def err_destructor_name : Error<
744   "expected the class name after '~' to name the enclosing class">;
745 def err_destructor_class_name : Error<
746   "expected the class name after '~' to name a destructor">;
747 def err_ident_in_pseudo_dtor_not_a_type : Error<
748   "identifier %0 in pseudo-destructor expression does not name a type">;
750 // C++ initialization
751 def err_init_conversion_failed : Error<
752   "cannot initialize %select{a variable|a parameter|return object|an "
753   "exception object|a member subobject|an array element|a new value|a value|a "
754   "base class|a vector element}0 of type %1 with an %select{rvalue|lvalue}2 of "
755   "type %3">;
757 def err_lvalue_to_rvalue_ref : Error<"rvalue reference cannot bind to lvalue">;
758 def err_invalid_initialization : Error<
759 "invalid initialization of reference of type %0 from expression of type %1">;
760 def err_lvalue_to_rvalue_ambig_ref : Error<"rvalue reference cannot bind to lvalue "
761                                            "due to multiple conversion functions">;
762 def err_not_reference_to_const_init : Error<
763   "%select{non-const|volatile}0 lvalue reference to type %1 cannot be "
764   "initialized with a %select{value|temporary}2 of type %3">;
765 def err_lvalue_reference_bind_to_temporary : Error<
766   "%select{non-const|volatile}0 lvalue reference to type %1 cannot bind to a "
767   "temporary of type %2">;
768 def err_lvalue_reference_bind_to_unrelated : Error<
769   "%select{non-const|volatile}0 lvalue reference to type %1 cannot bind to a "
770   "value of unrelated type %2">;
771 def err_reference_bind_drops_quals : Error<
772   "binding of reference to type %0 to a value of type %1 drops qualifiers">;
773 def err_reference_bind_failed : Error<
774   "reference to type %0 could not bind to an %select{rvalue|lvalue}1 of type "
775   "%2">;
776 def err_reference_bind_init_list : Error<
777   "reference to type %0 cannot bind to an initializer list">;
778 def err_init_list_bad_dest_type : Error<
779   "%select{|non-aggregate }0type %1 cannot be initialized with an initializer "
780   "list">;
781 def err_member_function_call_bad_cvr : Error<"member function %0 not viable: "
782     "'this' argument has type %1, but function is not marked "
783     "%select{const|restrict|const or restrict|volatile|const or volatile|"
784     "volatile or restrict|const, volatile, or restrict}2">;
786 def err_reference_init_drops_quals : Error<
787   "initialization of reference to type %0 with a %select{value|temporary}1 of type %2 drops "
788   "qualifiers">;
789 def err_reference_bind_to_bitfield : Error<
790   "%select{non-const|volatile}0 reference cannot bind to bit-field %1">;
791 def err_reference_bind_to_vector_element : Error<
792   "%select{non-const|volatile}0 reference cannot bind to vector element">;
793 def err_reference_var_requires_init : Error<
794   "declaration of reference variable %0 requires an initializer">;
795 def err_const_var_requires_init : Error<
796   "declaration of const variable '%0' requires an initializer">;
797 def err_reference_without_init : Error<
798   "reference to type %0 requires an initializer">;
799 def err_reference_has_multiple_inits : Error<
800   "reference cannot be initialized with multiple values">;
801 def err_init_non_aggr_init_list : Error<
802   "initialization of non-aggregate type %0 with an initializer list">;
803 def err_init_reference_member_uninitialized : Error<
804   "reference member of type %0 uninitialized">;
805 def note_uninit_reference_member : Note<
806   "uninitialized reference member is here">;
807 def warn_field_is_uninit : Warning<"field is uninitialized when used here">,
808   InGroup<DiagGroup<"uninitialized">>;
809 def err_init_incomplete_type : Error<"initialization of incomplete type %0">;
811 def err_temp_copy_no_viable : Error<
812   "no viable constructor %select{copying variable|copying parameter|"
813   "returning object|throwing object|copying member subobject|copying array "
814   "element|allocating object|copying temporary|initializing base subobject|"
815   "initializing vector element}0 of type %1">;
816 def ext_rvalue_to_reference_temp_copy_no_viable : ExtWarn<
817   "no viable constructor %select{copying variable|copying parameter|"
818   "returning object|throwing object|copying member subobject|copying array "
819   "element|allocating object|copying temporary|initializing base subobject|"
820   "initializing vector element}0 of type %1; C++98 requires a copy "
821   "constructor when binding a reference to a temporary">,
822   InGroup<BindToTemporaryCopy>;
823 def err_temp_copy_ambiguous : Error<
824   "ambiguous constructor call when %select{copying variable|copying "
825   "parameter|returning object|throwing object|copying member subobject|copying "
826   "array element|allocating object|copying temporary|initializing base subobject|"
827   "initializing vector element}0 of type %1">;
828 def err_temp_copy_deleted : Error<
829   "%select{copying variable|copying parameter|returning object|throwing "
830   "object|copying member subobject|copying array element|allocating object|"
831   "copying temporary|initializing base subobject|initializing vector element}0 "
832   "of type %1 invokes deleted constructor">;
833 def err_temp_copy_incomplete : Error<
834   "copying a temporary object of incomplete type %0">;
836 // C++0x decltype
837 def err_cannot_determine_declared_type_of_overloaded_function : Error<
838     "cannot determine the type of an overloaded function">;
839     
840 // C++0x auto
841 def err_auto_variable_cannot_appear_in_own_initializer : Error<
842   "variable %0 declared with 'auto' type cannot appear in its own initializer">;
843 def err_illegal_decl_array_of_auto : Error<
844   "'%0' declared as array of 'auto'">;
845 def err_auto_not_allowed : Error<
846   "'auto' not allowed in %select{function prototype|struct member|union member"
847   "|class member|exception declaration|template parameter|block literal}0">;
848 def err_auto_var_requires_init : Error<
849   "declaration of variable %0 with type %1 requires an initializer">;
850 def err_auto_missing_trailing_return : Error<
851   "'auto' return without trailing return type">;
852 def err_trailing_return_without_auto : Error<
853   "trailing return type without 'auto' return">;
854   
855 // C++0x attributes
856 def err_repeat_attribute : Error<"'%0' attribute cannot be repeated">;
858 // C++0x [[final]]
859 def err_final_function_overridden : Error<
860   "declaration of %0 overrides a 'final' function">;
861 def err_final_base : Error<
862   "derivation from 'final' %0">;
864 // C++0x [[override]]
865 def err_override_function_not_overriding : Error<
866   "%0 marked 'override' but does not override any member functions">;
868 def err_function_overriding_without_override : Error<
869   "%0 overrides function%s1 without being marked 'override'">;
871 // C++0x scoped enumerations
872 def err_enum_invalid_underlying : Error<
873   "non-integral type %0 is an invalid underlying type">;
874 def err_enumerator_too_large : Error<
875   "enumerator value is not representable in the underlying type %0">;
876 def ext_enumerator_too_large : ExtWarn<
877   "enumerator value is not representable in the underlying type %0">,
878   InGroup<Microsoft>;
879 def err_enumerator_wrapped : Error<
880   "enumerator value %0 is not representable in the underlying type %1">;
881 def err_enum_redeclare_type_mismatch : Error<
882   "enumeration redeclared with different underlying type">;
883 def err_enum_redeclare_fixed_mismatch : Error<
884   "enumeration previously declared with %select{non|}0fixed underlying type">;
885 def err_enum_redeclare_scoped_mismatch : Error<
886   "enumeration previously declared as %select{un|}0scoped">;
887   
888 // Objective-C++
889 def err_objc_decls_may_only_appear_in_global_scope : Error<
890   "Objective-C declarations may only appear in global scope">;
891 def err_nsobject_attribute : Error<
892   "__attribute ((NSObject)) is for pointer types only">;
894 // Attributes
895 def err_attribute_can_be_applied_only_to_symbol_declaration : Error<
896   "%0 attribute can be applied only to symbol declaration">;
897 def err_attributes_are_not_compatible : Error<
898   "%0 and %1 attributes are not compatible">;
899 def err_attribute_wrong_number_arguments : Error<
900   "attribute requires %0 argument(s)">;
901 def err_iboutletcollection_type : Error<
902   "invalid type %0 as argument of iboutletcollection attribute">;
903 def err_iboutletcollection_object_type : Error<
904   "%select{ivar|property}1 with iboutletcollection attribute must "
905   "have object type (invalid %0)">;
906 def err_attribute_missing_parameter_name : Error<
907   "attribute requires unquoted parameter">;
908 def err_attribute_invalid_vector_type : Error<"invalid vector element type %0">;
909 def err_attribute_bad_neon_vector_size : Error<
910   "Neon vector size must be 64 or 128 bits">;
911 def err_attribute_argument_not_int : Error<
912   "'%0' attribute requires integer constant">;
913 def err_attribute_argument_outof_range : Error<
914   "init_priority attribute requires integer constant between "
915   "101 and 65535 inclusive">;
916 def err_init_priority_object_attr : Error<
917   "can only use 'init_priority' attribute on file-scope definitions "
918   "of objects of class type">;
919 def err_attribute_argument_n_not_int : Error<
920   "'%0' attribute requires parameter %1 to be an integer constant">;
921 def err_attribute_argument_n_not_string : Error<
922   "'%0' attribute requires parameter %1 to be a string">;
923 def err_attribute_argument_out_of_bounds : Error<
924   "'%0' attribute parameter %1 is out of bounds">;
925 def err_attribute_requires_objc_interface : Error<
926   "attribute may only be applied to an Objective-C interface">;
927 def warn_nonnull_pointers_only : Warning<
928   "nonnull attribute only applies to pointer arguments">;
929 def err_attribute_invalid_implicit_this_argument : Error<
930   "'%0' attribute is invalid for the implicit this argument">;
931 def err_ownership_type : Error<
932   "%0 attribute only applies to %1 arguments">;
933 def err_format_strftime_third_parameter : Error<
934   "strftime format attribute requires 3rd parameter to be 0">;
935 def err_format_attribute_requires_variadic : Error<
936   "format attribute requires variadic function">;
937 def err_format_attribute_not : Error<"format argument not %0">;
938 def err_format_attribute_result_not : Error<"function does not return %0">;
939 def err_format_attribute_implicit_this_format_string : Error<
940   "format attribute cannot specify the implicit this argument as the format "
941   "string">;
942 def err_attribute_invalid_size : Error<
943   "vector size not an integral multiple of component size">;
944 def err_attribute_zero_size : Error<"zero vector size">;
945 def err_typecheck_vector_not_convertable : Error<
946   "can't convert between vector values of different size (%0 and %1)">;
947 def err_typecheck_ext_vector_not_typedef : Error<
948   "ext_vector_type only applies to types, not variables">;
949 def err_unsupported_vector_size : Error<
950   "unsupported type %0 for vector_size attribute, please use on typedef">;
951 def err_ext_vector_component_exceeds_length : Error<
952   "vector component access exceeds type %0">;
953 def err_ext_vector_component_name_illegal : Error<
954   "illegal vector component name '%0'">;
955 def err_attribute_address_space_not_int : Error<
956   "address space attribute requires an integer constant">;
957 def err_attribute_address_space_negative : Error<
958   "address space is negative">;
959 def err_attribute_address_space_too_high : Error<
960   "address space is larger than the maximum supported (%0)">;
961 def err_attribute_address_multiple_qualifiers : Error<
962   "multiple address spaces specified for type">;
963 def err_implicit_pointer_address_space_cast : Error<
964   "illegal implicit conversion between two pointers with different address "
965   "spaces">;
966 def err_as_qualified_auto_decl : Error<
967   "automatic variable qualified with an address space">;
968 def err_arg_with_address_space : Error<
969   "parameter may not be qualified with an address space">;
970 def err_attribute_not_string : Error<
971   "argument to %0 attribute was not a string literal">;
972 def err_attribute_section_invalid_for_target : Error<
973   "argument to 'section' attribute is not valid for this target: %0">;
974 def err_attribute_section_local_variable : Error<
975   "'section' attribute is not valid on local variables">;
976 def err_attribute_aligned_not_power_of_two : Error<
977   "requested alignment is not a power of 2">;
978 def warn_redeclaration_without_attribute_prev_attribute_ignored : Warning<
979   "'%0' redeclared without %1 attribute: previous %1 ignored">;
980 def warn_attribute_ignored : Warning<"%0 attribute ignored">;
981 def warn_unknown_attribute_ignored : Warning<
982   "unknown attribute %0 ignored">, InGroup<UnknownAttributes>;
983 def warn_attribute_precede_definition : Warning<
984   "attribute declaration must precede definition">;
985 def warn_attribute_void_function_method : Warning<
986   "attribute %0 cannot be applied to "
987   "%select{functions|Objective-C method}1 without return value">;
988 def warn_attribute_weak_on_field : Warning<
989   "__weak attribute cannot be specified on a field declaration">;
990 def warn_attribute_weak_on_local : Warning<
991   "__weak attribute cannot be specified on an automatic variable">;
992 def warn_weak_identifier_undeclared : Warning<
993   "weak identifier %0 never declared">;
994 def err_attribute_weak_static : Error<
995   "weak declaration of '%0' must be public">;
996 def warn_attribute_weak_import_invalid_on_definition : Warning<
997   "'weak_import' attribute cannot be specified on a definition">;
998 def err_attribute_weakref_not_static : Error<
999   "weakref declaration of '%0' must be static">;
1000 def err_attribute_weakref_not_global_context : Error<
1001   "weakref declaration of '%0' must be in a global context">;
1002 def err_attribute_weakref_without_alias : Error<
1003   "weakref declaration of '%0' must also have an alias attribute">;
1004 def warn_attribute_wrong_decl_type : Warning<
1005   "%0 attribute only applies to %select{function|union|"
1006   "variable and function|function or method|parameter|"
1007   "parameter or Objective-C method |function, method or block|"
1008   "virtual method or class|function, method, or parameter|class|virtual method"
1009   "|member}1 types">;
1010 def err_attribute_wrong_decl_type : Error<
1011   "%0 attribute only applies to %select{function|union|"
1012   "variable and function|function or method|parameter|"
1013   "parameter or Objective-C method |function, method or block|"
1014   "virtual method or class|function, method, or parameter|class|virtual method"
1015   "|member}1 types">;
1016 def warn_function_attribute_wrong_type : Warning<
1017   "%0 only applies to function types; type here is %1">;
1018 def warn_gnu_inline_attribute_requires_inline : Warning<
1019   "'gnu_inline' attribute requires function to be marked 'inline',"
1020   " attribute ignored">;
1021 def err_attribute_vecreturn_only_vector_member : Error<
1022   "the vecreturn attribute can only be used on a class or structure with one member, which must be a vector">;
1023 def err_attribute_vecreturn_only_pod_record : Error<
1024   "the vecreturn attribute can only be used on a POD (plain old data) class or structure (i.e. no virtual functions)">;
1025 def err_cconv_change : Error<
1026   "function declared '%0' here was previously declared "
1027   "%select{'%2'|without calling convention}1">;
1028 def err_cconv_knr : Error<
1029   "function with no prototype cannot use %0 calling convention">;
1030 def err_cconv_varargs : Error<
1031   "variadic function cannot use %0 calling convention">;
1032 def err_regparm_mismatch : Error<"function declared with with regparm(%0) "
1033   "attribute was previously declared "
1034   "%plural{0:without the regparm|:with the regparm(%1)}1 attribute">;
1035 def warn_label_attribute_not_unused : Warning<
1036   "The only valid attribute for labels is 'unused'">;
1038 def warn_impcast_vector_scalar : Warning<
1039   "implicit conversion turns vector to scalar: %0 to %1">,
1040   InGroup<DiagGroup<"conversion">>, DefaultIgnore;
1041 def warn_impcast_complex_scalar : Warning<
1042   "implicit conversion discards imaginary component: %0 to %1">,
1043   InGroup<DiagGroup<"conversion">>, DefaultIgnore;
1044 def warn_impcast_float_precision : Warning<
1045   "implicit conversion loses floating-point precision: %0 to %1">,
1046   InGroup<DiagGroup<"conversion">>, DefaultIgnore;
1047 def warn_impcast_float_integer : Warning<
1048   "implicit conversion turns floating-point number into integer: %0 to %1">,
1049   InGroup<DiagGroup<"conversion">>, DefaultIgnore;
1050 def warn_impcast_integer_sign : Warning<
1051   "implicit conversion changes signedness: %0 to %1">,
1052   InGroup<DiagGroup<"conversion">>, DefaultIgnore;
1053 def warn_impcast_integer_sign_conditional : Warning<
1054   "operand of ? changes signedness: %0 to %1">,
1055   InGroup<DiagGroup<"conversion">>, DefaultIgnore;
1056 def warn_impcast_integer_precision : Warning<
1057   "implicit conversion loses integer precision: %0 to %1">,
1058   InGroup<DiagGroup<"conversion">>, DefaultIgnore;
1059 def warn_impcast_integer_64_32 : Warning<
1060   "implicit conversion loses integer precision: %0 to %1">,
1061   InGroup<DiagGroup<"shorten-64-to-32">>, DefaultIgnore;
1062 def warn_impcast_integer_precision_constant : Warning<
1063   "implicit conversion from %2 to %3 changes value from %0 to %1">,
1064   InGroup<DiagGroup<"constant-conversion">>;
1065 def warn_impcast_bitfield_precision_constant : Warning<
1066   "implicit truncation from %2 to bitfield changes value from %0 to %1">,
1067   InGroup<DiagGroup<"constant-conversion">>;
1069 def warn_cast_align : Warning<
1070   "cast from %0 to %1 increases required alignment from %2 to %3">,
1071   InGroup<CastAlign>, DefaultIgnore;
1073 def warn_attribute_ignored_for_field_of_type : Warning<
1074   "%0 attribute ignored for field of type %1">;
1075 def warn_transparent_union_attribute_field_size_align : Warning<
1076   "%select{alignment|size}0 of field %1 (%2 bits) does not match the "
1077   "%select{alignment|size}0 of the first field in transparent union; "
1078   "transparent_union attribute ignored">;
1079 def note_transparent_union_first_field_size_align : Note<
1080   "%select{alignment|size}0 of first field is %1 bits">;
1081 def warn_transparent_union_attribute_not_definition : Warning<
1082   "transparent_union attribute can only be applied to a union definition; "
1083   "attribute ignored">;
1084 def warn_transparent_union_attribute_floating : Warning<
1085   "first field of a transparent union cannot have %select{floating point|"
1086   "vector}0 type %1; transparent_union attribute ignored">;
1087 def warn_transparent_union_attribute_zero_fields : Warning<
1088   "transparent union definition must contain at least one field; "
1089   "transparent_union attribute ignored">;
1090 def warn_attribute_type_not_supported : Warning<
1091   "'%0' attribute argument not supported: %1">;
1092 def warn_attribute_unknown_visibility : Warning<"unknown visibility '%0'">;
1093 def err_unknown_machine_mode : Error<"unknown machine mode %0">;
1094 def err_unsupported_machine_mode : Error<"unsupported machine mode %0">;
1095 def err_mode_not_primitive : Error<
1096   "mode attribute only supported for integer and floating-point types">;
1097 def err_mode_wrong_type : Error<
1098   "type of machine mode does not match type of base type">;
1099 def err_attr_wrong_decl : Error<
1100   "'%0' attribute invalid on this declaration, requires typedef or value">;
1101 def warn_attribute_nonnull_no_pointers : Warning<
1102   "'nonnull' attribute applied to function with no pointer arguments">;
1103 def warn_attribute_malloc_pointer_only : Warning<
1104   "'malloc' attribute only applies to functions returning a pointer type">;
1105 def warn_transparent_union_nonpointer : Warning<
1106   "'transparent_union' attribute support incomplete; only supported for "
1107   "pointer unions">;
1108 def warn_attribute_sentinel_named_arguments : Warning<
1109   "'sentinel' attribute requires named arguments">;
1110 def warn_attribute_sentinel_not_variadic : Warning<
1111   "'sentinel' attribute only supported for variadic %select{functions|blocks}0">;
1112 def err_attribute_sentinel_less_than_zero : Error<
1113   "'sentinel' parameter 1 less than zero">;
1114 def err_attribute_sentinel_not_zero_or_one : Error<
1115   "'sentinel' parameter 2 not 0 or 1">;
1116 def err_attribute_cleanup_arg_not_found : Error<
1117   "'cleanup' argument %0 not found">;
1118 def err_attribute_cleanup_arg_not_function : Error<
1119   "'cleanup' argument %0 is not a function">;
1120 def err_attribute_cleanup_func_must_take_one_arg : Error<
1121   "'cleanup' function %0 must take 1 parameter">;
1122 def err_attribute_cleanup_func_arg_incompatible_type : Error<
1123   "'cleanup' function %0 parameter has type %1 which is incompatible with "
1124   "type %2">;
1125 def err_attribute_regparm_wrong_platform : Error<
1126   "'regparm' is not valid on this platform">;
1127 def err_attribute_regparm_invalid_number : Error<
1128   "'regparm' parameter must be between 0 and %0 inclusive">;
1131 // Clang-Specific Attributes
1132 def err_attribute_iboutlet : Error<
1133   "%0 attribute can only be applied to instance variables or properties">;
1134 def err_attribute_ibaction: Error<
1135   "ibaction attribute can only be applied to Objective-C instance methods">;
1136 def err_attribute_overloadable_not_function : Error<
1137   "'overloadable' attribute can only be applied to a function">;
1138 def err_attribute_overloadable_missing : Error<
1139   "%select{overloaded function|redeclaration of}0 %1 must have the "
1140   "'overloadable' attribute">;
1141 def note_attribute_overloadable_prev_overload : Note<
1142   "previous overload of function is here">;
1143 def err_attribute_overloadable_no_prototype : Error<
1144   "'overloadable' function %0 must have a prototype">;
1145 def warn_ns_attribute_wrong_return_type : Warning<
1146     "%0 attribute only applies to functions or methods that "
1147     "return a pointer or Objective-C object">;
1149 // Function Parameter Semantic Analysis.
1150 def err_param_with_void_type : Error<"argument may not have 'void' type">;
1151 def err_void_only_param : Error<
1152   "'void' must be the first and only parameter if specified">;
1153 def err_void_param_qualified : Error<
1154   "'void' as parameter must not have type qualifiers">;
1155 def err_ident_list_in_fn_declaration : Error<
1156   "a parameter list without types is only allowed in a function definition">;
1157 def ext_param_not_declared : Extension<
1158   "parameter %0 was not declared, defaulting to type 'int'">;
1159 def err_param_typedef_of_void : Error<
1160   "empty parameter list defined with a typedef of 'void' not allowed in C++">;
1161 def err_param_default_argument : Error<
1162   "C does not support default arguments">;
1163 def err_param_default_argument_redefinition : Error<
1164   "redefinition of default argument">;
1165 def err_param_default_argument_missing : Error<
1166   "missing default argument on parameter">;
1167 def err_param_default_argument_missing_name : Error<
1168   "missing default argument on parameter %0">;
1169 def err_param_default_argument_references_param : Error<
1170   "default argument references parameter %0">;
1171 def err_param_default_argument_references_local : Error<
1172   "default argument references local variable %0 of enclosing function">;
1173 def err_param_default_argument_references_this : Error<
1174   "default argument references 'this'">;
1175 def err_param_default_argument_nonfunc : Error<
1176   "default arguments can only be specified for parameters in a function "
1177   "declaration">;
1178 def err_param_default_argument_template_redecl : Error<
1179   "default arguments cannot be added to a function template that has already "
1180   "been declared">;
1181 def err_param_default_argument_member_template_redecl : Error<
1182   "default arguments cannot be added to an out-of-line definition of a member "
1183   "of a %select{class template|class template partial specialization|nested "
1184   "class in a template}0">;
1185 def err_uninitialized_member_for_assign : Error<
1186   "cannot define the implicit default assignment operator for %0, because "
1187   "non-static %select{reference|const}1 member %2 can't use default "
1188   "assignment operator">;
1189 def note_first_required_here : Note<
1190   "synthesized method is first required here">;
1191 def err_uninitialized_member_in_ctor : Error<
1192   "%select{|implicit default }0constructor for %1 must explicitly initialize "
1193   "the %select{reference|const}2 member %3">;
1195 def err_use_of_default_argument_to_function_declared_later : Error<
1196   "use of default argument to function %0 that is declared later in class %1">;
1197 def note_default_argument_declared_here : Note<
1198   "default argument declared here">;
1200 def ext_param_promoted_not_compatible_with_prototype : ExtWarn<
1201   "promoted type %0 of K&R function parameter is not compatible with the "
1202   "parameter type %1 declared in a previous prototype">;
1205 // C++ Overloading Semantic Analysis.
1206 def err_ovl_diff_return_type : Error<
1207   "functions that differ only in their return type cannot be overloaded">;
1208 def err_ovl_static_nonstatic_member : Error<
1209   "static and non-static member functions with the same parameter types "
1210   "cannot be overloaded">;
1212 def err_ovl_no_viable_function_in_call : Error<
1213   "no matching function for call to %0">;
1214 def err_ovl_no_viable_member_function_in_call : Error<
1215   "no matching member function for call to %0">;
1216 def err_ovl_ambiguous_call : Error<
1217   "call to %0 is ambiguous">;
1218 def err_ovl_deleted_call : Error<
1219   "call to %select{unavailable|deleted}0 function %1">;
1220 def err_ovl_ambiguous_member_call : Error<
1221   "call to member function %0 is ambiguous">;
1222 def err_ovl_deleted_member_call : Error<
1223   "call to %select{unavailable|deleted}0 member function %1">;
1224 def note_ovl_too_many_candidates : Note<
1225     "remaining %0 candidate%s0 omitted; "
1226     "pass -fshow-overloads=all to show them">;
1227 def note_ovl_candidate : Note<"candidate "
1228     "%select{function|function|constructor|"
1229     "function |function |constructor |"
1230     "is the implicit default constructor|"
1231     "is the implicit copy constructor|"
1232     "is the implicit copy assignment operator}0%1">;
1234 def warn_init_pointer_from_false : Warning<
1235     "initialization of pointer of type %0 from literal 'false'">,
1236     InGroup<BoolConversions>;
1238 def note_ovl_candidate_bad_deduction : Note<
1239     "candidate template ignored: failed template argument deduction">;
1240 def note_ovl_candidate_incomplete_deduction : Note<"candidate template ignored: "
1241     "couldn't infer template argument %0">;
1242 def note_ovl_candidate_inconsistent_deduction : Note<
1243     "candidate template ignored: deduced conflicting %select{types|values|"
1244     "templates}0 for parameter %1 (%2 vs. %3)">;
1245 def note_ovl_candidate_explicit_arg_mismatch_named : Note<
1246     "candidate template ignored: invalid explicitly-specified argument "
1247     "for template parameter %0">;
1248 def note_ovl_candidate_explicit_arg_mismatch_unnamed : Note<
1249     "candidate template ignored: invalid explicitly-specified argument "
1250     "for %ordinal0 template parameter">;
1251 def note_ovl_candidate_instantiation_depth : Note<
1252     "candidate template ignored: substitution exceeded maximum template "
1253     "instantiation depth">;
1254 def note_ovl_candidate_underqualified : Note<
1255     "candidate template ignored: can't deduce a type for %0 which would "
1256     "make %2 equal %1">;
1257 def note_ovl_candidate_substitution_failure : Note<
1258     "candidate template ignored: substitution failure %0">;
1259     
1260 // Note that we don't treat templates differently for this diagnostic.
1261 def note_ovl_candidate_arity : Note<"candidate "
1262     "%select{function|function|constructor|function|function|constructor|"
1263     "constructor (the implicit default constructor)|"
1264     "constructor (the implicit copy constructor)|"
1265     "function (the implicit copy assignment operator)}0 %select{|template }1"
1266     "not viable: requires%select{ at least| at most|}2 %3 argument%s3, but %4 "
1267     "%plural{1:was|:were}4 provided">;
1269 def note_ovl_candidate_deleted : Note<
1270   "candidate %select{function|function|constructor|"
1271   "function |function |constructor |||}0%1 "
1272   "has been explicitly %select{made unavailable|deleted}2">;
1274 // Giving the index of the bad argument really clutters this message, and
1275 // it's relatively unimportant because 1) it's generally obvious which
1276 // argument(s) are of the given object type and 2) the fix is usually
1277 // to complete the type, which doesn't involve changes to the call line
1278 // anyway.  If people complain, we can change it.
1279 def note_ovl_candidate_bad_conv_incomplete : Note<"candidate "
1280     "%select{function|function|constructor|"
1281     "function |function |constructor |"
1282     "constructor (the implicit default constructor)|"
1283     "constructor (the implicit copy constructor)|"
1284     "function (the implicit copy assignment operator)}0%1 "
1285     "not viable: cannot convert argument of incomplete type %2 to %3">;
1286 def note_ovl_candidate_bad_overload : Note<"candidate "
1287     "%select{function|function|constructor|"
1288     "function |function |constructor |"
1289     "constructor (the implicit default constructor)|"
1290     "constructor (the implicit copy constructor)|"
1291     "function (the implicit copy assignment operator)}0%1"
1292     " not viable: no overload of %3 matching %2 for %ordinal4 argument">;
1293 def note_ovl_candidate_bad_conv : Note<"candidate "
1294     "%select{function|function|constructor|"
1295     "function |function |constructor |"
1296     "constructor (the implicit default constructor)|"
1297     "constructor (the implicit copy constructor)|"
1298     "function (the implicit copy assignment operator)}0%1"
1299     " not viable: no known conversion from %2 to %3 for "
1300     "%select{%ordinal5 argument|object argument}4">;
1301 def note_ovl_candidate_bad_addrspace : Note<"candidate "
1302     "%select{function|function|constructor|"
1303     "function |function |constructor |"
1304     "constructor (the implicit default constructor)|"
1305     "constructor (the implicit copy constructor)|"
1306     "function (the implicit copy assignment operator)}0%1 not viable: "
1307     "%select{%ordinal6|'this'}5 argument (%2) is in "
1308     "address space %3, but parameter must be in address space %4">;
1309 def note_ovl_candidate_bad_cvr_this : Note<"candidate "
1310     "%select{|function|||function||||"
1311     "function (the implicit copy assignment operator)}0 not viable: "
1312     "'this' argument has type %2, but method is not marked "
1313     "%select{const|restrict|const or restrict|volatile|const or volatile|"
1314     "volatile or restrict|const, volatile, or restrict}3">;
1315 def note_ovl_candidate_bad_cvr : Note<"candidate "
1316     "%select{function|function|constructor|"
1317     "function |function |constructor |"
1318     "constructor (the implicit default constructor)|"
1319     "constructor (the implicit copy constructor)|"
1320     "function (the implicit copy assignment operator)}0%1 not viable: "
1321     "%ordinal4 argument (%2) would lose "
1322     "%select{const|restrict|const and restrict|volatile|const and volatile|"
1323     "volatile and restrict|const, volatile, and restrict}3 qualifier"
1324     "%select{||s||s|s|s}3">;
1325 def note_ovl_candidate_bad_base_to_derived_conv : Note<"candidate "
1326     "%select{function|function|constructor|"
1327     "function |function |constructor |"
1328     "constructor (the implicit default constructor)|"
1329     "constructor (the implicit copy constructor)|"
1330     "function (the implicit copy assignment operator)}0%1"
1331     " not viable: cannot %select{convert from|convert from|bind}2 "
1332     "%select{base class pointer|superclass|base class object of type}2 %3 to "
1333     "%select{derived class pointer|subclass|derived class reference}2 %4 for "
1334     "%ordinal5 argument">;
1336 def note_ambiguous_type_conversion: Note<
1337     "because of ambiguity in conversion of %0 to %1">;
1338 def note_ovl_builtin_binary_candidate : Note<
1339     "built-in candidate %0">;
1340 def note_ovl_builtin_unary_candidate : Note<
1341     "built-in candidate %0">;
1342 def err_ovl_no_viable_function_in_init : Error<
1343   "no matching constructor for initialization of %0">;
1344 def err_ovl_ambiguous_init : Error<"call to constructor of %0 is ambiguous">;
1345 def err_ref_init_ambiguous : Error<
1346   "reference initialization of type %0 with initializer of type %1 is ambiguous">;
1347 def err_ovl_deleted_init : Error<
1348   "call to %select{unavailable|deleted}0 constructor of %1">;
1349 def err_ovl_ambiguous_oper_unary : Error<
1350   "use of overloaded operator '%0' is ambiguous (operand type %1)">;
1351 def err_ovl_ambiguous_oper_binary : Error<
1352   "use of overloaded operator '%0' is ambiguous (with operand types %1 and %2)">;
1353 def err_ovl_no_viable_oper : Error<"no viable overloaded '%0'">;
1354 def err_ovl_deleted_oper : Error<
1355   "overload resolution selected %select{unavailable|deleted}0 operator '%1'">;
1356 def err_ovl_no_viable_subscript :
1357     Error<"no viable overloaded operator[] for type %0">;
1358 def err_ovl_no_oper :
1359     Error<"type %0 does not provide a %select{subscript|call}1 operator">;
1360 def err_ovl_unresolvable :
1361     Error<"cannot resolve overloaded function from context">;
1362   
1364 def err_ovl_no_viable_object_call : Error<
1365   "no matching function for call to object of type %0">;
1366 def err_ovl_ambiguous_object_call : Error<
1367   "call to object of type %0 is ambiguous">;
1368 def err_ovl_deleted_object_call : Error<
1369   "call to %select{unavailable|deleted}0 function call operator in type %1">;
1370 def note_ovl_surrogate_cand : Note<"conversion candidate of type %0">;
1371 def err_member_call_without_object : Error<
1372   "call to non-static member function without an object argument">;
1374 // C++ Address of Overloaded Function
1375 def err_addr_ovl_no_viable : Error<
1376   "address of overloaded function %0 does not match required type %1">;
1377 def err_addr_ovl_ambiguous : Error<
1378   "address of overloaded function %0 is ambiguous">;
1379 def err_addr_ovl_not_func_ptrref : Error<
1380   "address of overloaded function %0 cannot be converted to type %1">;
1381 def err_addr_ovl_no_qualifier : Error<
1382   "can't form member pointer of type %0 without '&' and class name">;
1383   
1384 // C++ Template Declarations
1385 def err_template_param_shadow : Error<
1386   "declaration of %0 shadows template parameter">;
1387 def note_template_param_here : Note<"template parameter is declared here">;
1388 def warn_template_export_unsupported : Warning<
1389   "exported templates are unsupported">;
1390 def err_template_outside_namespace_or_class_scope : Error<
1391   "templates can only be declared in namespace or class scope">;
1392 def err_template_linkage : Error<"templates must have C++ linkage">;
1393 def err_template_typedef : Error<"a typedef cannot be a template">;
1394 def err_template_unnamed_class : Error<
1395   "cannot declare a class template with no name">;
1396 def err_template_param_list_different_arity : Error<
1397   "%select{too few|too many}0 template parameters in template "
1398   "%select{|template parameter }1redeclaration">;
1399 def note_template_param_list_different_arity : Note<
1400   "%select{too few|too many}0 template parameters in template template "
1401   "argument">;
1402 def note_template_prev_declaration : Note<
1403   "previous template %select{declaration|template parameter}0 is here">;
1404 def err_template_param_different_kind : Error<
1405   "template parameter has a different kind in template "
1406   "%select{|template parameter }0redeclaration">;
1407 def note_template_param_different_kind : Note<
1408   "template parameter has a different kind in template argument">;
1409   
1410 def err_template_nontype_parm_different_type : Error<
1411   "template non-type parameter has a different type %0 in template "
1412   "%select{|template parameter }1redeclaration">;
1414 def note_template_nontype_parm_different_type : Note<
1415   "template non-type parameter has a different type %0 in template argument">;
1416 def note_template_nontype_parm_prev_declaration : Note<
1417   "previous non-type template parameter with type %0 is here">;
1418 def err_template_nontype_parm_bad_type : Error<
1419   "a non-type template parameter cannot have type %0">;
1420 def err_template_param_default_arg_redefinition : Error<
1421   "template parameter redefines default argument">;
1422 def note_template_param_prev_default_arg : Note<
1423   "previous default template argument defined here">;
1424 def err_template_param_default_arg_missing : Error<
1425   "template parameter missing a default argument">;
1426 def err_template_parameter_default_in_function_template : Error<
1427   "a template parameter of a function template cannot have a default argument "
1428   "in C++98">;
1429 def err_template_parameter_default_template_member : Error<
1430   "cannot add a default template argument to the definition of a member of a "
1431   "class template">;
1432 def err_template_parameter_default_friend_template : Error<
1433   "default template argument not permitted on a friend template">;
1434 def err_template_template_parm_no_parms : Error<
1435   "template template parameter must have its own template parameters">;
1437 def err_template_variable : Error<"variable %0 declared as a template">;
1438 def err_template_variable_noparams : Error<
1439   "extraneous 'template<>' in declaration of variable %0">;
1440 def err_template_tag_noparams : Error<
1441   "extraneous 'template<>' in declaration of %0 %1">;
1442 def err_template_decl_ref : Error<
1443   "cannot refer to class template %0 without a template argument list">;
1445 // C++ Template Argument Lists
1446 def err_template_missing_args : Error<
1447   "use of class template %0 requires template arguments">;
1448 def err_template_arg_list_different_arity : Error<
1449   "%select{too few|too many}0 template arguments for "
1450   "%select{class template|function template|template template parameter"
1451   "|template}1 %2">;
1452 def note_template_decl_here : Note<"template is declared here">;
1453 def note_member_of_template_here : Note<"member is declared here">;
1454 def err_template_arg_must_be_type : Error<
1455   "template argument for template type parameter must be a type">;
1456 def err_template_arg_must_be_expr : Error<
1457   "template argument for non-type template parameter must be an expression">;
1458 def err_template_arg_nontype_ambig : Error<
1459   "template argument for non-type template parameter is treated as type %0">;
1460 def err_template_arg_must_be_template : Error<
1461   "template argument for template template parameter must be a class template">;
1462 def ext_template_arg_local_type : ExtWarn<
1463   "template argument uses local type %0">, InGroup<LocalTypeTemplateArgs>;
1464 def ext_template_arg_unnamed_type : ExtWarn<
1465   "template argument uses unnamed type">, InGroup<UnnamedTypeTemplateArgs>;
1466 def note_template_unnamed_type_here : Note<
1467   "unnamed type used in template argument was declared here">;
1468 def err_template_arg_overload_type : Error<
1469   "template argument is the type of an unresolved overloaded function">;
1470 def err_template_arg_not_class_template : Error<
1471   "template argument does not refer to a class template or template "
1472   "template parameter">;
1473 def note_template_arg_refers_here_func : Note<
1474   "template argument refers to function template %0, here">;
1475 def err_template_arg_template_params_mismatch : Error<
1476   "template template argument has different template parameters than its "
1477   "corresponding template template parameter">;
1478 def err_template_arg_not_integral_or_enumeral : Error<
1479   "non-type template argument of type %0 must have an integral or enumeration"
1480   " type">;
1481 def err_template_arg_not_ice : Error<
1482   "non-type template argument of type %0 is not an integral constant "
1483   "expression">;
1484 def err_deduced_non_type_template_arg_type_mismatch : Error<
1485   "deduced non-type template argument does not have the same type as the "
1486   "its corresponding template parameter (%0 vs %1)">;
1487 def err_template_arg_not_convertible : Error<
1488   "non-type template argument of type %0 cannot be converted to a value "
1489   "of type %1">;
1490 def warn_template_arg_negative : Warning<
1491   "non-type template argument with value '%0' converted to '%1' for unsigned "
1492   "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
1493 def warn_template_arg_too_large : Warning<
1494   "non-type template argument value '%0' truncated to '%1' for "
1495   "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
1496 def err_template_arg_no_ref_bind : Error<
1497   "non-type template parameter of reference type %0 cannot bind to template "
1498   "argument of type %1">;
1499 def err_template_arg_ref_bind_ignores_quals : Error<
1500   "reference binding of non-type template parameter of type %0 to template "
1501   "argument of type %1 ignores qualifiers">;
1502 def err_template_arg_not_decl_ref : Error<
1503   "non-type template argument does not refer to any declaration">;
1504 def err_template_arg_not_object_or_func_form : Error<
1505   "non-type template argument does not directly refer to an object or "
1506   "function">;
1507 def err_template_arg_not_address_of : Error<
1508   "non-type template argument for template parameter of pointer type %0 must "
1509   "have its address taken">;
1510 def err_template_arg_address_of_non_pointer : Error<
1511   "address taken in non-type template argument for template parameter of "
1512   "reference type %0">;
1513 def err_template_arg_reference_var : Error<
1514   "non-type template argument of reference type %0 is not an object">;
1515 def err_template_arg_field : Error<
1516   "non-type template argument refers to non-static data member %0">;
1517 def err_template_arg_method : Error<
1518   "non-type template argument refers to non-static member function %0">;
1519 def err_template_arg_function_not_extern : Error<
1520   "non-template argument refers to function %0 with internal linkage">;
1521 def err_template_arg_object_not_extern : Error<
1522   "non-template argument refers to object %0 that does not have external "
1523   "linkage">;
1524 def note_template_arg_internal_object : Note<
1525   "non-template argument refers to %select{function|object}0 here">;
1526 def note_template_arg_refers_here : Note<"non-template argument refers here">;
1527 def err_template_arg_not_object_or_func : Error<
1528   "non-type template argument does not refer to an object or function">;
1529 def err_template_arg_not_pointer_to_member_form : Error<
1530   "non-type template argument is not a pointer to member constant">;
1531 def ext_template_arg_extra_parens : ExtWarn<
1532   "address non-type template argument cannot be surrounded by parentheses">;
1533 def err_pointer_to_member_type : Error<
1534   "invalid use of pointer to member type after %select{.*|->*}0">;
1536 // C++ template specialization
1537 def err_template_spec_unknown_kind : Error<
1538   "can only provide an explicit specialization for a class template, function "
1539   "template, or a member function, static data member, or member class of a "
1540   "class template">;
1541 def note_specialized_entity : Note<
1542   "explicitly specialized declaration is here">;
1543 def err_template_spec_decl_function_scope : Error<
1544   "explicit specialization of %0 in function scope">;
1545 def err_template_spec_decl_class_scope : Error<
1546   "explicit specialization of %0 in class scope">;
1547 def err_template_spec_decl_friend : Error<
1548   "cannot declare an explicit specialization in a friend">;
1549 def err_template_spec_decl_out_of_scope_global : Error<
1550   "%select{class template|class template partial|function template|member "
1551   "function|static data member|member class}0 specialization of %1 must "
1552   "originally be declared in the global scope">;
1553 def ext_template_spec_decl_out_of_scope_global : ExtWarn<
1554   "%select{class template|class template partial|function template|member "
1555   "function|static data member|member class}0 specialization of %1 must "
1556   "originally be declared in the global scope; accepted as a C++0x extension">,
1557   InGroup<CXX0x>;
1558 def err_template_spec_decl_out_of_scope : Error<
1559   "%select{class template|class template partial|function template|member "
1560   "function|static data member|member class}0 specialization of %1 must "
1561   "originally be declared in namespace %2">;
1562 def ext_template_spec_decl_out_of_scope : ExtWarn<
1563   "%select{class template|class template partial|function template|member "
1564   "function|static data member|member class}0 specialization of %1 must "
1565   "originally be declared in namespace %2; accepted as a C++0x extension">,
1566   InGroup<CXX0x>;
1567 def err_template_spec_redecl_out_of_scope : Error<
1568   "%select{class template|class template partial|function template|member "
1569   "function|static data member|member class}0 specialization of %1 not in a "
1570   "namespace enclosing %2">;
1571 def err_template_spec_redecl_global_scope : Error<
1572   "%select{class template|class template partial|function template|member "
1573   "function|static data member|member class}0 specialization of %1 must occur "
1574   "at global scope">;
1575 def err_spec_member_not_instantiated : Error<
1576   "specialization of member %q0 does not specialize an instantiated member">;
1577 def note_specialized_decl : Note<"attempt to specialize declaration here">;
1578 def err_specialization_after_instantiation : Error<
1579   "explicit specialization of %0 after instantiation">;
1580 def note_instantiation_required_here : Note<
1581   "%select{implicit|explicit}0 instantiation first required here">;
1582 def err_template_spec_friend : Error<
1583   "template specialization declaration cannot be a friend">;
1584 def err_template_spec_default_arg : Error<
1585   "default argument not permitted on an explicit "
1586   "%select{instantiation|specialization}0 of function %1">;
1587 def err_not_class_template_specialization : Error<
1588   "cannot specialize a %select{dependent template|template template "
1589   "parameter}0">;
1591 // C++ class template specializations and out-of-line definitions
1592 def err_template_spec_needs_header : Error<
1593   "template specialization requires 'template<>'">;
1594 def err_template_spec_needs_template_parameters : Error<
1595   "template specialization or definition requires a template parameter list "
1596   "corresponding to the nested type %0">;
1597 def err_template_param_list_matches_nontemplate : Error<
1598   "template parameter list matching the non-templated nested type %0 should "
1599   "be empty ('template<>')">;
1600 def err_template_spec_extra_headers : Error<
1601   "extraneous template parameter list in template specialization or "
1602   "out-of-line template definition">;
1603 def warn_template_spec_extra_headers : Warning<
1604   "extraneous template parameter list in template specialization">;
1605 def note_explicit_template_spec_does_not_need_header : Note<
1606   "'template<>' header not required for explicitly-specialized class %0 "
1607   "declared here">;
1608 def err_template_qualified_declarator_no_match : Error<
1609   "nested name specifier '%0' for declaration does not refer into a class, "
1610   "class template or class template partial specialization">;
1612 // C++ Class Template Partial Specialization
1613 def err_default_arg_in_partial_spec : Error<
1614     "default template argument in a class template partial specialization">;
1615 def err_dependent_non_type_arg_in_partial_spec : Error<
1616     "non-type template argument depends on a template parameter of the "
1617     "partial specialization">;
1618 def err_dependent_typed_non_type_arg_in_partial_spec : Error<
1619     "non-type template argument specializes a template parameter with "
1620     "dependent type %0">;
1621 def err_partial_spec_args_match_primary_template : Error<
1622     "class template partial specialization does not specialize any template "
1623     "argument; to %select{declare|define}0 the primary template, remove the "
1624     "template argument list">; 
1625 def warn_partial_specs_not_deducible : Warning<
1626     "class template partial specialization contains "
1627     "%select{a template parameter|template parameters}0 that can not be "
1628     "deduced; this partial specialization will never be used">;
1629 def note_partial_spec_unused_parameter : Note<
1630     "non-deducible template parameter %0">;
1631 def err_partial_spec_ordering_ambiguous : Error<
1632     "ambiguous partial specializations of %0">;
1633 def note_partial_spec_match : Note<"partial specialization matches %0">;
1634 def err_partial_spec_redeclared : Error<
1635   "class template partial specialization %0 cannot be redeclared">;
1636 def note_prev_partial_spec_here : Note<
1637   "previous declaration of class template partial specialization %0 is here">;
1638 def err_partial_spec_fully_specialized : Error<
1639   "partial specialization of %0 does not use any of its template parameters">;
1640   
1641 // C++ Function template specializations
1642 def err_function_template_spec_no_match : Error<
1643     "no function template matches function template specialization %0">;
1644 def err_function_template_spec_ambiguous : Error<
1645     "function template specialization %0 ambiguously refers to more than one "
1646     "function template; explicitly specify%select{|additional }1 template "
1647     "arguments to identify a particular function template">;
1648 def note_function_template_spec_matched : Note<
1649     "function template matches specialization %0">;
1651 // C++ Template Instantiation
1652 def err_template_recursion_depth_exceeded : Error<
1653   "recursive template instantiation exceeded maximum depth of %0">,
1654   DefaultFatal, NoSFINAE;
1655 def note_template_recursion_depth : Note<
1656   "use -ftemplate-depth-N to increase recursive template instantiation depth">;
1658 def err_template_instantiate_undefined : Error<
1659   "%select{implicit|explicit}0 instantiation of undefined template %1">;
1660 def err_implicit_instantiate_member_undefined : Error<
1661   "implicit instantiation of undefined member %0">;
1662 def note_template_class_instantiation_here : Note<
1663   "in instantiation of template class %0 requested here">;
1664 def note_template_member_class_here : Note<
1665   "in instantiation of member class %0 requested here">;
1666 def note_template_member_function_here : Note<
1667   "in instantiation of member function %q0 requested here">;
1668 def note_function_template_spec_here : Note<
1669   "in instantiation of function template specialization %q0 requested here">;
1670 def note_template_static_data_member_def_here : Note<
1671   "in instantiation of static data member %q0 requested here">;
1672   
1673 def note_default_arg_instantiation_here : Note<
1674   "in instantiation of default argument for '%0' required here">;
1675 def note_default_function_arg_instantiation_here : Note<
1676   "in instantiation of default function argument expression "
1677   "for '%0' required here">;
1678 def note_explicit_template_arg_substitution_here : Note<
1679   "while substituting explicitly-specified template arguments into function "
1680   "template %0 %1">;
1681 def note_function_template_deduction_instantiation_here : Note<
1682   "while substituting deduced template arguments into function template %0 "
1683   "%1">;
1684 def note_partial_spec_deduct_instantiation_here : Note<
1685   "during template argument deduction for class template partial "
1686   "specialization %0 %1">;
1687 def note_prior_template_arg_substitution : Note<
1688   "while substituting prior template arguments into %select{non-type|template}0"
1689   " template parameter%1 %2">;
1690 def note_template_default_arg_checking : Note<
1691   "while checking a default template argument used here">;
1692 def note_instantiation_contexts_suppressed : Note<
1693   "(skipping %0 context%s0 in backtrace; use -ftemplate-backtrace-limit=0 to "
1694   "see all)">;
1696 def err_field_instantiates_to_function : Error<
1697   "data member instantiated with function type %0">;
1698 def err_variable_instantiates_to_function : Error<
1699   "%select{variable|static data member}0 instantiated with function type %1">;
1700 def err_nested_name_spec_non_tag : Error<
1701   "type %0 cannot be used prior to '::' because it has no members">;
1703 // C++ Explicit Instantiation
1704 def err_explicit_instantiation_duplicate : Error<
1705     "duplicate explicit instantiation of %0">;
1706 def note_previous_explicit_instantiation : Note<
1707     "previous explicit instantiation is here">;
1708 def ext_explicit_instantiation_after_specialization : Extension<
1709     "explicit instantiation of %0 that occurs after an explicit "
1710     "specialization will be ignored (C++0x extension)">,
1711     InGroup<CXX0x>;
1712 def note_previous_template_specialization : Note<
1713     "previous template specialization is here">;
1714 def err_explicit_instantiation_enum : Error<
1715     "explicit instantiation of enumeration type %0">;
1716 def err_explicit_instantiation_nontemplate_type : Error<
1717     "explicit instantiation of non-templated type %0">;
1718 def note_nontemplate_decl_here : Note<
1719     "non-templated declaration is here">;
1720 def err_explicit_instantiation_in_class : Error<
1721   "explicit instantiation of %0 in class scope">;
1722 def err_explicit_instantiation_out_of_scope : Error<
1723   "explicit instantiation of %0 not in a namespace enclosing %1">;
1724 def err_explicit_instantiation_must_be_global : Error<
1725   "explicit instantiation of %0 must occur at global scope">;
1726 def warn_explicit_instantiation_out_of_scope_0x : Warning<
1727   "explicit instantiation of %0 not in a namespace enclosing %1">, 
1728   InGroup<DiagGroup<"-Wc++0x-compat"> >;
1729 def warn_explicit_instantiation_must_be_global_0x : Warning<
1730   "explicit instantiation of %0 must occur at global scope">, 
1731   InGroup<DiagGroup<"-Wc++0x-compat"> >;
1732   
1733 def err_explicit_instantiation_requires_name : Error<
1734   "explicit instantiation declaration requires a name">;
1735 def err_explicit_instantiation_of_typedef : Error<
1736   "explicit instantiation of typedef %0">;
1737 def err_explicit_instantiation_not_known : Error<
1738   "explicit instantiation of %0 does not refer to a function template, member "
1739   "function, member class, or static data member">;
1740 def note_explicit_instantiation_here : Note<
1741   "explicit instantiation refers here">;
1742 def err_explicit_instantiation_data_member_not_instantiated : Error<
1743   "explicit instantiation refers to static data member %q0 that is not an "
1744   "instantiation">;
1745 def err_explicit_instantiation_member_function_not_instantiated : Error<
1746   "explicit instantiation refers to member function %q0 that is not an "
1747   "instantiation">;
1748 def err_explicit_instantiation_ambiguous : Error<
1749   "partial ordering for explicit instantiation of %0 is ambiguous">;
1750 def note_explicit_instantiation_candidate : Note<
1751   "explicit instantiation candidate function template here %0">;
1752 def err_explicit_instantiation_inline : Error<
1753   "explicit instantiation cannot be 'inline'">;
1754 def ext_explicit_instantiation_without_qualified_id : ExtWarn<
1755   "qualifier in explicit instantiation of %q0 requires a template-id "
1756   "(a typedef is not permitted)">;
1757 def err_explicit_instantiation_unqualified_wrong_namespace : Error<
1758   "explicit instantiation of %q0 must occur in %1">;
1759 def warn_explicit_instantiation_unqualified_wrong_namespace_0x : Warning<
1760   "explicit instantiation of %q0 must occur in %1">, 
1761   InGroup<DiagGroup<"c++0x-compat"> >;
1762 def err_explicit_instantiation_undefined_member : Error<
1763   "explicit instantiation of undefined %select{member class|member function|"
1764   "static data member}0 %1 of class template %2">;
1765 def err_explicit_instantiation_undefined_func_template : Error<
1766   "explicit instantiation of undefined function template %0">;
1767 def err_explicit_instantiation_declaration_after_definition : Error<
1768   "explicit instantiation declaration (with 'extern') follows explicit "
1769   "instantiation definition (without 'extern')">;
1770 def note_explicit_instantiation_definition_here : Note<
1771   "explicit instantiation definition is here">;
1772   
1773 // C++ typename-specifiers
1774 def err_typename_nested_not_found : Error<"no type named %0 in %1">;
1775 def err_typename_nested_not_type : Error<
1776     "typename specifier refers to non-type member %0 in %1">;
1777 def note_typename_refers_here : Note<
1778     "referenced member %0 is declared here">;
1779 def err_typename_missing : Error<
1780   "missing 'typename' prior to dependent type name '%0%1'">;
1781 def ext_typename_outside_of_template : ExtWarn<
1782   "'typename' occurs outside of a template">;
1784 def err_template_kw_refers_to_non_template : Error<
1785     "%0 following the 'template' keyword does not refer to a template">;
1786 def err_template_kw_refers_to_function_template : Error<
1787     "%0 following the 'template' keyword refers to a function template">;
1788 def err_template_kw_refers_to_class_template : Error<
1789     "'%0%1' instantiated to a class template, not a function template">;
1790 def note_referenced_class_template : Error<
1791     "class template declared here">;
1792 def err_template_kw_missing : Error<
1793   "missing 'template' keyword prior to dependent template name '%0%1'">;
1794 def ext_template_outside_of_template : ExtWarn<
1795   "'template' keyword outside of a template">;
1797 // C++0x Variadic Templates
1798 def err_variadic_templates_unsupported : Error<
1799   "variadic templates are not yet implemented">;
1800 def err_template_param_pack_default_arg : Error<
1801   "template parameter pack cannot have a default argument">;
1802 def err_template_param_pack_must_be_last_template_parameter : Error<
1803   "template parameter pack must be the last template parameter">;
1805 def err_template_parameter_pack_non_pack : Error<
1806   "template %select{type|non-type|template}0 parameter%select{| pack}1 "
1807   "conflicts with previous template %select{type|non-type|template}0 "
1808   "parameter%select{ pack|}1">;
1809 def note_template_parameter_pack_non_pack : Note<
1810   "template %select{type|non-type|template}0 parameter%select{| pack}1 "
1811   "does not match template %select{type|non-type|template}0 "
1812   "parameter%select{ pack|}1 in template argument">;
1813 def note_template_parameter_pack_here : Note<
1814   "previous template %select{type|non-type|template}0 "
1815   "parameter%select{| pack}1 declared here">;
1816   
1817 def err_unexpected_typedef : Error<
1818   "unexpected type name %0: expected expression">;
1819 def err_unexpected_namespace : Error<
1820   "unexpected namespace name %0: expected expression">;
1821 def err_undeclared_var_use : Error<"use of undeclared identifier %0">;
1822 def note_dependent_var_use : Note<"must qualify identifier to find this "
1823     "declaration in dependent base class">;
1824 def err_undeclared_use : Error<"use of undeclared %0">;
1825 def warn_deprecated : Warning<"%0 is deprecated">,
1826     InGroup<DeprecatedDeclarations>;
1827 def warn_deprecated_message : Warning<"%0 is deprecated: %1">,
1828     InGroup<DeprecatedDeclarations>;
1829 def err_unavailable : Error<"%0 is unavailable">;
1830 def err_unavailable_message : Error<"%0 is unavailable: %1">;
1831 def note_unavailable_here : Note<
1832   "function has been explicitly marked %select{unavailable|deleted}0 here">;
1833 def warn_not_enough_argument : Warning<
1834   "not enough variable arguments in %0 declaration to fit a sentinel">;
1835 def warn_missing_sentinel : Warning <
1836   "missing sentinel in %select{function call|method dispatch|block call}0">;
1837 def note_sentinel_here : Note<
1838   "%select{function|method|block}0 has been explicitly marked sentinel here">;
1839 def warn_missing_prototype : Warning<
1840   "no previous prototype for function %0">,
1841   InGroup<DiagGroup<"missing-prototypes">>, DefaultIgnore;
1842 def err_redefinition : Error<"redefinition of %0">;
1843 def err_definition_of_implicitly_declared_member : Error<
1844   "definition of implicitly declared %select{constructor|copy constructor|"
1845   "copy assignment operator|destructor}1">;
1846 def err_redefinition_extern_inline : Error<
1847   "redefinition of a 'extern inline' function %0 is not supported in "
1848   "%select{C99 mode|C++}1">;
1849   
1850 def warn_redefinition_of_typedef : Warning<
1851   "redefinition of typedef %0 is invalid in C">,
1852   InGroup<DiagGroup<"typedef-redefinition"> >, DefaultError;
1854 def err_inline_declaration_block_scope : Error<
1855   "inline declaration of %0 not allowed in block scope">;
1856 def err_static_non_static : Error<
1857   "static declaration of %0 follows non-static declaration">;
1858 def err_non_static_static : Error<
1859   "non-static declaration of %0 follows static declaration">;
1860 def err_non_thread_thread : Error<
1861   "non-thread-local declaration of %0 follows thread-local declaration">;
1862 def err_thread_non_thread : Error<
1863   "thread-local declaration of %0 follows non-thread-local declaration">;
1864 def err_redefinition_different_type : Error<
1865   "redefinition of %0 with a different type">;
1866 def err_redefinition_different_kind : Error<
1867   "redefinition of %0 as different kind of symbol">;
1868 def err_redefinition_different_typedef : Error<
1869   "typedef redefinition with different types (%0 vs %1)">;
1870 def err_tag_reference_non_tag : Error<
1871   "elaborated type refers to %select{a non-tag type|a typedef|a template}0">;
1872 def err_tag_reference_conflict : Error<
1873   "implicit declaration introduced by elaborated type conflicts with "
1874   "%select{a declaration|a typedef|a template}0 of the same name">;
1875 def err_dependent_tag_decl : Error<
1876   "%select{declaration|definition}0 of %select{struct|union|class|enum}1 "
1877   "in a dependent scope">;
1878 def err_tag_definition_of_typedef : Error<
1879   "definition of type %0 conflicts with typedef of the same name">;
1880 def err_conflicting_types : Error<"conflicting types for %0">;
1881 def err_nested_redefinition : Error<"nested redefinition of %0">;
1882 def err_use_with_wrong_tag : Error<
1883   "use of %0 with tag type that does not match previous declaration">;
1884 def warn_struct_class_tag_mismatch : Warning<
1885     "%select{struct|class}0 %select{|template}1 %2 was previously declared "
1886     "as a %select{class|struct}0 %select{|template}1">,
1887     InGroup<MismatchedTags>, DefaultIgnore;
1888 def ext_forward_ref_enum : Extension<
1889   "ISO C forbids forward references to 'enum' types">;
1890 def err_forward_ref_enum : Error<
1891   "ISO C++ forbids forward references to 'enum' types">;
1892 def ext_ms_forward_ref_enum : Extension<
1893   "forward references to 'enum' types are a Microsoft extension">, InGroup<Microsoft>;
1894 def ext_forward_ref_enum_def : Extension<
1895   "redeclaration of already-defined enum %0 is a GNU extension">, InGroup<GNU>;
1896   
1897 def err_redefinition_of_enumerator : Error<"redefinition of enumerator %0">;
1898 def err_duplicate_member : Error<"duplicate member %0">;
1899 def err_misplaced_ivar : Error<
1900   "ivars may not be placed in %select{categories|class extension}0">;
1901 def ext_enum_value_not_int : Extension<
1902   "ISO C restricts enumerator values to range of 'int' (%0 is too "
1903   "%select{small|large}1)">;
1904 def warn_enum_too_large : Warning<
1905   "enumeration values exceed range of largest integer">;
1906 def warn_enumerator_too_large : Warning<
1907   "enumerator value %0 is not representable in the largest integer type">;
1908   
1909 def warn_illegal_constant_array_size : Extension<
1910   "size of static array must be an integer constant expression">;
1911 def err_vm_decl_in_file_scope : Error<
1912   "variably modified type declaration not allowed at file scope">;
1913 def err_vm_decl_has_extern_linkage : Error<
1914   "variably modified type declaration can not have 'extern' linkage">;
1915 def err_typecheck_field_variable_size : Error<
1916   "fields must have a constant size: 'variable length array in structure' "
1917   "extension will never be supported">;
1918 def err_vm_func_decl : Error<
1919   "function declaration cannot have variably modified type">;
1920 def err_array_too_large : Error<
1921   "array is too large (%0 elements)">;
1923 // -Wpadded, -Wpacked
1924 def warn_padded_struct_field : Warning<
1925   "padding %select{struct|class}0 %1 with %2 %select{byte|bit}3%select{|s}4 "
1926   "to align %5">, InGroup<Padded>, DefaultIgnore;
1927 def warn_padded_struct_anon_field : Warning<
1928   "padding %select{struct|class}0 %1 with %2 %select{byte|bit}3%select{|s}4 "
1929   "to align anonymous bit-field">, InGroup<Padded>, DefaultIgnore;
1930 def warn_padded_struct_size : Warning<
1931   "padding size of %0 with %1 %select{byte|bit}2%select{|s}3 "
1932   "to alignment boundary">, InGroup<Padded>, DefaultIgnore;
1933 def warn_unnecessary_packed : Warning<
1934   "packed attribute is unnecessary for %0">, InGroup<Packed>, DefaultIgnore;
1936 def err_typecheck_negative_array_size : Error<"array size is negative">;
1937 def warn_typecheck_function_qualifiers : Warning<
1938   "qualifier on function type %0 has unspecified behavior">;
1939 def err_typecheck_invalid_restrict_not_pointer : Error<
1940   "restrict requires a pointer or reference (%0 is invalid)">;
1941 def err_typecheck_invalid_restrict_not_pointer_noarg : Error<
1942   "restrict requires a pointer or reference">;
1943 def err_typecheck_invalid_restrict_invalid_pointee : Error<
1944   "pointer to function type %0 may not be 'restrict' qualified">;
1945 def ext_typecheck_zero_array_size : Extension<
1946   "zero size arrays are an extension">;
1947 def err_typecheck_zero_array_size : Error<
1948   "zero-length arrays are not permitted in C++">;
1949 def err_at_least_one_initializer_needed_to_size_array : Error<
1950   "at least one initializer value required to size array">;
1951 def err_array_size_non_int : Error<"size of array has non-integer type %0">;
1952 def err_init_element_not_constant : Error<
1953   "initializer element is not a compile-time constant">;
1954 def err_block_extern_cant_init : Error<
1955   "'extern' variable cannot have an initializer">;
1956 def warn_extern_init : Warning<"'extern' variable has an initializer">;
1957 def err_variable_object_no_init : Error<
1958   "variable-sized object may not be initialized">;
1959 def err_array_init_list_required : Error<
1960   "initialization with '{...}' expected for array">;
1961 def err_excess_initializers : Error<
1962   "excess elements in %select{array|vector|scalar|union|struct}0 initializer">;
1963 def warn_excess_initializers : ExtWarn<
1964   "excess elements in %select{array|vector|scalar|union|struct}0 initializer">;
1965 def err_excess_initializers_in_char_array_initializer : Error<
1966   "excess elements in char array initializer">;
1967 def warn_excess_initializers_in_char_array_initializer : ExtWarn<
1968   "excess elements in char array initializer">;
1969 def warn_initializer_string_for_char_array_too_long : ExtWarn<
1970   "initializer-string for char array is too long">;
1971 def warn_missing_field_initializers : Warning<
1972   "missing field '%0' initializer">,
1973   InGroup<MissingFieldInitializers>, DefaultIgnore;
1974 def warn_braces_around_scalar_init : Warning<
1975   "braces around scalar initializer">;
1976 def warn_many_braces_around_scalar_init : ExtWarn<
1977   "too many braces around scalar initializer">;
1978 def err_empty_scalar_initializer : Error<"scalar initializer cannot be empty">;
1979 def err_illegal_initializer : Error<
1980   "illegal initializer (only variables can be initialized)">;
1981 def err_illegal_initializer_type : Error<"illegal initializer type %0">;
1982 def err_init_objc_class : Error<
1983   "cannot initialize Objective-C class type %0">;
1984 def err_implicit_empty_initializer : Error<
1985   "initializer for aggregate with no elements requires explicit braces">;
1986 def err_bitfield_has_negative_width : Error<
1987   "bit-field %0 has negative width (%1)">;
1988 def err_anon_bitfield_has_negative_width : Error<
1989   "anonymous bit-field has negative width (%0)">;
1990 def err_bitfield_has_zero_width : Error<"named bit-field %0 has zero width">;
1991 def err_bitfield_width_exceeds_type_size : Error<
1992   "size of bit-field %0 (%1 bits) exceeds size of its type (%2 bits)">;
1993 def err_anon_bitfield_width_exceeds_type_size : Error<
1994   "size of anonymous bit-field (%0 bits) exceeds size of its type (%1 bits)">;
1995   
1996 // Used by C++ which allows bit-fields that are wider than the type.
1997 def warn_bitfield_width_exceeds_type_size: Warning<
1998   "size of bit-field %0 (%1 bits) exceeds the size of its type; value will be "
1999   "truncated to %2 bits">;
2000 def warn_anon_bitfield_width_exceeds_type_size : Warning<
2001   "size of anonymous bit-field (%0 bits) exceeds size of its type; value will "
2002   "be truncated to %1 bits">;
2004 def warn_missing_braces : Warning<
2005   "suggest braces around initialization of subobject">,
2006   InGroup<DiagGroup<"missing-braces">>, DefaultIgnore;
2008 def err_redefinition_of_label : Error<"redefinition of label '%0'">;
2009 def err_undeclared_label_use : Error<"use of undeclared label '%0'">;
2010 def warn_unused_label : Warning<"unused label '%0'">,
2011   InGroup<UnusedLabel>, DefaultIgnore;
2013 def err_goto_into_protected_scope : Error<"goto into protected scope">;
2014 def err_switch_into_protected_scope : Error<
2015   "switch case is in protected scope">;
2016 def err_indirect_goto_without_addrlabel : Error<
2017   "indirect goto in function with no address-of-label expressions">;
2018 def err_indirect_goto_in_protected_scope : Error<
2019   "indirect goto might cross protected scopes">;
2020 def note_indirect_goto_target : Note<"possible target of indirect goto">;
2021 def note_protected_by_variable_init : Note<
2022   "jump bypasses variable initialization">;
2023 def note_protected_by_cleanup : Note<
2024   "jump bypasses initialization of variable with __attribute__((cleanup))">;
2025 def note_protected_by_vla_typedef : Note<
2026   "jump bypasses initialization of VLA typedef">;
2027 def note_protected_by_vla : Note<
2028   "jump bypasses initialization of variable length array">;
2029 def note_protected_by_objc_try : Note<
2030   "jump bypasses initialization of @try block">;
2031 def note_protected_by_objc_catch : Note<
2032   "jump bypasses initialization of @catch block">;
2033 def note_protected_by_objc_finally : Note<
2034   "jump bypasses initialization of @finally block">;
2035 def note_protected_by_objc_synchronized : Note<
2036   "jump bypasses initialization of @synchronized block">;
2037 def note_protected_by_cxx_try : Note<
2038   "jump bypasses initialization of try block">;
2039 def note_protected_by_cxx_catch : Note<
2040   "jump bypasses initialization of catch block">;
2041 def note_protected_by___block : Note<
2042   "jump bypasses setup of __block variable">;
2044 def note_exits_cleanup : Note<
2045   "jump exits scope of variable with __attribute__((cleanup))">;
2046 def note_exits_dtor : Note<
2047   "jump exits scope of variable with non-trivial destructor">;
2048 def note_exits___block : Note<
2049   "jump exits scope of __block variable">;
2050 def note_exits_objc_try : Note<
2051   "jump exits @try block">;
2052 def note_exits_objc_catch : Note<
2053   "jump exits @catch block">;
2054 def note_exits_objc_finally : Note<
2055   "jump exits @finally block">;
2056 def note_exits_objc_synchronized : Note<
2057   "jump exits @synchronized block">;
2058 def note_exits_cxx_try : Note<
2059   "jump exits try block">;
2060 def note_exits_cxx_catch : Note<
2061   "jump exits catch block">;
2063 def err_func_returning_array_function : Error<
2064   "function cannot return %select{array|function}0 type %1">;
2065 def err_field_declared_as_function : Error<"field %0 declared as a function">;
2066 def err_field_incomplete : Error<"field has incomplete type %0">;
2067 def ext_variable_sized_type_in_struct : ExtWarn<
2068   "field %0 with variable sized type %1 not at the end of a struct or class is"
2069   " a GNU extension">, InGroup<GNU>;
2071 def err_flexible_array_empty_struct : Error<
2072   "flexible array %0 not allowed in otherwise empty struct">;
2073 def err_flexible_array_has_nonpod_type : Error<
2074   "flexible array member %0 of non-POD element type %1">;
2075 def ext_flexible_array_in_struct : Extension<
2076   "%0 may not be nested in a struct due to flexible array member">;
2077 def ext_flexible_array_in_array : Extension<
2078   "%0 may not be used as an array element due to flexible array member">;
2079 def err_flexible_array_init_nonempty : Error<
2080   "non-empty initialization of flexible array member inside subobject">;
2081 def ext_flexible_array_empty_aggregate : Extension<
2082   "flexible array member %0 in otherwise empty %select{struct|class}1 "
2083   "is a Microsoft extension">, InGroup<Microsoft>;
2084 def ext_flexible_array_union : Extension<
2085   "flexible array member %0 in a union is a Microsoft extension">,
2086   InGroup<Microsoft>;
2088 def err_flexible_array_init_needs_braces : Error<
2089   "flexible array requires brace-enclosed initializer">;
2090 def err_illegal_decl_array_of_functions : Error<
2091   "'%0' declared as array of functions of type %1">;
2092 def err_illegal_decl_array_incomplete_type : Error<
2093   "array has incomplete element type %0">;
2094 def err_illegal_message_expr_incomplete_type : Error<
2095   "objective-c message has incomplete result type %0">;
2096 def err_illegal_decl_array_of_references : Error<
2097   "'%0' declared as array of references of type %1">;
2098 def err_array_star_outside_prototype : Error<
2099   "star modifier used outside of function prototype">;
2100 def err_illegal_decl_pointer_to_reference : Error<
2101   "'%0' declared as a pointer to a reference of type %1">;
2102 def err_illegal_decl_mempointer_to_reference : Error<
2103   "'%0' declared as a member pointer to a reference of type %1">;
2104 def err_illegal_decl_mempointer_to_void : Error<
2105   "'%0' declared as a member pointer to void">;
2106 def err_illegal_decl_mempointer_in_nonclass : Error<
2107   "'%0' does not point into a class">;
2108 def err_mempointer_in_nonclass_type : Error<
2109   "member pointer refers into non-class type %0">;
2110 def err_reference_to_void : Error<"cannot form a reference to 'void'">;
2111 def err_qualified_block_pointer_type : Error<
2112   "qualifier specification on block pointer type not allowed">;
2113 def err_nonfunction_block_type : Error<
2114   "block pointer to non-function type is invalid">;
2115 def err_return_block_has_expr : Error<"void block should not return a value">;
2116 def err_block_return_missing_expr : Error<
2117   "non-void block should return a value">;
2118 def err_block_with_return_type_requires_args : Error<
2119   "block with explicit return type requires argument list">;
2120 def err_func_def_incomplete_result : Error<
2121   "incomplete result type %0 in function definition">;
2123 // Expressions.
2124 def ext_sizeof_function_type : Extension<
2125   "invalid application of 'sizeof' to a function type">, InGroup<PointerArith>;
2126 def err_sizeof_alignof_overloaded_function_type : Error<
2127   "invalid application of '%select{sizeof|__alignof}0' to an overloaded "
2128   "function">;
2129 def ext_sizeof_void_type : Extension<
2130   "invalid application of '%0' to a void type">, InGroup<PointerArith>;
2131 def err_sizeof_alignof_incomplete_type : Error<
2132   "invalid application of '%select{sizeof|__alignof}0' to an incomplete type %1">;
2133 def err_sizeof_alignof_bitfield : Error<
2134   "invalid application of '%select{sizeof|__alignof}0' to bit-field">;
2135 def err_offsetof_incomplete_type : Error<
2136   "offsetof of incomplete type %0">;
2137 def err_offsetof_record_type : Error<
2138   "offsetof requires struct, union, or class type, %0 invalid">;
2139 def err_offsetof_array_type : Error<"offsetof requires array type, %0 invalid">;
2140 def ext_offsetof_extended_field_designator : Extension<
2141   "using extended field designator is an extension">;
2142 def warn_offsetof_non_pod_type : ExtWarn<"offset of on non-POD type %0">,
2143   InGroup<InvalidOffsetof>;
2144 def err_offsetof_bitfield : Error<"cannot compute offset of bit-field %0">;
2146 def warn_floatingpoint_eq : Warning<
2147   "comparing floating point with == or != is unsafe">,
2148   InGroup<DiagGroup<"float-equal">>, DefaultIgnore;
2150 def warn_division_by_zero : Warning<"division by zero is undefined">;
2151 def warn_remainder_by_zero : Warning<"remainder by zero is undefined">;
2152 def warn_shift_negative : Warning<"shift count is negative">;
2153 def warn_shift_gt_typewidth : Warning<"shift count >= width of type">;
2155 def warn_precedence_bitwise_rel : Warning<
2156   "%0 has lower precedence than %1; %1 will be evaluated first">,
2157   InGroup<Parentheses>;
2158 def note_precedence_bitwise_first : Note<
2159   "place parentheses around the %0 expression to evaluate it first">;
2160 def note_precedence_bitwise_silence : Note<
2161   "place parentheses around the %0 expression to silence this warning">;
2163 def warn_logical_instead_of_bitwise : Warning<
2164   "use of logical %0 with constant operand; switch to bitwise %1 or "
2165   "remove constant">, InGroup<DiagGroup<"constant-logical-operand">>;
2167 def warn_logical_and_in_logical_or : Warning<
2168   "'&&' within '||'">, InGroup<LogicalOpParentheses>;
2169 def note_logical_and_in_logical_or_silence : Note<
2170   "place parentheses around the '&&' expression to silence this warning">;
2172 def err_sizeof_nonfragile_interface : Error<
2173   "invalid application of '%select{alignof|sizeof}1' to interface %0 in "
2174   "non-fragile ABI">;
2175 def err_atdef_nonfragile_interface : Error<
2176   "invalid application of @defs in non-fragile ABI">;
2177 def err_subscript_nonfragile_interface : Error<
2178   "subscript requires size of interface %0, which is not constant in "
2179   "non-fragile ABI">;
2181 def err_arithmetic_nonfragile_interface : Error<
2182   "arithmetic on pointer to interface %0, which is not a constant size in "
2183   "non-fragile ABI">;
2186 def ext_subscript_non_lvalue : Extension<
2187   "ISO C90 does not allow subscripting non-lvalue array">;
2188 def err_typecheck_subscript_value : Error<
2189   "subscripted value is not an array, pointer, or vector">;
2190 def err_typecheck_subscript_not_integer : Error<
2191   "array subscript is not an integer">;
2192 def err_subscript_function_type : Error<
2193   "subscript of pointer to function type %0">;
2194 def err_subscript_incomplete_type : Error<
2195   "subscript of pointer to incomplete type %0">;
2196 def err_typecheck_member_reference_struct_union : Error<
2197   "member reference base type %0 is not a structure or union">;
2198 def err_typecheck_member_reference_ivar : Error<
2199   "%0 does not have a member named %1">;
2200 def err_typecheck_member_reference_arrow : Error<
2201   "member reference type %0 is not a pointer">;
2202 def err_typecheck_member_reference_suggestion : Error<
2203   "member reference type %0 is %select{a|not a}1 pointer; maybe you meant to use '%select{->|.}1'?">;
2204 def err_typecheck_member_reference_type : Error<
2205   "cannot refer to type member %0 in %1 with '%select{.|->}2'">;
2206 def err_typecheck_member_reference_unknown : Error<
2207   "cannot refer to member %0 in %1 with '%select{.|->}2'">;
2208 def err_member_reference_needs_call : Error<
2209   "base of member reference has function type %0; perhaps you meant to call "
2210   "this function with '()'?">;
2211 def warn_subscript_is_char : Warning<"array subscript is of type 'char'">,
2212   InGroup<CharSubscript>, DefaultIgnore;
2214 def err_typecheck_incomplete_tag : Error<"incomplete definition of type %0">;
2215 def err_no_member : Error<"no member named %0 in %1">;
2217 def err_member_redeclared : Error<"class member cannot be redeclared">;
2218 def err_member_name_of_class : Error<"member %0 has the same name as its class">;
2219 def err_member_def_undefined_record : Error<
2220   "out-of-line definition of %0 from class %1 without definition">;
2221 def err_member_def_does_not_match : Error<
2222   "out-of-line definition of %0 does not match any declaration in %1">;
2223 def err_nonstatic_member_out_of_line : Error<
2224   "non-static data member defined out-of-line">;
2225 def err_nonstatic_flexible_variable : Error<
2226   "non-static initialization of a variable with flexible array member">;
2227 def err_qualified_typedef_declarator : Error<
2228   "typedef declarator cannot be qualified">;
2229 def err_qualified_param_declarator : Error<
2230   "parameter declarator cannot be qualified">;
2231 def ext_out_of_line_declaration : ExtWarn<
2232   "out-of-line declaration of a member must be a definition">,
2233   InGroup<OutOfLineDeclaration>, DefaultError;
2234 def warn_member_extra_qualification : Warning<
2235   "extra qualification on member %0">;
2236 def err_member_qualification : Error<
2237   "non-friend class member %0 cannot have a qualified name">;  
2238 def note_member_def_close_match : Note<"member declaration nearly matches">;
2239 def err_typecheck_ivar_variable_size : Error<
2240   "instance variables must have a constant size">;
2241 def err_ivar_reference_type : Error<
2242   "instance variables cannot be of reference type">;
2243 def err_typecheck_illegal_increment_decrement : Error<
2244   "cannot %select{decrement|increment}1 value of type %0">;
2245 def err_typecheck_arithmetic_incomplete_type : Error<
2246   "arithmetic on pointer to incomplete type %0">;
2247 def err_typecheck_pointer_arith_function_type : Error<
2248   "arithmetic on pointer to function type %0">;
2249 def err_typecheck_pointer_arith_void_type : Error<
2250   "arithmetic on pointer to void type">;
2251 def err_typecheck_decl_incomplete_type : Error<
2252   "variable has incomplete type %0">;
2253 def ext_typecheck_decl_incomplete_type : ExtWarn<
2254   "tentative definition of variable with internal linkage has incomplete non-array type %0">;
2255 def err_tentative_def_incomplete_type : Error<
2256   "tentative definition has type %0 that is never completed">;
2257 def err_tentative_def_incomplete_type_arr : Error<
2258   "tentative definition has array of type %0 that is never completed">;
2259 def warn_tentative_incomplete_array : Warning<
2260   "tentative array definition assumed to have one element">;
2261 def err_typecheck_incomplete_array_needs_initializer : Error<
2262   "definition of variable with array type needs an explicit size "
2263   "or an initializer">;
2264 def err_array_init_not_init_list : Error<
2265   "array initializer must be an initializer "
2266   "list%select{| or string literal}0">;
2267 def warn_deprecated_string_literal_conversion : Warning<
2268   "conversion from string literal to %0 is deprecated">, InGroup<Deprecated>;
2269 def err_realimag_invalid_type : Error<"invalid type %0 to %1 operator">;
2270 def err_typecheck_sclass_fscope : Error<
2271   "illegal storage class on file-scoped variable">;
2272 def err_unsupported_global_register : Error<
2273   "global register variables are not supported">;
2274 def err_typecheck_sclass_func : Error<"illegal storage class on function">;
2275 def err_static_block_func : Error<
2276   "function declared in block scope cannot have 'static' storage class">;
2277 def err_typecheck_address_of : Error<"address of %0 requested">;
2278 def ext_typecheck_addrof_void : Extension<
2279   "ISO C forbids taking the address of an expression of type 'void'">;
2280 def err_unqualified_pointer_member_function : Error<
2281   "must explicitly qualify name of member function when taking its address">;
2282 def err_invalid_form_pointer_member_function : Error<
2283   "cannot create a non-constant pointer to member function">;
2284 def err_parens_pointer_member_function : Error<
2285   "cannot parenthesize the name of a method when forming a member pointer">;
2286 def err_typecheck_invalid_lvalue_addrof : Error<
2287   "address expression must be an lvalue or a function designator">;
2288 def ext_typecheck_addrof_class_temporary : ExtWarn<
2289   "taking the address of a temporary object of type %0">, 
2290   InGroup<DiagGroup<"address-of-temporary">>, DefaultError;
2291 def err_typecheck_addrof_class_temporary : Error<
2292   "taking the address of a temporary object of type %0">;
2293 def err_typecheck_unary_expr : Error<
2294   "invalid argument type %0 to unary expression">;
2295 def err_typecheck_indirection_requires_pointer : Error<
2296   "indirection requires pointer operand (%0 invalid)">;
2297 def warn_indirection_through_null : Warning<
2298   "indirection of non-volatile null pointer will be deleted, not trap">;
2299 def note_indirection_through_null : Note<
2300   "consider using __builtin_trap() or qualifying pointer with 'volatile'">;
2302 def err_assignment_requires_nonfragile_object : Error<
2303   "cannot assign to class object in non-fragile ABI (%0 invalid)">;
2304 def err_direct_interface_unsupported : Error<
2305   "indirection to an interface is not supported (%0 invalid)">;
2306 def err_typecheck_invalid_operands : Error<
2307   "invalid operands to binary expression (%0 and %1)">;
2308 def err_typecheck_sub_ptr_object : Error<
2309   "subtraction of pointer %0 requires pointee to be a complete object type">;
2310 def err_typecheck_sub_ptr_compatible : Error<
2311   "%0 and %1 are not pointers to compatible types">;
2312 def ext_typecheck_ordered_comparison_of_pointer_integer : ExtWarn<
2313   "ordered comparison between pointer and integer (%0 and %1)">;
2314 def ext_typecheck_ordered_comparison_of_pointer_and_zero : Extension<
2315   "ordered comparison between pointer and zero (%0 and %1) is an extension">;
2316 def ext_typecheck_ordered_comparison_of_function_pointers : ExtWarn<
2317   "ordered comparison of function pointers (%0 and %1)">;
2318 def ext_typecheck_comparison_of_fptr_to_void : Extension<
2319   "equality comparison between function pointer and void pointer (%0 and %1)">;
2320 def err_typecheck_comparison_of_fptr_to_void : Error<
2321   "equality comparison between function pointer and void pointer (%0 and %1)">;
2322 def ext_typecheck_comparison_of_pointer_integer : ExtWarn<
2323   "comparison between pointer and integer (%0 and %1)">;
2324 def err_typecheck_comparison_of_pointer_integer : Error<
2325   "comparison between pointer and integer (%0 and %1)">;
2326 def ext_typecheck_comparison_of_distinct_pointers : ExtWarn<
2327   "comparison of distinct pointer types (%0 and %1)">;
2328 def ext_typecheck_cond_incompatible_operands : ExtWarn<
2329   "incompatible operand types (%0 and %1)">;
2330 def err_typecheck_comparison_of_distinct_pointers : Error<
2331   "comparison of distinct pointer types (%0 and %1)">;
2332 def ext_typecheck_comparison_of_distinct_pointers_nonstandard : ExtWarn<
2333   "comparison of distinct pointer types (%0 and %1) uses non-standard "
2334   "composite pointer type %2">;
2335 def err_typecheck_vector_comparison : Error<
2336   "comparison of vector types (%0 and %1) not supported yet">;
2337 def err_typecheck_assign_const : Error<"read-only variable is not assignable">;
2338 def err_stmtexpr_file_scope : Error<
2339   "statement expression not allowed at file scope">;
2340 def warn_mixed_sign_comparison : Warning<
2341   "comparison of integers of different signs: %0 and %1">,
2342   InGroup<SignCompare>, DefaultIgnore;
2343 def warn_mixed_sign_conditional : Warning<
2344   "operands of ? are integers of different signs: %0 and %1">,
2345   InGroup<SignCompare>, DefaultIgnore;
2346 def warn_lunsigned_always_true_comparison : Warning<
2347   "comparison of unsigned%select{| enum}2 expression %0 is always %1">,
2348   InGroup<TautologicalCompare>;
2349 def warn_runsigned_always_true_comparison : Warning<
2350   "comparison of %0 unsigned%select{| enum}2 expression is always %1">,
2351   InGroup<TautologicalCompare>;
2353 def err_invalid_this_use : Error<
2354   "invalid use of 'this' outside of a nonstatic member function">;
2355 def err_invalid_member_use_in_static_method : Error<
2356   "invalid use of member %0 in static member function">;
2357 def err_invalid_qualified_function_type : Error<
2358   "type qualifier is not allowed on this function">;
2359 def err_invalid_qualified_function_pointer : Error<
2360   "type qualifier is not allowed on this function %select{pointer|reference}0">;
2361 def err_invalid_qualified_typedef_function_type_use : Error<
2362   "a qualified function type cannot be used to declare a "
2363   "%select{static member|nonmember}0 function">;
2365 def err_invalid_non_static_member_use : Error<
2366   "invalid use of nonstatic data member %0">;
2367 def err_invalid_incomplete_type_use : Error<
2368   "invalid use of incomplete type %0">;
2369 def err_builtin_func_cast_more_than_one_arg : Error<
2370   "function-style cast to a builtin type can only take one argument">;
2371 def err_builtin_direct_init_more_than_one_arg : Error<
2372   "initializer of a builtin type can only take one argument">;
2373 def err_value_init_for_array_type : Error<
2374   "array types cannot be value-initialized">;
2375 def warn_format_nonliteral_noargs : Warning<
2376   "format string is not a string literal (potentially insecure)">,
2377   InGroup<FormatSecurity>;
2378 def warn_format_nonliteral : Warning<
2379   "format string is not a string literal">,
2380   InGroup<FormatNonLiteral>, DefaultIgnore;
2382 def err_unexpected_interface : Error<
2383   "unexpected interface name %0: expected expression">;
2384 def err_ref_non_value : Error<"%0 does not refer to a value">;
2385 def err_ref_vm_type : Error<
2386   "cannot refer to declaration with a variably modified type inside block">;
2387 def err_ref_array_type : Error<
2388   "cannot refer to declaration with an array type inside block">;
2389 def err_property_not_found : Error<
2390   "property %0 not found on object of type %1">;
2391 def err_duplicate_property : Error<
2392   "property has a previous declaration">;
2393 def ext_gnu_void_ptr : Extension<
2394   "use of GNU void* extension">, InGroup<PointerArith>;
2395 def ext_gnu_ptr_func_arith : Extension<
2396   "arithmetic on pointer to function type %0 is a GNU extension">,
2397   InGroup<PointerArith>;
2398 def error_readonly_property_assignment : Error<
2399   "assigning to property with 'readonly' attribute not allowed">;
2400 def ext_integer_increment_complex : Extension<
2401   "ISO C does not support '++'/'--' on complex integer type %0">;
2402 def ext_integer_complement_complex : Extension<
2403   "ISO C does not support '~' for complex conjugation of %0">;
2404 def error_nosetter_property_assignment : Error<
2405   "setter method is needed to assign to object using property" " assignment syntax">;
2406 def error_no_subobject_property_setting : Error<
2407   "expression is not assignable">;
2409 def ext_freestanding_complex : Extension<
2410   "complex numbers are an extension in a freestanding C99 implementation">;
2412 // FIXME: Remove when we support imaginary.
2413 def err_imaginary_not_supported : Error<"imaginary types are not supported">;
2415 // Obj-c expressions
2416 def warn_root_inst_method_not_found : Warning<
2417   "instance method %0 is being used on 'Class' which is not in the root class">;
2418 def warn_class_method_not_found : Warning<
2419   "method %objcclass0 not found (return type defaults to 'id')">;
2420 def warn_inst_method_not_found : Warning<
2421   "method %objcinstance0 not found (return type defaults to 'id')">;
2422 def error_no_super_class_message : Error<
2423   "no @interface declaration found in class messaging of %0">;
2424 def error_no_super_class : Error<
2425   "no super class declared in @interface for %0">;
2426 def err_invalid_receiver_to_message : Error<
2427   "invalid receiver to message expression">;
2428 def err_invalid_receiver_to_message_super : Error<
2429   "'super' is only valid in a method body">;
2430 def err_invalid_receiver_class_message : Error<
2431   "receiver type %0 is not an Objective-C class">;
2432 def err_missing_open_square_message_send : Error<
2433   "missing '[' at start of message send expression">;
2434 def warn_bad_receiver_type : Warning<
2435   "receiver type %0 is not 'id' or interface pointer, consider "
2436   "casting it to 'id'">;
2437 def err_bad_receiver_type : Error<"bad receiver type %0">;
2438 def err_unknown_receiver_suggest : Error<
2439   "unknown receiver %0; did you mean %1?">;
2440 def error_objc_throw_expects_object : Error<
2441   "@throw requires an Objective-C object type (%0 invalid)">;
2442 def error_objc_synchronized_expects_object : Error<
2443   "@synchronized requires an Objective-C object type (%0 invalid)">;
2444 def error_rethrow_used_outside_catch : Error<
2445   "@throw (rethrow) used outside of a @catch block">;
2446 def err_attribute_multiple_objc_gc : Error<
2447   "multiple garbage collection attributes specified for type">;
2448 def err_catch_param_not_objc_type : Error<
2449   "@catch parameter is not a pointer to an interface type">;
2450 def err_illegal_qualifiers_on_catch_parm : Error<
2451   "illegal qualifiers on @catch parameter">;
2452 def err_storage_spec_on_catch_parm : Error<
2453   "@catch parameter cannot have storage specifier %select{|'typedef'|'extern'|"
2454   "'static'|'auto'|'register'|'__private_extern__'|'mutable'}0">;
2455 def warn_register_objc_catch_parm : Warning<
2456   "'register' storage specifier on @catch parameter will be ignored">;
2457 def err_qualified_objc_catch_parm : Error<
2458   "@catch parameter declarator cannot be qualified">;
2459 def err_objc_pointer_cxx_catch_gnu : Error<
2460   "can't catch Objective C exceptions in C++ in the GNU runtime">;
2461 def err_objc_pointer_cxx_catch_fragile : Error<
2462   "can't catch Objective C exceptions in C++ in the non-unified "
2463   "exception model">;
2464 def err_objc_object_catch : Error<
2465   "can't catch an Objective C object by value">;
2467 def warn_setter_getter_impl_required : Warning<
2468   "property %0 requires method %1 to be defined - "
2469   "use @synthesize, @dynamic or provide a method implementation">;
2470 def warn_setter_getter_impl_required_in_category : Warning<
2471   "property %0 requires method %1 to be defined - "
2472   "use @dynamic or provide a method implementation in category">;
2473 def note_property_impl_required : Note<
2474   "implementation is here">;
2475 def note_parameter_named_here : Note<
2476   "passing argument to parameter %0 here">;
2477 def note_parameter_here : Note<
2478   "passing argument to parameter here">;
2480 // C++ casts
2481 // These messages adhere to the TryCast pattern: %0 is an int specifying the
2482 // cast type, %1 is the source type, %2 is the destination type.
2483 def err_bad_reinterpret_cast_overload : Error<
2484   "reinterpret_cast cannot resolve overloaded function %0 to type %1">;
2486 def err_bad_static_cast_overload : Error<
2487   "address of overloaded function %0 cannot be static_cast to type %1">;
2489 def err_bad_cxx_cast_generic : Error<
2490   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
2491   "functional-style cast}0 from %1 to %2 is not allowed">;
2492 def err_bad_cxx_cast_rvalue : Error<
2493   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
2494   "functional-style cast}0 from rvalue to reference type %2">;
2495 def err_bad_cxx_cast_const_away : Error<
2496   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
2497   "functional-style cast}0 from %1 to %2 casts away constness">;
2498 def err_bad_const_cast_dest : Error<
2499   "%select{const_cast||||C-style cast|functional-style cast}0 to %2, "
2500   "which is not a reference, pointer-to-object, or pointer-to-data-member">;
2501 def ext_cast_fn_obj : Extension<
2502   "cast between pointer-to-function and pointer-to-object is an extension">;
2503 def err_bad_reinterpret_cast_small_int : Error<
2504   "cast from pointer to smaller type %2 loses information">;
2505 def err_bad_cxx_cast_vector_to_scalar_different_size : Error<
2506   "%select{||reinterpret_cast||C-style cast|}0 from vector %1 " 
2507   "to scalar %2 of different size">;
2508 def err_bad_cxx_cast_scalar_to_vector_different_size : Error<
2509   "%select{||reinterpret_cast||C-style cast|}0 from scalar %1 " 
2510   "to vector %2 of different size">;
2511 def err_bad_cxx_cast_vector_to_vector_different_size : Error<
2512   "%select{||reinterpret_cast||C-style cast|}0 from vector %1 " 
2513   "to vector %2 of different size">;
2514 def err_bad_lvalue_to_rvalue_cast : Error<
2515   "cannot cast from lvalue of type %1 to rvalue reference type %2; types are "
2516   "not compatible">;
2517 def err_bad_static_cast_pointer_nonpointer : Error<
2518   "cannot cast from type %1 to pointer type %2">;
2519 def err_bad_static_cast_member_pointer_nonmp : Error<
2520   "cannot cast from type %1 to member pointer type %2">;
2521 def err_bad_cxx_cast_member_pointer_size : Error<
2522   "cannot %select{||reinterpret_cast||C-style cast|}0 from member pointer "
2523   "type %1 to member pointer type %2 of different size">;
2524 def err_bad_static_cast_incomplete : Error<"%0 is an incomplete type">;
2526 // These messages don't adhere to the pattern.
2527 // FIXME: Display the path somehow better.
2528 def err_ambiguous_base_to_derived_cast : Error<
2529   "ambiguous cast from base %0 to derived %1:%2">;
2530 def err_static_downcast_via_virtual : Error<
2531   "cannot cast %0 to %1 via virtual base %2">;
2532 def err_downcast_from_inaccessible_base : Error<
2533   "cannot cast %select{private|protected}2 base class %1 to %0">;
2534 def err_upcast_to_inaccessible_base : Error<
2535   "cannot cast %0 to its %select{private|protected}2 base class %1">;
2536 def err_bad_dynamic_cast_not_ref_or_ptr : Error<
2537   "%0 is not a reference or pointer">;
2538 def err_bad_dynamic_cast_not_class : Error<"%0 is not a class">;
2539 def err_bad_dynamic_cast_incomplete : Error<"%0 is an incomplete type">;
2540 def err_bad_dynamic_cast_not_ptr : Error<"%0 is not a pointer">;
2541 def err_bad_dynamic_cast_not_polymorphic : Error<"%0 is not polymorphic">;
2543 // Other C++ expressions
2544 def err_need_header_before_typeid : Error<
2545   "you need to include <typeinfo> before using the 'typeid' operator">;
2546 def err_need_header_before_ms_uuidof : Error<
2547   "you need to include <guiddef.h> before using the '__uuidof' operator">;
2548 def err_incomplete_typeid : Error<"'typeid' of incomplete type %0">;
2549 def err_static_illegal_in_new : Error<
2550   "the 'static' modifier for the array size is not legal in new expressions">;
2551 def err_array_new_needs_size : Error<
2552   "array size must be specified in new expressions">;
2553 def err_bad_new_type : Error<
2554   "cannot allocate %select{function|reference}1 type %0 with new">;
2555 def err_new_incomplete_type : Error<
2556   "allocation of incomplete type %0">;
2557 def err_new_array_nonconst : Error<
2558   "only the first dimension of an allocated array may have dynamic size">;
2559 def err_new_array_init_args : Error<
2560   "array 'new' cannot have initialization arguments">;
2561 def ext_new_paren_array_nonconst : ExtWarn<
2562   "when type is in parentheses, array cannot have dynamic size">;
2563 def err_placement_new_non_placement_delete : Error<
2564   "'new' expression with placement arguments refers to non-placement "
2565   "'operator delete'">;
2566 def err_array_size_not_integral : Error<
2567   "array size expression must have integral or enumerated type, not %0">;
2568 def err_array_size_incomplete_type : Error<
2569   "array size expression has incomplete class type %0">;
2570 def err_array_size_explicit_conversion : Error<
2571   "array size expression of type %0 requires explicit conversion to type %1">;
2572 def note_array_size_conversion : Note<
2573   "conversion to %select{integral|enumeration}0 type %1 declared here">;
2574 def err_array_size_ambiguous_conversion : Error<
2575   "ambiguous conversion of array size expression of type %0 to an integral or "
2576   "enumeration type">;
2577 def ext_array_size_conversion : Extension<
2578   "implicit conversion from array size expression of type %0 to "
2579   "%select{integral|enumeration}1 type %2 is a C++0x extension">,
2580   InGroup<CXX0x>;
2581   
2582 def err_default_init_const : Error<
2583   "default initialization of an object of const type %0"
2584   "%select{| requires a user-provided default constructor}1">;
2585 def err_delete_operand : Error<"cannot delete expression of type %0">;
2586 def ext_delete_void_ptr_operand : ExtWarn<
2587   "cannot delete expression with pointer-to-'void' type %0">;
2588 def err_ambiguous_delete_operand : Error<"ambiguous conversion of delete "
2589                                          "expression of type %0 to a pointer">;
2590 def warn_delete_incomplete : Warning<
2591   "deleting pointer to incomplete type %0 may cause undefined behaviour">;
2592 def err_delete_incomplete_class_type : Warning<
2593   "deleting incomplete class type %0; no conversions to pointer type">;
2594 def warn_delete_array_type : Warning<
2595   "'delete' applied to a pointer-to-array type %0 treated as delete[]">;
2596 def err_no_suitable_delete_member_function_found : Error<
2597   "no suitable member %0 in %1">;
2598 def err_ambiguous_suitable_delete_member_function_found : Error<
2599   "multiple suitable %0 functions in %1">;
2600 def note_member_declared_here : Note<
2601   "member %0 declared here">;
2602 def err_decrement_bool : Error<"cannot decrement expression of type bool">;
2603 def warn_increment_bool : Warning<
2604   "incrementing expression of type bool is deprecated">, InGroup<Deprecated>;
2605 def ext_catch_incomplete_ptr : ExtWarn<
2606   "ISO C++ forbids catching a pointer to incomplete type %0">;
2607 def ext_catch_incomplete_ref : ExtWarn<
2608   "ISO C++ forbids catching a reference to incomplete type %0">;
2609 def err_catch_incomplete : Error<"cannot catch incomplete type %0">;
2610 def err_catch_rvalue_ref : Error<"cannot catch exceptions by rvalue reference">;
2611 def err_qualified_catch_declarator : Error<
2612   "exception declarator cannot be qualified">;
2613 def err_early_catch_all : Error<"catch-all handler must come last">;
2614 def err_bad_memptr_rhs : Error<
2615   "right hand operand to %0 has non pointer-to-member type %1">;
2616 def err_memptr_rhs_to_incomplete : Error<
2617   "cannot dereference pointer into incomplete class type %0">;
2618 def err_bad_memptr_lhs : Error<
2619   "left hand operand to %0 must be a %select{|pointer to }1class "
2620   "compatible with the right hand operand, but is %2">;
2621 def warn_exception_caught_by_earlier_handler : Warning<
2622   "exception of type %0 will be caught by earlier handler">;
2623 def note_previous_exception_handler : Note<"for type %0">;
2625 def err_conditional_void_nonvoid : Error<
2626   "%select{left|right}1 operand to ? is void, but %select{right|left}1 operand "
2627   "is of type %0">;
2628 def err_conditional_ambiguous : Error<
2629   "conditional expression is ambiguous; %0 can be converted to %1 "
2630   "and vice versa">;
2631 def err_conditional_ambiguous_ovl : Error<
2632   "conditional expression is ambiguous; %0 and %1 can be converted to several "
2633   "common types">;
2635 def err_throw_incomplete : Error<
2636   "cannot throw object of incomplete type %0">;
2637 def err_throw_incomplete_ptr : Error<
2638   "cannot throw pointer to object of incomplete type %0">;
2639 def err_return_in_constructor_handler : Error<
2640   "return in the catch of a function try block of a constructor is illegal">;
2642 def err_operator_arrow_circular : Error<
2643   "circular pointer delegation detected">;
2644 def err_pseudo_dtor_base_not_scalar : Error<
2645   "object expression of non-scalar type %0 cannot be used in a "
2646   "pseudo-destructor expression">;
2647 def err_pseudo_dtor_type_mismatch : Error<
2648   "the type of object expression (%0) does not match the type being destroyed "
2649   "(%1) in pseudo-destructor expression">;
2650 def err_pseudo_dtor_call_with_args : Error<
2651   "call to pseudo-destructor cannot have any arguments">;
2652 def err_dtor_expr_without_call : Error<
2653   "%select{destructor reference|pseudo-destructor expression}0 must be "
2654   "called immediately with '()'">;
2655 def err_pseudo_dtor_destructor_non_type : Error<
2656   "%0 does not refer to a type name in pseudo-destructor expression; expected "
2657   "the name of type %1">;
2658 def err_pseudo_dtor_template : Error<
2659   "specialization of template %0 does not refer to a scalar type in pseudo-"
2660   "destructor expression">;
2661 def err_invalid_use_of_function_type : Error<
2662   "a function type is not allowed here">;
2663 def err_invalid_use_of_array_type : Error<"an array type is not allowed here">;
2664 def err_type_defined_in_condition : Error<
2665   "types may not be defined in conditions">;
2666 def err_typecheck_bool_condition : Error<
2667   "value of type %0 is not contextually convertible to 'bool'">;
2668 def err_typecheck_ambiguous_condition : Error<
2669   "conversion from %0 to %1 is ambiguous">;
2670 def err_typecheck_nonviable_condition : Error<
2671   "no viable conversion from %0 to %1">;
2672 def err_typecheck_deleted_function : Error<
2673   "conversion function from %0 to %1 invokes a deleted function">;
2674   
2675 def err_expected_class_or_namespace : Error<"expected a class or namespace">;
2676 def err_missing_qualified_for_redecl : Error<
2677   "must qualify the name %0 to declare %q1 in this scope">;
2678 def err_invalid_declarator_scope : Error<
2679   "definition or redeclaration of %0 not in a namespace enclosing %1">;
2680 def err_invalid_declarator_global_scope : Error<
2681   "definition or redeclaration of %0 cannot name the global scope">;
2682 def err_invalid_declarator_in_function : Error<
2683   "definition or redeclaration of %0 not allowed inside a function">;
2684 def err_not_tag_in_scope : Error<
2685   "no %select{struct|union|class|enum}0 named %1 in %2">;
2687 def err_cannot_form_pointer_to_member_of_reference_type : Error<
2688   "cannot form a pointer-to-member to member %0 of reference type %1">;
2689 def err_invalid_use_of_bound_member_func : Error<
2690   "a bound member function may only be used to call it">;
2691 def err_incomplete_object_call : Error<
2692   "incomplete type in call to object of type %0">;
2693 def err_incomplete_pointer_to_member_return : Error<
2694   "incomplete return type %0 of pointer-to-member constant">;
2696 def warn_condition_is_assignment : Warning<"using the result of an "
2697   "assignment as a condition without parentheses">,
2698   InGroup<Parentheses>;
2699 // Completely identical except off by default.
2700 def warn_condition_is_idiomatic_assignment : Warning<"using the result "
2701   "of an assignment as a condition without parentheses">,
2702   InGroup<DiagGroup<"idiomatic-parentheses">>, DefaultIgnore;
2703 def note_condition_assign_to_comparison : Note<
2704   "use '==' to turn this assignment into an equality comparison">;
2705 def note_condition_assign_silence : Note<
2706   "place parentheses around the assignment to silence this warning">;
2708 def warn_synthesized_ivar_access : Warning<
2709   "direct access of synthesized ivar by using property access %0">,
2710   InGroup<NonfragileAbi2>, DefaultIgnore;
2711 def warn_ivar_variable_conflict : Warning<
2712   "when default property synthesis is on, "
2713   "%0 lookup will access property ivar instead of global variable">, 
2714   InGroup<NonfragileAbi2>;
2715 def note_global_declared_at : Note<"global variable declared here">;
2717 // assignment related diagnostics (also for argument passing, returning, etc).
2718 // In most of these diagnostics the %2 is a value from the
2719 // Sema::AssignmentAction enumeration
2720 def err_typecheck_convert_incompatible : Error<
2721   "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
2722   " %0 "
2723   "%select{from incompatible type|to parameter of incompatible type|"
2724   "from a function with incompatible result type|to incompatible type|"
2725   "with an expression of incompatible type|to parameter of incompatible type|"
2726   "to incompatible type}2 %1">;
2727 def warn_incompatible_qualified_id : Warning<
2728   "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
2729   " %0 "
2730   "%select{from incompatible type|to parameter of incompatible type|"
2731   "from a function with incompatible result type|to incompatible type|"
2732   "with an expression of incompatible type|to parameter of incompatible type|"
2733   "to incompatible type}2 %1">;
2734 def ext_typecheck_convert_pointer_int : ExtWarn<
2735   "incompatible pointer to integer conversion "
2736   "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
2737   " %0 "
2738   "%select{from|to parameter of type|from a function with result type|to type|"
2739   "with an expression of type|to parameter of type|to type}2 %1">;
2740 def ext_typecheck_convert_int_pointer : ExtWarn<
2741   "incompatible integer to pointer conversion "
2742   "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
2743   " %0 "
2744   "%select{from|to parameter of type|from a function with result type|to type|"
2745   "with an expression of type|to parameter of type|to type}2 %1">;
2746 def ext_typecheck_convert_pointer_void_func : Extension<
2747   "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
2748   " %0 "
2749   "%select{from|to parameter of type|from a function with result type|to type|"
2750   "with an expression of type|to parameter of type|to type}2 %1 "
2751   "converts between void pointer and function pointer">;
2752 def ext_typecheck_convert_incompatible_pointer_sign : ExtWarn<
2753   "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
2754   " %0 "
2755   "%select{from|to parameter of type|from a function with result type|to type|"
2756   "with an expression of type|to parameter of type|to type}2 %1 "
2757   "converts between pointers to integer types with different sign">,
2758   InGroup<DiagGroup<"pointer-sign">>;
2759 def ext_typecheck_convert_incompatible_pointer : ExtWarn<
2760   "incompatible pointer types "
2761   "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
2762   " %0 "
2763   "%select{from|to parameter of type|from a function with result type|to type|"
2764   "with an expression of type|to parameter of type|to type}2 %1">;
2765 def ext_typecheck_convert_discards_qualifiers : ExtWarn<
2766   "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
2767   " %0 "
2768   "%select{from|to parameter of type|from a function with result type|to type|"
2769   "with an expression of type|to parameter of type|to type}2 %1 discards "
2770   "qualifiers">;
2771 def ext_nested_pointer_qualifier_mismatch : ExtWarn<
2772   "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
2773   " %0 "
2774   "%select{from|to parameter of type|from a function with result type|to type|"
2775   "with an expression of type|to parameter of type|to type}2 %1 discards "
2776   "qualifiers in nested pointer types">;
2777 def warn_incompatible_vectors : Warning<
2778   "incompatible vector types "
2779   "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
2780   " %0 "
2781   "%select{from|to parameter of type|from a function with result type|to type|"
2782   "with an expression of type|to parameter of type|to type}2 %1">,
2783   InGroup<VectorConversions>, DefaultIgnore;
2784 def err_int_to_block_pointer : Error<
2785   "invalid block pointer conversion "
2786   "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
2787   " %0 "
2788   "%select{from|to parameter of type|from a function with result type|to type|"
2789   "with an expression of type|to parameter of type|to type}2 %1">;
2790 def err_typecheck_convert_incompatible_block_pointer : Error<
2791   "incompatible block pointer types "
2792   "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
2793   " %0 "
2794   "%select{from|to parameter of type|from a function with result type|to type|"
2795   "with an expression of type|to parameter of type|to type}2 %1">;
2796   
2797 def err_typecheck_convert_ambiguous : Error<
2798   "ambiguity in initializing value of type %0 with initializer of type %1">;
2799 def err_cannot_initialize_decl_noname : Error<
2800   "cannot initialize a value of type %0 with an %select{rvalue|lvalue}1 "
2801   "of type %2">;
2802 def err_cannot_initialize_decl : Error<
2803   "cannot initialize %0 with an %select{rvalue|lvalue}1 of type %2">;
2804 def err_typecheck_comparison_of_distinct_blocks : Error<
2805   "comparison of distinct block types (%0 and %1)">;
2807 def err_typecheck_array_not_modifiable_lvalue : Error<
2808   "array type %0 is not assignable">;
2809 def err_typecheck_non_object_not_modifiable_lvalue : Error<
2810   "non-object type %0 is not assignable">;
2811 def err_typecheck_expression_not_modifiable_lvalue : Error<
2812   "expression is not assignable">;
2813 def err_typecheck_incomplete_type_not_modifiable_lvalue : Error<
2814   "incomplete type %0 is not assignable">;
2815 def err_typecheck_lvalue_casts_not_supported : Error<
2816   "assignment to cast is illegal, lvalue casts are not supported">;
2818 def err_typecheck_duplicate_vector_components_not_mlvalue : Error<
2819   "vector is not assignable (contains duplicate components)">;
2820 def err_block_decl_ref_not_modifiable_lvalue : Error<
2821   "variable is not assignable (missing __block type specifier)">;
2822 def err_typecheck_call_not_function : Error<
2823   "called object type %0 is not a function or function pointer">;
2824 def err_call_incomplete_return : Error<
2825   "calling function with incomplete return type %0">;
2826 def err_call_function_incomplete_return : Error<
2827   "calling %0 with incomplete return type %1">;
2828 def note_function_with_incomplete_return_type_declared_here : Note<
2829   "%0 declared here">;
2830 def err_call_incomplete_argument : Error<
2831   "argument type %0 is incomplete">;
2832 def err_typecheck_call_too_few_args : Error<
2833   "too few arguments to %select{function|block|method}0 call, "
2834   "expected %1, have %2">;
2835 def err_typecheck_call_too_few_args_at_least : Error<
2836   "too few arguments to %select{function|block|method}0 call, "
2837   "expected at least %1, have %2">;
2838 def err_typecheck_call_too_many_args : Error<
2839   "too many arguments to %select{function|block|method}0 call, "
2840   "expected %1, have %2">;
2841 def err_typecheck_call_too_many_args_at_most : Error<
2842   "too many arguments to %select{function|block|method}0 call, "
2843   "expected at most %1, have %2">;
2844 def warn_call_wrong_number_of_arguments : Warning<
2845   "too %select{few|many}0 arguments in call to %1">;
2846 def err_atomic_builtin_must_be_pointer : Error<
2847   "first argument to atomic builtin must be a pointer (%0 invalid)">;
2848 def err_atomic_builtin_must_be_pointer_intptr : Error<
2849   "first argument to atomic builtin must be a pointer to integer or pointer"
2850   " (%0 invalid)">;
2851 def err_atomic_builtin_pointer_size : Error<
2852   "first argument to atomic builtin must be a pointer to 1,2,4,8 or 16 byte "
2853   "type (%0 invalid)">;
2855   
2856 def err_deleted_function_use : Error<"attempt to use a deleted function">;
2858 def err_cannot_pass_objc_interface_to_vararg : Error<
2859   "cannot pass object with interface type %0 by-value through variadic "
2860   "%select{function|block|method}1">;
2862 def warn_cannot_pass_non_pod_arg_to_vararg : Warning<
2863   "cannot pass object of non-POD type %0 through variadic "
2864   "%select{function|block|method|constructor}1; call will abort at runtime">,
2865   InGroup<DiagGroup<"non-pod-varargs">>, DefaultError;
2867 def err_typecheck_call_invalid_ordered_compare : Error<
2868   "ordered compare requires two args of floating point type (%0 and %1)">;
2869 def err_typecheck_call_invalid_unary_fp : Error<
2870   "floating point classification requires argument of floating point type "
2871   "(passed in %0)">;
2872 def err_typecheck_cond_expect_scalar : Error<
2873   "used type %0 where arithmetic or pointer type is required">;
2874 def ext_typecheck_cond_one_void : Extension<
2875   "C99 forbids conditional expressions with only one void side">;
2876 def err_typecheck_cond_expect_scalar_or_vector : Error<
2877   "used type %0 where arithmetic, pointer, or vector type is required">;
2878 def err_typecheck_cast_to_incomplete : Error<
2879   "cast to incomplete type %0">;
2880 def ext_typecheck_cast_nonscalar : Extension<
2881   "C99 forbids casting nonscalar type %0 to the same type">;
2882 def ext_typecheck_cast_to_union : Extension<"C99 forbids casts to union type">;
2883 def err_typecheck_cast_to_union_no_type : Error<
2884   "cast to union type from type %0 not present in union">;
2885 def err_cast_pointer_from_non_pointer_int : Error<
2886   "operand of type %0 cannot be cast to a pointer type">;
2887 def err_cast_pointer_to_non_pointer_int : Error<
2888   "pointer cannot be cast to type %0">;
2889 def err_typecheck_expect_scalar_operand : Error<
2890   "operand of type %0 where arithmetic or pointer type is required">;
2891 def err_typecheck_cond_incompatible_operands : Error<
2892   "incompatible operand types (%0 and %1)">;
2893 def ext_typecheck_cond_incompatible_operands_nonstandard : ExtWarn<
2894   "incompatible operand types (%0 and %1) use non-standard composite pointer "
2895   "type %2">;
2896 def err_cast_selector_expr : Error<
2897   "cannot type cast @selector expression">;
2898 def warn_typecheck_cond_incompatible_pointers : ExtWarn<
2899   "pointer type mismatch (%0 and %1)">;
2900 def warn_typecheck_cond_pointer_integer_mismatch : ExtWarn<
2901   "pointer/integer type mismatch in conditional expression (%0 and %1)">;
2902 def err_typecheck_choose_expr_requires_constant : Error<
2903   "'__builtin_choose_expr' requires a constant expression">;
2904 def ext_typecheck_expression_not_constant_but_accepted : Extension<
2905   "expression is not a constant, but is accepted as one by GNU extensions">, 
2906   InGroup<GNU>;
2907 def warn_unused_expr : Warning<"expression result unused">,
2908   InGroup<UnusedValue>;
2909 def warn_unused_voidptr : Warning<
2910   "expression result unused; should this cast be to 'void'?">,
2911   InGroup<UnusedValue>;
2912 def warn_unused_property_expr : Warning<
2913  "property access result unused - getters should not be used for side effects">,
2914   InGroup<UnusedValue>;
2915 def warn_unused_call : Warning<
2916   "ignoring return value of function declared with %0 attribute">,
2917   InGroup<UnusedValue>;
2919 def err_incomplete_type_used_in_type_trait_expr : Error<
2920   "incomplete type %0 used in type trait expression">;
2921 def err_expected_ident_or_lparen : Error<"expected identifier or '('">;
2923 } // End of general sema category.
2925 // inline asm.
2926 let CategoryName = "Inline Assembly Issue" in {
2927   def err_asm_wide_character : Error<"wide string is invalid in 'asm'">;
2928   def err_asm_invalid_lvalue_in_output : Error<"invalid lvalue in asm output">;
2929   def err_asm_invalid_output_constraint : Error<
2930     "invalid output constraint '%0' in asm">;
2931   def err_asm_invalid_lvalue_in_input : Error<
2932     "invalid lvalue in asm input for constraint '%0'">;
2933   def err_asm_invalid_input_constraint : Error<
2934     "invalid input constraint '%0' in asm">;
2935   def err_asm_invalid_type_in_input : Error<
2936     "invalid type %0 in asm input for constraint '%1'">;
2937   def err_asm_tying_incompatible_types : Error<
2938     "unsupported inline asm: input with type %0 matching output with type %1">;
2939   def err_asm_unknown_register_name : Error<"unknown register name '%0' in asm">;
2940   def err_invalid_asm_cast_lvalue : Error<
2941     "invalid use of a cast in a inline asm context requiring an l-value: "
2942     "remove the cast or build with -fheinous-gnu-extensions">;
2944   def warn_invalid_asm_cast_lvalue : Warning<
2945     "invalid use of a cast in a inline asm context requiring an l-value: "
2946     "accepted due to -fheinous-gnu-extensions, but clang may remove support "
2947     "for this in the future">;
2950 let CategoryName = "Semantic Issue" in {
2952 def err_invalid_conversion_between_vectors : Error<
2953   "invalid conversion between vector type %0 and %1 of different size">;
2954 def err_invalid_conversion_between_vector_and_integer : Error<
2955   "invalid conversion between vector type %0 and integer type %1 "
2956   "of different size">;
2958 def err_invalid_conversion_between_vector_and_scalar : Error<
2959   "invalid conversion between vector type %0 and scalar type %1">;
2960 def err_overload_expr_requires_non_zero_constant : Error<
2961   "overload requires a non-zero constant expression as first argument">;
2962 def err_overload_incorrect_fntype : Error<
2963   "argument is not a function, or has wrong number of parameters">;
2965 // C++ member initializers.
2966 def err_only_constructors_take_base_inits : Error<
2967   "only constructors take base initializers">;
2969 def err_multiple_mem_initialization : Error <
2970   "multiple initializations given for non-static member %0">;
2971 def err_multiple_mem_union_initialization : Error <
2972   "initializing multiple members of anonymous union">;
2973 def err_multiple_base_initialization : Error <
2974   "multiple initializations given for base %0">;
2976 def err_mem_init_not_member_or_class : Error<
2977   "member initializer %0 does not name a non-static data member or base "
2978   "class">;
2980 def warn_initializer_out_of_order : Warning<
2981   "%select{field|base class}0 %1 will be initialized after "
2982   "%select{field|base}2 %3">,
2983   InGroup<Reorder>, DefaultIgnore;
2985 def err_base_init_does_not_name_class : Error<
2986   "constructor initializer %0 does not name a class">;
2987 def err_base_init_direct_and_virtual : Error<
2988   "base class initializer %0 names both a direct base class and an "
2989   "inherited virtual base class">;
2990 def err_not_direct_base_or_virtual : Error<
2991   "type %0 is not a direct or virtual base of %1">;
2993 def err_in_class_initializer_non_const : Error<
2994   "non-const static data member must be initialized out of line">;
2995 def err_in_class_initializer_bad_type : Error<
2996   "static data member of type %0 must be initialized out of line">;
2997 def ext_in_class_initializer_float_type : ExtWarn<
2998   "in-class initializer for static data member of type %0 "
2999   "is a C++0x extension">, InGroup<CXX0x>;
3000 def err_in_class_initializer_non_constant : Error<
3001   "in-class initializer is not a constant expression">;
3003 // C++ anonymous unions and GNU anonymous structs/unions
3004 def ext_anonymous_union : Extension<
3005   "anonymous unions are a GNU extension in C">, InGroup<GNU>;
3006 def ext_anonymous_struct : Extension<
3007   "anonymous structs are a GNU extension">, InGroup<GNU>;
3008 def err_anonymous_union_not_static : Error<
3009   "anonymous unions at namespace or global scope must be declared 'static'">;
3010 def err_anonymous_union_with_storage_spec : Error<
3011   "anonymous union at class scope must not have a storage specifier">;
3012 def err_anonymous_struct_not_member : Error<
3013   "anonymous %select{structs|structs and classes}0 must be "
3014   "%select{struct or union|class}0 members">;
3015 def err_anonymous_union_member_redecl : Error<
3016   "member of anonymous union redeclares %0">;
3017 def err_anonymous_struct_member_redecl : Error<
3018   "member of anonymous struct redeclares %0">;
3019 def err_anonymous_record_with_type : Error<
3020   "types cannot be declared in an anonymous %select{struct|union}0">;
3021 def ext_anonymous_record_with_type : Extension<
3022   "types declared in an anonymous %select{struct|union}0 are a Microsoft "
3023   "extension">, InGroup<Microsoft>;
3024 def err_anonymous_record_with_function : Error<
3025   "functions cannot be declared in an anonymous %select{struct|union}0">;
3026 def err_anonymous_record_with_static : Error<
3027   "static members cannot be declared in an anonymous %select{struct|union}0">;
3028 def err_anonymous_record_bad_member : Error<
3029   "anonymous %select{struct|union}0 can only contain non-static data members">;
3030 def err_anonymous_record_nonpublic_member : Error<
3031   "anonymous %select{struct|union}0 cannot contain a "
3032   "%select{private|protected}1 data member">;
3033 def ext_ms_anonymous_struct : ExtWarn<
3034   "anonymous structs are a Microsoft extension">, InGroup<Microsoft>;
3036 // C++ local classes
3037 def err_reference_to_local_var_in_enclosing_function : Error<
3038   "reference to local variable %0 declared in enclosed function %1">;
3039 def note_local_variable_declared_here : Note<
3040   "%0 declared here">;
3041 def err_static_data_member_not_allowed_in_local_class : Error<
3042   "static data member %0 not allowed in local class %1">; 
3043   
3044 // C++ derived classes
3045 def err_base_clause_on_union : Error<"unions cannot have base classes">;
3046 def err_base_must_be_class : Error<"base specifier must name a class">;
3047 def err_union_as_base_class : Error<"unions cannot be base classes">;
3048 def err_incomplete_base_class : Error<"base class has incomplete type">;
3049 def err_duplicate_base_class : Error<
3050   "base class %0 specified more than once as a direct base class">;
3051 // FIXME: better way to display derivation?  Pass entire thing into diagclient?
3052 def err_ambiguous_derived_to_base_conv : Error<
3053   "ambiguous conversion from derived class %0 to base class %1:%2">;
3054 def err_ambiguous_memptr_conv : Error<
3055   "ambiguous conversion from pointer to member of %select{base|derived}0 "
3056   "class %1 to pointer to member of %select{derived|base}0 class %2:%3">;
3058 def err_memptr_conv_via_virtual : Error<
3059   "conversion from pointer to member of class %0 to pointer to member "
3060   "of class %1 via virtual base %2 is not allowed">;
3062 // C++ access control
3063 def err_conv_to_inaccessible_base : Error<
3064   "conversion from %0 to inaccessible base class %1">, NoSFINAE;
3065 def note_inheritance_specifier_here : Note<
3066   "'%0' inheritance specifier here">;
3067 def note_inheritance_implicitly_private_here : Note<
3068   "inheritance is implicitly 'private'">;
3070 // C++ member name lookup
3071 def err_ambiguous_member_multiple_subobjects : Error<
3072   "non-static member %0 found in multiple base-class subobjects of type %1:%2">;
3073 def err_ambiguous_member_multiple_subobject_types : Error<
3074   "member %0 found in multiple base classes of different types">;
3075 def note_ambiguous_member_found : Note<"member found by ambiguous name lookup">;
3076 def err_ambiguous_reference : Error<"reference to %0 is ambiguous">;
3077 def note_ambiguous_candidate : Note<"candidate found by name lookup is %q0">;
3078 def err_ambiguous_tag_hiding : Error<"a type named %0 is hidden by a "
3079   "declaration in a different namespace">;
3080 def note_hidden_tag : Note<"type declaration hidden">;
3081 def note_hiding_object : Note<"declaration hides type">;
3083 // C++ operator overloading
3084 def err_operator_overload_needs_class_or_enum : Error<
3085   "overloaded %0 must have at least one parameter of class "
3086   "or enumeration type">;
3088 def err_operator_overload_variadic : Error<"overloaded %0 cannot be variadic">;
3089 def err_operator_overload_static : Error<
3090   "overloaded %0 cannot be a static member function">;
3091 def err_operator_overload_default_arg : Error<
3092   "parameter of overloaded %0 cannot have a default argument">;
3093 def err_operator_overload_must_be : Error<
3094   "overloaded %0 must be a %select{unary|binary|unary or binary}2 operator "
3095   "(has %1 parameter%s1)">;
3097 def err_operator_overload_must_be_member : Error<
3098   "overloaded %0 must be a non-static member function">;
3099 def err_operator_overload_post_incdec_must_be_int : Error<
3100   "parameter of overloaded post-%select{increment|decrement}1 operator must "
3101   "have type 'int' (not %0)">;
3103 // C++ allocation and deallocation functions.
3104 def err_operator_new_delete_declared_in_namespace : Error<
3105   "%0 cannot be declared inside a namespace">;
3106 def err_operator_new_delete_declared_static : Error<
3107   "%0 cannot be declared static in global scope">;
3108 def err_operator_new_delete_invalid_result_type : Error<
3109   "%0 must return type %1">;
3110 def err_operator_new_delete_dependent_result_type : Error<
3111   "%0 cannot have a dependent return type; use %1 instead">;
3112 def err_operator_new_delete_too_few_parameters : Error<
3113   "%0 must have at least one parameter.">;
3114 def err_operator_new_delete_template_too_few_parameters : Error<
3115   "%0 template must have at least two parameters.">;
3117 def err_operator_new_dependent_param_type : Error<
3118   "%0 cannot take a dependent type as first parameter; "
3119   "use size_t (%1) instead">;
3120 def err_operator_new_param_type : Error<
3121   "%0 takes type size_t (%1) as first parameter">;
3122 def err_operator_new_default_arg: Error<
3123   "parameter of %0 cannot have a default argument">;
3124 def err_operator_delete_dependent_param_type : Error<
3125   "%0 cannot take a dependent type as first parameter; use %1 instead">;
3126 def err_operator_delete_param_type : Error<
3127   "first parameter of %0 must have type %1">;
3129 // C++ literal operators
3130 def err_literal_operator_outside_namespace : Error<
3131   "literal operator %0 must be in a namespace or global scope">;
3132 // FIXME: This diagnostic sucks
3133 def err_literal_operator_params : Error<
3134   "parameter declaration for literal operator %0 is not valid">;
3136 // C++ conversion functions
3137 def err_conv_function_not_member : Error<
3138   "conversion function must be a non-static member function">;
3139 def err_conv_function_return_type : Error<
3140   "conversion function cannot have a return type">;
3141 def err_conv_function_with_params : Error<
3142   "conversion function cannot have any parameters">;
3143 def err_conv_function_variadic : Error<
3144   "conversion function cannot be variadic">;
3145 def err_conv_function_to_array : Error<
3146   "conversion function cannot convert to an array type">;
3147 def err_conv_function_to_function : Error<
3148   "conversion function cannot convert to a function type">;
3149 def err_conv_function_with_complex_decl : Error<
3150   "must use a typedef to declare a conversion to %0">;
3151 def err_conv_function_redeclared : Error<
3152   "conversion function cannot be redeclared">;
3153 def warn_conv_to_self_not_used : Warning<
3154   "conversion function converting %0 to itself will never be used">;
3155 def warn_conv_to_base_not_used : Warning<
3156   "conversion function converting %0 to its base class %1 will never be used">;
3157 def warn_conv_to_void_not_used : Warning<
3158   "conversion function converting %0 to %1 will never be used">;
3160 def warn_not_compound_assign : Warning<
3161   "use of unary operator that may be intended as compound assignment (%0=)">;
3163 // C++0x explicit conversion operators
3164 def warn_explicit_conversion_functions : Warning<
3165   "explicit conversion functions are a C++0x extension">, InGroup<CXX0x>;
3167 def warn_printf_write_back : Warning<
3168   "use of '%%n' in format string discouraged (potentially insecure)">,
3169   InGroup<FormatSecurity>;
3170 def warn_printf_insufficient_data_args : Warning<
3171   "more '%%' conversions than data arguments">, InGroup<Format>;
3172 def warn_printf_data_arg_not_used : Warning<
3173   "data argument not used by format string">, InGroup<FormatExtraArgs>;
3174 def warn_format_invalid_conversion : Warning<
3175   "invalid conversion specifier '%0'">, InGroup<Format>;
3176 def warn_printf_incomplete_specifier : Warning<
3177   "incomplete format specifier">, InGroup<Format>;
3178 def warn_missing_format_string : Warning<
3179   "format string missing">, InGroup<Format>;
3180 def warn_scanf_nonzero_width : Warning<
3181   "zero field width in scanf format string is unused">,
3182   InGroup<Format>;
3183 def warn_printf_conversion_argument_type_mismatch : Warning<
3184   "conversion specifies type %0 but the argument has type %1">,
3185   InGroup<Format>;
3186 def warn_printf_positional_arg_exceeds_data_args : Warning <
3187   "data argument position '%0' exceeds the number of data arguments (%1)">,
3188   InGroup<Format>;
3189 def warn_format_zero_positional_specifier : Warning<
3190   "position arguments in format strings start counting at 1 (not 0)">,
3191   InGroup<Format>;
3192 def warn_format_invalid_positional_specifier : Warning<
3193   "invalid position specified for %select{field width|field precision}0">,
3194   InGroup<Format>;
3195 def warn_format_mix_positional_nonpositional_args : Warning<
3196   "cannot mix positional and non-positional arguments in format string">,
3197   InGroup<Format>;
3198 def warn_null_arg : Warning<
3199   "null passed to a callee which requires a non-null argument">,
3200   InGroup<NonNull>;
3201 def warn_empty_format_string : Warning<
3202   "format string is empty">, InGroup<FormatZeroLength>;
3203 def warn_format_string_is_wide_literal : Warning<
3204   "format string should not be a wide string">, InGroup<Format>;
3205 def warn_printf_format_string_contains_null_char : Warning<
3206   "format string contains '\\0' within the string body">, InGroup<Format>;
3207 def warn_printf_asterisk_missing_arg : Warning<
3208   "'%select{*|.*}0' specified field %select{width|precision}0 is missing a matching 'int' argument">;
3209 def warn_printf_asterisk_wrong_type : Warning<
3210   "field %select{width|precision}0 should have type %1, but argument has type %2">,
3211   InGroup<Format>;
3212 def warn_printf_nonsensical_optional_amount: Warning<
3213   "%select{field width|precision}0 used with '%1' conversion specifier, resulting in undefined behavior">,
3214   InGroup<Format>;
3215 def warn_printf_nonsensical_flag: Warning<
3216   "flag '%0' results in undefined behavior with '%1' conversion specifier">,
3217   InGroup<Format>;
3218 def warn_format_nonsensical_length: Warning<
3219   "length modifier '%0' results in undefined behavior or no effect with '%1' conversion specifier">,
3220   InGroup<Format>;
3221 def warn_printf_ignored_flag: Warning<
3222   "flag '%0' is ignored when flag '%1' is present">,
3223   InGroup<Format>;
3224 def warn_scanf_scanlist_incomplete : Warning<
3225   "no closing ']' for '%%[' in scanf format string">,
3226   InGroup<Format>;
3227   
3228 // CHECK: returning address/reference of stack memory
3229 def warn_ret_stack_addr : Warning<
3230   "address of stack memory associated with local variable %0 returned">;
3231 def warn_ret_stack_ref : Warning<
3232   "reference to stack memory associated with local variable %0 returned">;
3233 def warn_ret_local_temp_ref : Warning<
3234   "returning reference to local temporary">;
3235 def warn_ret_local_temp_var_ref : Warning<
3236   "reference to temporary associated with local variable %0 returned">;
3237 def note_local_temp_var_ref : Note<
3238   "binding variable %0 to temporary here">;
3239 def warn_ret_addr_label : Warning<
3240   "returning address of label, which is local">;
3241 def err_ret_local_block : Error<
3242   "returning block that lives on the local stack">;
3245 // For non-floating point, expressions of the form x == x or x != x
3246 // should result in a warning, since these always evaluate to a constant.
3247 // Array comparisons have similar warnings
3248 def warn_comparison_always : Warning<
3249   "%select{self-|array }0comparison always evaluates to %select{false|true|a constant}1">,
3250   InGroup<TautologicalCompare>;
3252 def warn_stringcompare : Warning<
3253   "result of comparison against %select{a string literal|@encode}0 is "
3254   "unspecified (use strncmp instead)">;
3258 // Blocks
3259 def err_blocks_disable : Error<"blocks support disabled - compile with -fblocks"
3260   " or pick a deployment target that supports them">;
3261 def err_expected_block_lbrace : Error<"expected '{' in block literal">;
3262 def err_return_in_block_expression : Error<
3263   "return not allowed in block expression literal">;
3264 def err_block_returns_array : Error<
3265   "block declared as returning an array">;
3268 // CFString checking
3269 def err_cfstring_literal_not_string_constant : Error<
3270   "CFString literal is not a string constant">;
3271 def warn_cfstring_literal_contains_nul_character : Warning<
3272   "CFString literal contains NUL character">;
3273 def warn_cfstring_truncated : Warning<
3274   "input conversion stopped due to an input byte that does not "
3275   "belong to the input codeset UTF-8">;
3277 // Statements.
3278 def err_continue_not_in_loop : Error<
3279   "'continue' statement not in loop statement">;
3280 def err_break_not_in_loop_or_switch : Error<
3281   "'break' statement not in loop or switch statement">;
3282 def err_default_not_in_switch : Error<
3283   "'default' statement not in switch statement">;
3284 def err_case_not_in_switch : Error<"'case' statement not in switch statement">;
3285 def warn_bool_switch_condition : Warning<
3286   "switch condition has boolean value">;
3287 def warn_case_value_overflow : Warning<
3288   "overflow converting case value to switch condition type (%0 to %1)">,
3289   InGroup<DiagGroup<"switch">>;
3290 def err_duplicate_case : Error<"duplicate case value '%0'">;
3291 def warn_case_empty_range : Warning<"empty case range specified">;
3292 def warn_missing_case_for_condition :
3293   Warning<"no case matching constant switch condition '%0'">;
3294 def warn_missing_case1 : Warning<"enumeration value %0 not handled in switch">,
3295   InGroup<DiagGroup<"switch-enum"> >;
3296 def warn_missing_case2 : Warning<
3297   "enumeration values %0 and %1 not handled in switch">,
3298   InGroup<DiagGroup<"switch-enum"> >;
3299 def warn_missing_case3 : Warning<
3300   "enumeration values %0, %1, and %2 not handled in switch">,
3301   InGroup<DiagGroup<"switch-enum"> >;
3302 def warn_missing_cases : Warning<
3303   "%0 enumeration values not handled in switch: %1, %2, %3...">,
3304   InGroup<DiagGroup<"switch-enum"> >;
3306 def warn_not_in_enum : Warning<"case value not in enumerated type %0">,
3307   InGroup<DiagGroup<"switch-enum"> >; 
3308 def err_typecheck_statement_requires_scalar : Error<
3309   "statement requires expression of scalar type (%0 invalid)">;
3310 def err_typecheck_statement_requires_integer : Error<
3311   "statement requires expression of integer type (%0 invalid)">;
3312 def err_multiple_default_labels_defined : Error<
3313   "multiple default labels in one switch">;
3314 def err_switch_multiple_conversions : Error<
3315   "multiple conversions from switch condition type %0 to an integral or "
3316   "enumeration type">;
3317 def note_switch_conversion : Note<
3318   "conversion to %select{integral|enumeration}0 type %1">;
3319 def err_switch_explicit_conversion : Error<
3320   "switch condition type %0 requires explicit conversion to %1">;
3321 def err_switch_incomplete_class_type : Error<
3322   "switch condition has incomplete class type %0">;
3323 def warn_empty_if_body : Warning<
3324   "if statement has empty body">, InGroup<EmptyBody>;
3325 def err_va_start_used_in_non_variadic_function : Error<
3326   "'va_start' used in function with fixed args">;
3327 def warn_second_parameter_of_va_start_not_last_named_argument : Warning<
3328   "second parameter of 'va_start' not last named argument">;
3329 def err_first_argument_to_va_arg_not_of_type_va_list : Error<
3330   "first argument to 'va_arg' is of type %0 and not 'va_list'">;
3332 def warn_return_missing_expr : Warning<
3333   "non-void %select{function|method}1 %0 should return a value">, DefaultError,
3334   InGroup<ReturnType>;
3335 def ext_return_missing_expr : ExtWarn<
3336   "non-void %select{function|method}1 %0 should return a value">, DefaultError,
3337   InGroup<ReturnType>;
3338 def ext_return_has_expr : ExtWarn<
3339   "void %select{function|method}1 %0 should not return a value">, DefaultError,
3340   InGroup<ReturnType>;
3341 def ext_return_has_void_expr : Extension<
3342   "void %select{function|method}1 %0 should not return void expression">;
3343 def warn_noreturn_function_has_return_expr : Warning<
3344   "function %0 declared 'noreturn' should not return">,
3345   InGroup<DiagGroup<"invalid-noreturn">>;
3346 def warn_falloff_noreturn_function : Warning<
3347   "function declared 'noreturn' should not return">,
3348   InGroup<DiagGroup<"invalid-noreturn">>;
3349 def err_noreturn_block_has_return_expr : Error<
3350   "block declared 'noreturn' should not return">;
3351 def err_block_on_nonlocal : Error<
3352   "__block attribute not allowed, only allowed on local variables">;
3353 def err_block_on_vm : Error<
3354   "__block attribute not allowed on declaration with a variably modified type">;
3356 def err_shufflevector_non_vector : Error<
3357   "first two arguments to __builtin_shufflevector must be vectors">;
3358 def err_shufflevector_incompatible_vector : Error<
3359   "first two arguments to __builtin_shufflevector must have the same type">;
3360 def err_shufflevector_nonconstant_argument : Error<
3361   "index for __builtin_shufflevector must be a constant integer">;
3362 def err_shufflevector_argument_too_large : Error<
3363   "index for __builtin_shufflevector must be less than the total number "
3364   "of vector elements">;
3366 def err_vector_incorrect_num_initializers : Error<
3367   "%select{too many|too few}0 elements in vector initialization (expected %1 elements, have %2)">;
3368 def err_altivec_empty_initializer : Error<"expected initializer">;
3370 def err_invalid_neon_type_code : Error<
3371   "incompatible constant for this __builtin_neon function">; 
3372 def err_argument_invalid_range : Error<
3373   "argument should be a value from %0 to %1">;
3375 def err_builtin_longjmp_invalid_val : Error<
3376   "argument to __builtin_longjmp must be a constant 1">;
3378 def err_constant_integer_arg_type : Error<
3379   "argument to %0 must be a constant integer">;
3381 def ext_mixed_decls_code : Extension<
3382   "ISO C90 forbids mixing declarations and code">,
3383   InGroup<DiagGroup<"declaration-after-statement">>;
3384   
3385 def err_non_variable_decl_in_for : Error<
3386   "declaration of non-local variable in 'for' loop">;
3387 def err_toomany_element_decls : Error<
3388   "only one element declaration is allowed">;
3389 def err_selector_element_not_lvalue : Error<
3390   "selector element is not a valid lvalue">;
3391 def err_selector_element_type : Error<
3392   "selector element type %0 is not a valid object">;
3393 def err_collection_expr_type : Error<
3394   "collection expression type %0 is not a valid object">;
3395 def warn_collection_expr_type : Warning<
3396   "collection expression type %0 may not respond to %1">;
3398 def err_invalid_conversion_between_ext_vectors : Error<
3399   "invalid conversion between ext-vector type %0 and %1">;
3401 // Type
3402 def ext_invalid_sign_spec : Extension<"'%0' cannot be signed or unsigned">;
3403 def warn_receiver_forward_class : Warning<
3404     "receiver %0 is a forward class and corresponding @interface may not exist">;
3405 def note_method_sent_forward_class : Note<"method %0 is used for the forward class">;
3406 def ext_missing_declspec : ExtWarn<
3407   "declaration specifier missing, defaulting to 'int'">;
3408 def ext_missing_type_specifier : ExtWarn<
3409   "type specifier missing, defaults to 'int'">,
3410   InGroup<ImplicitInt>;
3411 def err_decimal_unsupported : Error<
3412   "GNU decimal type extension not supported">;
3413 def err_missing_type_specifier : Error<
3414   "C++ requires a type specifier for all declarations">;
3415 def err_missing_param_declspec : Error<
3416   "parameter requires a declaration specifier">;
3417 def err_objc_array_of_interfaces : Error<
3418   "array of interface %0 is invalid (probably should be an array of pointers)">;
3419 def ext_c99_array_usage : Extension<
3420   "use of C99-specific array features, accepted as an extension">;
3421 def err_c99_array_usage_cxx : Error<
3422   "C99-specific array features are not permitted in C++">;
3423   
3424 def note_getter_unavailable : Note<
3425   "or because setter is declared here, but no getter method %0 is found">;
3426 def err_invalid_protocol_qualifiers : Error<
3427   "invalid protocol qualifiers on non-ObjC type">;
3428 def warn_ivar_use_hidden : Warning<
3429   "local declaration of %0 hides instance variable">;
3430 def error_ivar_use_in_class_method : Error<
3431   "instance variable %0 accessed in class method">;
3432 def error_private_ivar_access : Error<"instance variable %0 is private">,
3433   NoSFINAE;
3434 def error_protected_ivar_access : Error<"instance variable %0 is protected">,
3435   NoSFINAE;
3436 def warn_maynot_respond : Warning<"%0 may not respond to %1">;
3437 def warn_attribute_method_def : Warning<
3438   "method attribute can only be specified on method declarations">;
3439 def ext_typecheck_base_super : Warning<
3440   "method parameter type %0 does not match "
3441   "super class method parameter type %1">, InGroup<SuperSubClassMismatch>, DefaultIgnore;
3443 // Spell-checking diagnostics
3444 def err_unknown_typename_suggest : Error<
3445   "unknown type name %0; did you mean %1?">;
3446 def err_unknown_nested_typename_suggest : Error<
3447   "no type named %0 in %1; did you mean %2?">;
3448 def err_no_member_suggest : Error<"no member named %0 in %1; did you mean %2?">;
3449 def err_undeclared_use_suggest : Error<
3450   "use of undeclared %0; did you mean %1?">;
3451 def err_undeclared_var_use_suggest : Error<
3452   "use of undeclared identifier %0; did you mean %1?">;
3453 def err_no_template_suggest : Error<"no template named %0; did you mean %1?">;
3454 def err_no_member_template_suggest : Error<
3455   "no template named %0 in %1; did you mean %2?">;
3456 def err_mem_init_not_member_or_class_suggest : Error<
3457   "initializer %0 does not name a non-static data member or base "
3458   "class; did you mean the %select{base class|member}1 %2?">;
3459 def err_field_designator_unknown_suggest : Error<
3460   "field designator %0 does not refer to any field in type %1; did you mean "
3461   "%2?">;
3462 def err_typecheck_member_reference_ivar_suggest : Error<
3463   "%0 does not have a member named %1; did you mean %2?">;
3464 def err_property_not_found_suggest : Error<
3465   "property %0 not found on object of type %1; did you mean %2?">;
3466 def err_undef_interface_suggest : Error<
3467   "cannot find interface declaration for %0; did you mean %1?">;
3468 def warn_undef_interface_suggest : Warning<
3469   "cannot find interface declaration for %0; did you mean %1?">;
3470 def err_undef_superclass_suggest : Error<
3471   "cannot find interface declaration for %0, superclass of %1; did you mean "
3472   "%2?">;
3473 def err_undeclared_protocol_suggest : Error<
3474   "cannot find protocol declaration for %0; did you mean %1?">;
3475 def note_base_class_specified_here : Note<
3476   "base class %0 specified here">;
3477 def err_using_directive_suggest : Error<
3478   "no namespace named %0; did you mean %1?">;
3479 def err_using_directive_member_suggest : Error<
3480   "no namespace named %0 in %1; did you mean %2?">;
3481 def note_namespace_defined_here : Note<"namespace %0 defined here">;
3483 } // end of sema category
3484 } // end of sema component.