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