]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - include/clang/Basic/DiagnosticSemaKinds.td
Update clang to r93512.
[FreeBSD/FreeBSD.git] / include / clang / Basic / DiagnosticSemaKinds.td
1 //==--- DiagnosticSemaKinds.td - libsema diagnostics ----------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 //===----------------------------------------------------------------------===//
11 // Semantic Analysis
12 //===----------------------------------------------------------------------===//
13
14 let Component = "Sema" in {
15
16 // Constant expressions
17 def err_expr_not_ice : Error<
18   "expression is not an integer constant expression">;
19 def ext_expr_not_ice : Extension<
20   "expression is not integer constant expression "
21   "(but is allowed as an extension)">;
22
23 def ext_null_pointer_expr_not_ice : Extension<
24   "null pointer expression is not an integer constant expression "
25   "(but is allowed as an extension)">;
26
27
28
29 // Semantic analysis of constant literals.
30 def ext_predef_outside_function : Warning<
31   "predefined identifier is only valid inside function">;
32 def err_float_overflow : Error<
33   "magnitude of floating-point constant too large for type %0; maximum is %1">;
34 def err_float_underflow : Error<
35   "magnitude of floating-point constant too small for type %0; minimum is %1">;
36
37 // C99 Designated Initializers
38 def err_array_designator_negative : Error<
39   "array designator value '%0' is negative">;
40 def err_array_designator_empty_range : Error<
41   "array designator range [%0, %1] is empty">;
42 def err_array_designator_non_array : Error<
43   "array designator cannot initialize non-array type %0">;
44 def err_array_designator_too_large : Error<
45   "array designator index (%0) exceeds array bounds (%1)">;
46 def err_field_designator_non_aggr : Error<
47   "field designator cannot initialize a "
48   "%select{non-struct, non-union|non-class}0 type %1">;
49 def err_field_designator_unknown : Error<
50   "field designator %0 does not refer to any field in type %1">;
51 def err_field_designator_nonfield : Error<
52   "field designator %0 does not refer to a non-static data member">;
53 def note_field_designator_found : Note<"field designator refers here">;
54 def err_designator_for_scalar_init : Error<
55   "designator in initializer for scalar type %0">;
56 def warn_subobject_initializer_overrides : Warning<
57   "subobject initialization overrides initialization of other fields "
58   "within its enclosing subobject">;
59 def warn_initializer_overrides : Warning<
60   "initializer overrides prior initialization of this subobject">;
61 def note_previous_initializer : Note<
62   "previous initialization %select{|with side effects }0is here"
63   "%select{| (side effects may not occur at run time)}0">;
64 def err_designator_into_flexible_array_member : Error<
65   "designator into flexible array member subobject">;
66 def note_flexible_array_member : Note<
67   "initialized flexible array member %0 is here">;
68 def ext_flexible_array_init : Extension<
69   "flexible array initialization is a GNU extension">;
70
71 // Declarations.
72 def ext_vla : Extension<
73   "variable length arrays are a C99 feature, accepted as an extension">;
74 def err_vla_cxx : Error<
75   "variable length arrays are not permitted in C++">;
76   
77 def ext_anon_param_requires_type_specifier : Extension<
78   "type specifier required for unnamed parameter, defaults to int">;
79 def err_bad_variable_name : Error<
80   "'%0' cannot be the name of a variable or data member">;
81 def err_parameter_name_omitted : Error<"parameter name omitted">;
82 def warn_unused_parameter : Warning<"unused parameter %0">,
83   InGroup<UnusedParameter>, DefaultIgnore;
84 def warn_unused_variable : Warning<"unused variable %0">,
85   InGroup<UnusedVariable>, DefaultIgnore;
86 def warn_decl_in_param_list : Warning<
87   "declaration of %0 will not be visible outside of this function">;
88
89 def warn_implicit_function_decl : Warning<
90   "implicit declaration of function %0">,
91   InGroup<ImplicitFunctionDeclare>, DefaultIgnore;
92 def ext_implicit_function_decl : ExtWarn<
93   "implicit declaration of function %0 is invalid in C99">,
94   InGroup<ImplicitFunctionDeclare>;
95
96 def err_ellipsis_first_arg : Error<
97   "ISO C requires a named argument before '...'">;
98 def err_declarator_need_ident : Error<"declarator requires an identifier">;
99 def err_bad_language : Error<"unknown linkage language">;
100 def warn_use_out_of_scope_declaration : Warning<
101   "use of out-of-scope declaration of %0">;
102 def err_inline_non_function : Error<
103   "'inline' can only appear on functions">;
104   
105 // C++ using declarations
106 def err_using_requires_qualname : Error<
107   "using declaration requires a qualified name">;
108 def err_using_typename_non_type : Error<
109   "'typename' keyword used on a non-type">;
110 def err_using_dependent_value_is_type : Error<
111   "dependent using declaration resolved to type without 'typename'">;
112 def err_using_decl_nested_name_specifier_is_not_class : Error<
113   "using declaration in class refers into '%0', which is not a class">;
114 def err_using_decl_nested_name_specifier_is_current_class : Error<
115   "using declaration refers to its own class">;
116 def err_using_decl_nested_name_specifier_is_not_base_class : Error<
117   "using declaration refers into '%0', which is not a base class of %1">;
118 def err_using_decl_can_not_refer_to_class_member : Error<
119   "using declaration can not refer to class member">;
120 def err_using_decl_can_not_refer_to_namespace : Error<
121   "using declaration can not refer to namespace">;
122 def err_using_decl_constructor : Error<
123   "using declaration can not refer to a constructor">;
124 def err_using_decl_destructor : Error<
125   "using declaration can not refer to a destructor">;
126 def err_using_decl_template_id : Error<
127   "using declaration can not refer to a template specialization">;
128 def note_using_decl_target : Note<"target of using declaration">;
129 def note_using_decl_conflict : Note<"conflicting declaration">;
130 def err_using_decl_redeclaration : Error<"redeclaration of using decl">;
131 def err_using_decl_conflict : Error<
132   "target of using declaration conflicts with declaration already in scope">;
133 def err_using_decl_conflict_reverse : Error<
134   "declaration conflicts with target of using declaration already in scope">;
135 def note_using_decl : Note<"%select{|previous }0using declaration">;
136
137 def warn_access_decl_deprecated : Warning<
138   "access declarations are deprecated; use using declarations instead">;
139
140 def err_invalid_thread : Error<
141   "'__thread' is only allowed on variable declarations">;
142 def err_thread_non_global : Error<
143   "'__thread' variables must have global storage">;
144 def err_thread_unsupported : Error<
145   "thread-local storage is unsupported for the current target">;
146
147 def warn_maybe_falloff_nonvoid_function : Warning<
148   "control may reach end of non-void function">,
149   InGroup<ReturnType>;
150 def warn_falloff_nonvoid_function : Warning<
151   "control reaches end of non-void function">,
152   InGroup<ReturnType>;
153 def err_maybe_falloff_nonvoid_block : Error<
154   "control may reach end of non-void block">;
155 def err_falloff_nonvoid_block : Error<
156   "control reaches end of non-void block">;
157 def warn_suggest_noreturn_function : Warning<
158   "function could be attribute 'noreturn'">,
159   InGroup<DiagGroup<"missing-noreturn">>, DefaultIgnore;
160 def warn_suggest_noreturn_block : Warning<
161   "block could be attribute 'noreturn'">,
162   InGroup<DiagGroup<"missing-noreturn">>, DefaultIgnore;
163 def warn_unreachable : Warning<"will never be executed">,
164   InGroup<DiagGroup<"unreachable-code">>, DefaultIgnore;
165
166 /// Built-in functions.
167 def ext_implicit_lib_function_decl : ExtWarn<
168   "implicitly declaring C library function '%0' with type %1">;
169 def note_please_include_header : Note<
170   "please include the header <%0> or explicitly provide a "
171   "declaration for '%1'">;
172 def note_previous_builtin_declaration : Note<"%0 is a builtin with type %1">;
173 def err_implicit_decl_requires_stdio : Error<
174   "implicit declaration of '%0' requires inclusion of the header <stdio.h>">;
175 def err_implicit_decl_requires_setjmp : Error<
176   "implicit declaration of '%0' requires inclusion of the header <setjmp.h>">;
177 def warn_redecl_library_builtin : Warning<
178   "incompatible redeclaration of library function %0">;
179 def err_builtin_definition : Error<"definition of builtin function %0">;
180 def err_types_compatible_p_in_cplusplus : Error<
181   "__builtin_types_compatible_p is not valid in C++">;
182 def warn_builtin_unknown : Warning<"use of unknown builtin %0">, DefaultError;
183
184 /// main()
185 // static/inline main() are not errors in C, just in C++.
186 def warn_unusual_main_decl : Warning<"'main' should not be declared "
187     "%select{static|inline|static or inline}0">;
188 def err_unusual_main_decl : Error<"'main' is not allowed to be declared "
189     "%select{static|inline|static or inline}0">;
190 def err_main_returns_nonint : Error<"'main' must return 'int'">;
191 def err_main_surplus_args : Error<"too many parameters (%0) for 'main': "
192     "must be 0, 2, or 3">;
193 def warn_main_one_arg : Warning<"only one parameter on 'main' declaration">;
194 def err_main_arg_wrong : Error<"%select{first|second|third|fourth}0 "
195     "parameter of 'main' (%select{argument count|argument array|environment|"
196     "platform-specific data}0) must be of type %1">;
197
198 /// parser diagnostics
199 def ext_typedef_without_a_name : ExtWarn<"typedef requires a name">;
200 def err_statically_allocated_object : Error<
201   "interface type cannot be statically allocated">;
202 def err_object_cannot_be_passed_returned_by_value : Error<
203   "interface type %1 cannot be %select{returned|passed}0 by value">;
204 def warn_enum_value_overflow : Warning<"overflow in enumeration value">;
205 def warn_pragma_pack_invalid_alignment : Warning<
206   "expected #pragma pack parameter to be '1', '2', '4', '8', or '16'">;
207 // Follow the MSVC implementation.
208 def warn_pragma_pack_show : Warning<"value of #pragma pack(show) == %0">;
209 def warn_pragma_pack_pop_identifer_and_alignment : Warning<
210   "specifying both a name and alignment to 'pop' is undefined">;
211 def warn_pragma_pack_pop_failed : Warning<"#pragma pack(pop, ...) failed: %0">;
212
213 def warn_pragma_unused_undeclared_var : Warning<
214   "undeclared variable %0 used as an argument for '#pragma unused'">;
215 def warn_pragma_unused_expected_localvar : Warning<
216   "only local variables can be arguments to '#pragma unused'">;
217 def err_unsupported_pragma_weak : Error<
218   "using '#pragma weak' to refer to an undeclared identifier is not yet supported">;
219
220 /// Objective-C parser diagnostics
221 def err_duplicate_class_def : Error<
222   "duplicate interface definition for class %0">;
223 def err_undef_superclass : Error<
224   "cannot find interface declaration for %0, superclass of %1">;
225 def err_recursive_superclass : Error<
226   "trying to recursively use %0 as superclass of %1">;
227 def warn_previous_alias_decl : Warning<"previously declared alias is ignored">;
228 def err_conflicting_aliasing_type : Error<"conflicting types for alias %0">;
229 def warn_undef_interface : Warning<"cannot find interface declaration for %0">;
230 def warn_duplicate_protocol_def : Warning<"duplicate protocol definition of %0 is ignored">;
231 def err_protocol_has_circular_dependency : Error<
232   "protocol has circular dependency">;
233 def err_undeclared_protocol : Error<"cannot find protocol declaration for %0">;
234 def warn_undef_protocolref : Warning<"cannot find protocol definition for %0">;
235 def warn_readonly_property : Warning<
236   "attribute 'readonly' of property %0 restricts attribute "
237   "'readwrite' of property inherited from %1">;
238
239 def warn_property_attribute : Warning<
240   "property %0 '%1' attribute does not match the property inherited from %2">;
241 def warn_property_types_are_incompatible : Warning<
242   "property type %0 is incompatible with type %1 inherited from %2">;
243 def err_undef_interface : Error<"cannot find interface declaration for %0">;
244 def warn_dup_category_def : Warning<
245   "duplicate definition of category %1 on interface %0">;
246 def err_conflicting_super_class : Error<"conflicting super class name %0">;
247 def err_dup_implementation_class : Error<"reimplementation of class %0">;
248 def err_dup_implementation_category : Error<
249   "reimplementation of category %1 for class %0">;
250 def err_conflicting_ivar_type : Error<
251   "instance variable %0 has conflicting type: %1 vs %2">;
252 def err_conflicting_ivar_bitwidth : Error<
253   "instance variable %0 has conflicting bit-field width">;
254 def err_conflicting_ivar_name : Error<
255   "conflicting instance variable names: %0 vs %1">;
256 def err_inconsistant_ivar_count : Error<
257   "inconsistent number of instance variables specified">;
258 def warn_incomplete_impl : Warning<"incomplete implementation">;
259 def warn_undef_method_impl : Warning<"method definition for %0 not found">;
260
261 def warn_conflicting_ret_types : Warning<
262   "conflicting return type in implementation of %0: %1 vs %2">;
263
264 def warn_conflicting_param_types : Warning<
265   "conflicting parameter types in implementation of %0: %1 vs %2">;
266
267 def warn_implements_nscopying : Warning<
268 "default assign attribute on property %0 which implements "
269 "NSCopying protocol is not appropriate with -fobjc-gc[-only]">;
270
271 def warn_multiple_method_decl : Warning<"multiple methods named %0 found">;
272 def warn_accessor_property_type_mismatch : Warning<
273   "type of property %0 does not match type of accessor %1">;
274 def note_declared_at : Note<"declared at">;
275 def err_setter_type_void : Error<"type of setter must be void">;
276 def err_duplicate_method_decl : Error<"duplicate declaration of method %0">;
277 def warn_missing_atend : Warning<"'@end' is missing in implementation context">;
278 def err_objc_var_decl_inclass : 
279     Error<"cannot declare variable inside @interface or @protocol">;
280 def error_missing_method_context : Error<
281   "missing context for method declaration">;
282 def err_objc_property_attr_mutually_exclusive : Error<
283   "property attributes '%0' and '%1' are mutually exclusive">;
284 def err_objc_property_requires_object : Error<
285   "property with '%0' attribute must be of object type">;
286 def warn_objc_property_no_assignment_attribute : Warning<
287   "no 'assign', 'retain', or 'copy' attribute is specified - "
288   "'assign' is assumed">;
289 def warn_objc_property_default_assign_on_object : Warning<
290   "default property attribute 'assign' not appropriate for non-gc object">;
291 def warn_property_attr_mismatch : Warning<
292   "property attribute in continuation class does not match the primary class">;
293 def warn_objc_property_copy_missing_on_block : Warning<
294     "'copy' attribute must be specified for the block property "
295     "when -fobjc-gc-only is specified">;
296 def warn_atomic_property_rule : Warning<
297   "writable atomic property %0 cannot pair a synthesized setter/getter "
298   "with a user defined setter/getter">;
299 def err_use_continuation_class : Error<
300   "property declaration in continuation class of %0 is to change a 'readonly' "
301   "property to 'readwrite'">;
302 def err_continuation_class : Error<"continuation class has no primary class">;
303 def err_property_type : Error<"property cannot have array or function type %0">;
304 def error_missing_property_context : Error<
305   "missing context for property implementation declaration">;
306 def error_bad_property_decl : Error<
307   "property implementation must have its declaration in interface %0">;
308 def error_category_property : Error<
309   "property declared in category %0 cannot be implemented in "
310   "class implementation">;
311 def note_property_declare : Note<
312   "property declared here">;
313 def error_synthesize_category_decl : Error<
314   "@synthesize not allowed in a category's implementation">;
315 def error_reference_property : Error<
316   "property of reference type is not supported">;
317 def error_missing_property_interface : Error<
318   "property implementation in a category with no category declaration">;
319 def error_bad_category_property_decl : Error<
320   "property implementation must have its declaration in the category %0">;
321 def error_bad_property_context : Error<
322   "property implementation must be in a class or category implementation">;
323 def error_missing_property_ivar_decl : Error<
324   "synthesized property %0 must either be named the same as a compatible"
325   " ivar or must explicitly name an ivar">;
326
327 def error_synthesized_ivar_yet_not_supported : Error<
328   "instance variable synthesis not yet supported"
329   " (need to declare %0 explicitly)">;
330
331 def error_property_ivar_type : Error<
332   "type of property %0 does not match type of ivar %1">;
333 def error_ivar_in_superclass_use : Error<
334   "property %0 attempting to use ivar %1 declared in super class %2">;
335 def error_weak_property : Error<
336   "existing ivar %1 for __weak property %0 must be __weak">;
337 def error_strong_property : Error<
338   "existing ivar %1 for a __strong property %0 must be garbage collectable">;
339 def error_dynamic_property_ivar_decl : Error<
340   "dynamic property can not have ivar specification">;
341 def error_duplicate_ivar_use : Error<
342   "synthesized properties %0 and %1 both claim ivar %2">;
343 def error_property_implemented : Error<"property %0 is already implemented">;
344 def warn_objc_property_attr_mutually_exclusive : Warning<
345   "property attributes '%0' and '%1' are mutually exclusive">,
346   InGroup<ReadOnlySetterAttrs>, DefaultIgnore;
347 def warn_undeclared_selector : Warning<
348   "undeclared selector %0">, InGroup<UndeclaredSelector>, DefaultIgnore;
349
350 // C++ declarations
351 def err_static_assert_expression_is_not_constant : Error<
352   "static_assert expression is not an integral constant expression">;
353 def err_static_assert_failed : Error<"static_assert failed \"%0\"">;
354
355 def err_unexpected_friend : Error<
356   "friends can only be classes or functions">;
357 def err_enum_friend : Error<
358   "enum types cannot be friends">;
359 def err_friend_is_member : Error<
360   "friends cannot be members of the declaring class">;
361 def err_unelaborated_friend_type : Error<
362   "must specify '%select{struct|union|class|enum}0' to befriend %1">;
363 def err_qualified_friend_not_found : Error<
364   "no function named %0 with type %1 was found in the specified scope">;
365 def err_introducing_special_friend : Error<
366   "must use a qualified name when declaring a %select{constructor|"
367   "destructor|conversion operator}0 as a friend">;
368 def err_tagless_friend_type_template : Error<
369   "friend type templates must use an elaborated type">;
370
371 def err_abstract_type_in_decl : Error<
372   "%select{return|parameter|variable|field}0 type %1 is an abstract class">;
373 def err_allocation_of_abstract_type : Error<
374   "allocation of an object of abstract type %0">;
375   
376 def err_type_defined_in_type_specifier : Error<
377   "%0 can not be defined in a type specifier">;
378 def err_type_defined_in_result_type : Error<
379   "%0 can not be defined in the result type of a function">;
380 def err_type_defined_in_param_type : Error<
381   "%0 can not be defined in a parameter type">;
382
383 def note_pure_virtual_function : Note<
384   "pure virtual function %0">;
385
386 def err_deleted_non_function : Error<
387   "only functions can have deleted definitions">;
388 def err_deleted_decl_not_first : Error<
389   "deleted definition must be first declaration">;
390
391 // C++ exception specifications
392 def err_exception_spec_in_typedef : Error<
393   "exception specifications are not allowed in typedefs">;
394 def err_distant_exception_spec : Error<
395   "exception specifications are not allowed beyond a single level "
396   "of indirection">;
397 def err_incomplete_in_exception_spec : Error<
398   "%select{|pointer to |reference to }0incomplete type %1 is not allowed "
399   "in exception specification">;
400 def err_mismatched_exception_spec : Error<
401   "exception specification in declaration does not match previous declaration">;
402 def err_override_exception_spec : Error<
403   "exception specification of overriding function is more lax than "
404   "base version">;
405 def err_incompatible_exception_specs : Error<
406   "target exception specification is not superset of source">;
407 def err_deep_exception_specs_differ : Error<
408   "exception specifications of %select{return|argument}0 types differ">;
409
410 // C++ access checking
411 def err_class_redeclared_with_different_access : Error<
412   "%0 redeclared with '%1' access">;
413 def note_previous_access_declaration : Note<
414   "previously declared '%1' here">;
415   
416 // C++ name lookup
417 def err_incomplete_nested_name_spec : Error<
418   "incomplete type %0 named in nested name specifier">;
419 def err_nested_name_member_ref_lookup_ambiguous : Error<
420   "lookup of %0 in member access expression is ambiguous">;
421 def note_ambig_member_ref_object_type : Note<
422   "lookup in the object type %0 refers here">;
423 def note_ambig_member_ref_scope : Note<
424   "lookup from the current scope refers here">;
425 def err_qualified_member_nonclass : Error<
426   "qualified member access refers to a member in %0">;
427 def err_incomplete_member_access : Error<
428   "member access into incomplete type %0">;
429   
430 // C++ class members
431 def err_storageclass_invalid_for_member : Error<
432   "storage class specified for a member declaration">;
433 def err_mutable_function : Error<"'mutable' cannot be applied to functions">;
434 def err_mutable_reference : Error<"'mutable' cannot be applied to references">;
435 def err_mutable_const : Error<"'mutable' and 'const' cannot be mixed">;
436 def err_mutable_nonmember : Error<
437   "'mutable' can only be applied to member variables">;
438 def err_virtual_non_function : Error<
439   "'virtual' can only appear on non-static member functions">;
440 def err_explicit_non_function : Error<
441   "'explicit' can only appear on non-static member functions">;
442 def err_virtual_out_of_class : Error<
443   "'virtual' can only be specified inside the class definition">;
444 def err_static_not_bitfield : Error<"static member %0 cannot be a bit-field">;
445 def err_static_out_of_line : Error<
446   "'static' can only be specified inside the class definition">;
447 def err_typedef_not_bitfield : Error<"typedef member %0 cannot be a bit-field">;
448 def err_not_integral_type_bitfield : Error<
449   "bit-field %0 has non-integral type %1">;
450 def err_not_integral_type_anon_bitfield : Error<
451   "anonymous bit-field has non-integral type %0">;
452 def err_member_initialization : Error<
453   "%0 can only be initialized if it is a static const integral data member">;
454 def err_member_function_initialization : Error<
455   "initializer on function does not look like a pure-specifier">;
456 def err_non_virtual_pure : Error<
457   "%0 is not virtual and cannot be declared pure">;
458 def err_implicit_object_parameter_init : Error<
459   "cannot initialize object parameter of type %0 with an expression "
460   "of type %1">;
461
462 def note_field_decl : Note<"member is declared here">;
463 def note_bitfield_decl : Note<"bit-field is declared here">;
464 def note_previous_decl : Note<
465   "%0 declared here">;
466 def note_member_synthesized_at : Note<
467   "implicit default %select{constructor|copy constructor|"
468   "copy assignment operator|destructor}0 for %1 first required here">;
469 def err_missing_default_ctor : Error<
470   "%select{|implicit default }0constructor for %1 must explicitly initialize "
471   "the %select{base class|member}2 %3 which does not have a default "
472   "constructor">;
473 def err_illegal_union_member : Error<
474   "union member %0 has a non-trivial %select{constructor|"
475   "copy constructor|copy assignment operator|destructor}1">;
476 def note_nontrivial_has_virtual : Note<
477   "because type %0 has a virtual %select{member function|base class}1">;
478 def note_nontrivial_has_nontrivial : Note<
479   "because type %0 has a %select{member|base class}1 with a non-trivial "
480   "%select{constructor|copy constructor|copy assignment operator|destructor}2">;
481 def note_nontrivial_user_defined : Note<
482   "because type %0 has a user-declared %select{constructor|copy constructor|"
483   "copy assignment operator|destructor}1">;
484
485 def err_different_return_type_for_overriding_virtual_function : Error<
486   "virtual function %0 has a different return type (%1) than the "
487   "function it overrides (which has return type %2)">;
488 def note_overridden_virtual_function : Note<
489   "overridden virtual function is here">;
490
491 def err_covariant_return_inaccessible_base : Error<
492   "return type of virtual function %2 is not covariant with the return type "
493   "of the function it overrides "
494   "(conversion from %0 to inaccessible base class %1)">, NoSFINAE;
495 def err_covariant_return_ambiguous_derived_to_base_conv : Error<
496   "return type of virtual function %3 is not covariant with the return type of "
497   "the function it overrides (ambiguous conversion from derived class "
498   "%0 to base class %1:%2)">;
499 def err_covariant_return_not_derived : Error<
500   "return type of virtual function %0 is not covariant with the return type of "
501   "the function it overrides (%1 is not derived from %2)">;
502 def err_covariant_return_incomplete : Error<
503   "return type of virtual function %0 is not covariant with the return type of "
504   "the function it overrides (%1 is incomplete)">;
505 def err_covariant_return_type_different_qualifications : Error<
506   "return type of virtual function %0 is not covariant with the return type of "
507   "the function it overrides (%1 has different qualifiers than %2)">;
508 def err_covariant_return_type_class_type_more_qualified : Error<
509   "return type of virtual function %0 is not covariant with the return type of "
510   "the function it overrides (class type %1 is more qualified than class "
511   "type %2">;
512 // C++ constructors
513 def err_constructor_cannot_be : Error<"constructor cannot be declared '%0'">;
514 def err_invalid_qualified_constructor : Error<
515   "'%0' qualifier is not allowed on a constructor">;
516 def err_constructor_return_type : Error<
517   "constructor cannot have a return type">;
518 def err_constructor_redeclared : Error<"constructor cannot be redeclared">;
519 def err_constructor_byvalue_arg : Error<
520   "copy constructor must pass its first argument by reference">;
521
522 // C++ destructors
523 def err_destructor_not_member : Error<
524   "destructor must be a non-static member function">;
525 def err_destructor_cannot_be : Error<"destructor cannot be declared '%0'">;
526 def err_invalid_qualified_destructor : Error<
527   "'%0' qualifier is not allowed on a destructor">;
528 def err_destructor_return_type : Error<"destructor cannot have a return type">;
529 def err_destructor_redeclared : Error<"destructor cannot be redeclared">;
530 def err_destructor_with_params : Error<"destructor cannot have any parameters">;
531 def err_destructor_variadic : Error<"destructor cannot be variadic">;
532 def err_destructor_typedef_name : Error<
533   "destructor cannot be declared using a typedef %0 of the class name">;
534 def err_destructor_name : Error<
535   "expected the class name after '~' to name the enclosing class">;
536
537 // C++ initialization
538 def err_init_conversion_failed : Error<
539   "cannot initialize %select{a variable|a parameter|return object|an "
540   "exception object|a value|a base class|a member subobject|an array element}0"
541   " of type %1 with an %select{rvalue|lvalue}2 of type %3">;
542
543 def err_lvalue_to_rvalue_ref : Error<"rvalue reference cannot bind to lvalue">;
544 def err_invalid_initialization : Error<
545 "invalid initialization of reference of type %0 from expression of type %1">;
546 def err_lvalue_to_rvalue_ambig_ref : Error<"rvalue reference cannot bind to lvalue "
547                                            "due to multiple conversion functions">;
548 def err_not_reference_to_const_init : Error<
549   "non-const lvalue reference to type %0 cannot be initialized "
550   "with a %select{value|temporary}1 of type %2">;
551 def err_lvalue_reference_bind_to_temporary : Error<
552   "non-const lvalue reference to type %0 cannot bind to a temporary of type "
553   "%1">;
554 def err_lvalue_reference_bind_to_unrelated : Error<
555   "non-const lvalue reference to type %0 cannot bind to a value of unrelated "
556   "type %1">;
557 def err_reference_bind_drops_quals : Error<
558   "binding of reference to type %0 to a value of type %1 drops qualifiers">;
559 def err_reference_bind_failed : Error<
560   "reference to type %0 could not bind to an %select{rvalue|lvalue}1 of type "
561   "%2">;
562 def err_reference_bind_init_list : Error<
563   "reference to type %0 cannot bind to an initializer list">;
564 def err_init_list_bad_dest_type : Error<
565   "%select{|non-aggregate }0type %1 cannot be initialized with an initializer "
566   "list">;
567
568 def err_reference_init_drops_quals : Error<
569   "initialization of reference to type %0 with a %select{value|temporary}1 of type %2 drops "
570   "qualifiers">;
571 def err_reference_bind_to_bitfield : Error<
572   "%select{non-const|volatile}0 reference cannot bind to bit-field %1">;
573 def err_reference_var_requires_init : Error<
574   "declaration of reference variable %0 requires an initializer">;
575 def err_const_var_requires_init : Error<
576   "declaration of const variable '%0' requires an initializer">;
577 def err_reference_has_multiple_inits : Error<
578   "reference cannot be initialized with multiple values">;
579 def err_init_non_aggr_init_list : Error<
580   "initialization of non-aggregate type %0 with an initializer list">;
581 def err_init_reference_member_uninitialized : Error<
582   "reference member of type %0 uninitialized">;
583 def note_uninit_reference_member : Note<
584   "uninitialized reference member is here">;
585 def warn_field_is_uninit : Warning<"field is uninitialized when used here">,
586   InGroup<DiagGroup<"uninitialized">>;
587
588 def err_temp_copy_no_viable : Error<
589   "no viable copy constructor %select{copying variable|copying parameter|"
590   "returning object|throwing object}0 of type %1">;
591 def err_temp_copy_ambiguous : Error<
592   "ambiguous copy constructor call when %select{copying variable|copying "
593   "parameter|returning object|throwing object}0 of type %1">;
594 def err_temp_copy_deleted : Error<
595   "%select{copying variable|copying parameter|returning object|throwing "
596   "object}0 of type %1 invokes deleted copy constructor">;
597   
598 // C++0x decltype
599 def err_cannot_determine_declared_type_of_overloaded_function : Error<
600     "cannot determine the %select{type|declared type}0 of an overloaded "
601     "function">;
602     
603 // C++0x auto
604 def err_auto_variable_cannot_appear_in_own_initializer : Error<
605   "variable %0 declared with 'auto' type cannot appear in its own initializer">;
606 def err_illegal_decl_array_of_auto : Error<
607   "'%0' declared as array of 'auto'">;
608 def err_auto_not_allowed : Error<
609   "'auto' not allowed in %select{function prototype|struct member|union member"
610   "|class member|exception declaration|template parameter|block literal}0">;
611 def err_auto_var_requires_init : Error<
612   "declaration of variable %0 with type %1 requires an initializer">;
613   
614 // C++0x attributes
615 def err_repeat_attribute : Error<"'%0' attribute cannot be repeated">;
616
617 // C++0x [[final]]
618 def err_final_function_overridden : Error<
619   "declaration of %0 overrides a 'final' function">;
620 def err_final_base : Error<
621   "derivation from 'final' %0">;
622   
623 // Objective-C++
624 def err_objc_decls_may_only_appear_in_global_scope : Error<
625   "Objective-C declarations may only appear in global scope">;
626 def err_nsobject_attribute : Error<
627   "__attribute ((NSObject)) is for pointer types only">;
628
629 // Attributes
630 def err_attribute_can_be_applied_only_to_symbol_declaration : Error<
631   "%0 attribute can be applied only to symbol declaration">;
632 def err_attributes_are_not_compatible : Error<
633   "%0 and %1 attributes are not compatible">;
634 def err_attribute_wrong_number_arguments : Error<
635   "attribute requires %0 argument(s)">;
636 def err_attribute_missing_parameter_name : Error<
637   "attribute requires unquoted parameter">;
638 def err_attribute_invalid_vector_type : Error<"invalid vector type %0">;
639 def err_attribute_argument_not_int : Error<
640   "'%0' attribute requires integer constant">;
641 def err_attribute_argument_n_not_int : Error<
642   "'%0' attribute requires parameter %1 to be an integer constant">;
643 def err_attribute_argument_n_not_string : Error<
644   "'%0' attribute requires parameter %1 to be a string">;
645 def err_attribute_argument_out_of_bounds : Error<
646   "'%0' attribute parameter %1 is out of bounds">;
647 def err_attribute_requires_objc_interface : Error<
648   "attribute may only be applied to an Objective-C interface">;
649 def err_nonnull_pointers_only : Error<
650   "nonnull attribute only applies to pointer arguments">;
651 def err_format_strftime_third_parameter : Error<
652   "strftime format attribute requires 3rd parameter to be 0">;
653 def err_format_attribute_requires_variadic : Error<
654   "format attribute requires variadic function">;
655 def err_format_attribute_not : Error<"format argument not %0">;
656 def err_format_attribute_result_not : Error<"function does not return %0">;
657 def err_attribute_invalid_size : Error<
658   "vector size not an integral multiple of component size">;
659 def err_attribute_zero_size : Error<"zero vector size">;
660 def err_typecheck_vector_not_convertable : Error<
661   "can't convert between vector values of different size (%0 and %1)">;
662 def err_typecheck_ext_vector_not_typedef : Error<
663   "ext_vector_type only applies to types, not variables">;
664 def err_unsupported_vector_size : Error<
665   "unsupported type %0 for vector_size attribute, please use on typedef">;
666 def err_ext_vector_component_exceeds_length : Error<
667   "vector component access exceeds type %0">;
668 def err_ext_vector_component_name_illegal : Error<
669   "illegal vector component name '%0'">;
670 def err_attribute_address_space_not_int : Error<
671   "address space attribute requires an integer constant">;
672 def err_attribute_address_space_negative : Error<
673   "address space is negative">;
674 def err_attribute_address_space_too_high : Error<
675   "address space is larger than the maximum supported (%0)">;
676 def err_attribute_address_multiple_qualifiers : Error<
677   "multiple address spaces specified for type">;
678 def err_implicit_pointer_address_space_cast : Error<
679   "illegal implicit cast between two pointers with different address spaces">;
680 def err_as_qualified_auto_decl : Error<
681   "automatic variable qualified with an address space">;
682 def err_arg_with_address_space : Error<
683   "parameter may not be qualified with an address space">;
684 def err_attribute_not_string : Error<
685   "argument to %0 attribute was not a string literal">;
686 def err_attribute_section_invalid_for_target : Error<
687   "argument to 'section' attribute is not valid for this target: %0">;
688 def err_attribute_section_local_variable : Error<
689   "'section' attribute is not valid on local variables">;
690 def err_attribute_aligned_not_power_of_two : Error<
691   "requested alignment is not a power of 2">;
692 def warn_redeclaration_without_attribute_prev_attribute_ignored : Warning<
693   "'%0' redeclared without %1 attribute: previous %1 ignored">;
694 def warn_attribute_ignored : Warning<"%0 attribute ignored">;
695 def warn_attribute_precede_definition : Warning<
696   "attribute declaration must precede definition">;
697 def warn_attribute_void_function : Warning<
698   "attribute %0 cannot be applied to functions without return value">;
699 def warn_attribute_weak_on_field : Warning<
700   "__weak attribute cannot be specified on a field declaration">;
701 def warn_attribute_weak_on_local : Warning<
702   "__weak attribute cannot be specified on an automatic variable">;
703 def warn_weak_identifier_undeclared : Warning<
704   "weak identifier %0 never declared">;
705 def err_attribute_weak_static : Error<
706   "weak declaration of '%0' must be public">;
707 def warn_attribute_weak_import_invalid_on_definition : Warning<
708   "'weak_import' attribute cannot be specified on a definition">;
709 def warn_attribute_wrong_decl_type : Warning<
710   "%0 attribute only applies to %select{function|union|"
711   "variable and function|function or method|parameter|"
712   "parameter or Objective-C method |function, method or block|"
713   "virtual method or class|function, method, or parameter|class|virtual method"
714   "|member}1 types">;
715 def err_attribute_wrong_decl_type : Error<
716   "%0 attribute only applies to %select{function|union|"
717   "variable and function|function or method|parameter|"
718   "parameter or Objective-C method |function, method or block|"
719   "virtual method or class|function, method, or parameter|class|virtual method"
720   "|member}1 types">;
721 def warn_gnu_inline_attribute_requires_inline : Warning<
722   "'gnu_inline' attribute requires function to be marked 'inline',"
723   " attribute ignored">;
724 def err_cconv_knr : Error<
725   "function with no prototype cannot use '%0' calling convention">;
726 def err_cconv_varargs : Error<
727   "variadic function cannot use '%0' calling convention">;
728
729 def warn_impcast_vector_scalar : Warning<
730   "implicit cast turns vector to scalar: %0 to %1">,
731   InGroup<DiagGroup<"conversion">>, DefaultIgnore;
732 def warn_impcast_complex_scalar : Warning<
733   "implicit cast discards imaginary component: %0 to %1">,
734   InGroup<DiagGroup<"conversion">>, DefaultIgnore;
735 def warn_impcast_float_precision : Warning<
736   "implicit cast loses floating-point precision: %0 to %1">,
737   InGroup<DiagGroup<"conversion">>, DefaultIgnore;
738 def warn_impcast_float_integer : Warning<
739   "implicit cast turns floating-point number into integer: %0 to %1">,
740   InGroup<DiagGroup<"conversion">>, DefaultIgnore;
741 def warn_impcast_integer_precision : Warning<
742   "implicit cast loses integer precision: %0 to %1">,
743   InGroup<DiagGroup<"conversion">>, DefaultIgnore;
744 def warn_impcast_integer_64_32 : Warning<
745   "implicit cast loses integer precision: %0 to %1">,
746   InGroup<DiagGroup<"shorten-64-to-32">>, DefaultIgnore;
747
748 def warn_attribute_ignored_for_field_of_type : Warning<
749   "%0 attribute ignored for field of type %1">;
750 def warn_transparent_union_attribute_field_size_align : Warning<
751   "%select{alignment|size}0 of field %1 (%2 bits) does not match the "
752   "%select{alignment|size}0 of the first field in transparent union; "
753   "transparent_union attribute ignored">;
754 def note_transparent_union_first_field_size_align : Note<
755   "%select{alignment|size}0 of first field is %1 bits">;
756 def warn_transparent_union_attribute_not_definition : Warning<
757   "transparent_union attribute can only be applied to a union definition; "
758   "attribute ignored">;
759 def warn_transparent_union_attribute_floating : Warning<
760   "first field of a transparent union cannot have floating point or vector "
761   "type; transparent_union attribute ignored">;
762 def warn_transparent_union_attribute_zero_fields : Warning<
763   "transparent union definition must contain at least one field; "
764   "transparent_union attribute ignored">;
765 def warn_attribute_type_not_supported : Warning<
766   "'%0' attribute argument not supported: %1">;
767 def warn_attribute_unknown_visibility : Warning<"unknown visibility '%1'">;
768 def err_unknown_machine_mode : Error<"unknown machine mode %0">;
769 def err_unsupported_machine_mode : Error<"unsupported machine mode %0">;
770 def err_mode_not_primitive : Error<
771   "mode attribute only supported for integer and floating-point types">;
772 def err_mode_wrong_type : Error<
773   "type of machine mode does not match type of base type">;
774 def err_attr_wrong_decl : Error<
775   "'%0' attribute invalid on this declaration, requires typedef or value">;
776 def warn_attribute_nonnull_no_pointers : Warning<
777   "'nonnull' attribute applied to function with no pointer arguments">;
778 def warn_attribute_malloc_pointer_only : Warning<
779   "'malloc' attribute only applies to functions returning a pointer type">;
780 def warn_transparent_union_nonpointer : Warning<
781   "'transparent_union' attribute support incomplete; only supported for "
782   "pointer unions">;
783
784 def warn_attribute_sentinel_named_arguments : Warning<
785   "'sentinel' attribute requires named arguments">;
786 def warn_attribute_sentinel_not_variadic : Warning<
787   "'sentinel' attribute only supported for variadic %select{functions|blocks}0">;
788 def err_attribute_sentinel_less_than_zero : Error<
789   "'sentinel' parameter 1 less than zero">;
790 def err_attribute_sentinel_not_zero_or_one : Error<
791   "'sentinel' parameter 2 not 0 or 1">;
792 def err_attribute_cleanup_arg_not_found : Error<
793   "'cleanup' argument %0 not found">;
794 def err_attribute_cleanup_arg_not_function : Error<
795   "'cleanup' argument %0 is not a function">;
796 def err_attribute_cleanup_func_must_take_one_arg : Error<
797   "'cleanup' function %0 must take 1 parameter">;
798 def err_attribute_cleanup_func_arg_incompatible_type : Error<
799   "'cleanup' function %0 parameter has type %1 which is incompatible with "
800   "type %2">;
801 def err_attribute_regparm_wrong_platform : Error<
802   "'regparm' is not valid on this platform">;
803 def err_attribute_regparm_invalid_number : Error<
804   "'regparm' parameter must be between 0 and %0 inclusive">;
805
806
807 // Clang-Specific Attributes
808 def err_attribute_iboutlet : Error<
809   "'iboutlet' attribute can only be applied to instance variables or "
810   "properties">;
811 def err_attribute_overloadable_not_function : Error<
812   "'overloadable' attribute can only be applied to a function">;
813 def err_attribute_overloadable_missing : Error<
814   "%select{overloaded function|redeclaration of}0 %1 must have the "
815   "'overloadable' attribute">;
816 def note_attribute_overloadable_prev_overload : Note<
817   "previous overload of function is here">;
818 def err_attribute_overloadable_no_prototype : Error<
819   "'overloadable' function %0 must have a prototype">;
820 def warn_ns_attribute_wrong_return_type : Warning<
821     "%0 attribute only applies to functions or methods that "
822     "return a pointer or Objective-C object">;
823
824 // Function Parameter Semantic Analysis.
825 def err_param_with_void_type : Error<"argument may not have 'void' type">;
826 def err_void_only_param : Error<
827   "'void' must be the first and only parameter if specified">;
828 def err_void_param_qualified : Error<
829   "'void' as parameter must not have type qualifiers">;
830 def err_ident_list_in_fn_declaration : Error<
831   "a parameter list without types is only allowed in a function definition">;
832 def ext_param_not_declared : Extension<
833   "parameter %0 was not declared, defaulting to type 'int'">;
834 def err_param_typedef_of_void : Error<
835   "empty parameter list defined with a typedef of 'void' not allowed in C++">;
836 def err_param_default_argument : Error<
837   "C does not support default arguments">;
838 def err_param_default_argument_redefinition : Error<
839   "redefinition of default argument">;
840 def err_param_default_argument_missing : Error<
841   "missing default argument on parameter">;
842 def err_param_default_argument_missing_name : Error<
843   "missing default argument on parameter %0">;
844 def err_param_default_argument_references_param : Error<
845   "default argument references parameter %0">;
846 def err_param_default_argument_references_local : Error<
847   "default argument references local variable %0 of enclosing function">;
848 def err_param_default_argument_references_this : Error<
849   "default argument references 'this'">;
850 def err_param_default_argument_nonfunc : Error<
851   "default arguments can only be specified for parameters in a function "
852   "declaration">;
853 def err_param_default_argument_template_redecl : Error<
854   "default arguments cannot be added to a function template that has already "
855   "been declared">;
856 def err_param_default_argument_member_template_redecl : Error<
857   "default arguments cannot be added to an out-of-line definition of a member "
858   "of a %select{class template|class template partial specialization|nested "
859   "class in a template}0">;
860 def err_uninitialized_member_for_assign : Error<
861   "cannot define the implicit default assignment operator for %0, because "
862   "non-static %select{reference|const}1 member %2 can't use default "
863   "assignment operator">;
864 def note_first_required_here : Note<
865   "synthesized method is first required here">;
866 def err_null_intialized_reference_member : Error<
867   "cannot initialize the member to null in default constructor because "
868   "reference member %0 cannot be null-initialized">;
869 def err_unintialized_member_in_ctor : Error<
870   "%select{|implicit default }0constructor for %1 must explicitly initialize "
871   "the %select{reference|const}2 member %3">;
872
873 def err_use_of_default_argument_to_function_declared_later : Error<
874   "use of default argument to function %0 that is declared later in class %1">;
875 def note_default_argument_declared_here : Note<
876   "default argument declared here">;
877
878 def ext_param_promoted_not_compatible_with_prototype : ExtWarn<
879   "promoted type %0 of K&R function parameter is not compatible with the "
880   "parameter type %1 declared in a previous prototype">;
881
882
883 // C++ Overloading Semantic Analysis.
884 def err_ovl_diff_return_type : Error<
885   "functions that differ only in their return type cannot be overloaded">;
886 def err_ovl_static_nonstatic_member : Error<
887   "static and non-static member functions with the same parameter types "
888   "cannot be overloaded">;
889
890 def err_ovl_no_viable_function_in_call : Error<
891   "no matching function for call to %0">;
892 def err_ovl_no_viable_member_function_in_call : Error<
893   "no matching member function for call to %0">;
894 def err_ovl_ambiguous_call : Error<
895   "call to %0 is ambiguous">;
896 def err_ovl_deleted_call : Error<
897   "call to %select{unavailable|deleted}0 function %1">;
898 def err_ovl_ambiguous_member_call : Error<
899   "call to member function %0 is ambiguous">;
900 def err_ovl_deleted_member_call : Error<
901   "call to %select{unavailable|deleted}0 member function %1">;
902 def note_ovl_candidate : Note<"candidate "
903     "%select{function|function|constructor|"
904     "function |function |constructor |"
905     "is the implicit default constructor|"
906     "is the implicit copy constructor|"
907     "is the implicit copy assignment operator}0%1">;
908 // Note that we don't treat templates differently for this diagnostic.
909 def note_ovl_candidate_arity : Note<"candidate "
910     "%select{function|function|constructor|function|function|constructor|"
911     "constructor (the implicit default constructor)|"
912     "constructor (the implicit copy constructor)|"
913     "function (the implicit copy assignment operator)}0 not viable: requires"
914     "%select{ at least| at most|}2 %3 argument%s3, but %4 %plural{1:was|:were}4 "
915     "provided">;
916 def note_ovl_candidate_deleted : Note<
917   "candidate %select{function|function|constructor|"
918   "function |function |constructor |||}0%1 "
919   "has been explicitly %select{made unavailable|deleted}2">;
920 def note_ovl_candidate_bad_conv : Note<"candidate "
921     "%select{function|function|constructor|"
922     "function |function |constructor |"
923     "constructor (the implicit default constructor)|"
924     "constructor (the implicit copy constructor)|"
925     "function (the implicit copy assignment operator)}0%1"
926     " not viable: no known conversion from %2 to %3 for "
927     "%select{%ordinal5 argument|object argument}4">;
928 def note_ovl_candidate_bad_addrspace : Note<"candidate "
929     "%select{function|function|constructor|"
930     "function |function |constructor |"
931     "constructor (the implicit default constructor)|"
932     "constructor (the implicit copy constructor)|"
933     "function (the implicit copy assignment operator)}0%1 not viable: "
934     "%select{%ordinal6|'this'}5 argument (%2) is in "
935     "address space %3, but parameter must be in address space %4">;
936 def note_ovl_candidate_bad_cvr_this : Note<"candidate "
937     "%select{|function|||function||||"
938     "function (the implicit copy assignment operator)}0 not viable: "
939     "'this' argument has type %2, but method is not marked "
940     "%select{const|volatile|const or volatile|restrict|const or restrict|"
941     "volatile or restrict|const, volatile, or restrict}3">;
942 def note_ovl_candidate_bad_cvr : Note<"candidate "
943     "%select{function|function|constructor|"
944     "function |function |constructor |"
945     "constructor (the implicit default constructor)|"
946     "constructor (the implicit copy constructor)|"
947     "function (the implicit copy assignment operator)}0%1 not viable: "
948     "%ordinal4 argument (%2) would lose "
949     "%select{const|volatile|const and volatile|restrict|const and restrict|"
950     "volatile and restrict|const, volatile, and restrict}3 qualifier"
951     "%select{||s||s|s|s}3">;
952 def note_ambiguous_type_conversion: Note<
953     "because of ambiguity in conversion of %0 to %1">;
954 def note_ovl_builtin_binary_candidate : Note<
955     "built-in candidate %0">;
956 def note_ovl_builtin_unary_candidate : Note<
957     "built-in candidate %0">;
958 def err_ovl_no_viable_function_in_init : Error<
959   "no matching constructor for initialization of %0">;
960 def err_ovl_ambiguous_init : Error<"call to constructor of %0 is ambiguous">;
961 def err_ref_init_ambiguous : Error<
962   "reference initialization of type %0 with initializer of type %1 is ambiguous">;
963 def err_ovl_deleted_init : Error<
964   "call to %select{unavailable|deleted}0 constructor of %1">;
965 def err_ovl_ambiguous_oper : Error<
966   "use of overloaded operator '%0' is ambiguous">;
967 def err_ovl_no_viable_oper : Error<"no viable overloaded '%0'">;
968 def err_ovl_deleted_oper : Error<
969   "overload resolution selected %select{unavailable|deleted}0 operator '%1'">;
970 def err_ovl_no_viable_subscript :
971     Error<"no viable overloaded operator[] for type %0">;
972 def err_ovl_no_oper :
973     Error<"type %0 does not provide a %select{subscript|call}1 operator">;
974
975 def err_ovl_no_viable_object_call : Error<
976   "no matching function for call to object of type %0">;
977 def err_ovl_ambiguous_object_call : Error<
978   "call to object of type %0 is ambiguous">;
979 def err_ovl_deleted_object_call : Error<
980   "call to %select{unavailable|deleted}0 function call operator in type %1">;
981 def note_ovl_surrogate_cand : Note<"conversion candidate of type %0">;
982 def err_member_call_without_object : Error<
983   "call to non-static member function without an object argument">;
984
985 // C++ Address of Overloaded Function
986 def err_addr_ovl_ambiguous : Error<
987   "address of overloaded function %0 is ambiguous">;
988
989 // C++ Template Declarations
990 def err_template_param_shadow : Error<
991   "declaration of %0 shadows template parameter">;
992 def note_template_param_here : Note<"template parameter is declared here">;
993 def warn_template_export_unsupported : Warning<
994   "exported templates are unsupported">;
995 def err_template_outside_namespace_or_class_scope : Error<
996   "templates can only be declared in namespace or class scope">;
997 def err_template_linkage : Error<"templates must have C++ linkage">;
998 def err_template_typedef : Error<"a typedef cannot be a template">;
999 def err_template_unnamed_class : Error<
1000   "cannot declare a class template with no name">;
1001 def err_template_param_list_different_arity : Error<
1002   "%select{too few|too many}0 template parameters in template "
1003   "%select{|template parameter }1redeclaration">;
1004 def note_template_param_list_different_arity : Note<
1005   "%select{too few|too many}0 template parameters in template template "
1006   "argument">;
1007 def note_template_prev_declaration : Note<
1008   "previous template %select{declaration|template parameter}0 is here">;
1009 def err_template_param_different_kind : Error<
1010   "template parameter has a different kind in template "
1011   "%select{|template parameter }0redeclaration">;
1012 def note_template_param_different_kind : Note<
1013   "template parameter has a different kind in template argument">;
1014 def err_template_nontype_parm_different_type : Error<
1015   "template non-type parameter has a different type %0 in template "
1016   "%select{|template parameter }1redeclaration">;
1017
1018 def note_template_nontype_parm_different_type : Note<
1019   "template non-type parameter has a different type %0 in template argument">;
1020 def note_template_nontype_parm_prev_declaration : Note<
1021   "previous non-type template parameter with type %0 is here">;
1022 def err_template_nontype_parm_bad_type : Error<
1023   "a non-type template parameter cannot have type %0">;
1024 def err_template_param_default_arg_redefinition : Error<
1025   "template parameter redefines default argument">;
1026 def note_template_param_prev_default_arg : Note<
1027   "previous default template argument defined here">;
1028 def err_template_param_default_arg_missing : Error<
1029   "template parameter missing a default argument">;
1030 def err_template_parameter_default_in_function_template : Error<
1031   "a template parameter of a function template cannot have a default argument "
1032   "in C++98">;
1033 def err_template_parameter_default_template_member : Error<
1034   "cannot add a default template argument to the definition of a member of a "
1035   "class template">;
1036 def err_template_parameter_default_friend_template : Error<
1037   "default template argument not permitted on a friend template">;
1038
1039 def err_template_variable : Error<"variable %0 declared as a template">;
1040 def err_template_variable_noparams : Error<
1041   "extraneous 'template<>' in declaration of variable %0">;
1042 def err_template_tag_noparams : Error<
1043   "extraneous 'template<>' in declaration of %0 %1">;
1044 def err_template_decl_ref : Error<
1045   "cannot refer to class template %0 without a template argument list">;
1046
1047 def err_typedef_in_def_scope : Error<
1048   "cannot use typedef %0 in scope specifier for out-of-line declaration">;
1049
1050 // C++ Template Argument Lists
1051 def err_template_arg_list_different_arity : Error<
1052   "%select{too few|too many}0 template arguments for "
1053   "%select{class template|function template|template template parameter"
1054   "|template}1 %2">;
1055 def note_template_decl_here : Note<"template is declared here">;
1056 def note_member_of_template_here : Note<"member is declared here">;
1057 def err_template_arg_must_be_type : Error<
1058   "template argument for template type parameter must be a type">;
1059 def err_template_arg_must_be_expr : Error<
1060   "template argument for non-type template parameter must be an expression">;
1061 def err_template_arg_nontype_ambig : Error<
1062   "template argument for non-type template parameter is treated as type %0">;
1063 def err_template_arg_must_be_template : Error<
1064   "template argument for template template parameter must be a class template">;
1065 def err_template_arg_local_type : Error<"template argument uses local type %0">;
1066 def err_template_arg_unnamed_type : Error<
1067   "template argument uses unnamed type">;
1068 def note_template_unnamed_type_here : Note<
1069   "unnamed type used in template argument was declared here">;
1070 def err_template_arg_overload_type : Error<
1071   "template argument is the type of an unresolved overloaded function">;
1072 def err_template_arg_not_class_template : Error<
1073   "template argument does not refer to a class template or template "
1074   "template parameter">;
1075 def note_template_arg_refers_here_func : Note<
1076   "template argument refers to function template %0, here">;
1077 def err_template_arg_template_params_mismatch : Error<
1078   "template template argument has different template parameters than its "
1079   "corresponding template template parameter">;
1080 def err_template_arg_not_integral_or_enumeral : Error<
1081   "non-type template argument of type %0 must have an integral or enumeration"
1082   " type">;
1083 def err_template_arg_not_ice : Error<
1084   "non-type template argument of type %0 is not an integral constant "
1085   "expression">;
1086 def err_template_arg_not_convertible : Error<
1087   "non-type template argument of type %0 cannot be converted to a value "
1088   "of type %1">;
1089 def err_template_arg_negative : Error<
1090   "non-type template argument provides negative value '%0' for unsigned "
1091   "template parameter of type %1">;
1092 def err_template_arg_too_large : Error<
1093   "non-type template argument value '%0' is too large for template "
1094   "parameter of type %1">;
1095 def err_template_arg_no_ref_bind : Error<
1096   "non-type template parameter of reference type %0 cannot bind to template "
1097   "argument of type %1">;
1098 def err_template_arg_ref_bind_ignores_quals : Error<
1099   "reference binding of non-type template parameter of type %0 to template "
1100   "argument of type %1 ignores qualifiers">;
1101 def err_template_arg_not_object_or_func_form : Error<
1102   "non-type template argument does not directly refer to an object or "
1103   "function">;
1104 def err_template_arg_field : Error<
1105   "non-type template argument refers to non-static data member %0">;
1106 def err_template_arg_method : Error<
1107   "non-type template argument refers to non-static member function %0">;
1108 def err_template_arg_function_not_extern : Error<
1109   "non-template argument refers to function %0 with internal linkage">;
1110 def err_template_arg_object_not_extern : Error<
1111   "non-template argument refers to object %0 that does not have external "
1112   "linkage">;
1113 def note_template_arg_internal_object : Note<
1114   "non-template argument refers to %select{function|object}0 here">;
1115 def note_template_arg_refers_here : Note<"non-template argument refers here">;
1116 def err_template_arg_not_object_or_func : Error<
1117   "non-type template argument does not refer to an object or function">;
1118 def err_template_arg_not_pointer_to_member_form : Error<
1119   "non-type template argument is not a pointer to member constant">;
1120 def err_template_arg_extra_parens : Error<
1121   "non-type template argument cannot be surrounded by parentheses">;
1122 def err_pointer_to_member_type : Error<
1123   "invalid use of pointer to member type after %select{.*|->*}0">;
1124
1125 // C++ template specialization
1126 def err_template_spec_unknown_kind : Error<
1127   "can only provide an explicit specialization for a class template, function "
1128   "template, or a member function, static data member, or member class of a "
1129   "class template">;
1130 def note_specialized_entity : Note<
1131   "explicitly specialized declaration is here">;
1132 def err_template_spec_decl_function_scope : Error<
1133   "explicit specialization of %0 in function scope">;
1134 def err_template_spec_decl_class_scope : Error<
1135   "explicit specialization of %0 in class scope">;
1136 def err_template_spec_decl_out_of_scope_global : Error<
1137   "%select{class template|class template partial|function template|member "
1138   "function|static data member|member class}0 specialization of %1 must "
1139   "originally be declared in the global scope">;
1140 def err_template_spec_decl_out_of_scope : Error<
1141   "%select{class template|class template partial|function template|member "
1142   "function|static data member|member class}0 specialization of %1 must "
1143   "originally be declared in namespace %2">;
1144 def err_template_spec_redecl_out_of_scope : Error<
1145   "%select{class template|class template partial|function template|member "
1146   "function|static data member|member class}0 specialization of %1 not in a "
1147   "namespace enclosing %2">;
1148 def err_template_spec_redecl_global_scope : Error<
1149   "%select{class template|class template partial|function template|member "
1150   "function|static data member|member class}0 specialization of %1 must occur "
1151   "at global scope">;
1152 def err_spec_member_not_instantiated : Error<
1153   "specialization of member %q0 does not specialize an instantiated member">;
1154 def note_specialized_decl : Note<"attempt to specialize declaration here">;
1155 def err_specialization_after_instantiation : Error<
1156   "explicit specialization of %0 after instantiation">;
1157 def note_instantiation_required_here : Note<
1158   "%select{implicit|explicit}0 instantiation first required here">;
1159 def err_template_spec_friend : Error<
1160   "template specialization declaration cannot be a friend">;
1161 def err_template_spec_default_arg : Error<
1162   "default argument not permitted on an explicit "
1163   "%select{instantiation|specialization}0 of function %1">;
1164 def err_not_class_template_specialization : Error<
1165   "cannot specialize a %select{dependent template|template template "
1166   "parameter}0">;
1167
1168 // C++ class template specializations and out-of-line definitions
1169 def err_template_spec_needs_header : Error<
1170   "template specialization requires 'template<>'">;
1171 def err_template_spec_needs_template_parameters : Error<
1172   "template specialization or definition requires a template parameter list"
1173   "corresponding to the nested type %0">;
1174 def err_template_param_list_matches_nontemplate : Error<
1175   "template parameter list matching the non-templated nested type %0 should "
1176   "be empty ('template<>')">;
1177 def err_template_spec_extra_headers : Error<
1178   "extraneous template parameter list in template specialization or "
1179   "out-of-line template definition">;
1180 def warn_template_spec_extra_headers : Warning<
1181   "extraneous template parameter list in template specialization">;
1182 def note_explicit_template_spec_does_not_need_header : Note<
1183   "'template<>' header not required for explicitly-specialized class %0 "
1184   "declared here">;
1185 def err_template_qualified_declarator_no_match : Error<
1186   "nested name specifier '%0' for declaration does not refer into a class, "
1187   "class template or class template partial specialization">;
1188
1189 // C++ Class Template Partial Specialization
1190 def err_default_arg_in_partial_spec : Error<
1191     "default template argument in a class template partial specialization">;
1192 def err_dependent_non_type_arg_in_partial_spec : Error<
1193     "non-type template argument depends on a template parameter of the "
1194     "partial specialization">;
1195 def err_dependent_typed_non_type_arg_in_partial_spec : Error<
1196     "non-type template argument specializes a template parameter with "
1197     "dependent type %0">;
1198 def err_partial_spec_args_match_primary_template : Error<
1199     "class template partial specialization does not specialize any template "
1200     "argument; to %select{declare|define}0 the primary template, remove the "
1201     "template argument list">; 
1202 def warn_partial_specs_not_deducible : Warning<
1203     "class template partial specialization contains "
1204     "%select{a template parameter|template parameters}0 that can not be "
1205     "deduced; this partial specialization will never be used">;
1206 def note_partial_spec_unused_parameter : Note<
1207     "non-deducible template parameter %0">;
1208 def err_partial_spec_ordering_ambiguous : Error<
1209     "ambiguous partial specializations of %0">;
1210 def note_partial_spec_match : Note<"partial specialization matches %0">;
1211 def err_partial_spec_redeclared : Error<
1212   "class template partial specialization %0 cannot be redeclared">;
1213 def note_prev_partial_spec_here : Note<
1214   "previous declaration of class template partial specialization %0 is here">;
1215   
1216 // C++ Function template specializations
1217 def err_function_template_spec_no_match : Error<
1218     "no function template matches function template specialization %0">;
1219 def err_function_template_spec_ambiguous : Error<
1220     "function template specialization %0 ambiguously refers to more than one "
1221     "function template; explicitly specify%select{|additional }1 template "
1222     "arguments to identify a particular function template">;
1223 def note_function_template_spec_matched : Note<
1224     "function template matches specialization %0">;
1225
1226 // C++ Template Instantiation
1227 def err_template_recursion_depth_exceeded : Error<
1228   "recursive template instantiation exceeded maximum depth of %0">,
1229   DefaultFatal, NoSFINAE;
1230 def note_template_recursion_depth : Note<
1231   "use -ftemplate-depth-N to increase recursive template instantiation depth">;
1232
1233 def err_template_instantiate_undefined : Error<
1234   "%select{implicit|explicit}0 instantiation of undefined template %1">;
1235 def err_implicit_instantiate_member_undefined : Error<
1236   "implicit instantiation of undefined member %0">;
1237 def note_template_class_instantiation_here : Note<
1238   "in instantiation of template class %0 requested here">;
1239 def note_template_member_class_here : Note<
1240   "in instantiation of member class %0 requested here">;
1241 def note_template_member_function_here : Note<
1242   "in instantiation of member function %q0 requested here">;
1243 def note_function_template_spec_here : Note<
1244   "in instantiation of function template specialization %q0 requested here">;
1245 def note_template_static_data_member_def_here : Note<
1246   "in instantiation of static data member %q0 requested here">;
1247   
1248 def note_default_arg_instantiation_here : Note<
1249   "in instantiation of default argument for '%0' required here">;
1250 def note_default_function_arg_instantiation_here : Note<
1251   "in instantiation of default function argument expression "
1252   "for '%0' required here">;
1253 def note_explicit_template_arg_substitution_here : Note<
1254   "while substituting explicitly-specified template arguments into function "
1255   "template %f, here">;
1256 def note_function_template_deduction_instantiation_here : Note<
1257   "while substituting deduced template arguments into function template %0, "
1258   "here">;
1259 def note_partial_spec_deduct_instantiation_here : Note<
1260   "during template argument deduction for class template partial "
1261   "specialization %0, here">;
1262 def note_prior_template_arg_substitution : Note<
1263   "while substituting prior template arguments into %select{non-type|template}0"
1264   " template parameter%1 %2">;
1265 def note_template_default_arg_checking : Note<
1266   "while checking a default template argument used here">;
1267   
1268 def err_field_instantiates_to_function : Error<
1269   "data member instantiated with function type %0">;
1270 def err_nested_name_spec_non_tag : Error<
1271   "type %0 cannot be used prior to '::' because it has no members">;
1272
1273 // C++ Explicit Instantiation
1274 def err_explicit_instantiation_duplicate : Error<
1275     "duplicate explicit instantiation of %0">;
1276 def note_previous_explicit_instantiation : Note<
1277     "previous explicit instantiation is here">;
1278 def ext_explicit_instantiation_after_specialization : Extension<
1279     "explicit instantiation of %0 that occurs after an explicit "
1280     "specialization will be ignored (C++0x extension)">;
1281 def note_previous_template_specialization : Note<
1282     "previous template specialization is here">;
1283 def err_explicit_instantiation_enum : Error<
1284     "explicit instantiation of enumeration type %0">;
1285 def err_explicit_instantiation_nontemplate_type : Error<
1286     "explicit instantiation of non-templated type %0">;
1287 def note_nontemplate_decl_here : Note<
1288     "non-templated declaration is here">;
1289 def err_explicit_instantiation_out_of_scope : Error<
1290   "explicit instantiation of %0 not in a namespace enclosing %1">;
1291 def err_explicit_instantiation_must_be_global : Error<
1292   "explicit instantiation of %0 must occur at global scope">;
1293   
1294 def err_explicit_instantiation_requires_name : Error<
1295   "explicit instantiation declaration requires a name">;
1296 def err_explicit_instantiation_of_typedef : Error<
1297   "explicit instantiation of typedef %0">;
1298 def err_explicit_instantiation_not_known : Error<
1299   "explicit instantiation of %0 does not refer to a function template, member "
1300   "function, member class, or static data member">;
1301 def note_explicit_instantiation_here : Note<
1302   "explicit instantiation refers here">;
1303 def err_explicit_instantiation_data_member_not_instantiated : Error<
1304   "explicit instantiation refers to static data member %q0 that is not an "
1305   "instantiation">;
1306 def err_explicit_instantiation_member_function_not_instantiated : Error<
1307   "explicit instantiation refers to member function %q0 that is not an "
1308   "instantiation">;
1309 def err_explicit_instantiation_ambiguous : Error<
1310   "partial ordering for explicit instantiation of %0 is ambiguous">;
1311 def note_explicit_instantiation_candidate : Note<
1312   "explicit instantiation candidate function template here %0">;
1313 def err_explicit_instantiation_inline : Error<
1314   "explicit instantiation cannot be 'inline'">;
1315 def err_explicit_instantiation_without_qualified_id : Error<
1316   "qualifier in explicit instantiation of %q0 requires a template-id">;
1317 def err_explicit_instantiation_without_qualified_id_quals : Error<
1318   "qualifier in explicit instantiation of '%0%1' requires a template-id">;
1319 def err_explicit_instantiation_unqualified_wrong_namespace : Error<
1320   "explicit instantiation of %q0 must occur in %1">;
1321 def err_explicit_instantiation_undefined_member : Error<
1322   "explicit instantiation of undefined %select{member class|member function|"
1323   "static data member}0 %1 of class template %2">;
1324 def err_explicit_instantiation_undefined_func_template : Error<
1325   "explicit instantiation of undefined function template %0">;
1326 def err_explicit_instantiation_declaration_after_definition : Error<
1327   "explicit instantiation declaration (with 'extern') follows explicit "
1328   "instantiation definition (without 'extern')">;
1329 def note_explicit_instantiation_definition_here : Note<
1330   "explicit instantiation definition is here">;
1331   
1332 // C++ typename-specifiers
1333 def err_typename_nested_not_found : Error<"no type named %0 in %1">;
1334 def err_typename_nested_not_type : Error<
1335     "typename specifier refers to non-type member %0 in %1">;
1336 def note_typename_refers_here : Note<
1337     "referenced member %0 is declared here">;
1338 def err_typename_missing : Error<
1339   "missing 'typename' prior to dependent type name '%0%1'">;
1340
1341 def err_template_kw_refers_to_non_template : Error<
1342     "%0 following the 'template' keyword does not refer to a template">;
1343 def err_template_kw_refers_to_function_template : Error<
1344     "%0 following the 'template' keyword refers to a function template">;
1345 def err_template_kw_refers_to_class_template : Error<
1346     "'%0%1' instantiated to a class template, not a function template">;
1347 def note_referenced_class_template : Error<
1348     "class template declared here">;
1349 def err_template_kw_missing : Error<
1350   "missing 'template' keyword prior to dependent template name '%0%1'">;
1351
1352 // C++0x Variadic Templates
1353 def err_template_param_pack_default_arg : Error<
1354   "template parameter pack cannot have a default argument">;
1355 def err_template_param_pack_must_be_last_template_parameter : Error<
1356   "template parameter pack must be the last template parameter">;
1357
1358 def err_unexpected_typedef : Error<
1359   "unexpected type name %0: expected expression">;
1360 def err_unexpected_namespace : Error<
1361   "unexpected namespace name %0: expected expression">;
1362 def err_undeclared_var_use : Error<"use of undeclared identifier %0">;
1363 def note_dependent_var_use : Note<"must qualify identifier to find this "
1364     "declaration in dependent base class">;
1365 def err_undeclared_use : Error<"use of undeclared %0">;
1366 def warn_deprecated : Warning<"%0 is deprecated">,
1367     InGroup<DiagGroup<"deprecated-declarations">>;
1368 def warn_unavailable : Warning<"%0 is unavailable">,
1369     InGroup<DiagGroup<"unavailable-declarations">>;
1370 def note_unavailable_here : Note<
1371   "function has been explicitly marked %select{unavailable|deleted}0 here">;
1372 def warn_not_enough_argument : Warning<
1373   "not enough variable arguments in %0 declaration to fit a sentinel">;
1374 def warn_missing_sentinel : Warning <
1375   "missing sentinel in %select{function call|method dispatch|block call}0">;
1376 def note_sentinel_here : Note<
1377   "%select{function|method|block}0 has been explicitly marked sentinel here">;
1378 def warn_missing_prototype : Warning<
1379   "no previous prototype for function %0">,
1380   InGroup<DiagGroup<"missing-prototypes">>, DefaultIgnore;
1381 def err_redefinition : Error<"redefinition of %0">;
1382 def err_definition_of_implicitly_declared_member : Error<
1383   "definition of implicitly declared %select{constructor|copy constructor|"
1384   "copy assignment operator|destructor}1">;
1385   
1386 def warn_redefinition_of_typedef : Warning<
1387   "redefinition of typedef %0 is invalid in C">,
1388   InGroup<DiagGroup<"typedef-redefinition"> >, DefaultError;
1389
1390 def err_static_non_static : Error<
1391   "static declaration of %0 follows non-static declaration">;
1392 def err_non_static_static : Error<
1393   "non-static declaration of %0 follows static declaration">;
1394 def err_non_thread_thread : Error<
1395   "non-thread-local declaration of %0 follows thread-local declaration">;
1396 def err_thread_non_thread : Error<
1397   "thread-local declaration of %0 follows non-thread-local declaration">;
1398 def err_redefinition_different_type : Error<
1399   "redefinition of %0 with a different type">;
1400 def err_redefinition_different_kind : Error<
1401   "redefinition of %0 as different kind of symbol">;
1402 def err_redefinition_different_typedef : Error<
1403   "typedef redefinition with different types (%0 vs %1)">;
1404 def err_tag_definition_of_typedef : Error<
1405   "definition of type %0 conflicts with typedef of the same name">;
1406 def err_conflicting_types : Error<"conflicting types for %0">;
1407 def err_nested_redefinition : Error<"nested redefinition of %0">;
1408 def err_use_with_wrong_tag : Error<
1409   "use of %0 with tag type that does not match previous declaration">;
1410 def warn_struct_class_tag_mismatch : Warning<
1411     "%select{struct|class}0 %select{|template}1 %2 was previously declared "
1412     "as a %select{class|struct}0 %select{|template}1">,
1413     InGroup<MismatchedTags>, DefaultIgnore;
1414 def ext_forward_ref_enum : Extension<
1415   "ISO C forbids forward references to 'enum' types">;
1416 def err_forward_ref_enum : Error<
1417   "ISO C++ forbids forward references to 'enum' types">;
1418 def err_redefinition_of_enumerator : Error<"redefinition of enumerator %0">;
1419 def err_duplicate_member : Error<"duplicate member %0">;
1420 def ext_enum_value_not_int : Extension<
1421   "ISO C restricts enumerator values to range of 'int' (%0 is too large)">;
1422 def warn_enum_too_large : Warning<
1423   "enumeration values exceed range of largest integer">;
1424 def warn_illegal_constant_array_size : Extension<
1425   "size of static array must be an integer constant expression">;
1426 def err_vla_decl_in_file_scope : Error<
1427   "variable length array declaration not allowed at file scope">;
1428 def err_vla_decl_has_static_storage : Error<
1429   "variable length array declaration can not have 'static' storage duration">;
1430 def err_vla_decl_has_extern_linkage : Error<
1431   "variable length array declaration can not have 'extern' linkage">;
1432 def err_vm_decl_in_file_scope : Error<
1433   "variably modified type declaration not allowed at file scope">;
1434 def err_vm_decl_has_extern_linkage : Error<
1435   "variably modified type declaration can not have 'extern' linkage">;
1436 def err_typecheck_field_variable_size : Error<
1437   "fields must have a constant size: 'variable length array in structure' "
1438   "extension will never be supported">;
1439 def err_vm_func_decl : Error<
1440   "function declaration cannot have variably modified type">;
1441
1442 def err_typecheck_negative_array_size : Error<"array size is negative">;
1443 def warn_typecheck_function_qualifiers : Warning<
1444   "qualifier on function type %0 has unspecified behavior">;
1445 def err_typecheck_invalid_restrict_not_pointer : Error<
1446   "restrict requires a pointer or reference (%0 is invalid)">;
1447 def err_typecheck_invalid_restrict_not_pointer_noarg : Error<
1448   "restrict requires a pointer or reference">;
1449 def err_typecheck_invalid_restrict_invalid_pointee : Error<
1450   "pointer to function type %0 may not be 'restrict' qualified">;
1451 def ext_typecheck_zero_array_size : Extension<
1452   "zero size arrays are an extension">;
1453 def err_at_least_one_initializer_needed_to_size_array : Error<
1454   "at least one initializer value required to size array">;
1455 def err_array_size_non_int : Error<"size of array has non-integer type %0">;
1456 def err_init_element_not_constant : Error<
1457   "initializer element is not a compile-time constant">;
1458 def err_block_extern_cant_init : Error<
1459   "'extern' variable cannot have an initializer">;
1460 def warn_extern_init : Warning<"'extern' variable has an initializer">;
1461 def err_variable_object_no_init : Error<
1462   "variable-sized object may not be initialized">;
1463 def err_array_init_list_required : Error<
1464   "initialization with '{...}' expected for array">;
1465 def err_excess_initializers : Error<
1466   "excess elements in %select{array|vector|scalar|union|struct}0 initializer">;
1467 def warn_excess_initializers : ExtWarn<
1468   "excess elements in %select{array|vector|scalar|union|struct}0 initializer">;
1469 def err_excess_initializers_in_char_array_initializer : Error<
1470   "excess elements in char array initializer">;
1471 def warn_excess_initializers_in_char_array_initializer : ExtWarn<
1472   "excess elements in char array initializer">;
1473 def warn_initializer_string_for_char_array_too_long : ExtWarn<
1474   "initializer-string for char array is too long">;
1475 def warn_braces_around_scalar_init : Warning<
1476   "braces around scalar initializer">;
1477 def err_many_braces_around_scalar_init : Error<
1478   "too many braces around scalar initializer">;
1479 def err_empty_scalar_initializer : Error<"scalar initializer cannot be empty">;
1480 def err_illegal_initializer : Error<
1481   "illegal initializer (only variables can be initialized)">;
1482 def err_illegal_initializer_type : Error<"illegal initializer type %0">;
1483 def err_implicit_empty_initializer : Error<
1484   "initializer for aggregate with no elements requires explicit braces">;
1485 def err_bitfield_has_negative_width : Error<
1486   "bit-field %0 has negative width (%1)">;
1487 def err_anon_bitfield_has_negative_width : Error<
1488   "anonymous bit-field has negative width (%0)">;
1489 def err_bitfield_has_zero_width : Error<"named bit-field %0 has zero width">;
1490 def err_bitfield_width_exceeds_type_size : Error<
1491   "size of bit-field %0 exceeds size of its type (%1 bits)">;
1492 def err_anon_bitfield_width_exceeds_type_size : Error<
1493   "size of anonymous bit-field exceeds size of its type (%0 bits)">;
1494
1495 def err_redefinition_of_label : Error<"redefinition of label '%0'">;
1496 def err_undeclared_label_use : Error<"use of undeclared label '%0'">;
1497
1498 def err_goto_into_protected_scope : Error<"illegal goto into protected scope">;
1499 def err_switch_into_protected_scope : Error<
1500   "illegal switch case into protected scope">;
1501 def err_indirect_goto_in_protected_scope : Error<
1502   "illegal indirect goto in protected scope, unknown effect on scopes">;
1503 def err_addr_of_label_in_protected_scope : Error<
1504   "address taken of label in protected scope, jump to it would have "
1505   "unknown effect on scope">;
1506 def note_protected_by_vla_typedef : Note<
1507   "jump bypasses initialization of VLA typedef">;
1508 def note_protected_by_vla : Note<
1509   "jump bypasses initialization of variable length array">;
1510 def note_protected_by_cleanup : Note<
1511   "jump bypasses initialization of declaration with __attribute__((cleanup))">;
1512 def note_protected_by_objc_try : Note<
1513   "jump bypasses initialization of @try block">;
1514 def note_protected_by_objc_catch : Note<
1515   "jump bypasses initialization of @catch block">;
1516 def note_protected_by_objc_finally : Note<
1517   "jump bypasses initialization of @finally block">;
1518 def note_protected_by_objc_synchronized : Note<
1519   "jump bypasses initialization of @synchronized block">;
1520 def note_protected_by_cxx_try : Note<
1521   "jump bypasses initialization of try block">;
1522 def note_protected_by_cxx_catch : Note<
1523   "jump bypasses initialization of catch block">;
1524 def note_protected_by___block : Note<
1525   "jump bypasses setup of __block variable">;
1526
1527 def err_func_returning_array_function : Error<
1528   "function cannot return %select{array|function}0 type %1">;
1529 def err_field_declared_as_function : Error<"field %0 declared as a function">;
1530 def err_field_incomplete : Error<"field has incomplete type %0">;
1531 def ext_variable_sized_type_in_struct : ExtWarn<
1532   "field %0 with variable sized type %1 not at the end of a struct or class is"
1533   " a GNU extension">;
1534
1535 def err_flexible_array_empty_struct : Error<
1536   "flexible array %0 not allowed in otherwise empty struct">;
1537 def ext_flexible_array_in_struct : Extension<
1538   "%0 may not be nested in a struct due to flexible array member">;
1539 def ext_flexible_array_in_array : Extension<
1540   "%0 may not be used as an array element due to flexible array member">;
1541 def err_flexible_array_init_nonempty : Error<
1542   "non-empty initialization of flexible array member inside subobject">;
1543 def err_flexible_array_init_needs_braces : Error<
1544   "flexible array requires brace-enclosed initializer">;
1545 def err_illegal_decl_array_of_functions : Error<
1546   "'%0' declared as array of functions of type %1">;
1547 def err_illegal_decl_array_incomplete_type : Error<
1548   "array has incomplete element type %0">;
1549 def err_illegal_decl_array_of_references : Error<
1550   "'%0' declared as array of references of type %1">;
1551 def err_array_star_outside_prototype : Error<
1552   "star modifier used outside of function prototype">;
1553 def err_illegal_decl_pointer_to_reference : Error<
1554   "'%0' declared as a pointer to a reference of type %1">;
1555 def err_illegal_decl_mempointer_to_reference : Error<
1556   "'%0' declared as a member pointer to a reference of type %1">;
1557 def err_illegal_decl_mempointer_to_void : Error<
1558   "'%0' declared as a member pointer to void">;
1559 def err_illegal_decl_mempointer_in_nonclass : Error<
1560   "'%0' does not point into a class">;
1561 def err_mempointer_in_nonclass_type : Error<
1562   "member pointer refers into non-class type %0">;
1563 def err_reference_to_void : Error<"cannot form a reference to 'void'">;
1564 def err_qualified_block_pointer_type : Error<
1565   "qualifier specification on block pointer type not allowed">;
1566 def err_nonfunction_block_type : Error<
1567   "block pointer to non-function type is invalid">;
1568 def err_return_block_has_expr : Error<"void block should not return a value">;
1569 def err_block_return_missing_expr : Error<
1570   "non-void block should return a value">;
1571 def err_block_with_return_type_requires_args : Error<
1572   "block with explicit return type requires argument list">;
1573 def err_func_def_incomplete_result : Error<
1574   "incomplete result type %0 in function definition">;
1575
1576 // Expressions.
1577 def ext_sizeof_function_type : Extension<
1578   "invalid application of 'sizeof' to a function type">, InGroup<PointerArith>;
1579 def ext_sizeof_void_type : Extension<
1580   "invalid application of '%0' to a void type">, InGroup<PointerArith>;
1581 def err_sizeof_alignof_incomplete_type : Error<
1582   "invalid application of '%select{sizeof|__alignof}0' to an incomplete type %1">;
1583 def err_sizeof_alignof_bitfield : Error<
1584   "invalid application of '%select{sizeof|__alignof}0' to bit-field">;
1585 def err_offsetof_incomplete_type : Error<
1586   "offsetof of incomplete type %0">;
1587 def err_offsetof_record_type : Error<
1588   "offsetof requires struct, union, or class type, %0 invalid">;
1589 def err_offsetof_array_type : Error<"offsetof requires array type, %0 invalid">;
1590 def ext_offsetof_extended_field_designator : Extension<
1591   "using extended field designator is an extension">;
1592 def warn_offsetof_non_pod_type : ExtWarn<"offset of on non-POD type %0">,
1593   InGroup<InvalidOffsetof>;
1594
1595 def warn_floatingpoint_eq : Warning<
1596   "comparing floating point with == or != is unsafe">,
1597   InGroup<DiagGroup<"float-equal">>, DefaultIgnore;
1598
1599 def warn_division_by_zero : Warning<"division by zero is undefined">;
1600 def warn_remainder_by_zero : Warning<"remainder by zero is undefined">;
1601 def warn_shift_negative : Warning<"shift count is negative">;
1602 def warn_shift_gt_typewidth : Warning<"shift count >= width of type">;
1603
1604 def warn_precedence_bitwise_rel : Warning<
1605   "%0 has lower precedence than %1; %1 will be evaluated first">,
1606   InGroup<Parentheses>;
1607 def note_precedence_bitwise_first : Note<
1608   "place parentheses around the %0 expression to evaluate it first">;
1609   
1610 def err_sizeof_nonfragile_interface : Error<
1611   "invalid application of '%select{alignof|sizeof}1' to interface %0 in "
1612   "non-fragile ABI">;
1613 def err_atdef_nonfragile_interface : Error<
1614   "invalid application of @defs in non-fragile ABI">;
1615 def err_subscript_nonfragile_interface : Error<
1616   "subscript requires size of interface %0, which is not constant in "
1617   "non-fragile ABI">;
1618
1619 def err_arithmetic_nonfragile_interface : Error<
1620   "arithmetic on pointer to interface %0, which is not a constant size in "
1621   "non-fragile ABI">;
1622
1623
1624 def ext_subscript_non_lvalue : Extension<
1625   "ISO C90 does not allow subscripting non-lvalue array">;
1626 def err_typecheck_subscript_value : Error<
1627   "subscripted value is not an array, pointer, or vector">;
1628 def err_typecheck_subscript_not_integer : Error<
1629   "array subscript is not an integer">;
1630 def err_subscript_function_type : Error<
1631   "subscript of pointer to function type %0">;
1632 def err_subscript_incomplete_type : Error<
1633   "subscript of pointer to incomplete type %0">;
1634 def err_typecheck_member_reference_struct_union : Error<
1635   "member reference base type %0 is not a structure or union">;
1636 def err_typecheck_member_reference_ivar : Error<
1637   "%0 does not have a member named %1">;
1638 def err_typecheck_member_reference_arrow : Error<
1639   "member reference type %0 is not a pointer">;
1640 def err_typecheck_member_reference_suggestion : Error<
1641   "member reference type %0 is %select{a|not a}1 pointer; maybe you meant to use '%select{->|.}1'?">;
1642 def err_typecheck_member_reference_type : Error<
1643   "cannot refer to type member %0 with '%select{.|->}1'">;
1644 def err_typecheck_member_reference_unknown : Error<
1645   "cannot refer to member %0 with '%select{.|->}1'">;
1646 def err_member_reference_needs_call : Error<
1647   "base of member reference has function type %0; perhaps you meant to call "
1648   "this function with '()'?">;
1649 def warn_subscript_is_char : Warning<"array subscript is of type 'char'">,
1650   InGroup<CharSubscript>, DefaultIgnore;
1651
1652 def err_typecheck_incomplete_tag : Error<"incomplete definition of type %0">;
1653 def err_no_member : Error<"no member named %0 in %1">;
1654
1655 def err_member_redeclared : Error<"class member cannot be redeclared">;
1656 def err_member_def_does_not_match : Error<
1657   "out-of-line definition of %0 does not match any declaration in %1">;
1658 def err_nonstatic_member_out_of_line : Error<
1659   "non-static data member defined out-of-line">;
1660 def err_qualified_typedef_declarator : Error<
1661   "typedef declarator cannot be qualified">;
1662 def err_qualified_param_declarator : Error<
1663   "parameter declarator cannot be qualified">;
1664 def err_out_of_line_declaration : Error<
1665   "out-of-line declaration of a member must be a definition">;
1666 def note_member_def_close_match : Note<"member declaration nearly matches">;
1667 def err_typecheck_ivar_variable_size : Error<
1668   "instance variables must have a constant size">;
1669 def err_typecheck_illegal_increment_decrement : Error<
1670   "cannot %select{decrement|increment}1 value of type %0">;
1671 def err_typecheck_arithmetic_incomplete_type : Error<
1672   "arithmetic on pointer to incomplete type %0">;
1673 def err_typecheck_pointer_arith_function_type : Error<
1674   "arithmetic on pointer to function type %0">;
1675 def err_typecheck_pointer_arith_void_type : Error<
1676   "arithmetic on pointer to void type">;
1677 def err_typecheck_decl_incomplete_type : Error<
1678   "variable has incomplete type %0">;
1679 def ext_typecheck_decl_incomplete_type : ExtWarn<
1680   "tentative definition of variable with internal linkage has incomplete non-array type %0">;
1681 def err_tentative_def_incomplete_type : Error<
1682   "tentative definition has type %0 that is never completed">;
1683 def err_tentative_def_incomplete_type_arr : Error<
1684   "tentative definition has array of type %0 that is never completed">;
1685 def warn_tentative_incomplete_array : Warning<
1686   "tentative array definition assumed to have one element">;
1687 def err_typecheck_incomplete_array_needs_initializer : Error<
1688   "definition of variable with array type needs an explicit size "
1689   "or an initializer">;
1690 def err_array_init_not_init_list : Error<
1691   "array initializer must be an initializer "
1692   "list%select{| or string literal}0">;
1693
1694 def err_realimag_invalid_type : Error<"invalid type %0 to %1 operator">;
1695 def err_typecheck_sclass_fscope : Error<
1696   "illegal storage class on file-scoped variable">;
1697 def err_unsupported_global_register : Error<
1698   "global register variables are not supported">;
1699 def err_typecheck_sclass_func : Error<"illegal storage class on function">;
1700 def err_static_block_func : Error<
1701   "function declared in block scope cannot have 'static' storage class">;
1702 def err_typecheck_address_of : Error<"address of %0 requested">;
1703 def ext_typecheck_addrof_void : Extension<
1704   "ISO C forbids taking the address of an expression of type 'void'">;
1705 def err_unqualified_pointer_member_function : Error<
1706   "must explicitly qualify member function %0 when taking its address">;
1707 def err_typecheck_invalid_lvalue_addrof : Error<
1708   "address expression must be an lvalue or a function designator">;
1709 def err_typecheck_unary_expr : Error<
1710   "invalid argument type %0 to unary expression">;
1711 def err_typecheck_indirection_requires_pointer : Error<
1712   "indirection requires pointer operand (%0 invalid)">;
1713 def err_indirection_requires_nonfragile_object : Error<
1714   "indirection cannot be to an interface in non-fragile ABI (%0 invalid)">;
1715 def err_direct_interface_unsupported : Error<
1716   "indirection to an interface is not supported (%0 invalid)">;
1717 def err_typecheck_invalid_operands : Error<
1718   "invalid operands to binary expression (%0 and %1)">;
1719 def err_typecheck_sub_ptr_object : Error<
1720   "subtraction of pointer %0 requires pointee to be a complete object type">;
1721 def err_typecheck_sub_ptr_compatible : Error<
1722   "%0 and %1 are not pointers to compatible types">;
1723 def ext_typecheck_ordered_comparison_of_pointer_integer : ExtWarn<
1724   "ordered comparison between pointer and integer (%0 and %1)">;
1725 def ext_typecheck_ordered_comparison_of_pointer_and_zero : Extension<
1726   "ordered comparison between pointer and zero (%0 and %1) is an extension">;
1727 def ext_typecheck_ordered_comparison_of_function_pointers : ExtWarn<
1728   "ordered comparison of function pointers (%0 and %1)">;
1729 def ext_typecheck_comparison_of_fptr_to_void : Extension<
1730   "equality comparison between function pointer and void pointer (%0 and %1)">;
1731 def ext_typecheck_comparison_of_pointer_integer : ExtWarn<
1732   "comparison between pointer and integer (%0 and %1)">;
1733 def ext_typecheck_comparison_of_distinct_pointers : ExtWarn<
1734   "comparison of distinct pointer types (%0 and %1)">;
1735 def ext_typecheck_cond_incompatible_operands : ExtWarn<
1736   "incompatible operand types (%0 and %1)">;
1737 def err_typecheck_comparison_of_distinct_pointers : Error<
1738   "comparison of distinct pointer types (%0 and %1)">;
1739 def err_typecheck_vector_comparison : Error<
1740   "comparison of vector types (%0 and %1) not supported yet">;
1741 def err_typecheck_assign_const : Error<"read-only variable is not assignable">;
1742 def err_stmtexpr_file_scope : Error<
1743   "statement expression not allowed at file scope">;
1744 def warn_mixed_sign_comparison : Warning<
1745   "comparison of integers of different signs: %0 and %1">,
1746   InGroup<DiagGroup<"sign-compare">>, DefaultIgnore;
1747 def warn_mixed_sign_conditional : Warning<
1748   "operands of ? are integers of different signs: %0 and %1">,
1749   InGroup<DiagGroup<"sign-compare">>, DefaultIgnore;
1750
1751 def err_invalid_this_use : Error<
1752   "invalid use of 'this' outside of a nonstatic member function">;
1753 def err_invalid_member_use_in_static_method : Error<
1754   "invalid use of member %0 in static member function">;
1755 def err_invalid_qualified_function_type : Error<
1756   "type qualifier is not allowed on this function">;
1757 def err_invalid_qualified_typedef_function_type_use : Error<
1758   "a qualified function type cannot be used to declare a nonmember function "
1759   "or a static member function">;
1760
1761 def err_invalid_non_static_member_use : Error<
1762   "invalid use of nonstatic data member %0">;
1763 def err_invalid_incomplete_type_use : Error<
1764   "invalid use of incomplete type %0">;
1765 def err_builtin_func_cast_more_than_one_arg : Error<
1766   "function-style cast to a builtin type can only take one argument">;
1767 def err_builtin_direct_init_more_than_one_arg : Error<
1768   "initializer of a builtin type can only take one argument">;
1769 def err_value_init_for_array_type : Error<
1770   "array types cannot be value-initialized">;
1771 def warn_printf_nonliteral_noargs : Warning<
1772   "format string is not a string literal (potentially insecure)">,
1773   InGroup<FormatSecurity>;
1774 def warn_printf_nonliteral : Warning<
1775   "format string is not a string literal">,
1776   InGroup<FormatNonLiteral>, DefaultIgnore;
1777
1778 def err_unexpected_interface : Error<
1779   "unexpected interface name %0: expected expression">;
1780 def err_ref_non_value : Error<"%0 does not refer to a value">;
1781 def err_ref_vm_type : Error<
1782   "cannot refer to declaration with a variably modified type inside block">;
1783 def err_ref_array_type : Error<
1784   "cannot refer to declaration with an array type inside block">;
1785 def err_property_not_found : Error<
1786   "property %0 not found on object of type %1">;
1787 def err_duplicate_property : Error<
1788   "property has a previous declaration">;
1789 def ext_gnu_void_ptr : Extension<
1790   "use of GNU void* extension">, InGroup<PointerArith>;
1791 def ext_gnu_ptr_func_arith : Extension<
1792   "arithmetic on pointer to function type %0 is a GNU extension">,
1793   InGroup<PointerArith>;
1794 def error_readonly_property_assignment : Error<
1795   "assigning to property with 'readonly' attribute not allowed">;
1796 def ext_integer_increment_complex : Extension<
1797   "ISO C does not support '++'/'--' on complex integer type %0">;
1798 def ext_integer_complement_complex : Extension<
1799   "ISO C does not support '~' for complex conjugation of %0">;
1800 def error_nosetter_property_assignment : Error<
1801   "setter method is needed to assign to object using property" " assignment syntax">;
1802 def error_no_subobject_property_setting : Error<
1803   "cannot assign to a sub-structure of an ivar using property" " assignment syntax">;
1804
1805 def ext_freestanding_complex : Extension<
1806   "complex numbers are an extension in a freestanding C99 implementation">;
1807
1808
1809 // Obj-c expressions
1810 def warn_root_inst_method_not_found : Warning<
1811   "instance method %0 is being used on 'Class' which is not in the root class">;
1812 def warn_class_method_not_found : Warning<
1813   "method %objcclass0 not found (return type defaults to 'id')">;
1814 def warn_inst_method_not_found : Warning<
1815   "method %objcinstance0 not found (return type defaults to 'id')">;
1816 def error_no_super_class_message : Error<
1817   "no @interface declaration found in class messaging of %0">;
1818 def error_no_super_class : Error<
1819   "no super class declared in @interface for %0">;
1820 def err_invalid_receiver_to_message : Error<
1821   "invalid receiver to message expression">;
1822 def warn_bad_receiver_type : Warning<
1823   "receiver type %0 is not 'id' or interface pointer, consider "
1824   "casting it to 'id'">;
1825 def err_bad_receiver_type : Error<"bad receiver type %0">;
1826 def error_objc_throw_expects_object : Error<
1827   "@throw requires an Objective-C object type (%0 invalid)">;
1828 def error_objc_synchronized_expects_object : Error<
1829   "@synchronized requires an Objective-C object type (%0 invalid)">;
1830 def error_rethrow_used_outside_catch : Error<
1831   "@throw (rethrow) used outside of a @catch block">;
1832 def err_attribute_multiple_objc_gc : Error<
1833   "multiple garbage collection attributes specified for type">;
1834 def err_catch_param_not_objc_type : Error<
1835   "@catch parameter is not a pointer to an interface type">;
1836 def err_illegal_qualifiers_on_catch_parm : Error<
1837   "illegal qualifiers on @catch parameter">;
1838 def err_illegal_super_cast : Error<
1839   "cannot cast 'super' (it isn't an expression)">;
1840 def warn_setter_getter_impl_required : Warning<
1841   "property %0 requires method %1 to be defined - "
1842   "use @synthesize, @dynamic or provide a method implementation">;
1843 def note_property_impl_required : Note<
1844   "implementation is here">;
1845
1846
1847 // C++ casts
1848 // These messages adhere to the TryCast pattern: %0 is an int specifying the
1849 // cast type, %1 is the source type, %2 is the destination type.
1850 def err_bad_cxx_cast_generic : Error<
1851   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
1852   "functional-style cast}0 from %1 to %2 is not allowed">;
1853 def err_bad_cxx_cast_rvalue : Error<
1854   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
1855   "functional-style cast}0 from rvalue to reference type %2">;
1856 def err_bad_cxx_cast_const_away : Error<
1857   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
1858   "functional-style cast}0 from %1 to %2 casts away constness">;
1859 def err_bad_const_cast_dest : Error<
1860   "%select{const_cast||||C-style cast|functional-style cast}0 to %2, "
1861   "which is not a reference, pointer-to-object, or pointer-to-data-member">;
1862 def ext_cast_fn_obj : Extension<
1863   "cast between pointer-to-function and pointer-to-object is an extension">;
1864 def err_bad_reinterpret_cast_small_int : Error<
1865   "cast from pointer to smaller type %2 loses information">;
1866 def err_bad_cxx_cast_vector_to_scalar_different_size : Error<
1867   "%select{||reinterpret_cast||C-style cast|}0 from vector %1 " 
1868   "to scalar %2 of different size">;
1869 def err_bad_cxx_cast_scalar_to_vector_different_size : Error<
1870   "%select{||reinterpret_cast||C-style cast|}0 from scalar %1 " 
1871   "to vector %2 of different size">;
1872 def err_bad_cxx_cast_vector_to_vector_different_size : Error<
1873   "%select{||reinterpret_cast||C-style cast|}0 from vector %1 " 
1874   "to vector %2 of different size">;
1875 def err_bad_lvalue_to_rvalue_cast : Error<
1876   "cannot cast from lvalue of type %1 to rvalue reference type %2; types are "
1877   "not compatible">;
1878 def err_bad_static_cast_pointer_nonpointer : Error<
1879   "cannot cast from type %1 to pointer type %2">;
1880 def err_bad_static_cast_member_pointer_nonmp : Error<
1881   "cannot cast from type %1 to member pointer type %2">;
1882 def err_bad_static_cast_incomplete : Error<"%0 is an incomplete type">;
1883
1884 // These messages don't adhere to the pattern.
1885 // FIXME: Display the path somehow better.
1886 def err_ambiguous_base_to_derived_cast : Error<
1887   "ambiguous cast from base %0 to derived %1:%2">;
1888 def err_static_downcast_via_virtual : Error<
1889   "cannot cast %0 to %1 via virtual base %2">;
1890 def err_downcast_from_inaccessible_base : Error<
1891   "cannot cast %1 to %0 due to inaccessible conversion path">;
1892 def err_bad_dynamic_cast_not_ref_or_ptr : Error<
1893   "%0 is not a reference or pointer">;
1894 def err_bad_dynamic_cast_not_class : Error<"%0 is not a class">;
1895 def err_bad_dynamic_cast_incomplete : Error<"%0 is an incomplete type">;
1896 def err_bad_dynamic_cast_not_ptr : Error<"%0 is not a pointer">;
1897 def err_bad_dynamic_cast_not_polymorphic : Error<"%0 is not polymorphic">;
1898
1899 // Other C++ expressions
1900 def err_need_header_before_typeid : Error<
1901   "you need to include <typeinfo> before using the 'typeid' operator">;
1902 def err_incomplete_typeid : Error<"'typeid' of incomplete type %0">;
1903 def err_static_illegal_in_new : Error<
1904   "the 'static' modifier for the array size is not legal in new expressions">;
1905 def err_array_new_needs_size : Error<
1906   "array size must be specified in new expressions">;
1907 def err_bad_new_type : Error<
1908   "cannot allocate %select{function|reference}1 type %0 with new">;
1909 def err_new_incomplete_type : Error<
1910   "allocation of incomplete type %0">;
1911 def err_new_array_nonconst : Error<
1912   "only the first dimension of an allocated array may have dynamic size">;
1913 def err_new_paren_array_nonconst : Error<
1914   "when type is in parentheses, array cannot have dynamic size">;
1915 def err_array_size_not_integral : Error<
1916   "array size expression must have integral or enumerated type, not %0">;
1917 def err_default_init_const : Error<
1918   "default initialization of an object of const type %0">;  
1919 def err_delete_operand : Error<"cannot delete expression of type %0">;
1920 def err_ambiguous_delete_operand : Error<"ambiguous conversion of delete "
1921                                          "expression of type %0 to a pointer">;
1922 def warn_delete_incomplete : Warning<
1923   "deleting pointer to incomplete type %0 may cause undefined behaviour">;
1924 def err_no_suitable_delete_member_function_found : Error<
1925   "no suitable member %0 in %1">;
1926 def note_delete_member_function_declared_here : Note<
1927   "%0 declared here">;
1928 def err_decrement_bool : Error<"cannot decrement expression of type bool">;
1929 def warn_increment_bool : Warning<
1930   "incrementing expression of type bool is deprecated">;
1931 def err_catch_incomplete_ptr : Error<
1932   "cannot catch pointer to incomplete type %0">;
1933 def err_catch_incomplete_ref : Error<
1934   "cannot catch reference to incomplete type %0">;
1935 def err_catch_incomplete : Error<"cannot catch incomplete type %0">;
1936 def err_catch_rvalue_ref : Error<"cannot catch exceptions by rvalue reference">;
1937 def err_qualified_catch_declarator : Error<
1938   "exception declarator cannot be qualified">;
1939 def err_early_catch_all : Error<"catch-all handler must come last">;
1940 def err_bad_memptr_rhs : Error<
1941   "right hand operand to %0 has non pointer-to-member type %1">;
1942 def err_bad_memptr_lhs : Error<
1943   "left hand operand to %0 must be a %select{|pointer to }1class "
1944   "compatible with the right hand operand, but is %2">;
1945 def warn_exception_caught_by_earlier_handler : Warning<
1946   "exception of type %0 will be caught by earlier handler">;
1947 def note_previous_exception_handler : Note<"for type %0">;
1948
1949 def err_conditional_void_nonvoid : Error<
1950   "%select{left|right}1 operand to ? is void, but %select{right|left}1 operand "
1951   "is of type %0">;
1952 def err_conditional_ambiguous : Error<
1953   "conditional expression is ambiguous; %0 can be converted to %1 "
1954   "and vice versa">;
1955 def err_conditional_ambiguous_ovl : Error<
1956   "conditional expression is ambiguous; %0 and %1 can be converted to several "
1957   "common types">;
1958
1959 def err_throw_incomplete : Error<
1960   "cannot throw object of incomplete type %0">;
1961 def err_throw_incomplete_ptr : Error<
1962   "cannot throw pointer to object of incomplete type %0">;
1963 def err_return_in_constructor_handler : Error<
1964   "return in the catch of a function try block of a constructor is illegal">;
1965
1966 def err_operator_arrow_circular : Error<
1967   "circular pointer delegation detected">;
1968 def err_pseudo_dtor_base_not_scalar : Error<
1969   "object expression of non-scalar type %0 cannot be used in a "
1970   "pseudo-destructor expression">;
1971 def err_pseudo_dtor_type_mismatch : Error<
1972   "the type of object expression (%0) does not match the type being destroyed "
1973   "(%1) in pseudo-destructor expression">;
1974 def err_pseudo_dtor_call_with_args : Error<
1975   "call to pseudo-destructor cannot have any arguments">;
1976 def err_dtor_expr_without_call : Error<
1977   "%select{destructor reference|pseudo-destructor expression}0 must be "
1978   "called immediately with '()'">;
1979
1980 def err_invalid_use_of_function_type : Error<
1981   "a function type is not allowed here">;
1982 def err_invalid_use_of_array_type : Error<"an array type is not allowed here">;
1983 def err_type_defined_in_condition : Error<
1984   "types may not be defined in conditions">;
1985 def err_typecheck_bool_condition : Error<
1986   "value of type %0 is not contextually convertible to 'bool'">;
1987 def err_typecheck_ambiguous_condition : Error<
1988   "conversion from %0 to %1 is ambiguous">;
1989 def err_typecheck_nonviable_condition : Error<
1990   "no viable conversion from %0 to %1">;
1991 def err_typecheck_deleted_function : Error<
1992   "conversion function from %0 to %1 invokes a deleted function">;
1993   
1994 def err_expected_class_or_namespace : Error<"expected a class or namespace">;
1995 def err_invalid_declarator_scope : Error<
1996   "definition or redeclaration of %0 not in a namespace enclosing %1">;
1997 def err_invalid_declarator_global_scope : Error<
1998   "definition or redeclaration of %0 cannot name the global scope">;
1999 def err_invalid_declarator_in_function : Error<
2000   "definition or redeclaration of %0 not allowed inside a function">;
2001 def err_not_tag_in_scope : Error<
2002   "%0 does not name a tag member in the specified scope">;
2003
2004 def err_cannot_form_pointer_to_member_of_reference_type : Error<
2005   "cannot form a pointer-to-member to member %0 of reference type %1">;
2006 def err_incomplete_object_call : Error<
2007   "incomplete type in call to object of type %0">;
2008   
2009 def warn_condition_is_assignment : Warning<"using the result of an "
2010   "assignment as a condition without parentheses">,
2011   InGroup<Parentheses>;
2012 // Completely identical except off by default.
2013 def warn_condition_is_idiomatic_assignment : Warning<"using the result "
2014   "of an assignment as a condition without parentheses">,
2015   InGroup<DiagGroup<"idiomatic-parentheses">>, DefaultIgnore;
2016 def note_condition_assign_to_comparison : Note<
2017   "use '==' to turn this assignment into an equality comparison">;
2018
2019 def warn_value_always_zero : Warning<
2020   "%0 is always %select{zero|false|NULL}1 in this context">;
2021
2022 // assignment related diagnostics (also for argument passing, returning, etc).
2023 // In most of these diagnostics the %2 is a value from the
2024 // Sema::AssignmentAction enumeration
2025 def err_typecheck_convert_incompatible : Error<
2026   "incompatible type %select{assigning|passing|returning|converting|initializing|sending|casting}2"
2027   " %1, expected %0">;
2028 def err_typecheck_convert_ambiguous : Error<
2029   "ambiguity in initializing value of type %0 with initializer of type %1">;
2030 def err_cannot_initialize_decl_noname : Error<
2031   "cannot initialize a value of type %0 with an %select{rvalue|lvalue}1 "
2032   "of type %2">;
2033 def err_cannot_initialize_decl : Error<
2034   "cannot initialize %0 with an %select{rvalue|lvalue}1 of type %2">;
2035 def warn_incompatible_qualified_id : Warning<
2036   "incompatible type %select{assigning|passing|returning|converting|initializing|sending|casting}2"
2037   " %1, expected %0">;
2038 def ext_typecheck_convert_pointer_int : ExtWarn<
2039   "incompatible pointer to integer conversion "
2040   "%select{assigning|passing|returning|converting|initializing|sending|casting}2 %1, expected %0">;
2041 def ext_typecheck_convert_int_pointer : ExtWarn<
2042   "incompatible integer to pointer conversion "
2043   "%select{assigning|passing|returning|converting|initializing|sending|casting}2 %1, expected %0">;
2044 def ext_typecheck_convert_pointer_void_func : Extension<
2045   "%select{assigning|passing|returning|converting|initializing|sending|casting}2"
2046   " %1 converts between void* and function pointer, expected %0">;
2047 def ext_typecheck_convert_incompatible_pointer_sign : ExtWarn<
2048  "pointer types point to integer types with different sign "
2049  "%select{assigning|passing|returning|converting|initializing|sending|casting}2 %1, expected %0">,
2050   InGroup<DiagGroup<"pointer-sign">>;
2051 def ext_typecheck_convert_incompatible_pointer : ExtWarn<
2052   "incompatible pointer types "
2053   "%select{assigning|passing|returning|converting|initializing|sending|casting}2 %1, expected %0">;
2054 def ext_typecheck_convert_discards_qualifiers : ExtWarn<
2055   "%select{assigning|passing|returning|converting|initializing|sending|casting}2"
2056   " %1 discards qualifiers, expected %0">;
2057 def ext_nested_pointer_qualifier_mismatch : ExtWarn<
2058   "%select{assigning|passing|returning|converting|initializing|sending|casting}2,"
2059   " %0 and %1 have different qualifiers in nested pointer types">;
2060 def warn_incompatible_vectors : Warning<
2061   "incompatible vector types %select{assigning|passing|returning|converting|initializing|sending|casting}2"
2062   " %1, expected %0">,
2063   InGroup<VectorConversions>, DefaultIgnore;
2064 def err_int_to_block_pointer : Error<
2065   "invalid conversion "
2066   "%select{assigning|passing|returning|converting|initializing|sending|casting}2"
2067   " integer %1, expected block pointer %0">;
2068 def err_typecheck_comparison_of_distinct_blocks : Error<
2069   "comparison of distinct block types (%0 and %1)">;
2070 def err_typecheck_convert_incompatible_block_pointer : Error<
2071   "incompatible block pointer types "
2072   "%select{assigning|passing|returning|converting|initializing|sending|casting}2 %1, expected %0">;
2073
2074 def err_typecheck_array_not_modifiable_lvalue : Error<
2075   "array type %0 is not assignable">;
2076 def err_typecheck_non_object_not_modifiable_lvalue : Error<
2077   "non-object type %0 is not assignable">;
2078 def err_typecheck_expression_not_modifiable_lvalue : Error<
2079   "expression is not assignable">;
2080 def err_typecheck_incomplete_type_not_modifiable_lvalue : Error<
2081   "incomplete type %0 is not assignable">;
2082 def err_typecheck_lvalue_casts_not_supported : Error<
2083   "assignment to cast is illegal, lvalue casts are not supported">;
2084
2085 def err_typecheck_duplicate_vector_components_not_mlvalue : Error<
2086   "vector is not assignable (contains duplicate components)">;
2087 def err_block_decl_ref_not_modifiable_lvalue : Error<
2088   "variable is not assignable (missing __block type specifier)">;
2089 def err_typecheck_call_not_function : Error<
2090   "called object type %0 is not a function or function pointer">;
2091 def err_call_incomplete_return : Error<
2092   "calling function with incomplete return type %0">;
2093 def err_call_function_incomplete_return : Error<
2094   "calling %0 with incomplete return type %1">;
2095 def note_function_with_incomplete_return_type_declared_here : Note<
2096   "%0 declared here">;
2097 def err_call_incomplete_argument : Error<
2098   "argument type %0 is incomplete">;
2099 def err_typecheck_call_too_few_args : Error<
2100   "too few arguments to %select{function|block|method}0 call">;
2101 def err_typecheck_call_too_many_args : Error<
2102   "too many arguments to %select{function|block|method}0 call">;
2103 def warn_call_wrong_number_of_arguments : Warning<
2104   "too %select{few|many}0 arguments in call to %1">;
2105 def err_atomic_builtin_must_be_pointer : Error<
2106   "first argument to atomic builtin must be a pointer (%0 invalid)">;
2107 def err_atomic_builtin_must_be_pointer_intptr : Error<
2108   "first argument to atomic builtin must be a pointer to integer or pointer"
2109   " (%0 invalid)">;
2110 def err_atomic_builtin_pointer_size : Error<
2111   "first argument to atomic builtin must be a pointer to 1,2,4,8 or 16 byte "
2112   "type (%0 invalid)">;
2113
2114   
2115 def err_deleted_function_use : Error<"attempt to use a deleted function">;
2116
2117 def err_cannot_pass_objc_interface_to_vararg : Error<
2118   "cannot pass object with interface type %0 by-value through variadic "
2119   "%select{function|block|method}1">;
2120
2121 def warn_cannot_pass_non_pod_arg_to_vararg : Warning<
2122   "cannot pass object of non-POD type %0 through variadic "
2123   "%select{function|block|method|constructor}1; call will abort at runtime">,
2124   InGroup<DiagGroup<"non-pod-varargs">>, DefaultError;
2125
2126 def err_typecheck_call_invalid_ordered_compare : Error<
2127   "ordered compare requires two args of floating point type (%0 and %1)">;
2128 def err_typecheck_call_invalid_unary_fp : Error<
2129   "floating point classification requires argument of floating point type "
2130   "(passed in %0)">;
2131 def err_typecheck_cond_expect_scalar : Error<
2132   "used type %0 where arithmetic or pointer type is required">;
2133 def ext_typecheck_cond_one_void : Extension<
2134   "C99 forbids conditional expressions with only one void side">;
2135 def ext_typecheck_cast_nonscalar : Extension<
2136   "C99 forbids casting nonscalar type %0 to the same type">;
2137 def ext_typecheck_cast_to_union : Extension<"C99 forbids casts to union type">;
2138 def err_typecheck_cast_to_union_no_type : Error<
2139   "cast to union type from type %0 not present in union">;
2140 def err_cast_pointer_from_non_pointer_int : Error<
2141   "operand of type %0 cannot be cast to a pointer type">;
2142 def err_cast_pointer_to_non_pointer_int : Error<
2143   "pointer cannot be cast to type %0">;
2144 def err_typecheck_expect_scalar_operand : Error<
2145   "operand of type %0 where arithmetic or pointer type is required">;
2146 def err_typecheck_cond_incompatible_operands : Error<
2147   "incompatible operand types (%0 and %1)">;
2148 def err_cast_selector_expr : Error<
2149   "cannot type cast @selector expression">;
2150 def warn_typecheck_cond_incompatible_pointers : ExtWarn<
2151   "pointer type mismatch (%0 and %1)">;
2152 def warn_typecheck_cond_pointer_integer_mismatch : ExtWarn<
2153   "pointer/integer type mismatch in conditional expression (%0 and %1)">;
2154 def err_typecheck_choose_expr_requires_constant : Error<
2155   "'__builtin_choose_expr' requires a constant expression">;
2156 def ext_typecheck_expression_not_constant_but_accepted : Extension<
2157   "expression is not a constant, but is accepted as one by GNU extensions">;
2158 def warn_unused_expr : Warning<"expression result unused">,
2159   InGroup<UnusedValue>;
2160 def warn_unused_property_expr : Warning<
2161   "property access result unused - getters should not have side effects">,
2162   InGroup<UnusedValue>;
2163 def warn_unused_call : Warning<
2164   "ignoring return value of function declared with %0 attribute">,
2165   InGroup<UnusedValue>;
2166
2167 def err_incomplete_type_used_in_type_trait_expr : Error<
2168   "incomplete type %0 used in type trait expression">;
2169   
2170 // inline asm.
2171 def err_asm_wide_character : Error<"wide string is invalid in 'asm'">;
2172 def err_asm_invalid_lvalue_in_output : Error<"invalid lvalue in asm output">;
2173 def err_asm_invalid_output_constraint : Error<
2174   "invalid output constraint '%0' in asm">;
2175 def err_asm_invalid_lvalue_in_input : Error<
2176   "invalid lvalue in asm input for constraint '%0'">;
2177 def err_asm_invalid_input_constraint : Error<
2178   "invalid input constraint '%0' in asm">;
2179 def err_asm_invalid_type_in_input : Error<
2180   "invalid type %0 in asm input for constraint '%1'">;
2181 def err_asm_tying_incompatible_types : Error<
2182   "unsupported inline asm: input with type %0 matching output with type %1">;
2183 def err_asm_unknown_register_name : Error<"unknown register name '%0' in asm">;
2184 def err_invalid_asm_cast_lvalue : Error<
2185   "invalid use of a cast in a inline asm context requiring an l-value: "
2186   "remove the cast or build with -fheinous-gnu-extensions">;
2187
2188 def warn_invalid_asm_cast_lvalue : Warning<
2189   "invalid use of a cast in a inline asm context requiring an l-value: "
2190   "accepted due to -fheinous-gnu-extensions, but clang may remove support "
2191   "for this in the future">;
2192
2193
2194
2195 def err_invalid_conversion_between_vectors : Error<
2196   "invalid conversion between vector type %0 and %1 of different size">;
2197 def err_invalid_conversion_between_vector_and_integer : Error<
2198   "invalid conversion between vector type %0 and integer type %1 "
2199   "of different size">;
2200
2201 def err_invalid_conversion_between_vector_and_scalar : Error<
2202   "invalid conversion between vector type %0 and scalar type %1">;
2203 def err_overload_expr_requires_non_zero_constant : Error<
2204   "overload requires a non-zero constant expression as first argument">;
2205 def err_overload_incorrect_fntype : Error<
2206   "argument is not a function, or has wrong number of parameters">;
2207
2208 // C++ member initializers.
2209 def err_only_constructors_take_base_inits : Error<
2210   "only constructors take base initializers">;
2211
2212 def error_multiple_mem_initialization : Error <
2213   "multiple initializations given for non-static member '%0'">;
2214
2215 def error_multiple_base_initialization : Error <
2216   "multiple initializations given for base %0">;
2217
2218 def err_mem_init_not_member_or_class : Error<
2219   "member initializer %0 does not name a non-static data member or base "
2220   "class">;
2221 def err_mem_initializer_mismatch : Error<
2222   "Too many arguments for member initializer %0">;
2223
2224 def warn_field_initialized : Warning<
2225   "member '%0' will be initialized after">,
2226   InGroup<Reorder>, DefaultIgnore;
2227 def warn_base_initialized : Warning<
2228   "base class %0 will be initialized after">,
2229   InGroup<Reorder>, DefaultIgnore;
2230 def note_fieldorbase_initialized_here : Note<
2231   "%select{field|base}0 %1">;
2232
2233 def err_base_init_does_not_name_class : Error<
2234   "constructor initializer %0 does not name a class">;
2235 def err_base_init_direct_and_virtual : Error<
2236   "base class initializer %0 names both a direct base class and an "
2237   "inherited virtual base class">;
2238 def err_not_direct_base_or_virtual : Error<
2239   "type %0 is not a direct or virtual base of '%1'">;
2240 def err_not_direct_base_or_virtual_multi : Error<
2241   "type %0 is not a direct or virtual base of '%1'">;
2242
2243 def err_in_class_initializer_non_integral_type : Error<
2244   "in-class initializer has non-integral, non-enumeration type %0">;
2245 def err_in_class_initializer_non_constant : Error<
2246   "in-class initializer is not an integral constant expression">;
2247
2248 // C++ anonymous unions and GNU anonymous structs/unions
2249 def ext_anonymous_union : Extension<
2250   "anonymous unions are a GNU extension in C">;
2251 def ext_anonymous_struct : Extension<
2252   "anonymous structs are a GNU extension">;
2253 def err_anonymous_union_not_static : Error<
2254   "anonymous unions at namespace or global scope must be declared 'static'">;
2255 def err_anonymous_union_with_storage_spec : Error<
2256   "anonymous union at class scope must not have a storage specifier">;
2257 def err_anonymous_struct_not_member : Error<
2258   "anonymous %select{structs|structs and classes}0 must be "
2259   "%select{struct or union|class}0 members">;
2260 def err_anonymous_union_member_redecl : Error<
2261   "member of anonymous union redeclares %0">;
2262 def err_anonymous_struct_member_redecl : Error<
2263   "member of anonymous struct redeclares %0">;
2264 def err_anonymous_record_with_type : Error<
2265   "types cannot be declared in an anonymous %select{struct|union}0">;
2266 def err_anonymous_record_with_function : Error<
2267   "functions cannot be declared in an anonymous %select{struct|union}0">;
2268 def err_anonymous_record_with_static : Error<
2269   "static members cannot be declared in an anonymous %select{struct|union}0">;
2270 def err_anonymous_record_bad_member : Error<
2271   "anonymous %select{struct|union}0 can only contain non-static data members">;
2272 def err_anonymous_record_nonpublic_member : Error<
2273   "anonymous %select{struct|union}0 cannot contain a "
2274   "%select{private|protected}1 data member">;
2275
2276 // C++ local classes
2277 def err_reference_to_local_var_in_enclosing_function : Error<
2278   "reference to local variable %0 declared in enclosed function %1">;
2279 def note_local_variable_declared_here : Note<
2280   "%0 declared here">;
2281 def err_static_data_member_not_allowed_in_local_class : Error<
2282   "static data member %0 not allowed in local class %1">; 
2283   
2284 // C++ derived classes
2285 def err_base_clause_on_union : Error<"unions cannot have base classes">;
2286 def err_base_must_be_class : Error<"base specifier must name a class">;
2287 def err_union_as_base_class : Error<"unions cannot be base classes">;
2288 def err_incomplete_base_class : Error<"base class has incomplete type">;
2289 def err_duplicate_base_class : Error<
2290   "base class %0 specified more than once as a direct base class">;
2291 // FIXME: better way to display derivation?  Pass entire thing into diagclient?
2292 def err_ambiguous_derived_to_base_conv : Error<
2293   "ambiguous conversion from derived class %0 to base class %1:%2">;
2294 def err_ambiguous_memptr_conv : Error<
2295   "ambiguous conversion from pointer to member of %select{base|derived}0 "
2296   "class %1 to pointer to member of %select{derived|base}0 class %2:%3">;
2297
2298 def err_memptr_conv_via_virtual : Error<
2299   "conversion from pointer to member of class %0 to pointer to member "
2300   "of class %1 via virtual base %2 is not allowed">;
2301
2302 // C++ access control
2303 def err_conv_to_inaccessible_base : Error<
2304   "conversion from %0 to inaccessible base class %1">, NoSFINAE;
2305 def note_inheritance_specifier_here : Note<
2306   "'%0' inheritance specifier here">;
2307 def note_inheritance_implicitly_private_here : Note<
2308   "inheritance is implicitly 'private'">;
2309
2310 // C++ member name lookup
2311 def err_ambiguous_member_multiple_subobjects : Error<
2312   "non-static member %0 found in multiple base-class subobjects of type %1:%2">;
2313 def err_ambiguous_member_multiple_subobject_types : Error<
2314   "member %0 found in multiple base classes of different types">;
2315 def note_ambiguous_member_found : Note<"member found by ambiguous name lookup">;
2316 def err_ambiguous_reference : Error<"reference to %0 is ambiguous">;
2317 def note_ambiguous_candidate : Note<"candidate found by name lookup is %q0">;
2318 def err_ambiguous_tag_hiding : Error<"a type named %0 is hidden by a "
2319   "declaration in a different namespace">;
2320 def note_hidden_tag : Note<"type declaration hidden">;
2321 def note_hiding_object : Note<"declaration hides type">;
2322
2323 // C++ operator overloading
2324 def err_operator_overload_needs_class_or_enum : Error<
2325   "overloaded %0 must have at least one parameter of class "
2326   "or enumeration type">;
2327
2328 def err_operator_overload_variadic : Error<"overloaded %0 cannot be variadic">;
2329 def err_operator_overload_static : Error<
2330   "overloaded %0 cannot be a static member function">;
2331 def err_operator_overload_default_arg : Error<
2332   "parameter of overloaded %0 cannot have a default argument">;
2333 def err_operator_overload_must_be : Error<
2334   "overloaded %0 must be a %select{unary|binary|unary or binary}2 operator "
2335   "(has %1 parameter%s1)">;
2336
2337 def err_operator_overload_must_be_member : Error<
2338   "overloaded %0 must be a non-static member function">;
2339 def err_operator_overload_post_incdec_must_be_int : Error<
2340   "parameter of overloaded post-%select{increment|decrement}1 operator must "
2341   "have type 'int' (not %0)">;
2342
2343 // C++ allocation and deallocation functions.
2344 def err_operator_new_delete_declared_in_namespace : Error<
2345   "%0 cannot be declared inside a namespace">;
2346 def err_operator_new_delete_declared_static : Error<
2347   "%0 cannot be declared static in global scope">;
2348 def err_operator_new_delete_invalid_result_type : Error<
2349   "%0 must return type %1">;
2350 def err_operator_new_delete_dependent_result_type : Error<
2351   "%0 cannot have a dependent return type; use %1 instead">;
2352 def err_operator_new_delete_too_few_parameters : Error<
2353   "%0 must have at least one parameter.">;
2354 def err_operator_new_delete_template_too_few_parameters : Error<
2355   "%0 template must have at least two parameters.">;
2356
2357 def err_operator_new_dependent_param_type : Error<
2358   "%0 cannot take a dependent type as first parameter; "
2359   "use size_t (%1) instead">;
2360 def err_operator_new_param_type : Error<
2361   "%0 takes type size_t (%1) as first parameter">;
2362 def err_operator_new_default_arg: Error<
2363   "parameter of %0 cannot have a default argument">;
2364 def err_operator_delete_dependent_param_type : Error<
2365   "%0 cannot take a dependent type as first parameter; use %1 instead">;
2366 def err_operator_delete_param_type : Error<
2367   "%0 takes type %1 as first parameter">;
2368
2369 // C++ literal operators
2370 def err_literal_operator_outside_namespace : Error<
2371   "literal operator %0 must be in a namespace or global scope">;
2372 // FIXME: This diagnostic sucks
2373 def err_literal_operator_params : Error<
2374   "parameter declaration for literal operator %0 is not valid">;
2375
2376 // C++ conversion functions
2377 def err_conv_function_not_member : Error<
2378   "conversion function must be a non-static member function">;
2379 def err_conv_function_return_type : Error<
2380   "conversion function cannot have a return type">;
2381 def err_conv_function_with_params : Error<
2382   "conversion function cannot have any parameters">;
2383 def err_conv_function_variadic : Error<
2384   "conversion function cannot be variadic">;
2385 def err_conv_function_to_array : Error<
2386   "conversion function cannot convert to an array type">;
2387 def err_conv_function_to_function : Error<
2388   "conversion function cannot convert to a function type">;
2389 def err_conv_function_redeclared : Error<
2390   "conversion function cannot be redeclared">;
2391 def warn_conv_to_self_not_used : Warning<
2392   "conversion function converting %0 to itself will never be used">;
2393 def warn_conv_to_base_not_used : Warning<
2394   "conversion function converting %0 to its base class %1 will never be used">;
2395 def warn_conv_to_void_not_used : Warning<
2396   "conversion function converting %0 to %1 will never be used">;
2397
2398 def warn_not_compound_assign : Warning<
2399   "use of unary operator that may be intended as compound assignment (%0=)">;
2400
2401 // C++0x explicit conversion operators
2402 def warn_explicit_conversion_functions : Warning<
2403   "explicit conversion functions are a C++0x extension">;
2404
2405 def warn_printf_write_back : Warning<
2406   "use of '%%n' in format string discouraged (potentially insecure)">,
2407   InGroup<FormatSecurity>;
2408 def warn_printf_insufficient_data_args : Warning<
2409   "more '%%' conversions than data arguments">, InGroup<Format>;
2410 def warn_printf_too_many_data_args : Warning<
2411   "more data arguments than '%%' conversions">, InGroup<FormatExtraArgs>;
2412 def warn_printf_invalid_conversion : Warning<
2413   "invalid conversion '%0'">, InGroup<Format>;
2414 def warn_printf_missing_format_string : Warning<
2415   "format string missing">, InGroup<Format>;
2416 def warn_null_arg : Warning<
2417   "null passed to a callee which requires a non-null argument">,
2418   InGroup<NonNull>;
2419 def warn_printf_empty_format_string : Warning<
2420   "format string is empty">, InGroup<FormatZeroLength>;
2421 def warn_printf_format_string_is_wide_literal : Warning<
2422   "format string should not be a wide string">, InGroup<Format>;
2423 def warn_printf_format_string_contains_null_char : Warning<
2424   "format string contains '\\0' within the string body">, InGroup<Format>;
2425 def warn_printf_asterisk_width_missing_arg : Warning<
2426   "'*' specified field width is missing a matching 'int' argument">;
2427 def warn_printf_asterisk_precision_missing_arg : Warning<
2428   "'.*' specified field precision is missing a matching 'int' argument">;
2429 def warn_printf_asterisk_width_wrong_type : Warning<
2430   "field width should have type 'int', but argument has type %0">,
2431   InGroup<Format>;
2432 def warn_printf_asterisk_precision_wrong_type : Warning<
2433   "field precision should have type 'int', but argument has type %0">,
2434   InGroup<Format>;
2435
2436 // CHECK: returning address/reference of stack memory
2437 def warn_ret_stack_addr : Warning<
2438   "address of stack memory associated with local variable %0 returned">;
2439 def warn_ret_stack_ref : Warning<
2440   "reference to stack memory associated with local variable %0 returned">;
2441 def warn_ret_addr_label : Warning<
2442   "returning address of label, which is local">;
2443 def err_ret_local_block : Error<
2444   "returning block that lives on the local stack">;
2445
2446
2447 // For non-floating point, expressions of the form x == x or x != x
2448 // should result in a warning, since these always evaluate to a constant.
2449 def warn_selfcomparison : Warning<
2450   "self-comparison always results in a constant value">;
2451 def warn_stringcompare : Warning<
2452   "result of comparison against %select{a string literal|@encode}0 is "
2453   "unspecified (use strcmp instead)">;
2454
2455
2456
2457 // Blocks
2458 def err_blocks_disable : Error<"blocks support disabled - compile with -fblocks"
2459   " or pick a deployment target that supports them">;
2460 def err_expected_block_lbrace : Error<"expected '{' in block literal">;
2461 def err_goto_in_block : Error<
2462   "goto not allowed in block literal">;
2463 def err_return_in_block_expression : Error<
2464   "return not allowed in block expression literal">;
2465 def err_block_returns_array : Error<
2466   "block declared as returning an array">;
2467
2468
2469 // CFString checking
2470 def err_cfstring_literal_not_string_constant : Error<
2471   "CFString literal is not a string constant">;
2472 def warn_cfstring_literal_contains_nul_character : Warning<
2473   "CFString literal contains NUL character">;
2474
2475 // Statements.
2476 def err_continue_not_in_loop : Error<
2477   "'continue' statement not in loop statement">;
2478 def err_break_not_in_loop_or_switch : Error<
2479   "'break' statement not in loop or switch statement">;
2480 def err_default_not_in_switch : Error<
2481   "'default' statement not in switch statement">;
2482 def err_case_not_in_switch : Error<"'case' statement not in switch statement">;
2483 def warn_bool_switch_condition : Warning<
2484   "switch condition is a bool">;
2485 def warn_case_value_overflow : Warning<
2486   "overflow converting case value to switch condition type (%0 to %1)">;
2487 def err_duplicate_case : Error<"duplicate case value '%0'">;
2488 def warn_case_empty_range : Warning<"empty case range specified">;
2489 def err_typecheck_statement_requires_scalar : Error<
2490   "statement requires expression of scalar type (%0 invalid)">;
2491 def err_typecheck_statement_requires_integer : Error<
2492   "statement requires expression of integer type (%0 invalid)">;
2493 def err_multiple_default_labels_defined : Error<
2494   "multiple default labels in one switch">;
2495 def err_switch_multiple_conversions : Error<
2496   "multiple conversions from switch condition type %0 to an integral or "
2497   "enumeration type">;
2498 def note_switch_conversion : Note<
2499   "conversion to %select{integral|enumeration}0 type %1">;
2500 def err_switch_explicit_conversion : Error<
2501   "switch condition type %0 requires explicit conversion to %1">;
2502 def err_switch_incomplete_class_type : Error<
2503   "switch condition has incomplete class type %0">;
2504 def warn_empty_if_body : Warning<
2505   "if statement has empty body">, InGroup<EmptyBody>;
2506 def err_va_start_used_in_non_variadic_function : Error<
2507   "'va_start' used in function with fixed args">;
2508 def warn_second_parameter_of_va_start_not_last_named_argument : Warning<
2509   "second parameter of 'va_start' not last named argument">;
2510 def err_first_argument_to_va_arg_not_of_type_va_list : Error<
2511   "first argument to 'va_arg' is of type %0 and not 'va_list'">;
2512
2513 def warn_return_missing_expr : Warning<
2514   "non-void %select{function|method}1 %0 should return a value">,
2515   InGroup<ReturnType>;
2516 def ext_return_missing_expr : ExtWarn<
2517   "non-void %select{function|method}1 %0 should return a value">,
2518   InGroup<ReturnType>;
2519 def ext_return_has_expr : ExtWarn<
2520   "void %select{function|method}1 %0 should not return a value">,
2521   InGroup<ReturnType>;
2522 def ext_return_has_void_expr : Extension<
2523   "void %select{function|method}1 %0 should not return void expression">;
2524 def warn_noreturn_function_has_return_expr : Warning<
2525   "function %0 declared 'noreturn' should not return">,
2526   InGroup<DiagGroup<"invalid-noreturn">>;
2527 def warn_falloff_noreturn_function : Warning<
2528   "function declared 'noreturn' should not return">,
2529   InGroup<DiagGroup<"invalid-noreturn">>;
2530 def err_noreturn_block_has_return_expr : Error<
2531   "block declared 'noreturn' should not return">;
2532 def err_block_on_nonlocal : Error<
2533   "__block attribute not allowed, only allowed on local variables">;
2534 def err_block_on_vm : Error<
2535   "__block attribute not allowed on declaration with a variably modified type">;
2536
2537 def err_shufflevector_non_vector : Error<
2538   "first two arguments to __builtin_shufflevector must be vectors">;
2539 def err_shufflevector_incompatible_vector : Error<
2540   "first two arguments to __builtin_shufflevector must have the same type">;
2541 def err_shufflevector_nonconstant_argument : Error<
2542   "index for __builtin_shufflevector must be a constant integer">;
2543 def err_shufflevector_argument_too_large : Error<
2544   "index for __builtin_shufflevector must be less than the total number "
2545   "of vector elements">;
2546
2547 def err_vector_incorrect_num_initializers : Error<
2548   "%select{too many|too few}0 elements in vector initialization (expected %1 elements, have %2)">;
2549 def err_altivec_empty_initializer : Error<"expected initializer">;
2550
2551 def err_stack_const_level : Error<
2552   "level argument for a stack address builtin must be constant">;
2553
2554 def err_prefetch_invalid_arg_type : Error<
2555   "argument to __builtin_prefetch must be of integer type">;
2556 def err_prefetch_invalid_arg_ice : Error<
2557   "argument to __builtin_prefetch must be a constant integer">;
2558 def err_argument_invalid_range : Error<
2559   "argument should be a value from %0 to %1">;
2560
2561 def err_object_size_invalid_argument : Error<
2562   "argument to __builtin_object_size must be a constant integer">;
2563
2564 def err_builtin_longjmp_invalid_val : Error<
2565   "argument to __builtin_longjmp must be a constant 1">;
2566
2567 def ext_mixed_decls_code : Extension<
2568   "ISO C90 forbids mixing declarations and code">;
2569 def err_non_variable_decl_in_for : Error<
2570   "declaration of non-local variable in 'for' loop">;
2571 def err_toomany_element_decls : Error<
2572   "only one element declaration is allowed">;
2573 def err_selector_element_not_lvalue : Error<
2574   "selector element is not a valid lvalue">;
2575 def err_selector_element_type : Error<
2576   "selector element type %0 is not a valid object">;
2577 def err_collection_expr_type : Error<
2578   "collection expression type %0 is not a valid object">;
2579
2580 def err_invalid_conversion_between_ext_vectors : Error<
2581   "invalid conversion between ext-vector type %0 and %1">;
2582
2583 // Type
2584 def ext_invalid_sign_spec : Extension<"'%0' cannot be signed or unsigned">;
2585 def warn_receiver_forward_class : Warning<
2586     "receiver %0 is a forward class and corresponding @interface may not exist">;
2587 def note_method_sent_forward_class : Note<"method %0 is used for the forward class">;
2588 def ext_missing_declspec : ExtWarn<
2589   "declaration specifier missing, defaulting to 'int'">;
2590 def ext_missing_type_specifier : ExtWarn<
2591   "type specifier missing, defaults to 'int'">,
2592   InGroup<ImplicitInt>;
2593 def err_decimal_unsupported : Error<
2594   "GNU decimal type extension not supported">;
2595 def err_missing_type_specifier : Error<
2596   "C++ requires a type specifier for all declarations">;
2597 def err_missing_param_declspec : Error<
2598   "parameter requires a declaration specifier">;
2599 def err_objc_array_of_interfaces : Error<
2600   "array of interface %0 is invalid (probably should be an array of pointers)">;
2601 def ext_c99_array_usage : Extension<
2602   "use of C99-specific array features, accepted as an extension">;
2603 def err_c99_array_usage_cxx : Error<
2604   "C99-specific array features are not permitted in C++">;
2605   
2606 def err_invalid_protocol_qualifiers : Error<
2607   "invalid protocol qualifiers on non-ObjC type">;
2608 def warn_ivar_use_hidden : Warning<
2609   "local declaration of %0 hides instance variable">;
2610 def error_ivar_use_in_class_method : Error<
2611   "instance variable %0 accessed in class method">;
2612 def error_private_ivar_access : Error<"instance variable %0 is private">,
2613     NoSFINAE;
2614 def error_protected_ivar_access : Error<"instance variable %0 is protected">,
2615     NoSFINAE;
2616 def warn_maynot_respond : Warning<"%0 may not respond to %1">;
2617 def warn_attribute_method_def : Warning<
2618   "method attribute can only be specified on method declarations">;
2619 def ext_typecheck_base_super : Warning<
2620   "method parameter type %0 does not match "
2621   "super class method parameter type %1">, InGroup<SuperSubClassMismatch>, DefaultIgnore;
2622
2623 // Spell-checking diagnostics
2624 def err_unknown_typename_suggest : Error<
2625   "unknown type name %0; did you mean %1?">;
2626 def err_unknown_nested_typename_suggest : Error<
2627   "no type named %0 in %1; did you mean %2?">;
2628 def err_no_member_suggest : Error<"no member named %0 in %1; did you mean %2?">;
2629 def err_undeclared_use_suggest : Error<
2630   "use of undeclared %0; did you mean %1?">;
2631 def err_undeclared_var_use_suggest : Error<
2632   "use of undeclared identifier %0; did you mean %1?">;
2633 def err_no_template_suggest : Error<"no template named %0; did you mean %1?">;
2634 def err_no_member_template_suggest : Error<
2635   "no template named %0 in %1; did you mean %2?">;
2636 def err_mem_init_not_member_or_class_suggest : Error<
2637   "initializer %0 does not name a non-static data member or base "
2638   "class; did you mean the %select{base class|member}1 %2?">;
2639 def err_field_designator_unknown_suggest : Error<
2640   "field designator %0 does not refer to any field in type %1; did you mean "
2641   "%2?">;
2642 def err_typecheck_member_reference_ivar_suggest : Error<
2643   "%0 does not have a member named %1; did you mean %2?">;
2644 def err_property_not_found_suggest : Error<
2645   "property %0 not found on object of type %1; did you mean %2?">;
2646 def err_undef_interface_suggest : Error<
2647   "cannot find interface declaration for %0; did you mean %1?">;
2648 def warn_undef_interface_suggest : Warning<
2649   "cannot find interface declaration for %0; did you mean %1?">;
2650 def err_undef_superclass_suggest : Error<
2651   "cannot find interface declaration for %0, superclass of %1; did you mean "
2652   "%2?">;
2653 def err_undeclared_protocol_suggest : Error<
2654   "cannot find protocol declaration for %0; did you mean %1?">;
2655 def note_base_class_specified_here : Note<
2656   "base class %0 specified here">;
2657 }
2658
2659