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