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