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