2 //==--- DiagnosticSemaKinds.td - libsema diagnostics ----------------------===//
4 // The LLVM Compiler Infrastructure
6 // This file is distributed under the University of Illinois Open Source
7 // License. See LICENSE.TXT for details.
9 //===----------------------------------------------------------------------===//
11 //===----------------------------------------------------------------------===//
13 //===----------------------------------------------------------------------===//
15 let Component = "Sema" in {
16 let CategoryName = "Semantic Issue" in {
18 def note_previous_decl : Note<"%0 declared here">;
19 def note_entity_declared_at : Note<"%0 declared here">;
20 def note_callee_decl : Note<"%0 declared here">;
21 def note_defined_here : Note<"%0 defined here">;
24 def warn_variables_not_in_loop_body : Warning<
25 "variable%select{s| %1|s %1 and %2|s %1, %2, and %3|s %1, %2, %3, and %4}0 "
26 "used in loop condition not modified in loop body">,
27 InGroup<ForLoopAnalysis>, DefaultIgnore;
28 def warn_redundant_loop_iteration : Warning<
29 "variable %0 is %select{decremented|incremented}1 both in the loop header "
30 "and in the loop body">,
31 InGroup<ForLoopAnalysis>, DefaultIgnore;
32 def note_loop_iteration_here : Note<"%select{decremented|incremented}0 here">;
34 def warn_for_range_const_reference_copy : Warning<
36 "%diff{has type $ but is initialized with type $"
37 "| is initialized with a value of a different type}1,2 resulting in a copy">,
38 InGroup<RangeLoopAnalysis>, DefaultIgnore;
39 def note_use_type_or_non_reference : Note<
40 "use non-reference type %0 to keep the copy or type %1 to prevent copying">;
41 def warn_for_range_variable_always_copy : Warning<
42 "loop variable %0 is always a copy because the range of type %1 does not "
43 "return a reference">,
44 InGroup<RangeLoopAnalysis>, DefaultIgnore;
45 def note_use_non_reference_type : Note<"use non-reference type %0">;
46 def warn_for_range_copy : Warning<
47 "loop variable %0 of type %1 creates a copy from type %2">,
48 InGroup<RangeLoopAnalysis>, DefaultIgnore;
49 def note_use_reference_type : Note<"use reference type %0 to prevent copying">;
51 def warn_duplicate_enum_values : Warning<
52 "element %0 has been implicitly assigned %1 which another element has "
53 "been assigned">, InGroup<DiagGroup<"duplicate-enum">>, DefaultIgnore;
54 def note_duplicate_element : Note<"element %0 also has value %1">;
56 // Absolute value functions
57 def warn_unsigned_abs : Warning<
58 "taking the absolute value of unsigned type %0 has no effect">,
59 InGroup<AbsoluteValue>;
60 def note_remove_abs : Note<
61 "remove the call to '%0' since unsigned values cannot be negative">;
62 def warn_abs_too_small : Warning<
63 "absolute value function %0 given an argument of type %1 but has parameter "
64 "of type %2 which may cause truncation of value">, InGroup<AbsoluteValue>;
65 def warn_wrong_absolute_value_type : Warning<
66 "using %select{integer|floating point|complex}1 absolute value function %0 "
67 "when argument is of %select{integer|floating point|complex}2 type">,
68 InGroup<AbsoluteValue>;
69 def note_replace_abs_function : Note<"use function '%0' instead">;
70 def warn_pointer_abs : Warning<
71 "taking the absolute value of %select{pointer|function|array}0 type %1 is suspicious">,
72 InGroup<AbsoluteValue>;
74 def warn_infinite_recursive_function : Warning<
75 "all paths through this function will call itself">,
76 InGroup<InfiniteRecursion>, DefaultIgnore;
78 // Constant expressions
79 def err_expr_not_ice : Error<
80 "expression is not an %select{integer|integral}0 constant expression">;
81 def ext_expr_not_ice : Extension<
82 "expression is not an %select{integer|integral}0 constant expression; "
83 "folding it to a constant is a GNU extension">, InGroup<GNUFoldingConstant>;
84 def err_typecheck_converted_constant_expression : Error<
85 "value of type %0 is not implicitly convertible to %1">;
86 def err_typecheck_converted_constant_expression_disallowed : Error<
87 "conversion from %0 to %1 is not allowed in a converted constant expression">;
88 def err_typecheck_converted_constant_expression_indirect : Error<
89 "conversion from %0 to %1 in converted constant expression would "
90 "bind reference to a temporary">;
91 def err_expr_not_cce : Error<
92 "%select{case value|enumerator value|non-type template argument|array size}0 "
93 "is not a constant expression">;
94 def ext_cce_narrowing : ExtWarn<
95 "%select{case value|enumerator value|non-type template argument|array size}0 "
96 "%select{cannot be narrowed from type %2 to %3|"
97 "evaluates to %2, which cannot be narrowed to type %3}1">,
98 InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
99 def err_ice_not_integral : Error<
100 "integral constant expression must have integral or unscoped enumeration "
102 def err_ice_incomplete_type : Error<
103 "integral constant expression has incomplete class type %0">;
104 def err_ice_explicit_conversion : Error<
105 "integral constant expression requires explicit conversion from %0 to %1">;
106 def note_ice_conversion_here : Note<
107 "conversion to %select{integral|enumeration}0 type %1 declared here">;
108 def err_ice_ambiguous_conversion : Error<
109 "ambiguous conversion from type %0 to an integral or unscoped "
111 def err_ice_too_large : Error<
112 "integer constant expression evaluates to value %0 that cannot be "
113 "represented in a %1-bit %select{signed|unsigned}2 integer type">;
114 def err_expr_not_string_literal : Error<"expression is not a string literal">;
116 // Semantic analysis of constant literals.
117 def ext_predef_outside_function : Warning<
118 "predefined identifier is only valid inside function">,
119 InGroup<DiagGroup<"predefined-identifier-outside-function">>;
120 def warn_float_overflow : Warning<
121 "magnitude of floating-point constant too large for type %0; maximum is %1">,
122 InGroup<LiteralRange>;
123 def warn_float_underflow : Warning<
124 "magnitude of floating-point constant too small for type %0; minimum is %1">,
125 InGroup<LiteralRange>;
126 def warn_double_const_requires_fp64 : Warning<
127 "double precision constant requires cl_khr_fp64, casting to single precision">;
129 // C99 variable-length arrays
130 def ext_vla : Extension<"variable length arrays are a C99 feature">,
131 InGroup<VLAExtension>;
132 def warn_vla_used : Warning<"variable length array used">,
133 InGroup<VLA>, DefaultIgnore;
134 def err_vla_non_pod : Error<"variable length array of non-POD element type %0">;
135 def err_vla_in_sfinae : Error<
136 "variable length array cannot be formed during template argument deduction">;
137 def err_array_star_in_function_definition : Error<
138 "variable length array must be bound in function definition">;
139 def err_vla_decl_in_file_scope : Error<
140 "variable length array declaration not allowed at file scope">;
141 def err_vla_decl_has_static_storage : Error<
142 "variable length array declaration cannot have 'static' storage duration">;
143 def err_vla_decl_has_extern_linkage : Error<
144 "variable length array declaration cannot have 'extern' linkage">;
145 def ext_vla_folded_to_constant : Extension<
146 "variable length array folded to constant array as an extension">, InGroup<GNUFoldingConstant>;
148 // C99 variably modified types
149 def err_variably_modified_template_arg : Error<
150 "variably modified type %0 cannot be used as a template argument">;
151 def err_variably_modified_nontype_template_param : Error<
152 "non-type template parameter of variably modified type %0">;
153 def err_variably_modified_new_type : Error<
154 "'new' cannot allocate object of variably modified type %0">;
156 // C99 Designated Initializers
157 def ext_designated_init : Extension<
158 "designated initializers are a C99 feature">, InGroup<C99>;
159 def err_array_designator_negative : Error<
160 "array designator value '%0' is negative">;
161 def err_array_designator_empty_range : Error<
162 "array designator range [%0, %1] is empty">;
163 def err_array_designator_non_array : Error<
164 "array designator cannot initialize non-array type %0">;
165 def err_array_designator_too_large : Error<
166 "array designator index (%0) exceeds array bounds (%1)">;
167 def err_field_designator_non_aggr : Error<
168 "field designator cannot initialize a "
169 "%select{non-struct, non-union|non-class}0 type %1">;
170 def err_field_designator_unknown : Error<
171 "field designator %0 does not refer to any field in type %1">;
172 def err_field_designator_nonfield : Error<
173 "field designator %0 does not refer to a non-static data member">;
174 def note_field_designator_found : Note<"field designator refers here">;
175 def err_designator_for_scalar_init : Error<
176 "designator in initializer for scalar type %0">;
177 def warn_subobject_initializer_overrides : Warning<
178 "subobject initialization overrides initialization of other fields "
179 "within its enclosing subobject">, InGroup<InitializerOverrides>;
180 def warn_initializer_overrides : Warning<
181 "initializer overrides prior initialization of this subobject">,
182 InGroup<InitializerOverrides>;
183 def note_previous_initializer : Note<
184 "previous initialization %select{|with side effects }0is here"
185 "%select{| (side effects may not occur at run time)}0">;
186 def err_designator_into_flexible_array_member : Error<
187 "designator into flexible array member subobject">;
188 def note_flexible_array_member : Note<
189 "initialized flexible array member %0 is here">;
190 def ext_flexible_array_init : Extension<
191 "flexible array initialization is a GNU extension">, InGroup<GNUFlexibleArrayInitializer>;
194 def ext_duplicate_declspec : ExtWarn<"duplicate '%0' declaration specifier">,
195 InGroup<DuplicateDeclSpecifier>;
196 def warn_duplicate_declspec : Warning<"duplicate '%0' declaration specifier">,
197 InGroup<DuplicateDeclSpecifier>;
198 def ext_plain_complex : ExtWarn<
199 "plain '_Complex' requires a type specifier; assuming '_Complex double'">;
200 def ext_integer_complex : Extension<
201 "complex integer types are a GNU extension">, InGroup<GNUComplexInteger>;
203 def err_invalid_sign_spec : Error<"'%0' cannot be signed or unsigned">;
204 def err_invalid_width_spec : Error<
205 "'%select{|short|long|long long}0 %1' is invalid">;
206 def err_invalid_complex_spec : Error<"'_Complex %0' is invalid">;
207 def err_friend_decl_spec : Error<"'%0' is invalid in friend declarations">;
209 def ext_auto_type_specifier : ExtWarn<
210 "'auto' type specifier is a C++11 extension">, InGroup<CXX11>;
211 def warn_auto_storage_class : Warning<
212 "'auto' storage class specifier is redundant and incompatible with C++11">,
213 InGroup<CXX11Compat>, DefaultIgnore;
215 def warn_deprecated_register : Warning<
216 "'register' storage class specifier is deprecated "
217 "and incompatible with C++1z">, InGroup<DeprecatedRegister>;
218 def ext_register_storage_class : ExtWarn<
219 "ISO C++1z does not allow 'register' storage class specifier">,
220 DefaultError, InGroup<Register>;
222 def err_invalid_decl_spec_combination : Error<
223 "cannot combine with previous '%0' declaration specifier">;
224 def err_invalid_vector_decl_spec_combination : Error<
225 "cannot combine with previous '%0' declaration specifier. "
226 "'__vector' must be first">;
227 def err_invalid_pixel_decl_spec_combination : Error<
228 "'__pixel' must be preceded by '__vector'. "
229 "'%0' declaration specifier not allowed here">;
230 def err_invalid_vector_bool_decl_spec : Error<
231 "cannot use '%0' with '__vector bool'">;
232 def err_invalid_vector_long_decl_spec : Error<
233 "cannot use 'long' with '__vector'">;
234 def err_invalid_vector_float_decl_spec : Error<
235 "cannot use 'float' with '__vector'">;
236 def err_invalid_vector_double_decl_spec : Error <
237 "use of 'double' with '__vector' requires VSX support to be enabled "
238 "(available on POWER7 or later)">;
239 def err_invalid_vector_long_long_decl_spec : Error <
240 "use of 'long long' with '__vector bool' requires VSX support (available on "
241 "POWER7 or later) or extended Altivec support (available on POWER8 or later) "
243 def err_invalid_vector_long_double_decl_spec : Error<
244 "cannot use 'long double' with '__vector'">;
245 def warn_vector_long_decl_spec_combination : Warning<
246 "Use of 'long' with '__vector' is deprecated">, InGroup<Deprecated>;
248 def err_use_of_tag_name_without_tag : Error<
249 "must use '%1' tag to refer to type %0%select{| in this scope}2">;
251 def err_redeclaration_different_type : Error<
252 "redeclaration of %0 with a different type%diff{: $ vs $|}1,2">;
253 def err_bad_variable_name : Error<
254 "%0 cannot be the name of a variable or data member">;
255 def err_bad_parameter_name : Error<
256 "%0 cannot be the name of a parameter">;
257 def err_parameter_name_omitted : Error<"parameter name omitted">;
258 def warn_mips_interrupt_attribute : Warning<
259 "MIPS 'interrupt' attribute only applies to functions that have "
260 "%select{no parameters|a 'void' return type}0">,
261 InGroup<IgnoredAttributes>;
262 def warn_unused_parameter : Warning<"unused parameter %0">,
263 InGroup<UnusedParameter>, DefaultIgnore;
264 def warn_unused_variable : Warning<"unused variable %0">,
265 InGroup<UnusedVariable>, DefaultIgnore;
266 def warn_unused_local_typedef : Warning<
267 "unused %select{typedef|type alias}0 %1">,
268 InGroup<UnusedLocalTypedef>, DefaultIgnore;
269 def warn_unused_property_backing_ivar :
270 Warning<"ivar %0 which backs the property is not "
271 "referenced in this property's accessor">,
272 InGroup<UnusedPropertyIvar>, DefaultIgnore;
273 def warn_unused_const_variable : Warning<"unused variable %0">,
274 InGroup<UnusedConstVariable>, DefaultIgnore;
275 def warn_unused_exception_param : Warning<"unused exception parameter %0">,
276 InGroup<UnusedExceptionParameter>, DefaultIgnore;
277 def warn_decl_in_param_list : Warning<
278 "declaration of %0 will not be visible outside of this function">,
280 def warn_redefinition_in_param_list : Warning<
281 "redefinition of %0 will not be visible outside of this function">,
283 def warn_empty_parens_are_function_decl : Warning<
284 "empty parentheses interpreted as a function declaration">,
285 InGroup<VexingParse>;
286 def warn_parens_disambiguated_as_function_declaration : Warning<
287 "parentheses were disambiguated as a function declaration">,
288 InGroup<VexingParse>;
289 def note_additional_parens_for_variable_declaration : Note<
290 "add a pair of parentheses to declare a variable">;
291 def note_empty_parens_function_call : Note<
292 "change this ',' to a ';' to call %0">;
293 def note_empty_parens_default_ctor : Note<
294 "remove parentheses to declare a variable">;
295 def note_empty_parens_zero_initialize : Note<
296 "replace parentheses with an initializer to declare a variable">;
297 def warn_unused_function : Warning<"unused function %0">,
298 InGroup<UnusedFunction>, DefaultIgnore;
299 def warn_unused_member_function : Warning<"unused member function %0">,
300 InGroup<UnusedMemberFunction>, DefaultIgnore;
301 def warn_used_but_marked_unused: Warning<"%0 was marked unused but was used">,
302 InGroup<UsedButMarkedUnused>, DefaultIgnore;
303 def warn_unneeded_internal_decl : Warning<
304 "%select{function|variable}0 %1 is not needed and will not be emitted">,
305 InGroup<UnneededInternalDecl>, DefaultIgnore;
306 def warn_unneeded_static_internal_decl : Warning<
307 "'static' function %0 declared in header file "
308 "should be declared 'static inline'">,
309 InGroup<UnneededInternalDecl>, DefaultIgnore;
310 def warn_unneeded_member_function : Warning<
311 "member function %0 is not needed and will not be emitted">,
312 InGroup<UnneededMemberFunction>, DefaultIgnore;
313 def warn_unused_private_field: Warning<"private field %0 is not used">,
314 InGroup<UnusedPrivateField>, DefaultIgnore;
316 def warn_parameter_size: Warning<
317 "%0 is a large (%1 bytes) pass-by-value argument; "
318 "pass it by reference instead ?">, InGroup<LargeByValueCopy>;
319 def warn_return_value_size: Warning<
320 "return value of %0 is a large (%1 bytes) pass-by-value object; "
321 "pass it by reference instead ?">, InGroup<LargeByValueCopy>;
322 def warn_return_value_udt: Warning<
323 "%0 has C-linkage specified, but returns user-defined type %1 which is "
324 "incompatible with C">, InGroup<ReturnTypeCLinkage>;
325 def warn_return_value_udt_incomplete: Warning<
326 "%0 has C-linkage specified, but returns incomplete type %1 which could be "
327 "incompatible with C">, InGroup<ReturnTypeCLinkage>;
328 def warn_implicit_function_decl : Warning<
329 "implicit declaration of function %0">,
330 InGroup<ImplicitFunctionDeclare>, DefaultIgnore;
331 def ext_implicit_function_decl : ExtWarn<
332 "implicit declaration of function %0 is invalid in C99">,
333 InGroup<ImplicitFunctionDeclare>;
334 def note_function_suggestion : Note<"did you mean %0?">;
336 def err_ellipsis_first_param : Error<
337 "ISO C requires a named parameter before '...'">;
338 def err_declarator_need_ident : Error<"declarator requires an identifier">;
339 def err_language_linkage_spec_unknown : Error<"unknown linkage language">;
340 def err_language_linkage_spec_not_ascii : Error<
341 "string literal in language linkage specifier cannot have an "
343 def warn_use_out_of_scope_declaration : Warning<
344 "use of out-of-scope declaration of %0">;
345 def err_inline_non_function : Error<
346 "'inline' can only appear on functions">;
347 def err_noreturn_non_function : Error<
348 "'_Noreturn' can only appear on functions">;
349 def warn_qual_return_type : Warning<
350 "'%0' type qualifier%s1 on return type %plural{1:has|:have}1 no effect">,
351 InGroup<IgnoredQualifiers>, DefaultIgnore;
353 def warn_decl_shadow :
354 Warning<"declaration shadows a %select{"
357 "static data member of %2|"
359 InGroup<Shadow>, DefaultIgnore;
361 // C++ using declarations
362 def err_using_requires_qualname : Error<
363 "using declaration requires a qualified name">;
364 def err_using_typename_non_type : Error<
365 "'typename' keyword used on a non-type">;
366 def err_using_dependent_value_is_type : Error<
367 "dependent using declaration resolved to type without 'typename'">;
368 def err_using_decl_nested_name_specifier_is_not_class : Error<
369 "using declaration in class refers into '%0', which is not a class">;
370 def err_using_decl_nested_name_specifier_is_current_class : Error<
371 "using declaration refers to its own class">;
372 def err_using_decl_nested_name_specifier_is_not_base_class : Error<
373 "using declaration refers into '%0', which is not a base class of %1">;
374 def err_using_decl_constructor_not_in_direct_base : Error<
375 "%0 is not a direct base of %1, cannot inherit constructors">;
376 def err_using_decl_constructor_conflict : Error<
377 "cannot inherit constructor, already inherited constructor with "
378 "the same signature">;
379 def note_using_decl_constructor_conflict_current_ctor : Note<
380 "conflicting constructor">;
381 def note_using_decl_constructor_conflict_previous_ctor : Note<
382 "previous constructor">;
383 def note_using_decl_constructor_conflict_previous_using : Note<
384 "previously inherited here">;
385 def warn_using_decl_constructor_ellipsis : Warning<
386 "inheriting constructor does not inherit ellipsis">,
387 InGroup<DiagGroup<"inherited-variadic-ctor">>;
388 def note_using_decl_constructor_ellipsis : Note<
389 "constructor declared with ellipsis here">;
390 def err_using_decl_can_not_refer_to_class_member : Error<
391 "using declaration cannot refer to class member">;
392 def note_using_decl_class_member_workaround : Note<
393 "use %select{an alias declaration|a typedef declaration|a reference}0 "
395 def err_using_decl_can_not_refer_to_namespace : Error<
396 "using declaration cannot refer to namespace">;
397 def err_using_decl_constructor : Error<
398 "using declaration cannot refer to a constructor">;
399 def warn_cxx98_compat_using_decl_constructor : Warning<
400 "inheriting constructors are incompatible with C++98">,
401 InGroup<CXX98Compat>, DefaultIgnore;
402 def err_using_decl_destructor : Error<
403 "using declaration cannot refer to a destructor">;
404 def err_using_decl_template_id : Error<
405 "using declaration cannot refer to a template specialization">;
406 def note_using_decl_target : Note<"target of using declaration">;
407 def note_using_decl_conflict : Note<"conflicting declaration">;
408 def err_using_decl_redeclaration : Error<"redeclaration of using decl">;
409 def err_using_decl_conflict : Error<
410 "target of using declaration conflicts with declaration already in scope">;
411 def err_using_decl_conflict_reverse : Error<
412 "declaration conflicts with target of using declaration already in scope">;
413 def note_using_decl : Note<"%select{|previous }0using declaration">;
415 def warn_access_decl_deprecated : Warning<
416 "access declarations are deprecated; use using declarations instead">,
418 def err_access_decl : Error<
419 "ISO C++11 does not allow access declarations; "
420 "use using declarations instead">;
421 def warn_exception_spec_deprecated : Warning<
422 "dynamic exception specifications are deprecated">,
423 InGroup<Deprecated>, DefaultIgnore;
424 def note_exception_spec_deprecated : Note<"use '%0' instead">;
425 def warn_deprecated_copy_operation : Warning<
426 "definition of implicit copy %select{constructor|assignment operator}1 "
427 "for %0 is deprecated because it has a user-declared "
428 "%select{copy %select{assignment operator|constructor}1|destructor}2">,
429 InGroup<Deprecated>, DefaultIgnore;
431 def warn_global_constructor : Warning<
432 "declaration requires a global constructor">,
433 InGroup<GlobalConstructors>, DefaultIgnore;
434 def warn_global_destructor : Warning<
435 "declaration requires a global destructor">,
436 InGroup<GlobalConstructors>, DefaultIgnore;
437 def warn_exit_time_destructor : Warning<
438 "declaration requires an exit-time destructor">,
439 InGroup<ExitTimeDestructors>, DefaultIgnore;
441 def err_invalid_thread : Error<
442 "'%0' is only allowed on variable declarations">;
443 def err_thread_non_global : Error<
444 "'%0' variables must have global storage">;
445 def err_thread_unsupported : Error<
446 "thread-local storage is not supported for the current target">;
448 def warn_maybe_falloff_nonvoid_function : Warning<
449 "control may reach end of non-void function">,
451 def warn_falloff_nonvoid_function : Warning<
452 "control reaches end of non-void function">,
454 def err_maybe_falloff_nonvoid_block : Error<
455 "control may reach end of non-void block">;
456 def err_falloff_nonvoid_block : Error<
457 "control reaches end of non-void block">;
458 def warn_suggest_noreturn_function : Warning<
459 "%select{function|method}0 %1 could be declared with attribute 'noreturn'">,
460 InGroup<MissingNoreturn>, DefaultIgnore;
461 def warn_suggest_noreturn_block : Warning<
462 "block could be declared with attribute 'noreturn'">,
463 InGroup<MissingNoreturn>, DefaultIgnore;
466 def warn_unreachable : Warning<
467 "code will never be executed">,
468 InGroup<UnreachableCode>, DefaultIgnore;
469 def warn_unreachable_break : Warning<
470 "'break' will never be executed">,
471 InGroup<UnreachableCodeBreak>, DefaultIgnore;
472 def warn_unreachable_return : Warning<
473 "'return' will never be executed">,
474 InGroup<UnreachableCodeReturn>, DefaultIgnore;
475 def warn_unreachable_loop_increment : Warning<
476 "loop will run at most once (loop increment never executed)">,
477 InGroup<UnreachableCodeLoopIncrement>, DefaultIgnore;
478 def note_unreachable_silence : Note<
479 "silence by adding parentheses to mark code as explicitly dead">;
481 /// Built-in functions.
482 def ext_implicit_lib_function_decl : ExtWarn<
483 "implicitly declaring library function '%0' with type %1">,
484 InGroup<ImplicitFunctionDeclare>;
485 def note_include_header_or_declare : Note<
486 "include the header <%0> or explicitly provide a declaration for '%1'">;
487 def note_previous_builtin_declaration : Note<"%0 is a builtin with type %1">;
488 def warn_implicit_decl_requires_sysheader : Warning<
489 "declaration of built-in function '%1' requires inclusion of the header <%0>">,
490 InGroup<BuiltinRequiresHeader>;
491 def warn_redecl_library_builtin : Warning<
492 "incompatible redeclaration of library function %0">,
493 InGroup<DiagGroup<"incompatible-library-redeclaration">>;
494 def err_builtin_definition : Error<"definition of builtin function %0">;
495 def err_arm_invalid_specialreg : Error<"invalid special register for builtin">;
496 def err_invalid_cpu_supports : Error<"invalid cpu feature string for builtin">;
497 def err_builtin_needs_feature : Error<"%0 needs target feature %1">;
498 def err_function_needs_feature
499 : Error<"always_inline function %1 requires target feature '%2', but would "
500 "be inlined into function %0 that is compiled without support for "
502 def warn_builtin_unknown : Warning<"use of unknown builtin %0">,
503 InGroup<ImplicitFunctionDeclare>, DefaultError;
504 def warn_dyn_class_memaccess : Warning<
505 "%select{destination for|source of|first operand of|second operand of}0 this "
506 "%1 call is a pointer to %select{|class containing a }2dynamic class %3; "
507 "vtable pointer will be %select{overwritten|copied|moved|compared}4">,
508 InGroup<DiagGroup<"dynamic-class-memaccess">>;
509 def note_bad_memaccess_silence : Note<
510 "explicitly cast the pointer to silence this warning">;
511 def warn_sizeof_pointer_expr_memaccess : Warning<
512 "'%0' call operates on objects of type %1 while the size is based on a "
513 "different type %2">,
514 InGroup<SizeofPointerMemaccess>;
515 def warn_sizeof_pointer_expr_memaccess_note : Note<
516 "did you mean to %select{dereference the argument to 'sizeof' (and multiply "
517 "it by the number of elements)|remove the addressof in the argument to "
518 "'sizeof' (and multiply it by the number of elements)|provide an explicit "
520 def warn_sizeof_pointer_type_memaccess : Warning<
521 "argument to 'sizeof' in %0 call is the same pointer type %1 as the "
522 "%select{destination|source}2; expected %3 or an explicit length">,
523 InGroup<SizeofPointerMemaccess>;
524 def warn_strlcpycat_wrong_size : Warning<
525 "size argument in %0 call appears to be size of the source; "
526 "expected the size of the destination">,
527 InGroup<DiagGroup<"strlcpy-strlcat-size">>;
528 def note_strlcpycat_wrong_size : Note<
529 "change size argument to be the size of the destination">;
530 def warn_memsize_comparison : Warning<
531 "size argument in %0 call is a comparison">,
532 InGroup<DiagGroup<"memsize-comparison">>;
533 def note_memsize_comparison_paren : Note<
534 "did you mean to compare the result of %0 instead?">;
535 def note_memsize_comparison_cast_silence : Note<
536 "explicitly cast the argument to size_t to silence this warning">;
538 def warn_strncat_large_size : Warning<
539 "the value of the size argument in 'strncat' is too large, might lead to a "
540 "buffer overflow">, InGroup<StrncatSize>;
541 def warn_strncat_src_size : Warning<"size argument in 'strncat' call appears "
542 "to be size of the source">, InGroup<StrncatSize>;
543 def warn_strncat_wrong_size : Warning<
544 "the value of the size argument to 'strncat' is wrong">, InGroup<StrncatSize>;
545 def note_strncat_wrong_size : Note<
546 "change the argument to be the free space in the destination buffer minus "
547 "the terminating null byte">;
549 def warn_assume_side_effects : Warning<
550 "the argument to %0 has side effects that will be discarded">,
551 InGroup<DiagGroup<"assume">>;
553 def warn_memcpy_chk_overflow : Warning<
554 "%0 will always overflow destination buffer">,
555 InGroup<DiagGroup<"builtin-memcpy-chk-size">>;
558 // static main() is not an error in C, just in C++.
559 def warn_static_main : Warning<"'main' should not be declared static">,
561 def err_static_main : Error<"'main' is not allowed to be declared static">;
562 def err_inline_main : Error<"'main' is not allowed to be declared inline">;
563 def ext_variadic_main : ExtWarn<
564 "'main' is not allowed to be declared variadic">, InGroup<Main>;
565 def ext_noreturn_main : ExtWarn<
566 "'main' is not allowed to be declared _Noreturn">, InGroup<Main>;
567 def note_main_remove_noreturn : Note<"remove '_Noreturn'">;
568 def err_constexpr_main : Error<
569 "'main' is not allowed to be declared constexpr">;
570 def err_deleted_main : Error<"'main' is not allowed to be deleted">;
571 def err_mainlike_template_decl : Error<"%0 cannot be a template">;
572 def err_main_returns_nonint : Error<"'main' must return 'int'">;
573 def ext_main_returns_nonint : ExtWarn<"return type of 'main' is not 'int'">,
574 InGroup<MainReturnType>;
575 def note_main_change_return_type : Note<"change return type to 'int'">;
576 def err_main_surplus_args : Error<"too many parameters (%0) for 'main': "
577 "must be 0, 2, or 3">;
578 def warn_main_one_arg : Warning<"only one parameter on 'main' declaration">,
580 def err_main_arg_wrong : Error<"%select{first|second|third|fourth}0 "
581 "parameter of 'main' (%select{argument count|argument array|environment|"
582 "platform-specific data}0) must be of type %1">;
583 def err_main_global_variable :
584 Error<"main cannot be declared as global variable">;
585 def warn_main_redefined : Warning<"variable named 'main' with external linkage "
586 "has undefined behavior">, InGroup<Main>;
587 def ext_main_used : Extension<
588 "ISO C++ does not allow 'main' to be used by a program">, InGroup<Main>;
590 /// parser diagnostics
591 def ext_no_declarators : ExtWarn<"declaration does not declare anything">,
592 InGroup<MissingDeclarations>;
593 def ext_typedef_without_a_name : ExtWarn<"typedef requires a name">,
594 InGroup<MissingDeclarations>;
595 def err_typedef_not_identifier : Error<"typedef name must be an identifier">;
596 def err_typedef_changes_linkage : Error<"unsupported: typedef changes linkage"
597 " of anonymous type, but linkage was already computed">;
598 def note_typedef_changes_linkage : Note<"use a tag name here to establish "
599 "linkage prior to definition">;
600 def err_statically_allocated_object : Error<
601 "interface type cannot be statically allocated">;
602 def err_object_cannot_be_passed_returned_by_value : Error<
603 "interface type %1 cannot be %select{returned|passed}0 by value"
604 "; did you forget * in %1?">;
605 def err_parameters_retval_cannot_have_fp16_type : Error<
606 "%select{parameters|function return value}0 cannot have __fp16 type; did you forget * ?">;
607 def err_opencl_half_load_store : Error<
608 "%select{loading directly from|assigning directly to}0 pointer to type %1 is not allowed">;
609 def err_opencl_cast_to_half : Error<"casting to type %0 is not allowed">;
610 def err_opencl_half_declaration : Error<
611 "declaring variable of type %0 is not allowed">;
612 def err_opencl_half_param : Error<
613 "declaring function parameter of type %0 is not allowed; did you forget * ?">;
614 def err_opencl_half_return : Error<
615 "declaring function return value of type %0 is not allowed; did you forget * ?">;
616 def warn_enum_value_overflow : Warning<"overflow in enumeration value">;
617 def warn_pragma_options_align_reset_failed : Warning<
618 "#pragma options align=reset failed: %0">,
619 InGroup<IgnoredPragmas>;
620 def err_pragma_options_align_mac68k_target_unsupported : Error<
621 "mac68k alignment pragma is not supported on this target">;
622 def warn_pragma_pack_invalid_alignment : Warning<
623 "expected #pragma pack parameter to be '1', '2', '4', '8', or '16'">,
624 InGroup<IgnoredPragmas>;
625 // Follow the Microsoft implementation.
626 def warn_pragma_pack_show : Warning<"value of #pragma pack(show) == %0">;
627 def warn_pragma_pack_pop_identifer_and_alignment : Warning<
628 "specifying both a name and alignment to 'pop' is undefined">;
629 def warn_pragma_pop_failed : Warning<"#pragma %0(pop, ...) failed: %1">,
630 InGroup<IgnoredPragmas>;
631 def warn_cxx_ms_struct :
632 Warning<"ms_struct may not produce Microsoft-compatible layouts for classes "
633 "with base classes or virtual functions">,
634 DefaultError, InGroup<IncompatibleMSStruct>;
635 def err_section_conflict : Error<"%0 causes a section type conflict with %1">;
636 def err_no_base_classes : Error<"invalid use of '__super', %0 has no base classes">;
637 def err_invalid_super_scope : Error<"invalid use of '__super', "
638 "this keyword can only be used inside class or member function scope">;
639 def err_super_in_lambda_unsupported : Error<
640 "use of '__super' inside a lambda is unsupported">;
642 def warn_pragma_unused_undeclared_var : Warning<
643 "undeclared variable %0 used as an argument for '#pragma unused'">,
644 InGroup<IgnoredPragmas>;
645 def warn_pragma_unused_expected_var_arg : Warning<
646 "only variables can be arguments to '#pragma unused'">,
647 InGroup<IgnoredPragmas>;
648 def err_pragma_push_visibility_mismatch : Error<
649 "#pragma visibility push with no matching #pragma visibility pop">;
650 def note_surrounding_namespace_ends_here : Note<
651 "surrounding namespace with visibility attribute ends here">;
652 def err_pragma_pop_visibility_mismatch : Error<
653 "#pragma visibility pop with no matching #pragma visibility push">;
654 def note_surrounding_namespace_starts_here : Note<
655 "surrounding namespace with visibility attribute starts here">;
656 def err_pragma_loop_invalid_argument_type : Error<
657 "invalid argument of type %0; expected an integer type">;
658 def err_pragma_loop_invalid_argument_value : Error<
659 "%select{invalid value '%0'; must be positive|value '%0' is too large}1">;
660 def err_pragma_loop_compatibility : Error<
661 "%select{incompatible|duplicate}0 directives '%1' and '%2'">;
662 def err_pragma_loop_precedes_nonloop : Error<
663 "expected a for, while, or do-while loop to follow '%0'">;
665 /// Objective-C parser diagnostics
666 def err_duplicate_class_def : Error<
667 "duplicate interface definition for class %0">;
668 def err_undef_superclass : Error<
669 "cannot find interface declaration for %0, superclass of %1">;
670 def err_forward_superclass : Error<
671 "attempting to use the forward class %0 as superclass of %1">;
672 def err_no_nsconstant_string_class : Error<
673 "cannot find interface declaration for %0">;
674 def err_recursive_superclass : Error<
675 "trying to recursively use %0 as superclass of %1">;
676 def err_conflicting_aliasing_type : Error<"conflicting types for alias %0">;
677 def warn_undef_interface : Warning<"cannot find interface declaration for %0">;
678 def warn_duplicate_protocol_def : Warning<"duplicate protocol definition of %0 is ignored">;
679 def err_protocol_has_circular_dependency : Error<
680 "protocol has circular dependency">;
681 def err_undeclared_protocol : Error<"cannot find protocol declaration for %0">;
682 def warn_undef_protocolref : Warning<"cannot find protocol definition for %0">;
683 def warn_atprotocol_protocol : Warning<
684 "@protocol is using a forward protocol declaration of %0">, InGroup<AtProtocol>;
685 def warn_readonly_property : Warning<
686 "attribute 'readonly' of property %0 restricts attribute "
687 "'readwrite' of property inherited from %1">,
688 InGroup<PropertyAttr>;
690 def warn_property_attribute : Warning<
691 "'%1' attribute on property %0 does not match the property inherited from %2">,
692 InGroup<PropertyAttr>;
693 def warn_property_types_are_incompatible : Warning<
694 "property type %0 is incompatible with type %1 inherited from %2">,
695 InGroup<DiagGroup<"incompatible-property-type">>;
696 def warn_protocol_property_mismatch : Warning<
697 "property of type %0 was selected for synthesis">,
698 InGroup<DiagGroup<"protocol-property-synthesis-ambiguity">>;
699 def err_undef_interface : Error<"cannot find interface declaration for %0">;
700 def err_category_forward_interface : Error<
701 "cannot define %select{category|class extension}0 for undefined class %1">;
702 def err_class_extension_after_impl : Error<
703 "cannot declare class extension for %0 after class implementation">;
704 def note_implementation_declared : Note<
705 "class implementation is declared here">;
706 def note_while_in_implementation : Note<
707 "detected while default synthesizing properties in class implementation">;
708 def note_class_declared : Note<
709 "class is declared here">;
710 def note_receiver_class_declared : Note<
711 "receiver is instance of class declared here">;
712 def note_receiver_expr_here : Note<
713 "receiver expression is here">;
714 def note_receiver_is_id : Note<
715 "receiver is treated with 'id' type for purpose of method lookup">;
716 def note_suppressed_class_declare : Note<
717 "class with specified objc_requires_property_definitions attribute is declared here">;
718 def err_objc_root_class_subclass : Error<
719 "objc_root_class attribute may only be specified on a root class declaration">;
720 def warn_objc_root_class_missing : Warning<
721 "class %0 defined without specifying a base class">,
722 InGroup<ObjCRootClass>;
723 def note_objc_needs_superclass : Note<
724 "add a super class to fix this problem">;
725 def warn_dup_category_def : Warning<
726 "duplicate definition of category %1 on interface %0">;
727 def err_conflicting_super_class : Error<"conflicting super class name %0">;
728 def err_dup_implementation_class : Error<"reimplementation of class %0">;
729 def err_dup_implementation_category : Error<
730 "reimplementation of category %1 for class %0">;
731 def err_conflicting_ivar_type : Error<
732 "instance variable %0 has conflicting type%diff{: $ vs $|}1,2">;
733 def err_duplicate_ivar_declaration : Error<
734 "instance variable is already declared">;
735 def warn_on_superclass_use : Warning<
736 "class implementation may not have super class">;
737 def err_conflicting_ivar_bitwidth : Error<
738 "instance variable %0 has conflicting bit-field width">;
739 def err_conflicting_ivar_name : Error<
740 "conflicting instance variable names: %0 vs %1">;
741 def err_inconsistent_ivar_count : Error<
742 "inconsistent number of instance variables specified">;
743 def warn_undef_method_impl : Warning<"method definition for %0 not found">,
744 InGroup<DiagGroup<"incomplete-implementation">>;
746 def warn_conflicting_overriding_ret_types : Warning<
747 "conflicting return type in "
748 "declaration of %0%diff{: $ vs $|}1,2">,
749 InGroup<OverridingMethodMismatch>, DefaultIgnore;
751 def warn_conflicting_ret_types : Warning<
752 "conflicting return type in "
753 "implementation of %0%diff{: $ vs $|}1,2">,
754 InGroup<MismatchedReturnTypes>;
756 def warn_conflicting_overriding_ret_type_modifiers : Warning<
757 "conflicting distributed object modifiers on return type "
758 "in declaration of %0">,
759 InGroup<OverridingMethodMismatch>, DefaultIgnore;
761 def warn_conflicting_ret_type_modifiers : Warning<
762 "conflicting distributed object modifiers on return type "
763 "in implementation of %0">,
764 InGroup<DistributedObjectModifiers>;
766 def warn_non_covariant_overriding_ret_types : Warning<
767 "conflicting return type in "
768 "declaration of %0: %1 vs %2">,
769 InGroup<OverridingMethodMismatch>, DefaultIgnore;
771 def warn_non_covariant_ret_types : Warning<
772 "conflicting return type in "
773 "implementation of %0: %1 vs %2">,
774 InGroup<MethodSignatures>, DefaultIgnore;
776 def warn_conflicting_overriding_param_types : Warning<
777 "conflicting parameter types in "
778 "declaration of %0%diff{: $ vs $|}1,2">,
779 InGroup<OverridingMethodMismatch>, DefaultIgnore;
781 def warn_conflicting_param_types : Warning<
782 "conflicting parameter types in "
783 "implementation of %0%diff{: $ vs $|}1,2">,
784 InGroup<MismatchedParameterTypes>;
786 def warn_conflicting_param_modifiers : Warning<
787 "conflicting distributed object modifiers on parameter type "
788 "in implementation of %0">,
789 InGroup<DistributedObjectModifiers>;
791 def warn_conflicting_overriding_param_modifiers : Warning<
792 "conflicting distributed object modifiers on parameter type "
793 "in declaration of %0">,
794 InGroup<OverridingMethodMismatch>, DefaultIgnore;
796 def warn_non_contravariant_overriding_param_types : Warning<
797 "conflicting parameter types in "
798 "declaration of %0: %1 vs %2">,
799 InGroup<OverridingMethodMismatch>, DefaultIgnore;
801 def warn_non_contravariant_param_types : Warning<
802 "conflicting parameter types in "
803 "implementation of %0: %1 vs %2">,
804 InGroup<MethodSignatures>, DefaultIgnore;
806 def warn_conflicting_overriding_variadic :Warning<
807 "conflicting variadic declaration of method and its "
809 InGroup<OverridingMethodMismatch>, DefaultIgnore;
811 def warn_conflicting_variadic :Warning<
812 "conflicting variadic declaration of method and its "
815 def warn_category_method_impl_match:Warning<
816 "category is implementing a method which will also be implemented"
817 " by its primary class">, InGroup<ObjCProtocolMethodImpl>;
819 def warn_implements_nscopying : Warning<
820 "default assign attribute on property %0 which implements "
821 "NSCopying protocol is not appropriate with -fobjc-gc[-only]">;
823 def warn_multiple_method_decl : Warning<"multiple methods named %0 found">,
824 InGroup<ObjCMultipleMethodNames>;
825 def warn_strict_multiple_method_decl : Warning<
826 "multiple methods named %0 found">, InGroup<StrictSelector>, DefaultIgnore;
827 def warn_accessor_property_type_mismatch : Warning<
828 "type of property %0 does not match type of accessor %1">;
829 def not_conv_function_declared_at : Note<"type conversion function declared here">;
830 def note_method_declared_at : Note<"method %0 declared here">;
831 def note_property_attribute : Note<"property %0 is declared "
832 "%select{deprecated|unavailable|partial}1 here">;
833 def err_setter_type_void : Error<"type of setter must be void">;
834 def err_duplicate_method_decl : Error<"duplicate declaration of method %0">;
835 def warn_duplicate_method_decl :
836 Warning<"multiple declarations of method %0 found and ignored">,
837 InGroup<MethodDuplicate>, DefaultIgnore;
838 def warn_objc_cdirective_format_string :
839 Warning<"using %0 directive in %select{NSString|CFString}1 "
840 "which is being passed as a formatting argument to the formatting "
841 "%select{method|CFfunction}2">,
842 InGroup<ObjCCStringFormat>, DefaultIgnore;
843 def err_objc_var_decl_inclass :
844 Error<"cannot declare variable inside @interface or @protocol">;
845 def error_missing_method_context : Error<
846 "missing context for method declaration">;
847 def err_objc_property_attr_mutually_exclusive : Error<
848 "property attributes '%0' and '%1' are mutually exclusive">;
849 def err_objc_property_requires_object : Error<
850 "property with '%0' attribute must be of object type">;
851 def warn_objc_property_no_assignment_attribute : Warning<
852 "no 'assign', 'retain', or 'copy' attribute is specified - "
853 "'assign' is assumed">,
854 InGroup<ObjCPropertyNoAttribute>;
855 def warn_objc_isa_use : Warning<
856 "direct access to Objective-C's isa is deprecated in favor of "
857 "object_getClass()">, InGroup<DeprecatedObjCIsaUsage>;
858 def warn_objc_isa_assign : Warning<
859 "assignment to Objective-C's isa is deprecated in favor of "
860 "object_setClass()">, InGroup<DeprecatedObjCIsaUsage>;
861 def warn_objc_pointer_masking : Warning<
862 "bitmasking for introspection of Objective-C object pointers is strongly "
864 InGroup<ObjCPointerIntrospect>;
865 def warn_objc_pointer_masking_performSelector : Warning<warn_objc_pointer_masking.Text>,
866 InGroup<ObjCPointerIntrospectPerformSelector>;
867 def warn_objc_property_default_assign_on_object : Warning<
868 "default property attribute 'assign' not appropriate for non-GC object">,
869 InGroup<ObjCPropertyNoAttribute>;
870 def warn_property_attr_mismatch : Warning<
871 "property attribute in class extension does not match the primary class">,
872 InGroup<PropertyAttr>;
873 def warn_property_implicitly_mismatched : Warning <
874 "primary property declaration is implicitly strong while redeclaration "
875 "in class extension is weak">,
876 InGroup<DiagGroup<"objc-property-implicit-mismatch">>;
877 def warn_objc_property_copy_missing_on_block : Warning<
878 "'copy' attribute must be specified for the block property "
879 "when -fobjc-gc-only is specified">;
880 def warn_objc_property_retain_of_block : Warning<
881 "retain'ed block property does not copy the block "
882 "- use copy attribute instead">, InGroup<ObjCRetainBlockProperty>;
883 def warn_objc_readonly_property_has_setter : Warning<
884 "setter cannot be specified for a readonly property">,
885 InGroup<ObjCReadonlyPropertyHasSetter>;
886 def warn_atomic_property_rule : Warning<
887 "writable atomic property %0 cannot pair a synthesized %select{getter|setter}1 "
888 "with a user defined %select{getter|setter}2">,
889 InGroup<DiagGroup<"atomic-property-with-user-defined-accessor">>;
890 def note_atomic_property_fixup_suggest : Note<"setter and getter must both be "
891 "synthesized, or both be user defined,or the property must be nonatomic">;
892 def err_atomic_property_nontrivial_assign_op : Error<
893 "atomic property of reference type %0 cannot have non-trivial assignment"
895 def warn_cocoa_naming_owned_rule : Warning<
896 "property follows Cocoa naming"
897 " convention for returning 'owned' objects">,
898 InGroup<DiagGroup<"objc-property-matches-cocoa-ownership-rule">>;
899 def err_cocoa_naming_owned_rule : Error<
900 "property follows Cocoa naming"
901 " convention for returning 'owned' objects">;
902 def note_cocoa_naming_declare_family : Note<
903 "explicitly declare getter %objcinstance0 with '%1' to return an 'unowned' "
905 def warn_auto_synthesizing_protocol_property :Warning<
906 "auto property synthesis will not synthesize property %0"
907 " declared in protocol %1">,
908 InGroup<DiagGroup<"objc-protocol-property-synthesis">>;
909 def warn_no_autosynthesis_shared_ivar_property : Warning <
910 "auto property synthesis will not synthesize property "
911 "%0 because it cannot share an ivar with another synthesized property">,
912 InGroup<ObjCNoPropertyAutoSynthesis>;
913 def warn_no_autosynthesis_property : Warning<
914 "auto property synthesis will not synthesize property "
915 "%0 because it is 'readwrite' but it will be synthesized 'readonly' "
916 "via another property">,
917 InGroup<ObjCNoPropertyAutoSynthesis>;
918 def warn_autosynthesis_property_in_superclass : Warning<
919 "auto property synthesis will not synthesize property "
920 "%0; it will be implemented by its superclass, use @dynamic to "
921 "acknowledge intention">,
922 InGroup<ObjCNoPropertyAutoSynthesis>;
923 def warn_autosynthesis_property_ivar_match :Warning<
924 "autosynthesized property %0 will use %select{|synthesized}1 instance variable "
925 "%2, not existing instance variable %3">,
926 InGroup<DiagGroup<"objc-autosynthesis-property-ivar-name-match">>;
927 def warn_missing_explicit_synthesis : Warning <
928 "auto property synthesis is synthesizing property not explicitly synthesized">,
929 InGroup<DiagGroup<"objc-missing-property-synthesis">>, DefaultIgnore;
930 def warn_property_getter_owning_mismatch : Warning<
931 "property declared as returning non-retained objects"
932 "; getter returning retained objects">;
933 def warn_property_redecl_getter_mismatch : Warning<
934 "getter name mismatch between property redeclaration (%1) and its original "
935 "declaration (%0)">, InGroup<PropertyAttr>;
936 def error_property_setter_ambiguous_use : Error<
937 "synthesized properties %0 and %1 both claim setter %2 -"
938 " use of this setter will cause unexpected behavior">;
939 def warn_default_atomic_custom_getter_setter : Warning<
940 "atomic by default property %0 has a user defined %select{getter|setter}1 "
941 "(property should be marked 'atomic' if this is intended)">,
942 InGroup<CustomAtomic>, DefaultIgnore;
943 def err_use_continuation_class : Error<
944 "illegal redeclaration of property in class extension %0"
945 " (attribute must be 'readwrite', while its primary must be 'readonly')">;
946 def err_type_mismatch_continuation_class : Error<
947 "type of property %0 in class extension does not match "
948 "property type in primary class">;
949 def err_use_continuation_class_redeclaration_readwrite : Error<
950 "illegal redeclaration of 'readwrite' property in class extension %0"
951 " (perhaps you intended this to be a 'readwrite' redeclaration of a "
952 "'readonly' public property?)">;
953 def err_continuation_class : Error<"class extension has no primary class">;
954 def err_property_type : Error<"property cannot have array or function type %0">;
955 def error_missing_property_context : Error<
956 "missing context for property implementation declaration">;
957 def error_bad_property_decl : Error<
958 "property implementation must have its declaration in interface %0 or one of "
960 def error_category_property : Error<
961 "property declared in category %0 cannot be implemented in "
962 "class implementation">;
963 def note_property_declare : Note<
964 "property declared here">;
965 def note_protocol_property_declare : Note<
966 "it could also be property of type %0 declared here">;
967 def note_property_synthesize : Note<
968 "property synthesized here">;
969 def error_synthesize_category_decl : Error<
970 "@synthesize not allowed in a category's implementation">;
971 def error_reference_property : Error<
972 "property of reference type is not supported">;
973 def error_missing_property_interface : Error<
974 "property implementation in a category with no category declaration">;
975 def error_bad_category_property_decl : Error<
976 "property implementation must have its declaration in the category %0">;
977 def error_bad_property_context : Error<
978 "property implementation must be in a class or category implementation">;
979 def error_missing_property_ivar_decl : Error<
980 "synthesized property %0 must either be named the same as a compatible"
981 " instance variable or must explicitly name an instance variable">;
982 def err_arc_perform_selector_retains : Error<
983 "performSelector names a selector which retains the object">;
984 def warn_arc_perform_selector_leaks : Warning<
985 "performSelector may cause a leak because its selector is unknown">,
986 InGroup<DiagGroup<"arc-performSelector-leaks">>;
987 def warn_dealloc_in_category : Warning<
988 "-dealloc is being overridden in a category">,
989 InGroup<DeallocInCategory>;
990 def err_gc_weak_property_strong_type : Error<
991 "weak attribute declared on a __strong type property in GC mode">;
992 def warn_arc_repeated_use_of_weak : Warning <
993 "weak %select{variable|property|implicit property|instance variable}0 %1 is "
994 "accessed multiple times in this %select{function|method|block|lambda}2 "
995 "but may be unpredictably set to nil; assign to a strong variable to keep "
997 InGroup<ARCRepeatedUseOfWeak>, DefaultIgnore;
998 def warn_implicitly_retains_self : Warning <
999 "block implicitly retains 'self'; explicitly mention 'self' to indicate "
1000 "this is intended behavior">,
1001 InGroup<DiagGroup<"implicit-retain-self">>, DefaultIgnore;
1002 def warn_arc_possible_repeated_use_of_weak : Warning <
1003 "weak %select{variable|property|implicit property|instance variable}0 %1 may "
1004 "be accessed multiple times in this %select{function|method|block|lambda}2 "
1005 "and may be unpredictably set to nil; assign to a strong variable to keep "
1006 "the object alive">,
1007 InGroup<ARCRepeatedUseOfWeakMaybe>, DefaultIgnore;
1008 def note_arc_weak_also_accessed_here : Note<
1009 "also accessed here">;
1010 def err_incomplete_synthesized_property : Error<
1011 "cannot synthesize property %0 with incomplete type %1">;
1013 def error_property_ivar_type : Error<
1014 "type of property %0 (%1) does not match type of instance variable %2 (%3)">;
1015 def error_property_accessor_type : Error<
1016 "type of property %0 (%1) does not match type of accessor %2 (%3)">;
1017 def error_ivar_in_superclass_use : Error<
1018 "property %0 attempting to use instance variable %1 declared in super class %2">;
1019 def error_weak_property : Error<
1020 "existing instance variable %1 for __weak property %0 must be __weak">;
1021 def error_strong_property : Error<
1022 "existing instance variable %1 for strong property %0 may not be __weak">;
1023 def error_dynamic_property_ivar_decl : Error<
1024 "dynamic property cannot have instance variable specification">;
1025 def error_duplicate_ivar_use : Error<
1026 "synthesized properties %0 and %1 both claim instance variable %2">;
1027 def error_property_implemented : Error<"property %0 is already implemented">;
1028 def warn_objc_missing_super_call : Warning<
1029 "method possibly missing a [super %0] call">,
1030 InGroup<ObjCMissingSuperCalls>;
1031 def error_dealloc_bad_result_type : Error<
1032 "dealloc return type must be correctly specified as 'void' under ARC, "
1034 def warn_undeclared_selector : Warning<
1035 "undeclared selector %0">, InGroup<UndeclaredSelector>, DefaultIgnore;
1036 def warn_undeclared_selector_with_typo : Warning<
1037 "undeclared selector %0; did you mean %1?">,
1038 InGroup<UndeclaredSelector>, DefaultIgnore;
1039 def warn_implicit_atomic_property : Warning<
1040 "property is assumed atomic by default">, InGroup<ImplicitAtomic>, DefaultIgnore;
1041 def note_auto_readonly_iboutlet_fixup_suggest : Note<
1042 "property should be changed to be readwrite">;
1043 def warn_auto_readonly_iboutlet_property : Warning<
1044 "readonly IBOutlet property %0 when auto-synthesized may "
1045 "not work correctly with 'nib' loader">,
1046 InGroup<DiagGroup<"readonly-iboutlet-property">>;
1047 def warn_auto_implicit_atomic_property : Warning<
1048 "property is assumed atomic when auto-synthesizing the property">,
1049 InGroup<ImplicitAtomic>, DefaultIgnore;
1050 def warn_unimplemented_selector: Warning<
1051 "no method with selector %0 is implemented in this translation unit">,
1052 InGroup<Selector>, DefaultIgnore;
1053 def warn_unimplemented_protocol_method : Warning<
1054 "method %0 in protocol %1 not implemented">, InGroup<Protocol>;
1055 def warning_multiple_selectors: Warning<
1056 "several methods with selector %0 of mismatched types are found "
1057 "for the @selector expression">,
1058 InGroup<SelectorTypeMismatch>, DefaultIgnore;
1060 def err_objc_kindof_nonobject : Error<
1061 "'__kindof' specifier cannot be applied to non-object type %0">;
1062 def err_objc_kindof_wrong_position : Error<
1063 "'__kindof' type specifier must precede the declarator">;
1066 def err_static_assert_expression_is_not_constant : Error<
1067 "static_assert expression is not an integral constant expression">;
1068 def err_static_assert_failed : Error<"static_assert failed%select{ %1|}0">;
1069 def ext_static_assert_no_message : ExtWarn<
1070 "static_assert with no message is a C++1z extension">, InGroup<CXX1z>;
1071 def warn_cxx14_compat_static_assert_no_message : Warning<
1072 "static_assert with no message is incompatible with C++ standards before C++1z">,
1073 DefaultIgnore, InGroup<CXXPre1zCompat>;
1075 def warn_inline_namespace_reopened_noninline : Warning<
1076 "inline namespace cannot be reopened as a non-inline namespace">;
1077 def err_inline_namespace_mismatch : Error<
1078 "%select{|non-}0inline namespace "
1079 "cannot be reopened as %select{non-|}0inline">;
1081 def err_unexpected_friend : Error<
1082 "friends can only be classes or functions">;
1083 def ext_enum_friend : ExtWarn<
1084 "befriending enumeration type %0 is a C++11 extension">, InGroup<CXX11>;
1085 def warn_cxx98_compat_enum_friend : Warning<
1086 "befriending enumeration type %0 is incompatible with C++98">,
1087 InGroup<CXX98Compat>, DefaultIgnore;
1088 def ext_nonclass_type_friend : ExtWarn<
1089 "non-class friend type %0 is a C++11 extension">, InGroup<CXX11>;
1090 def warn_cxx98_compat_nonclass_type_friend : Warning<
1091 "non-class friend type %0 is incompatible with C++98">,
1092 InGroup<CXX98Compat>, DefaultIgnore;
1093 def err_friend_is_member : Error<
1094 "friends cannot be members of the declaring class">;
1095 def warn_cxx98_compat_friend_is_member : Warning<
1096 "friend declaration naming a member of the declaring class is incompatible "
1097 "with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
1098 def ext_unelaborated_friend_type : ExtWarn<
1099 "unelaborated friend declaration is a C++11 extension; specify "
1100 "'%select{struct|interface|union|class|enum}0' to befriend %1">,
1102 def warn_cxx98_compat_unelaborated_friend_type : Warning<
1103 "befriending %1 without '%select{struct|interface|union|class|enum}0' "
1104 "keyword is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
1105 def err_qualified_friend_not_found : Error<
1106 "no function named %0 with type %1 was found in the specified scope">;
1107 def err_introducing_special_friend : Error<
1108 "must use a qualified name when declaring a %select{constructor|"
1109 "destructor|conversion operator}0 as a friend">;
1110 def err_tagless_friend_type_template : Error<
1111 "friend type templates must use an elaborated type">;
1112 def err_no_matching_local_friend : Error<
1113 "no matching function found in local scope">;
1114 def err_no_matching_local_friend_suggest : Error<
1115 "no matching function %0 found in local scope; did you mean %3?">;
1116 def err_partial_specialization_friend : Error<
1117 "partial specialization cannot be declared as a friend">;
1118 def err_qualified_friend_def : Error<
1119 "friend function definition cannot be qualified with '%0'">;
1120 def err_friend_def_in_local_class : Error<
1121 "friend function cannot be defined in a local class">;
1122 def err_friend_not_first_in_declaration : Error<
1123 "'friend' must appear first in a non-function declaration">;
1124 def err_using_decl_friend : Error<
1125 "cannot befriend target of using declaration">;
1126 def warn_template_qualified_friend_unsupported : Warning<
1127 "dependent nested name specifier '%0' for friend class declaration is "
1128 "not supported; turning off access control for %1">,
1129 InGroup<UnsupportedFriend>;
1130 def warn_template_qualified_friend_ignored : Warning<
1131 "dependent nested name specifier '%0' for friend template declaration is "
1132 "not supported; ignoring this friend declaration">,
1133 InGroup<UnsupportedFriend>;
1134 def ext_friend_tag_redecl_outside_namespace : ExtWarn<
1135 "unqualified friend declaration referring to type outside of the nearest "
1136 "enclosing namespace is a Microsoft extension; add a nested name specifier">,
1137 InGroup<MicrosoftUnqualifiedFriend>;
1138 def err_pure_friend : Error<"friend declaration cannot have a pure-specifier">;
1140 def err_invalid_member_in_interface : Error<
1141 "%select{data member |non-public member function |static member function |"
1142 "user-declared constructor|user-declared destructor|operator |"
1143 "nested class }0%1 is not permitted within an interface type">;
1144 def err_invalid_base_in_interface : Error<
1145 "interface type cannot inherit from "
1146 "%select{'struct|non-public 'interface|'class}0 %1'">;
1148 def err_abstract_type_in_decl : Error<
1149 "%select{return|parameter|variable|field|instance variable|"
1150 "synthesized instance variable}0 type %1 is an abstract class">;
1151 def err_allocation_of_abstract_type : Error<
1152 "allocating an object of abstract class type %0">;
1153 def err_throw_abstract_type : Error<
1154 "cannot throw an object of abstract type %0">;
1155 def err_array_of_abstract_type : Error<"array of abstract class type %0">;
1156 def err_capture_of_abstract_type : Error<
1157 "by-copy capture of value of abstract type %0">;
1158 def err_capture_of_incomplete_type : Error<
1159 "by-copy capture of variable %0 with incomplete type %1">;
1160 def err_capture_default_non_local : Error<
1161 "non-local lambda expression cannot have a capture-default">;
1163 def err_multiple_final_overriders : Error<
1164 "virtual function %q0 has more than one final overrider in %1">;
1165 def note_final_overrider : Note<"final overrider of %q0 in %1">;
1167 def err_type_defined_in_type_specifier : Error<
1168 "%0 cannot be defined in a type specifier">;
1169 def err_type_defined_in_result_type : Error<
1170 "%0 cannot be defined in the result type of a function">;
1171 def err_type_defined_in_param_type : Error<
1172 "%0 cannot be defined in a parameter type">;
1173 def err_type_defined_in_alias_template : Error<
1174 "%0 cannot be defined in a type alias template">;
1175 def err_type_defined_in_condition : Error<
1176 "%0 cannot be defined in a condition">;
1178 def note_pure_virtual_function : Note<
1179 "unimplemented pure virtual method %0 in %1">;
1181 def note_pure_qualified_call_kext : Note<
1182 "qualified call to %0::%1 is treated as a virtual call to %1 due to -fapple-kext">;
1184 def err_deleted_decl_not_first : Error<
1185 "deleted definition must be first declaration">;
1187 def err_deleted_override : Error<
1188 "deleted function %0 cannot override a non-deleted function">;
1190 def err_non_deleted_override : Error<
1191 "non-deleted function %0 cannot override a deleted function">;
1193 def warn_weak_vtable : Warning<
1194 "%0 has no out-of-line virtual method definitions; its vtable will be "
1195 "emitted in every translation unit">,
1196 InGroup<DiagGroup<"weak-vtables">>, DefaultIgnore;
1197 def warn_weak_template_vtable : Warning<
1198 "explicit template instantiation %0 will emit a vtable in every "
1199 "translation unit">,
1200 InGroup<DiagGroup<"weak-template-vtables">>, DefaultIgnore;
1202 def ext_using_undefined_std : ExtWarn<
1203 "using directive refers to implicitly-defined namespace 'std'">;
1205 // C++ exception specifications
1206 def err_exception_spec_in_typedef : Error<
1207 "exception specifications are not allowed in %select{typedefs|type aliases}0">;
1208 def err_distant_exception_spec : Error<
1209 "exception specifications are not allowed beyond a single level "
1211 def err_incomplete_in_exception_spec : Error<
1212 "%select{|pointer to |reference to }0incomplete type %1 is not allowed "
1213 "in exception specification">;
1214 def err_rref_in_exception_spec : Error<
1215 "rvalue reference type %0 is not allowed in exception specification">;
1216 def err_mismatched_exception_spec : Error<
1217 "exception specification in declaration does not match previous declaration">;
1218 def ext_mismatched_exception_spec : ExtWarn<err_mismatched_exception_spec.Text>,
1219 InGroup<MicrosoftExceptionSpec>;
1220 def err_override_exception_spec : Error<
1221 "exception specification of overriding function is more lax than "
1223 def ext_override_exception_spec : ExtWarn<err_override_exception_spec.Text>,
1224 InGroup<MicrosoftExceptionSpec>;
1225 def err_incompatible_exception_specs : Error<
1226 "target exception specification is not superset of source">;
1227 def err_deep_exception_specs_differ : Error<
1228 "exception specifications of %select{return|argument}0 types differ">;
1229 def err_missing_exception_specification : Error<
1230 "%0 is missing exception specification '%1'">;
1231 def ext_missing_exception_specification : ExtWarn<
1232 err_missing_exception_specification.Text>,
1233 InGroup<DiagGroup<"missing-exception-spec">>;
1234 def ext_ms_missing_exception_specification : ExtWarn<
1235 err_missing_exception_specification.Text>,
1236 InGroup<MicrosoftExceptionSpec>;
1237 def err_noexcept_needs_constant_expression : Error<
1238 "argument to noexcept specifier must be a constant expression">;
1239 def err_exception_spec_not_parsed : Error<
1240 "exception specification is not available until end of class definition">;
1242 // C++ access checking
1243 def err_class_redeclared_with_different_access : Error<
1244 "%0 redeclared with '%1' access">;
1245 def err_access : Error<
1246 "%1 is a %select{private|protected}0 member of %3">, AccessControl;
1247 def ext_ms_using_declaration_inaccessible : ExtWarn<
1248 "using declaration referring to inaccessible member '%0' (which refers "
1249 "to accessible member '%1') is a Microsoft compatibility extension">,
1250 AccessControl, InGroup<MicrosoftUsingDecl>;
1251 def err_access_ctor : Error<
1252 "calling a %select{private|protected}0 constructor of class %2">,
1254 def ext_rvalue_to_reference_access_ctor : Extension<
1255 "C++98 requires an accessible copy constructor for class %2 when binding "
1256 "a reference to a temporary; was %select{private|protected}0">,
1257 AccessControl, InGroup<BindToTemporaryCopy>;
1258 def err_access_base_ctor : Error<
1259 // The ERRORs represent other special members that aren't constructors, in
1260 // hopes that someone will bother noticing and reporting if they appear
1261 "%select{base class|inherited virtual base class}0 %1 has %select{private|"
1262 "protected}3 %select{default |copy |move |*ERROR* |*ERROR* "
1263 "|*ERROR*|}2constructor">, AccessControl;
1264 def err_access_field_ctor : Error<
1265 // The ERRORs represent other special members that aren't constructors, in
1266 // hopes that someone will bother noticing and reporting if they appear
1267 "field of type %0 has %select{private|protected}2 "
1268 "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}1constructor">,
1270 def err_access_friend_function : Error<
1271 "friend function %1 is a %select{private|protected}0 member of %3">,
1274 def err_access_dtor : Error<
1275 "calling a %select{private|protected}1 destructor of class %0">,
1277 def err_access_dtor_base :
1278 Error<"base class %0 has %select{private|protected}1 destructor">,
1280 def err_access_dtor_vbase :
1281 Error<"inherited virtual base class %1 has "
1282 "%select{private|protected}2 destructor">,
1284 def err_access_dtor_temp :
1285 Error<"temporary of type %0 has %select{private|protected}1 destructor">,
1287 def err_access_dtor_exception :
1288 Error<"exception object of type %0 has %select{private|protected}1 "
1289 "destructor">, AccessControl;
1290 def err_access_dtor_field :
1291 Error<"field of type %1 has %select{private|protected}2 destructor">,
1293 def err_access_dtor_var :
1294 Error<"variable of type %1 has %select{private|protected}2 destructor">,
1296 def err_access_dtor_ivar :
1297 Error<"instance variable of type %0 has %select{private|protected}1 "
1300 def note_previous_access_declaration : Note<
1301 "previously declared '%1' here">;
1302 def note_access_natural : Note<
1303 "%select{|implicitly }1declared %select{private|protected}0 here">;
1304 def note_access_constrained_by_path : Note<
1305 "constrained by %select{|implicitly }1%select{private|protected}0"
1306 " inheritance here">;
1307 def note_access_protected_restricted_noobject : Note<
1308 "must name member using the type of the current context %0">;
1309 def note_access_protected_restricted_ctordtor : Note<
1310 "protected %select{constructor|destructor}0 can only be used to "
1311 "%select{construct|destroy}0 a base class subobject">;
1312 def note_access_protected_restricted_object : Note<
1313 "can only access this member on an object of type %0">;
1314 def warn_cxx98_compat_sfinae_access_control : Warning<
1315 "substitution failure due to access control is incompatible with C++98">,
1316 InGroup<CXX98Compat>, DefaultIgnore, NoSFINAE;
1319 def err_incomplete_nested_name_spec : Error<
1320 "incomplete type %0 named in nested name specifier">;
1321 def err_dependent_nested_name_spec : Error<
1322 "nested name specifier for a declaration cannot depend on a template "
1324 def err_nested_name_member_ref_lookup_ambiguous : Error<
1325 "lookup of %0 in member access expression is ambiguous">;
1326 def ext_nested_name_member_ref_lookup_ambiguous : ExtWarn<
1327 "lookup of %0 in member access expression is ambiguous; using member of %1">,
1328 InGroup<AmbigMemberTemplate>;
1329 def note_ambig_member_ref_object_type : Note<
1330 "lookup in the object type %0 refers here">;
1331 def note_ambig_member_ref_scope : Note<
1332 "lookup from the current scope refers here">;
1333 def err_qualified_member_nonclass : Error<
1334 "qualified member access refers to a member in %0">;
1335 def err_incomplete_member_access : Error<
1336 "member access into incomplete type %0">;
1337 def err_incomplete_type : Error<
1338 "incomplete type %0 where a complete type is required">;
1339 def warn_cxx98_compat_enum_nested_name_spec : Warning<
1340 "enumeration type in nested name specifier is incompatible with C++98">,
1341 InGroup<CXX98Compat>, DefaultIgnore;
1342 def err_nested_name_spec_is_not_class : Error<
1343 "%0 cannot appear before '::' because it is not a class"
1344 "%select{ or namespace|, namespace, or enumeration}1; did you mean ':'?">;
1345 def ext_nested_name_spec_is_enum : ExtWarn<
1346 "use of enumeration in a nested name specifier is a C++11 extension">,
1349 // C++ class members
1350 def err_storageclass_invalid_for_member : Error<
1351 "storage class specified for a member declaration">;
1352 def err_mutable_function : Error<"'mutable' cannot be applied to functions">;
1353 def err_mutable_reference : Error<"'mutable' cannot be applied to references">;
1354 def ext_mutable_reference : ExtWarn<
1355 "'mutable' on a reference type is a Microsoft extension">,
1356 InGroup<MicrosoftMutableReference>;
1357 def err_mutable_const : Error<"'mutable' and 'const' cannot be mixed">;
1358 def err_mutable_nonmember : Error<
1359 "'mutable' can only be applied to member variables">;
1360 def err_virtual_in_union : Error<
1361 "unions cannot have virtual functions">;
1362 def err_virtual_non_function : Error<
1363 "'virtual' can only appear on non-static member functions">;
1364 def err_virtual_out_of_class : Error<
1365 "'virtual' can only be specified inside the class definition">;
1366 def err_virtual_member_function_template : Error<
1367 "'virtual' cannot be specified on member function templates">;
1368 def err_static_overrides_virtual : Error<
1369 "'static' member function %0 overrides a virtual function in a base class">;
1370 def err_explicit_non_function : Error<
1371 "'explicit' can only appear on non-static member functions">;
1372 def err_explicit_out_of_class : Error<
1373 "'explicit' can only be specified inside the class definition">;
1374 def err_explicit_non_ctor_or_conv_function : Error<
1375 "'explicit' can only be applied to a constructor or conversion function">;
1376 def err_static_not_bitfield : Error<"static member %0 cannot be a bit-field">;
1377 def err_static_out_of_line : Error<
1378 "'static' can only be specified inside the class definition">;
1379 def err_storage_class_for_static_member : Error<
1380 "static data member definition cannot specify a storage class">;
1381 def err_typedef_not_bitfield : Error<"typedef member %0 cannot be a bit-field">;
1382 def err_not_integral_type_bitfield : Error<
1383 "bit-field %0 has non-integral type %1">;
1384 def err_not_integral_type_anon_bitfield : Error<
1385 "anonymous bit-field has non-integral type %0">;
1386 def err_member_function_initialization : Error<
1387 "initializer on function does not look like a pure-specifier">;
1388 def err_non_virtual_pure : Error<
1389 "%0 is not virtual and cannot be declared pure">;
1390 def ext_pure_function_definition : ExtWarn<
1391 "function definition with pure-specifier is a Microsoft extension">,
1392 InGroup<MicrosoftPureDefinition>;
1393 def err_implicit_object_parameter_init : Error<
1394 "cannot initialize object parameter of type %0 with an expression "
1396 def err_qualified_member_of_unrelated : Error<
1397 "%q0 is not a member of class %1">;
1399 def warn_call_to_pure_virtual_member_function_from_ctor_dtor : Warning<
1400 "call to pure virtual member function %0 has undefined behavior; "
1401 "overrides of %0 in subclasses are not available in the "
1402 "%select{constructor|destructor}1 of %2">;
1404 def note_member_declared_at : Note<"member is declared here">;
1405 def note_ivar_decl : Note<"instance variable is declared here">;
1406 def note_bitfield_decl : Note<"bit-field is declared here">;
1407 def note_implicit_param_decl : Note<"%0 is an implicit parameter">;
1408 def note_member_synthesized_at : Note<
1409 "implicit %select{default constructor|copy constructor|move constructor|copy "
1410 "assignment operator|move assignment operator|destructor}0 for %1 first "
1412 def note_inhctor_synthesized_at : Note<
1413 "inheriting constructor for %0 first required here">;
1414 def err_missing_default_ctor : Error<
1415 "%select{|implicit default |inheriting }0constructor for %1 must explicitly "
1416 "initialize the %select{base class|member}2 %3 which does not have a default "
1418 def note_due_to_dllexported_class : Note<
1419 "due to '%0' being dllexported%select{|; try compiling in C++11 mode}1">;
1421 def err_illegal_union_or_anon_struct_member : Error<
1422 "%select{anonymous struct|union}0 member %1 has a non-trivial "
1423 "%select{constructor|copy constructor|move constructor|copy assignment "
1424 "operator|move assignment operator|destructor}2">;
1425 def warn_cxx98_compat_nontrivial_union_or_anon_struct_member : Warning<
1426 "%select{anonymous struct|union}0 member %1 with a non-trivial "
1427 "%select{constructor|copy constructor|move constructor|copy assignment "
1428 "operator|move assignment operator|destructor}2 is incompatible with C++98">,
1429 InGroup<CXX98Compat>, DefaultIgnore;
1431 def note_nontrivial_virtual_dtor : Note<
1432 "destructor for %0 is not trivial because it is virtual">;
1433 def note_nontrivial_has_virtual : Note<
1434 "because type %0 has a virtual %select{member function|base class}1">;
1435 def note_nontrivial_no_def_ctor : Note<
1436 "because %select{base class of |field of |}0type %1 has no "
1437 "default constructor">;
1438 def note_user_declared_ctor : Note<
1439 "implicit default constructor suppressed by user-declared constructor">;
1440 def note_nontrivial_no_copy : Note<
1441 "because no %select{<<ERROR>>|constructor|constructor|assignment operator|"
1442 "assignment operator|<<ERROR>>}2 can be used to "
1443 "%select{<<ERROR>>|copy|move|copy|move|<<ERROR>>}2 "
1444 "%select{base class|field|an object}0 of type %3">;
1445 def note_nontrivial_user_provided : Note<
1446 "because %select{base class of |field of |}0type %1 has a user-provided "
1447 "%select{default constructor|copy constructor|move constructor|"
1448 "copy assignment operator|move assignment operator|destructor}2">;
1449 def note_nontrivial_in_class_init : Note<
1450 "because field %0 has an initializer">;
1451 def note_nontrivial_param_type : Note<
1452 "because its parameter is %diff{of type $, not $|of the wrong type}2,3">;
1453 def note_nontrivial_default_arg : Note<"because it has a default argument">;
1454 def note_nontrivial_variadic : Note<"because it is a variadic function">;
1455 def note_nontrivial_subobject : Note<
1456 "because the function selected to %select{construct|copy|move|copy|move|"
1457 "destroy}2 %select{base class|field}0 of type %1 is not trivial">;
1458 def note_nontrivial_objc_ownership : Note<
1459 "because type %0 has a member with %select{no|no|__strong|__weak|"
1460 "__autoreleasing}1 ownership">;
1462 def err_static_data_member_not_allowed_in_anon_struct : Error<
1463 "static data member %0 not allowed in anonymous struct">;
1464 def ext_static_data_member_in_union : ExtWarn<
1465 "static data member %0 in union is a C++11 extension">, InGroup<CXX11>;
1466 def warn_cxx98_compat_static_data_member_in_union : Warning<
1467 "static data member %0 in union is incompatible with C++98">,
1468 InGroup<CXX98Compat>, DefaultIgnore;
1469 def ext_union_member_of_reference_type : ExtWarn<
1470 "union member %0 has reference type %1, which is a Microsoft extension">,
1471 InGroup<MicrosoftUnionMemberReference>;
1472 def err_union_member_of_reference_type : Error<
1473 "union member %0 has reference type %1">;
1474 def ext_anonymous_struct_union_qualified : Extension<
1475 "anonymous %select{struct|union}0 cannot be '%1'">;
1476 def err_different_return_type_for_overriding_virtual_function : Error<
1477 "virtual function %0 has a different return type "
1478 "%diff{($) than the function it overrides (which has return type $)|"
1479 "than the function it overrides}1,2">;
1480 def note_overridden_virtual_function : Note<
1481 "overridden virtual function is here">;
1482 def err_conflicting_overriding_cc_attributes : Error<
1483 "virtual function %0 has different calling convention attributes "
1484 "%diff{($) than the function it overrides (which has calling convention $)|"
1485 "than the function it overrides}1,2">;
1487 def err_covariant_return_inaccessible_base : Error<
1488 "invalid covariant return for virtual function: %1 is a "
1489 "%select{private|protected}2 base class of %0">, AccessControl;
1490 def err_covariant_return_ambiguous_derived_to_base_conv : Error<
1491 "return type of virtual function %3 is not covariant with the return type of "
1492 "the function it overrides (ambiguous conversion from derived class "
1493 "%0 to base class %1:%2)">;
1494 def err_covariant_return_not_derived : Error<
1495 "return type of virtual function %0 is not covariant with the return type of "
1496 "the function it overrides (%1 is not derived from %2)">;
1497 def err_covariant_return_incomplete : Error<
1498 "return type of virtual function %0 is not covariant with the return type of "
1499 "the function it overrides (%1 is incomplete)">;
1500 def err_covariant_return_type_different_qualifications : Error<
1501 "return type of virtual function %0 is not covariant with the return type of "
1502 "the function it overrides (%1 has different qualifiers than %2)">;
1503 def err_covariant_return_type_class_type_more_qualified : Error<
1504 "return type of virtual function %0 is not covariant with the return type of "
1505 "the function it overrides (class type %1 is more qualified than class "
1509 def err_constructor_cannot_be : Error<"constructor cannot be declared '%0'">;
1510 def err_invalid_qualified_constructor : Error<
1511 "'%0' qualifier is not allowed on a constructor">;
1512 def err_ref_qualifier_constructor : Error<
1513 "ref-qualifier '%select{&&|&}0' is not allowed on a constructor">;
1515 def err_constructor_return_type : Error<
1516 "constructor cannot have a return type">;
1517 def err_constructor_redeclared : Error<"constructor cannot be redeclared">;
1518 def err_constructor_byvalue_arg : Error<
1519 "copy constructor must pass its first argument by reference">;
1520 def warn_no_constructor_for_refconst : Warning<
1521 "%select{struct|interface|union|class|enum}0 %1 does not declare any "
1522 "constructor to initialize its non-modifiable members">;
1523 def note_refconst_member_not_initialized : Note<
1524 "%select{const|reference}0 member %1 will never be initialized">;
1525 def ext_ms_explicit_constructor_call : ExtWarn<
1526 "explicit constructor calls are a Microsoft extension">,
1527 InGroup<MicrosoftExplicitConstructorCall>;
1530 def err_destructor_not_member : Error<
1531 "destructor must be a non-static member function">;
1532 def err_destructor_cannot_be : Error<"destructor cannot be declared '%0'">;
1533 def err_invalid_qualified_destructor : Error<
1534 "'%0' qualifier is not allowed on a destructor">;
1535 def err_ref_qualifier_destructor : Error<
1536 "ref-qualifier '%select{&&|&}0' is not allowed on a destructor">;
1537 def err_destructor_return_type : Error<"destructor cannot have a return type">;
1538 def err_destructor_redeclared : Error<"destructor cannot be redeclared">;
1539 def err_destructor_with_params : Error<"destructor cannot have any parameters">;
1540 def err_destructor_variadic : Error<"destructor cannot be variadic">;
1541 def err_destructor_typedef_name : Error<
1542 "destructor cannot be declared using a %select{typedef|type alias}1 %0 of the class name">;
1543 def err_destructor_name : Error<
1544 "expected the class name after '~' to name the enclosing class">;
1545 def err_destructor_class_name : Error<
1546 "expected the class name after '~' to name a destructor">;
1547 def err_ident_in_dtor_not_a_type : Error<
1548 "identifier %0 in object destruction expression does not name a type">;
1549 def err_destructor_expr_type_mismatch : Error<
1550 "destructor type %0 in object destruction expression does not match the "
1551 "type %1 of the object being destroyed">;
1552 def note_destructor_type_here : Note<
1553 "type %0 is declared here">;
1555 def err_destructor_template : Error<
1556 "destructor cannot be declared as a template">;
1558 // C++ initialization
1559 def err_init_conversion_failed : Error<
1560 "cannot initialize %select{a variable|a parameter|return object|an "
1561 "exception object|a member subobject|an array element|a new value|a value|a "
1562 "base class|a constructor delegation|a vector element|a block element|a "
1563 "complex element|a lambda capture|a compound literal initializer|a "
1564 "related result|a parameter of CF audited function}0 "
1565 "%diff{of type $ with an %select{rvalue|lvalue}2 of type $|"
1566 "with an %select{rvalue|lvalue}2 of incompatible type}1,3"
1567 "%select{|: different classes%diff{ ($ vs $)|}5,6"
1568 "|: different number of parameters (%5 vs %6)"
1569 "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7"
1570 "|: different return type%diff{ ($ vs $)|}5,6"
1571 "|: different qualifiers ("
1572 "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
1573 "volatile and restrict|const, volatile, and restrict}5 vs "
1574 "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
1575 "volatile and restrict|const, volatile, and restrict}6)}4">;
1577 def err_lvalue_to_rvalue_ref : Error<"rvalue reference %diff{to type $ cannot "
1578 "bind to lvalue of type $|cannot bind to incompatible lvalue}0,1">;
1579 def err_lvalue_reference_bind_to_initlist : Error<
1580 "%select{non-const|volatile}0 lvalue reference to type %1 cannot bind to an "
1581 "initializer list temporary">;
1582 def err_lvalue_reference_bind_to_temporary : Error<
1583 "%select{non-const|volatile}0 lvalue reference %diff{to type $ cannot bind "
1584 "to a temporary of type $|cannot bind to incompatible temporary}1,2">;
1585 def err_lvalue_reference_bind_to_unrelated : Error<
1586 "%select{non-const|volatile}0 lvalue reference "
1587 "%diff{to type $ cannot bind to a value of unrelated type $|"
1588 "cannot bind to a value of unrelated type}1,2">;
1589 def err_reference_bind_drops_quals : Error<
1590 "binding value %diff{of type $ to reference to type $|to reference}0,1 "
1591 "drops %select{<<ERROR>>|'const'|'restrict'|'const' and 'restrict'|"
1592 "'volatile'|'const' and 'volatile'|'restrict' and 'volatile'|"
1593 "'const', 'restrict', and 'volatile'}2 qualifier%plural{1:|2:|4:|:s}2">;
1594 def err_reference_bind_failed : Error<
1595 "reference %diff{to type $ could not bind to an %select{rvalue|lvalue}1 of "
1596 "type $|could not bind to %select{rvalue|lvalue}1 of incompatible type}0,2">;
1597 def err_reference_bind_init_list : Error<
1598 "reference to type %0 cannot bind to an initializer list">;
1599 def warn_temporary_array_to_pointer_decay : Warning<
1600 "pointer is initialized by a temporary array, which will be destroyed at the "
1601 "end of the full-expression">,
1602 InGroup<DiagGroup<"address-of-array-temporary">>;
1603 def err_init_list_bad_dest_type : Error<
1604 "%select{|non-aggregate }0type %1 cannot be initialized with an initializer "
1606 def err_member_function_call_bad_cvr : Error<"member function %0 not viable: "
1607 "'this' argument has type %1, but function is not marked "
1608 "%select{const|restrict|const or restrict|volatile|const or volatile|"
1609 "volatile or restrict|const, volatile, or restrict}2">;
1611 def err_reference_bind_to_bitfield : Error<
1612 "%select{non-const|volatile}0 reference cannot bind to "
1613 "bit-field%select{| %1}2">;
1614 def err_reference_bind_to_vector_element : Error<
1615 "%select{non-const|volatile}0 reference cannot bind to vector element">;
1616 def err_reference_var_requires_init : Error<
1617 "declaration of reference variable %0 requires an initializer">;
1618 def err_reference_without_init : Error<
1619 "reference to type %0 requires an initializer">;
1620 def note_value_initialization_here : Note<
1621 "in value-initialization of type %0 here">;
1622 def err_reference_has_multiple_inits : Error<
1623 "reference cannot be initialized with multiple values">;
1624 def err_init_non_aggr_init_list : Error<
1625 "initialization of non-aggregate type %0 with an initializer list">;
1626 def err_init_reference_member_uninitialized : Error<
1627 "reference member of type %0 uninitialized">;
1628 def note_uninit_reference_member : Note<
1629 "uninitialized reference member is here">;
1630 def warn_field_is_uninit : Warning<"field %0 is uninitialized when used here">,
1631 InGroup<Uninitialized>;
1632 def warn_base_class_is_uninit : Warning<
1633 "base class %0 is uninitialized when used here to access %q1">,
1634 InGroup<Uninitialized>;
1635 def warn_reference_field_is_uninit : Warning<
1636 "reference %0 is not yet bound to a value when used here">,
1637 InGroup<Uninitialized>;
1638 def note_uninit_in_this_constructor : Note<
1639 "during field initialization in %select{this|the implicit default}0 "
1641 def warn_static_self_reference_in_init : Warning<
1642 "static variable %0 is suspiciously used within its own initialization">,
1643 InGroup<UninitializedStaticSelfInit>;
1644 def warn_uninit_self_reference_in_init : Warning<
1645 "variable %0 is uninitialized when used within its own initialization">,
1646 InGroup<Uninitialized>;
1647 def warn_uninit_self_reference_in_reference_init : Warning<
1648 "reference %0 is not yet bound to a value when used within its own"
1650 InGroup<Uninitialized>;
1651 def warn_uninit_var : Warning<
1652 "variable %0 is uninitialized when %select{used here|captured by block}1">,
1653 InGroup<Uninitialized>, DefaultIgnore;
1654 def warn_sometimes_uninit_var : Warning<
1655 "variable %0 is %select{used|captured}1 uninitialized whenever "
1656 "%select{'%3' condition is %select{true|false}4|"
1657 "'%3' loop %select{is entered|exits because its condition is false}4|"
1658 "'%3' loop %select{condition is true|exits because its condition is false}4|"
1659 "switch %3 is taken|"
1660 "its declaration is reached|"
1662 InGroup<UninitializedSometimes>, DefaultIgnore;
1663 def warn_maybe_uninit_var : Warning<
1664 "variable %0 may be uninitialized when "
1665 "%select{used here|captured by block}1">,
1666 InGroup<UninitializedMaybe>, DefaultIgnore;
1667 def note_uninit_var_def : Note<"variable %0 is declared here">;
1668 def note_uninit_var_use : Note<
1669 "%select{uninitialized use occurs|variable is captured by block}0 here">;
1670 def warn_uninit_byref_blockvar_captured_by_block : Warning<
1671 "block pointer variable %0 is uninitialized when captured by block">,
1672 InGroup<Uninitialized>, DefaultIgnore;
1673 def note_block_var_fixit_add_initialization : Note<
1674 "did you mean to use __block %0?">;
1675 def note_in_omitted_aggregate_initializer : Note<
1676 "in implicit initialization of %select{array element %1|field %1}0 "
1677 "with omitted initializer">;
1678 def note_in_reference_temporary_list_initializer : Note<
1679 "in initialization of temporary of type %0 created to "
1680 "list-initialize this reference">;
1681 def note_var_fixit_add_initialization : Note<
1682 "initialize the variable %0 to silence this warning">;
1683 def note_uninit_fixit_remove_cond : Note<
1684 "remove the %select{'%1' if its condition|condition if it}0 "
1685 "is always %select{false|true}2">;
1686 def err_init_incomplete_type : Error<"initialization of incomplete type %0">;
1688 def warn_unsequenced_mod_mod : Warning<
1689 "multiple unsequenced modifications to %0">, InGroup<Unsequenced>;
1690 def warn_unsequenced_mod_use : Warning<
1691 "unsequenced modification and access to %0">, InGroup<Unsequenced>;
1693 def err_temp_copy_no_viable : Error<
1694 "no viable constructor %select{copying variable|copying parameter|"
1695 "returning object|throwing object|copying member subobject|copying array "
1696 "element|allocating object|copying temporary|initializing base subobject|"
1697 "initializing vector element|capturing value}0 of type %1">;
1698 def ext_rvalue_to_reference_temp_copy_no_viable : Extension<
1699 "no viable constructor %select{copying variable|copying parameter|"
1700 "returning object|throwing object|copying member subobject|copying array "
1701 "element|allocating object|copying temporary|initializing base subobject|"
1702 "initializing vector element|capturing value}0 of type %1; C++98 requires a copy "
1703 "constructor when binding a reference to a temporary">,
1704 InGroup<BindToTemporaryCopy>;
1705 def err_temp_copy_ambiguous : Error<
1706 "ambiguous constructor call when %select{copying variable|copying "
1707 "parameter|returning object|throwing object|copying member subobject|copying "
1708 "array element|allocating object|copying temporary|initializing base subobject|"
1709 "initializing vector element|capturing value}0 of type %1">;
1710 def err_temp_copy_deleted : Error<
1711 "%select{copying variable|copying parameter|returning object|throwing "
1712 "object|copying member subobject|copying array element|allocating object|"
1713 "copying temporary|initializing base subobject|initializing vector element|"
1714 "capturing value}0 of type %1 invokes deleted constructor">;
1715 def err_temp_copy_incomplete : Error<
1716 "copying a temporary object of incomplete type %0">;
1717 def warn_cxx98_compat_temp_copy : Warning<
1718 "%select{copying variable|copying parameter|returning object|throwing "
1719 "object|copying member subobject|copying array element|allocating object|"
1720 "copying temporary|initializing base subobject|initializing vector element}1 "
1721 "of type %2 when binding a reference to a temporary would %select{invoke "
1722 "an inaccessible constructor|find no viable constructor|find ambiguous "
1723 "constructors|invoke a deleted constructor}0 in C++98">,
1724 InGroup<CXX98CompatBindToTemporaryCopy>, DefaultIgnore;
1725 def err_selected_explicit_constructor : Error<
1726 "chosen constructor is explicit in copy-initialization">;
1727 def note_constructor_declared_here : Note<
1728 "constructor declared here">;
1731 def err_decltype_in_declarator : Error<
1732 "'decltype' cannot be used to name a declaration">;
1735 def warn_cxx98_compat_auto_type_specifier : Warning<
1736 "'auto' type specifier is incompatible with C++98">,
1737 InGroup<CXX98Compat>, DefaultIgnore;
1738 def err_auto_variable_cannot_appear_in_own_initializer : Error<
1739 "variable %0 declared with %select{'auto'|'decltype(auto)'|'__auto_type'}1 "
1740 "type cannot appear in its own initializer">;
1741 def err_illegal_decl_array_of_auto : Error<
1742 "'%0' declared as array of %1">;
1743 def err_new_array_of_auto : Error<
1744 "cannot allocate array of 'auto'">;
1745 def err_auto_not_allowed : Error<
1746 "%select{'auto'|'decltype(auto)'|'__auto_type'}0 not allowed "
1747 "%select{in function prototype"
1748 "|in non-static struct member|in struct member"
1749 "|in non-static union member|in union member"
1750 "|in non-static class member|in interface member"
1751 "|in exception declaration|in template parameter|in block literal"
1752 "|in template argument|in typedef|in type alias|in function return type"
1753 "|in conversion function type|here|in lambda parameter"
1754 "|in type allocated by 'new'|in K&R-style function parameter}1">;
1755 def err_auto_not_allowed_var_inst : Error<
1756 "'auto' variable template instantiation is not allowed">;
1757 def err_auto_var_requires_init : Error<
1758 "declaration of variable %0 with type %1 requires an initializer">;
1759 def err_auto_new_requires_ctor_arg : Error<
1760 "new expression for type %0 requires a constructor argument">;
1761 def err_auto_new_list_init : Error<
1762 "new expression for type %0 cannot use list-initialization">;
1763 def err_auto_var_init_no_expression : Error<
1764 "initializer for variable %0 with type %1 is empty">;
1765 def err_auto_var_init_multiple_expressions : Error<
1766 "initializer for variable %0 with type %1 contains multiple expressions">;
1767 def err_auto_var_init_paren_braces : Error<
1768 "cannot deduce type for variable %1 with type %2 from "
1769 "%select{parenthesized|nested}0 initializer list">;
1770 def err_auto_new_ctor_multiple_expressions : Error<
1771 "new expression for type %0 contains multiple constructor arguments">;
1772 def err_auto_missing_trailing_return : Error<
1773 "'auto' return without trailing return type; deduced return types are a "
1775 def err_deduced_return_type : Error<
1776 "deduced return types are a C++14 extension">;
1777 def err_trailing_return_without_auto : Error<
1778 "function with trailing return type must specify return type 'auto', not %0">;
1779 def err_trailing_return_in_parens : Error<
1780 "trailing return type may not be nested within parentheses">;
1781 def err_auto_var_deduction_failure : Error<
1782 "variable %0 with type %1 has incompatible initializer of type %2">;
1783 def err_auto_var_deduction_failure_from_init_list : Error<
1784 "cannot deduce actual type for variable %0 with type %1 from initializer list">;
1785 def err_auto_new_deduction_failure : Error<
1786 "new expression for type %0 has incompatible constructor argument of type %1">;
1787 def err_auto_different_deductions : Error<
1788 "'%select{auto|decltype(auto)|__auto_type}0' deduced as %1 in declaration "
1789 "of %2 and deduced as %3 in declaration of %4">;
1790 def err_implied_std_initializer_list_not_found : Error<
1791 "cannot deduce type of initializer list because std::initializer_list was "
1792 "not found; include <initializer_list>">;
1793 def err_malformed_std_initializer_list : Error<
1794 "std::initializer_list must be a class template with a single type parameter">;
1795 def warn_dangling_std_initializer_list : Warning<
1796 "array backing the initializer list will be destroyed at the end of "
1797 "%select{the full-expression|the constructor}0">,
1798 InGroup<DiagGroup<"dangling-initializer-list">>;
1799 def err_auto_init_list_from_c : Error<
1800 "cannot use __auto_type with initializer list in C">;
1801 def err_auto_bitfield : Error<
1802 "cannot pass bit-field as __auto_type initializer in C">;
1804 // C++1y decltype(auto) type
1805 def err_decltype_auto_cannot_be_combined : Error<
1806 "'decltype(auto)' cannot be combined with other type specifiers">;
1807 def err_decltype_auto_function_declarator_not_declaration : Error<
1808 "'decltype(auto)' can only be used as a return type "
1809 "in a function declaration">;
1810 def err_decltype_auto_compound_type : Error<
1811 "cannot form %select{pointer to|reference to|array of}0 'decltype(auto)'">;
1812 def err_decltype_auto_initializer_list : Error<
1813 "cannot deduce 'decltype(auto)' from initializer list">;
1815 // C++1y deduced return types
1816 def err_auto_fn_deduction_failure : Error<
1817 "cannot deduce return type %0 from returned value of type %1">;
1818 def err_auto_fn_different_deductions : Error<
1819 "'%select{auto|decltype(auto)}0' in return type deduced as %1 here but "
1820 "deduced as %2 in earlier return statement">;
1821 def err_auto_fn_used_before_defined : Error<
1822 "function %0 with deduced return type cannot be used before it is defined">;
1823 def err_auto_fn_no_return_but_not_auto : Error<
1824 "cannot deduce return type %0 for function with no return statements">;
1825 def err_auto_fn_return_void_but_not_auto : Error<
1826 "cannot deduce return type %0 from omitted return expression">;
1827 def err_auto_fn_return_init_list : Error<
1828 "cannot deduce return type from initializer list">;
1829 def err_auto_fn_virtual : Error<
1830 "function with deduced return type cannot be virtual">;
1832 // C++11 override control
1833 def override_keyword_only_allowed_on_virtual_member_functions : Error<
1834 "only virtual member functions can be marked '%0'">;
1835 def override_keyword_hides_virtual_member_function : Error<
1836 "non-virtual member function marked '%0' hides virtual member "
1837 "%select{function|functions}1">;
1838 def err_function_marked_override_not_overriding : Error<
1839 "%0 marked 'override' but does not override any member functions">;
1840 def warn_function_marked_not_override_overriding : Warning <
1841 "%0 overrides a member function but is not marked 'override'">,
1842 InGroup<CXX11WarnOverrideMethod>;
1843 def err_class_marked_final_used_as_base : Error<
1844 "base %0 is marked '%select{final|sealed}1'">;
1845 def warn_abstract_final_class : Warning<
1846 "abstract class is marked '%select{final|sealed}0'">, InGroup<AbstractFinalClass>;
1849 def err_repeat_attribute : Error<"%0 attribute cannot be repeated">;
1852 def err_final_function_overridden : Error<
1853 "declaration of %0 overrides a '%select{final|sealed}1' function">;
1855 // C++11 scoped enumerations
1856 def err_enum_invalid_underlying : Error<
1857 "non-integral type %0 is an invalid underlying type">;
1858 def err_enumerator_too_large : Error<
1859 "enumerator value is not representable in the underlying type %0">;
1860 def ext_enumerator_too_large : ExtWarn<
1861 "enumerator value is not representable in the underlying type %0">,
1862 InGroup<MicrosoftEnumValue>;
1863 def err_enumerator_wrapped : Error<
1864 "enumerator value %0 is not representable in the underlying type %1">;
1865 def err_enum_redeclare_type_mismatch : Error<
1866 "enumeration redeclared with different underlying type %0 (was %1)">;
1867 def err_enum_redeclare_fixed_mismatch : Error<
1868 "enumeration previously declared with %select{non|}0fixed underlying type">;
1869 def err_enum_redeclare_scoped_mismatch : Error<
1870 "enumeration previously declared as %select{un|}0scoped">;
1871 def err_enum_class_reference : Error<
1872 "reference to %select{|scoped }0enumeration must use 'enum' "
1873 "not 'enum class'">;
1874 def err_only_enums_have_underlying_types : Error<
1875 "only enumeration types have underlying types">;
1876 def err_underlying_type_of_incomplete_enum : Error<
1877 "cannot determine underlying type of incomplete enumeration type %0">;
1879 // C++11 delegating constructors
1880 def err_delegating_ctor : Error<
1881 "delegating constructors are permitted only in C++11">;
1882 def warn_cxx98_compat_delegating_ctor : Warning<
1883 "delegating constructors are incompatible with C++98">,
1884 InGroup<CXX98Compat>, DefaultIgnore;
1885 def err_delegating_initializer_alone : Error<
1886 "an initializer for a delegating constructor must appear alone">;
1887 def warn_delegating_ctor_cycle : Warning<
1888 "constructor for %0 creates a delegation cycle">, DefaultError,
1889 InGroup<DelegatingCtorCycles>;
1890 def note_it_delegates_to : Note<"it delegates to">;
1891 def note_which_delegates_to : Note<"which delegates to">;
1893 // C++11 range-based for loop
1894 def err_for_range_decl_must_be_var : Error<
1895 "for range declaration must declare a variable">;
1896 def err_for_range_storage_class : Error<
1897 "loop variable %0 may not be declared %select{'extern'|'static'|"
1898 "'__private_extern__'|'auto'|'register'|'constexpr'}1">;
1899 def err_type_defined_in_for_range : Error<
1900 "types may not be defined in a for range declaration">;
1901 def err_for_range_deduction_failure : Error<
1902 "cannot use type %0 as a range">;
1903 def err_for_range_incomplete_type : Error<
1904 "cannot use incomplete type %0 as a range">;
1905 def err_for_range_iter_deduction_failure : Error<
1906 "cannot use type %0 as an iterator">;
1907 def err_for_range_member_begin_end_mismatch : Error<
1908 "range type %0 has '%select{begin|end}1' member but no '%select{end|begin}1' member">;
1909 def err_for_range_begin_end_types_differ : Error<
1910 "'begin' and 'end' must return the same type (got %0 and %1)">;
1911 def note_in_for_range: Note<
1912 "when looking up '%select{begin|end}0' function for range expression "
1914 def err_for_range_invalid: Error<
1915 "invalid range expression of type %0; no viable '%select{begin|end}1' "
1916 "function available">;
1917 def err_range_on_array_parameter : Error<
1918 "cannot build range expression with array function parameter %0 since "
1919 "parameter with array type %1 is treated as pointer type %2">;
1920 def err_for_range_dereference : Error<
1921 "invalid range expression of type %0; did you mean to dereference it "
1923 def note_for_range_invalid_iterator : Note <
1924 "in implicit call to 'operator%select{!=|*|++}0' for iterator of type %1">;
1925 def note_for_range_begin_end : Note<
1926 "selected '%select{begin|end}0' %select{function|template }1%2 with iterator type %3">;
1929 def warn_cxx98_compat_constexpr : Warning<
1930 "'constexpr' specifier is incompatible with C++98">,
1931 InGroup<CXX98Compat>, DefaultIgnore;
1932 // FIXME: Maybe this should also go in -Wc++14-compat?
1933 def warn_cxx14_compat_constexpr_not_const : Warning<
1934 "'constexpr' non-static member function will not be implicitly 'const' "
1935 "in C++14; add 'const' to avoid a change in behavior">,
1936 InGroup<DiagGroup<"constexpr-not-const">>;
1937 def err_invalid_constexpr : Error<
1938 "%select{function parameter|typedef|non-static data member}0 "
1939 "cannot be constexpr">;
1940 def err_invalid_constexpr_member : Error<"non-static data member cannot be "
1941 "constexpr%select{; did you intend to make it %select{const|static}0?|}1">;
1942 def err_constexpr_tag : Error<
1943 "%select{class|struct|interface|union|enum}0 cannot be marked constexpr">;
1944 def err_constexpr_dtor : Error<"destructor cannot be marked constexpr">;
1945 def err_constexpr_no_declarators : Error<
1946 "constexpr can only be used in variable and function declarations">;
1947 def err_invalid_constexpr_var_decl : Error<
1948 "constexpr variable declaration must be a definition">;
1949 def err_constexpr_static_mem_var_requires_init : Error<
1950 "declaration of constexpr static data member %0 requires an initializer">;
1951 def err_constexpr_var_non_literal : Error<
1952 "constexpr variable cannot have non-literal type %0">;
1953 def err_constexpr_var_requires_const_init : Error<
1954 "constexpr variable %0 must be initialized by a constant expression">;
1955 def err_constexpr_redecl_mismatch : Error<
1956 "%select{non-constexpr declaration of %0 follows constexpr declaration"
1957 "|constexpr declaration of %0 follows non-constexpr declaration}1">;
1958 def err_constexpr_virtual : Error<"virtual function cannot be constexpr">;
1959 def err_constexpr_virtual_base : Error<
1960 "constexpr %select{member function|constructor}0 not allowed in "
1961 "%select{struct|interface|class}1 with virtual base "
1962 "%plural{1:class|:classes}2">;
1963 def note_non_literal_incomplete : Note<
1964 "incomplete type %0 is not a literal type">;
1965 def note_non_literal_virtual_base : Note<"%select{struct|interface|class}0 "
1966 "with virtual base %plural{1:class|:classes}1 is not a literal type">;
1967 def note_constexpr_virtual_base_here : Note<"virtual base class declared here">;
1968 def err_constexpr_non_literal_return : Error<
1969 "constexpr function's return type %0 is not a literal type">;
1970 def err_constexpr_non_literal_param : Error<
1971 "constexpr %select{function|constructor}1's %ordinal0 parameter type %2 is "
1972 "not a literal type">;
1973 def err_constexpr_body_invalid_stmt : Error<
1974 "statement not allowed in constexpr %select{function|constructor}0">;
1975 def ext_constexpr_body_invalid_stmt : ExtWarn<
1976 "use of this statement in a constexpr %select{function|constructor}0 "
1977 "is a C++14 extension">, InGroup<CXX14>;
1978 def warn_cxx11_compat_constexpr_body_invalid_stmt : Warning<
1979 "use of this statement in a constexpr %select{function|constructor}0 "
1980 "is incompatible with C++ standards before C++14">,
1981 InGroup<CXXPre14Compat>, DefaultIgnore;
1982 def ext_constexpr_type_definition : ExtWarn<
1983 "type definition in a constexpr %select{function|constructor}0 "
1984 "is a C++14 extension">, InGroup<CXX14>;
1985 def warn_cxx11_compat_constexpr_type_definition : Warning<
1986 "type definition in a constexpr %select{function|constructor}0 "
1987 "is incompatible with C++ standards before C++14">,
1988 InGroup<CXXPre14Compat>, DefaultIgnore;
1989 def err_constexpr_vla : Error<
1990 "variably-modified type %0 cannot be used in a constexpr "
1991 "%select{function|constructor}1">;
1992 def ext_constexpr_local_var : ExtWarn<
1993 "variable declaration in a constexpr %select{function|constructor}0 "
1994 "is a C++14 extension">, InGroup<CXX14>;
1995 def warn_cxx11_compat_constexpr_local_var : Warning<
1996 "variable declaration in a constexpr %select{function|constructor}0 "
1997 "is incompatible with C++ standards before C++14">,
1998 InGroup<CXXPre14Compat>, DefaultIgnore;
1999 def err_constexpr_local_var_static : Error<
2000 "%select{static|thread_local}1 variable not permitted in a constexpr "
2001 "%select{function|constructor}0">;
2002 def err_constexpr_local_var_non_literal_type : Error<
2003 "variable of non-literal type %1 cannot be defined in a constexpr "
2004 "%select{function|constructor}0">;
2005 def err_constexpr_local_var_no_init : Error<
2006 "variables defined in a constexpr %select{function|constructor}0 must be "
2008 def ext_constexpr_function_never_constant_expr : ExtWarn<
2009 "constexpr %select{function|constructor}0 never produces a "
2010 "constant expression">, InGroup<DiagGroup<"invalid-constexpr">>, DefaultError;
2011 def err_enable_if_never_constant_expr : Error<
2012 "'enable_if' attribute expression never produces a constant expression">;
2013 def err_constexpr_body_no_return : Error<
2014 "no return statement in constexpr function">;
2015 def err_constexpr_return_missing_expr : Error<
2016 "non-void constexpr function %0 should return a value">;
2017 def warn_cxx11_compat_constexpr_body_no_return : Warning<
2018 "constexpr function with no return statements is incompatible with C++ "
2019 "standards before C++14">, InGroup<CXXPre14Compat>, DefaultIgnore;
2020 def ext_constexpr_body_multiple_return : ExtWarn<
2021 "multiple return statements in constexpr function is a C++14 extension">,
2023 def warn_cxx11_compat_constexpr_body_multiple_return : Warning<
2024 "multiple return statements in constexpr function "
2025 "is incompatible with C++ standards before C++14">,
2026 InGroup<CXXPre14Compat>, DefaultIgnore;
2027 def note_constexpr_body_previous_return : Note<
2028 "previous return statement is here">;
2029 def err_constexpr_function_try_block : Error<
2030 "function try block not allowed in constexpr %select{function|constructor}0">;
2031 def err_constexpr_union_ctor_no_init : Error<
2032 "constexpr union constructor does not initialize any member">;
2033 def err_constexpr_ctor_missing_init : Error<
2034 "constexpr constructor must initialize all members">;
2035 def note_constexpr_ctor_missing_init : Note<
2036 "member not initialized by constructor">;
2037 def note_non_literal_no_constexpr_ctors : Note<
2038 "%0 is not literal because it is not an aggregate and has no constexpr "
2039 "constructors other than copy or move constructors">;
2040 def note_non_literal_base_class : Note<
2041 "%0 is not literal because it has base class %1 of non-literal type">;
2042 def note_non_literal_field : Note<
2043 "%0 is not literal because it has data member %1 of "
2044 "%select{non-literal|volatile}3 type %2">;
2045 def note_non_literal_user_provided_dtor : Note<
2046 "%0 is not literal because it has a user-provided destructor">;
2047 def note_non_literal_nontrivial_dtor : Note<
2048 "%0 is not literal because it has a non-trivial destructor">;
2049 def warn_private_extern : Warning<
2050 "use of __private_extern__ on a declaration may not produce external symbol "
2051 "private to the linkage unit and is deprecated">, InGroup<PrivateExtern>;
2052 def note_private_extern : Note<
2053 "use __attribute__((visibility(\"hidden\"))) attribute instead">;
2056 def err_concept_wrong_decl_kind : Error<
2057 "'concept' can only appear on the definition of a function template or variable template">;
2058 def err_concept_decls_may_only_appear_in_namespace_scope : Error<
2059 "concept declarations may only appear in namespace scope">;
2060 def err_function_concept_not_defined : Error<
2061 "function concept declaration must be a definition">;
2062 def err_var_concept_not_initialized : Error<
2063 "variable concept declaration must be initialized">;
2064 def err_function_concept_exception_spec : Error<
2065 "function concept cannot have exception specification">;
2066 def err_concept_decl_invalid_specifiers : Error<
2067 "%select{variable|function}0 concept cannot be declared "
2068 "'%select{thread_local|inline|friend|constexpr}1'">;
2069 def err_function_concept_with_params : Error<
2070 "function concept cannot have any parameters">;
2072 // C++11 char16_t/char32_t
2073 def warn_cxx98_compat_unicode_type : Warning<
2074 "'%0' type specifier is incompatible with C++98">,
2075 InGroup<CXX98Compat>, DefaultIgnore;
2077 // __make_integer_seq
2078 def err_integer_sequence_negative_length : Error<
2079 "integer sequences must have non-negative sequence length">;
2080 def err_integer_sequence_integral_element_type : Error<
2081 "integer sequences must have integral element type">;
2084 def err_objc_decls_may_only_appear_in_global_scope : Error<
2085 "Objective-C declarations may only appear in global scope">;
2086 def warn_auto_var_is_id : Warning<
2087 "'auto' deduced as 'id' in declaration of %0">,
2088 InGroup<DiagGroup<"auto-var-id">>;
2091 def err_nsobject_attribute : Error<
2092 "'NSObject' attribute is for pointer types only">;
2093 def err_attributes_are_not_compatible : Error<
2094 "%0 and %1 attributes are not compatible">;
2095 def err_attribute_wrong_number_arguments : Error<
2096 "%0 attribute %plural{0:takes no arguments|1:takes one argument|"
2097 ":requires exactly %1 arguments}1">;
2098 def err_attribute_too_many_arguments : Error<
2099 "%0 attribute takes no more than %1 argument%s1">;
2100 def err_attribute_too_few_arguments : Error<
2101 "%0 attribute takes at least %1 argument%s1">;
2102 def err_attribute_invalid_vector_type : Error<"invalid vector element type %0">;
2103 def err_attribute_bad_neon_vector_size : Error<
2104 "Neon vector size must be 64 or 128 bits">;
2105 def warn_unsupported_target_attribute
2106 : Warning<"Ignoring unsupported '%0' in the target attribute string">,
2107 InGroup<IgnoredAttributes>;
2108 def err_attribute_unsupported
2109 : Error<"%0 attribute is not supported for this target">;
2110 // The err_*_attribute_argument_not_int are seperate because they're used by
2111 // VerifyIntegerConstantExpression.
2112 def err_aligned_attribute_argument_not_int : Error<
2113 "'aligned' attribute requires integer constant">;
2114 def err_align_value_attribute_argument_not_int : Error<
2115 "'align_value' attribute requires integer constant">;
2116 def err_alignas_attribute_wrong_decl_type : Error<
2117 "%0 attribute cannot be applied to a %select{function parameter|"
2118 "variable with 'register' storage class|'catch' variable|bit-field}1">;
2119 def err_alignas_missing_on_definition : Error<
2120 "%0 must be specified on definition if it is specified on any declaration">;
2121 def note_alignas_on_declaration : Note<"declared with %0 attribute here">;
2122 def err_alignas_mismatch : Error<
2123 "redeclaration has different alignment requirement (%1 vs %0)">;
2124 def err_alignas_underaligned : Error<
2125 "requested alignment is less than minimum alignment of %1 for type %0">;
2126 def err_attribute_argument_n_type : Error<
2127 "%0 attribute requires parameter %1 to be %select{int or bool|an integer "
2128 "constant|a string|an identifier}2">;
2129 def err_attribute_argument_type : Error<
2130 "%0 attribute requires %select{int or bool|an integer "
2131 "constant|a string|an identifier}1">;
2132 def err_attribute_argument_outof_range : Error<
2133 "%0 attribute requires integer constant between %1 and %2 inclusive">;
2134 def err_init_priority_object_attr : Error<
2135 "can only use 'init_priority' attribute on file-scope definitions "
2136 "of objects of class type">;
2137 def err_attribute_argument_vec_type_hint : Error<
2138 "invalid attribute argument %0 - expecting a vector or vectorizable scalar type">;
2139 def err_attribute_argument_out_of_bounds : Error<
2140 "%0 attribute parameter %1 is out of bounds">;
2141 def err_attribute_only_once_per_parameter : Error<
2142 "%0 attribute can only be applied once per parameter">;
2143 def err_attribute_uuid_malformed_guid : Error<
2144 "uuid attribute contains a malformed GUID">;
2145 def warn_attribute_pointers_only : Warning<
2146 "%0 attribute only applies to%select{| constant}1 pointer arguments">,
2147 InGroup<IgnoredAttributes>;
2148 def err_attribute_pointers_only : Error<warn_attribute_pointers_only.Text>;
2149 def warn_attribute_return_pointers_only : Warning<
2150 "%0 attribute only applies to return values that are pointers">,
2151 InGroup<IgnoredAttributes>;
2152 def warn_attribute_return_pointers_refs_only : Warning<
2153 "%0 attribute only applies to return values that are pointers or references">,
2154 InGroup<IgnoredAttributes>;
2155 def warn_attribute_pointer_or_reference_only : Warning<
2156 "%0 attribute only applies to a pointer or reference (%1 is invalid)">,
2157 InGroup<IgnoredAttributes>;
2158 def err_attribute_no_member_pointers : Error<
2159 "%0 attribute cannot be used with pointers to members">;
2160 def err_attribute_invalid_implicit_this_argument : Error<
2161 "%0 attribute is invalid for the implicit this argument">;
2162 def err_ownership_type : Error<
2163 "%0 attribute only applies to %select{pointer|integer}1 arguments">;
2164 def err_ownership_returns_index_mismatch : Error<
2165 "'ownership_returns' attribute index does not match; here it is %0">;
2166 def note_ownership_returns_index_mismatch : Note<
2167 "declared with index %0 here">;
2168 def err_format_strftime_third_parameter : Error<
2169 "strftime format attribute requires 3rd parameter to be 0">;
2170 def err_format_attribute_requires_variadic : Error<
2171 "format attribute requires variadic function">;
2172 def err_format_attribute_not : Error<"format argument not %0">;
2173 def err_format_attribute_result_not : Error<"function does not return %0">;
2174 def err_format_attribute_implicit_this_format_string : Error<
2175 "format attribute cannot specify the implicit this argument as the format "
2177 def err_init_method_bad_return_type : Error<
2178 "init methods must return an object pointer type, not %0">;
2179 def err_attribute_invalid_size : Error<
2180 "vector size not an integral multiple of component size">;
2181 def err_attribute_zero_size : Error<"zero vector size">;
2182 def err_attribute_size_too_large : Error<"vector size too large">;
2183 def err_typecheck_vector_not_convertable : Error<
2184 "cannot convert between vector values of different size (%0 and %1)">;
2185 def err_typecheck_vector_not_convertable_non_scalar : Error<
2186 "cannot convert between vector and non-scalar values (%0 and %1)">;
2187 def err_typecheck_vector_lengths_not_equal : Error<
2188 "vector operands do not have the same number of elements (%0 and %1)">;
2189 def err_ext_vector_component_exceeds_length : Error<
2190 "vector component access exceeds type %0">;
2191 def err_ext_vector_component_name_illegal : Error<
2192 "illegal vector component name '%0'">;
2193 def err_attribute_address_space_negative : Error<
2194 "address space is negative">;
2195 def err_attribute_address_space_too_high : Error<
2196 "address space is larger than the maximum supported (%0)">;
2197 def err_attribute_address_multiple_qualifiers : Error<
2198 "multiple address spaces specified for type">;
2199 def err_attribute_address_function_type : Error<
2200 "function type may not be qualified with an address space">;
2201 def err_as_qualified_auto_decl : Error<
2202 "automatic variable qualified with an address space">;
2203 def err_arg_with_address_space : Error<
2204 "parameter may not be qualified with an address space">;
2205 def err_field_with_address_space : Error<
2206 "field may not be qualified with an address space">;
2207 def err_attr_objc_ownership_redundant : Error<
2208 "the type %0 is already explicitly ownership-qualified">;
2209 def err_invalid_nsnumber_type : Error<
2210 "%0 is not a valid literal type for NSNumber">;
2211 def err_objc_illegal_boxed_expression_type : Error<
2212 "illegal type %0 used in a boxed expression">;
2213 def err_objc_non_trivially_copyable_boxed_expression_type : Error<
2214 "non-trivially copyable type %0 cannot be used in a boxed expression">;
2215 def err_objc_incomplete_boxed_expression_type : Error<
2216 "incomplete type %0 used in a boxed expression">;
2217 def err_undeclared_objc_literal_class : Error<
2218 "definition of class %0 must be available to use Objective-C "
2219 "%select{array literals|dictionary literals|numeric literals|boxed expressions|"
2220 "string literals}1">;
2221 def err_undeclared_boxing_method : Error<
2222 "declaration of %0 is missing in %1 class">;
2223 def err_objc_literal_method_sig : Error<
2224 "literal construction method %0 has incompatible signature">;
2225 def note_objc_literal_method_param : Note<
2226 "%select{first|second|third}0 parameter has unexpected type %1 "
2228 def note_objc_literal_method_return : Note<
2229 "method returns unexpected type %0 (should be an object type)">;
2230 def err_invalid_collection_element : Error<
2231 "collection element of type %0 is not an Objective-C object">;
2232 def err_box_literal_collection : Error<
2233 "%select{string|character|boolean|numeric}0 literal must be prefixed by '@' "
2235 def warn_objc_literal_comparison : Warning<
2236 "direct comparison of %select{an array literal|a dictionary literal|"
2237 "a numeric literal|a boxed expression|}0 has undefined behavior">,
2238 InGroup<ObjCLiteralComparison>;
2239 def err_missing_atsign_prefix : Error<
2240 "string literal must be prefixed by '@' ">;
2241 def warn_objc_string_literal_comparison : Warning<
2242 "direct comparison of a string literal has undefined behavior">,
2243 InGroup<ObjCStringComparison>;
2244 def warn_concatenated_nsarray_literal : Warning<
2245 "concatenated NSString literal for an NSArray expression - "
2246 "possibly missing a comma">,
2247 InGroup<ObjCStringConcatenation>;
2248 def note_objc_literal_comparison_isequal : Note<
2249 "use 'isEqual:' instead">;
2250 def warn_objc_collection_literal_element : Warning<
2251 "object of type %0 is not compatible with "
2252 "%select{array element type|dictionary key type|dictionary value type}1 %2">,
2253 InGroup<ObjCLiteralConversion>;
2255 def err_attribute_argument_is_zero : Error<
2256 "%0 attribute must be greater than 0">;
2257 def warn_attribute_argument_n_negative : Warning<
2258 "%0 attribute parameter %1 is negative and will be ignored">,
2259 InGroup<CudaCompat>;
2260 def err_property_function_in_objc_container : Error<
2261 "use of Objective-C property in function nested in Objective-C "
2262 "container not supported, move function outside its container">;
2264 let CategoryName = "Cocoa API Issue" in {
2265 def warn_objc_redundant_literal_use : Warning<
2266 "using %0 with a literal is redundant">, InGroup<ObjCRedundantLiteralUse>;
2269 def err_attr_tlsmodel_arg : Error<"tls_model must be \"global-dynamic\", "
2270 "\"local-dynamic\", \"initial-exec\" or \"local-exec\"">;
2272 def err_tls_var_aligned_over_maximum : Error<
2273 "alignment (%0) of thread-local variable %1 is greater than the maximum supported "
2274 "alignment (%2) for a thread-local variable on this target">;
2276 def err_only_annotate_after_access_spec : Error<
2277 "access specifier can only have annotation attributes">;
2279 def err_attribute_section_invalid_for_target : Error<
2280 "argument to 'section' attribute is not valid for this target: %0">;
2281 def warn_mismatched_section : Warning<
2282 "section does not match previous declaration">, InGroup<Section>;
2284 def err_anonymous_property: Error<
2285 "anonymous property is not supported">;
2286 def err_property_is_variably_modified : Error<
2287 "property %0 has a variably modified type">;
2288 def err_no_accessor_for_property : Error<
2289 "no %select{getter|setter}0 defined for property %1">;
2290 def error_cannot_find_suitable_accessor : Error<
2291 "cannot find suitable %select{getter|setter}0 for property %1">;
2293 def err_alignment_not_power_of_two : Error<
2294 "requested alignment is not a power of 2">;
2295 def err_alignment_dependent_typedef_name : Error<
2296 "requested alignment is dependent but declaration is not dependent">;
2298 def err_attribute_aligned_too_great : Error<
2299 "requested alignment must be %0 bytes or smaller">;
2300 def warn_redeclaration_without_attribute_prev_attribute_ignored : Warning<
2301 "%q0 redeclared without %1 attribute: previous %1 ignored">,
2302 InGroup<DiagGroup<"inconsistent-dllimport">>;
2303 def warn_dllimport_dropped_from_inline_function : Warning<
2304 "%q0 redeclared inline; %1 attribute ignored">,
2305 InGroup<IgnoredAttributes>;
2306 def warn_attribute_ignored : Warning<"%0 attribute ignored">,
2307 InGroup<IgnoredAttributes>;
2308 def warn_attribute_ignored_on_inline :
2309 Warning<"%0 attribute ignored on inline function">,
2310 InGroup<IgnoredAttributes>;
2311 def warn_attribute_after_definition_ignored : Warning<
2312 "attribute %0 after definition is ignored">,
2313 InGroup<IgnoredAttributes>;
2314 def warn_unknown_attribute_ignored : Warning<
2315 "unknown attribute %0 ignored">, InGroup<UnknownAttributes>;
2316 def warn_cxx11_gnu_attribute_on_type : Warning<
2317 "attribute %0 ignored, because it cannot be applied to a type">,
2318 InGroup<IgnoredAttributes>;
2319 def warn_unhandled_ms_attribute_ignored : Warning<
2320 "__declspec attribute %0 is not supported">,
2321 InGroup<IgnoredAttributes>;
2322 def err_attribute_invalid_on_stmt : Error<
2323 "%0 attribute cannot be applied to a statement">;
2324 def warn_declspec_attribute_ignored : Warning<
2325 "attribute %0 is ignored, place it after "
2326 "\"%select{class|struct|interface|union|enum}1\" to apply attribute to "
2327 "type declaration">, InGroup<IgnoredAttributes>;
2328 def warn_attribute_precede_definition : Warning<
2329 "attribute declaration must precede definition">,
2330 InGroup<IgnoredAttributes>;
2331 def warn_attribute_void_function_method : Warning<
2332 "attribute %0 cannot be applied to "
2333 "%select{functions|Objective-C method}1 without return value">,
2334 InGroup<IgnoredAttributes>;
2335 def warn_attribute_weak_on_field : Warning<
2336 "__weak attribute cannot be specified on a field declaration">,
2337 InGroup<IgnoredAttributes>;
2338 def warn_gc_attribute_weak_on_local : Warning<
2339 "Objective-C GC does not allow weak variables on the stack">,
2340 InGroup<IgnoredAttributes>;
2341 def warn_nsobject_attribute : Warning<
2342 "'NSObject' attribute may be put on a typedef only; attribute is ignored">,
2343 InGroup<NSobjectAttribute>;
2344 def warn_independentclass_attribute : Warning<
2345 "'objc_independent_class' attribute may be put on a typedef only; "
2346 "attribute is ignored">,
2347 InGroup<IndependentClassAttribute>;
2348 def warn_ptr_independentclass_attribute : Warning<
2349 "'objc_independent_class' attribute may be put on Objective-C object "
2350 "pointer type only; attribute is ignored">,
2351 InGroup<IndependentClassAttribute>;
2352 def warn_attribute_weak_on_local : Warning<
2353 "__weak attribute cannot be specified on an automatic variable when ARC "
2355 InGroup<IgnoredAttributes>;
2356 def warn_weak_identifier_undeclared : Warning<
2357 "weak identifier %0 never declared">;
2358 def err_attribute_weak_static : Error<
2359 "weak declaration cannot have internal linkage">;
2360 def err_attribute_selectany_non_extern_data : Error<
2361 "'selectany' can only be applied to data items with external linkage">;
2362 def err_declspec_thread_on_thread_variable : Error<
2363 "'__declspec(thread)' applied to variable that already has a "
2364 "thread-local storage specifier">;
2365 def err_attribute_dll_not_extern : Error<
2366 "%q0 must have external linkage when declared %q1">;
2367 def err_attribute_dll_thread_local : Error<
2368 "%q0 cannot be thread local when declared %q1">;
2369 def err_attribute_dll_lambda : Error<
2370 "lambda cannot be declared %0">;
2371 def warn_attribute_invalid_on_definition : Warning<
2372 "'%0' attribute cannot be specified on a definition">,
2373 InGroup<IgnoredAttributes>;
2374 def err_attribute_dll_redeclaration : Error<
2375 "redeclaration of %q0 cannot add %q1 attribute">;
2376 def warn_attribute_dll_redeclaration : Warning<
2377 "redeclaration of %q0 should not add %q1 attribute">,
2378 InGroup<DiagGroup<"dll-attribute-on-redeclaration">>;
2379 def err_attribute_dllimport_function_definition : Error<
2380 "dllimport cannot be applied to non-inline function definition">;
2381 def err_attribute_dll_deleted : Error<
2382 "attribute %q0 cannot be applied to a deleted function">;
2383 def err_attribute_dllimport_data_definition : Error<
2384 "definition of dllimport data">;
2385 def err_attribute_dllimport_static_field_definition : Error<
2386 "definition of dllimport static field not allowed">;
2387 def warn_attribute_dllimport_static_field_definition : Warning<
2388 "definition of dllimport static field">,
2389 InGroup<DiagGroup<"dllimport-static-field-def">>;
2390 def warn_attribute_dllexport_explicit_instantiation_decl : Warning<
2391 "explicit instantiation declaration should not be 'dllexport'">,
2392 InGroup<DiagGroup<"dllexport-explicit-instantiation-decl">>;
2393 def warn_invalid_initializer_from_system_header : Warning<
2394 "invalid constructor form class in system header, should not be explicit">,
2395 InGroup<DiagGroup<"invalid-initializer-from-system-header">>;
2396 def note_used_in_initialization_here : Note<"used in initialization here">;
2397 def err_attribute_dll_member_of_dll_class : Error<
2398 "attribute %q0 cannot be applied to member of %q1 class">;
2399 def warn_attribute_dll_instantiated_base_class : Warning<
2400 "propagating dll attribute to %select{already instantiated|explicitly specialized}0 "
2401 "base class template without dll attribute is not supported">,
2402 InGroup<DiagGroup<"unsupported-dll-base-class-template">>, DefaultIgnore;
2403 def err_attribute_dll_ambiguous_default_ctor : Error<
2404 "'__declspec(dllexport)' cannot be applied to more than one default constructor in %0">;
2405 def err_attribute_weakref_not_static : Error<
2406 "weakref declaration must have internal linkage">;
2407 def err_attribute_weakref_not_global_context : Error<
2408 "weakref declaration of %0 must be in a global context">;
2409 def err_attribute_weakref_without_alias : Error<
2410 "weakref declaration of %0 must also have an alias attribute">;
2411 def err_alias_not_supported_on_darwin : Error <
2412 "only weak aliases are supported on darwin">;
2413 def err_alias_to_undefined : Error<
2414 "alias must point to a defined variable or function">;
2415 def warn_alias_to_weak_alias : Warning<
2416 "alias will always resolve to %0 even if weak definition of alias %1 is overridden">,
2417 InGroup<IgnoredAttributes>;
2418 def warn_alias_with_section : Warning<
2419 "alias will not be in section '%0' but in the same section as the aliasee">,
2420 InGroup<IgnoredAttributes>;
2421 def err_duplicate_mangled_name : Error<
2422 "definition with same mangled name as another definition">;
2423 def err_cyclic_alias : Error<
2424 "alias definition is part of a cycle">;
2425 def warn_attribute_wrong_decl_type : Warning<
2426 "%0 attribute only applies to %select{functions|unions|"
2427 "variables and functions|functions and methods|parameters|"
2428 "functions, methods and blocks|functions, methods, and classes|"
2429 "functions, methods, and parameters|classes|enums|variables|methods|"
2430 "variables, functions and labels|fields and global variables|structs|"
2431 "variables and typedefs|thread-local variables|"
2432 "variables and fields|variables, data members and tag types|"
2433 "types and namespaces|Objective-C interfaces|methods and properties|"
2434 "struct or union|struct, union or class|types|"
2435 "Objective-C instance methods|init methods of interface or class extension declarations|"
2436 "variables, functions and classes|Objective-C protocols|"
2437 "functions and global variables|structs, unions, and typedefs|structs and typedefs|"
2438 "interface or protocol declarations|kernel functions|non-K&R-style functions}1">,
2439 InGroup<IgnoredAttributes>;
2440 def err_attribute_wrong_decl_type : Error<warn_attribute_wrong_decl_type.Text>;
2441 def warn_type_attribute_wrong_type : Warning<
2442 "'%0' only applies to %select{function|pointer|"
2443 "Objective-C object or block pointer}1 types; type here is %2">,
2444 InGroup<IgnoredAttributes>;
2445 def warn_incomplete_encoded_type : Warning<
2446 "encoding of %0 type is incomplete because %1 component has unknown encoding">,
2447 InGroup<DiagGroup<"encode-type">>;
2448 def warn_attribute_requires_functions_or_static_globals : Warning<
2449 "%0 only applies to variables with static storage duration and functions">,
2450 InGroup<IgnoredAttributes>;
2451 def warn_gnu_inline_attribute_requires_inline : Warning<
2452 "'gnu_inline' attribute requires function to be marked 'inline',"
2453 " attribute ignored">,
2454 InGroup<IgnoredAttributes>;
2455 def err_attribute_vecreturn_only_vector_member : Error<
2456 "the vecreturn attribute can only be used on a class or structure with one member, which must be a vector">;
2457 def err_attribute_vecreturn_only_pod_record : Error<
2458 "the vecreturn attribute can only be used on a POD (plain old data) class or structure (i.e. no virtual functions)">;
2459 def err_cconv_change : Error<
2460 "function declared '%0' here was previously declared "
2461 "%select{'%2'|without calling convention}1">;
2462 def warn_cconv_ignored : Warning<
2463 "calling convention %0 ignored for this target">, InGroup<IgnoredAttributes>;
2464 def err_cconv_knr : Error<
2465 "function with no prototype cannot use the %0 calling convention">;
2466 def warn_cconv_knr : Warning<
2467 err_cconv_knr.Text>,
2468 InGroup<DiagGroup<"missing-prototype-for-cc">>;
2469 def err_cconv_varargs : Error<
2470 "variadic function cannot use %0 calling convention">;
2471 def warn_cconv_varargs : Warning<
2472 "%0 calling convention ignored on variadic function">,
2473 InGroup<IgnoredAttributes>;
2474 def warn_cconv_structors : Warning<
2475 "%0 calling convention ignored on constructor/destructor">,
2476 InGroup<IgnoredAttributes>;
2477 def err_regparm_mismatch : Error<"function declared with regparm(%0) "
2478 "attribute was previously declared "
2479 "%plural{0:without the regparm|:with the regparm(%1)}1 attribute">;
2480 def err_returns_retained_mismatch : Error<
2481 "function declared with the ns_returns_retained attribute "
2482 "was previously declared without the ns_returns_retained attribute">;
2483 def err_objc_precise_lifetime_bad_type : Error<
2484 "objc_precise_lifetime only applies to retainable types; type here is %0">;
2485 def warn_objc_precise_lifetime_meaningless : Error<
2486 "objc_precise_lifetime is not meaningful for "
2487 "%select{__unsafe_unretained|__autoreleasing}0 objects">;
2488 def err_invalid_pcs : Error<"invalid PCS type">;
2489 def warn_attribute_not_on_decl : Warning<
2490 "%0 attribute ignored when parsing type">, InGroup<IgnoredAttributes>;
2491 def err_base_specifier_attribute : Error<
2492 "%0 attribute cannot be applied to a base specifier">;
2493 def err_invalid_attribute_on_virtual_function : Error<
2494 "%0 attribute cannot be applied to virtual functions">;
2496 // Availability attribute
2497 def warn_availability_unknown_platform : Warning<
2498 "unknown platform %0 in availability macro">, InGroup<Availability>;
2499 def warn_availability_version_ordering : Warning<
2500 "feature cannot be %select{introduced|deprecated|obsoleted}0 in %1 version "
2501 "%2 before it was %select{introduced|deprecated|obsoleted}3 in version %4; "
2502 "attribute ignored">, InGroup<Availability>;
2503 def warn_mismatched_availability: Warning<
2504 "availability does not match previous declaration">, InGroup<Availability>;
2505 def warn_mismatched_availability_override : Warning<
2506 "%select{|overriding }4method %select{introduced after|"
2507 "deprecated before|obsoleted before}0 "
2508 "%select{the protocol method it implements|overridden method}4 "
2509 "on %1 (%2 vs. %3)">, InGroup<Availability>;
2510 def warn_mismatched_availability_override_unavail : Warning<
2511 "%select{|overriding }1method cannot be unavailable on %0 when "
2512 "%select{the protocol method it implements|its overridden method}1 is "
2514 InGroup<Availability>;
2515 def note_overridden_method : Note<
2516 "overridden method is here">;
2517 def note_protocol_method : Note<
2518 "protocol method is here">;
2520 // Thread Safety Attributes
2521 def warn_invalid_capability_name : Warning<
2522 "invalid capability name '%0'; capability name must be 'mutex' or 'role'">,
2523 InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2524 def warn_thread_attribute_ignored : Warning<
2525 "ignoring %0 attribute because its argument is invalid">,
2526 InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2527 def warn_thread_attribute_argument_not_lockable : Warning<
2528 "%0 attribute requires arguments whose type is annotated "
2529 "with 'capability' attribute; type here is %1">,
2530 InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2531 def warn_thread_attribute_decl_not_lockable : Warning<
2532 "%0 attribute can only be applied in a context annotated "
2533 "with 'capability(\"mutex\")' attribute">,
2534 InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2535 def warn_thread_attribute_decl_not_pointer : Warning<
2536 "%0 only applies to pointer types; type here is %1">,
2537 InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2538 def err_attribute_argument_out_of_range : Error<
2539 "%0 attribute parameter %1 is out of bounds: "
2540 "%plural{0:no parameters to index into|"
2541 "1:can only be 1, since there is one parameter|"
2542 ":must be between 1 and %2}2">;
2544 // Thread Safety Analysis
2545 def warn_unlock_but_no_lock : Warning<"releasing %0 '%1' that was not held">,
2546 InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2547 def warn_unlock_kind_mismatch : Warning<
2548 "releasing %0 '%1' using %select{shared|exclusive}2 access, expected "
2549 "%select{shared|exclusive}3 access">,
2550 InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2551 def warn_double_lock : Warning<"acquiring %0 '%1' that is already held">,
2552 InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2553 def warn_no_unlock : Warning<
2554 "%0 '%1' is still held at the end of function">,
2555 InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2556 def warn_expecting_locked : Warning<
2557 "expecting %0 '%1' to be held at the end of function">,
2558 InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2559 // FIXME: improve the error message about locks not in scope
2560 def warn_lock_some_predecessors : Warning<
2561 "%0 '%1' is not held on every path through here">,
2562 InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2563 def warn_expecting_lock_held_on_loop : Warning<
2564 "expecting %0 '%1' to be held at start of each loop">,
2565 InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2566 def note_locked_here : Note<"%0 acquired here">;
2567 def warn_lock_exclusive_and_shared : Warning<
2568 "%0 '%1' is acquired exclusively and shared in the same scope">,
2569 InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2570 def note_lock_exclusive_and_shared : Note<
2571 "the other acquisition of %0 '%1' is here">;
2572 def warn_variable_requires_any_lock : Warning<
2573 "%select{reading|writing}1 variable '%0' requires holding "
2574 "%select{any mutex|any mutex exclusively}1">,
2575 InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2576 def warn_var_deref_requires_any_lock : Warning<
2577 "%select{reading|writing}1 the value pointed to by '%0' requires holding "
2578 "%select{any mutex|any mutex exclusively}1">,
2579 InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2580 def warn_fun_excludes_mutex : Warning<
2581 "cannot call function '%1' while %0 '%2' is held">,
2582 InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2583 def warn_cannot_resolve_lock : Warning<
2584 "cannot resolve lock expression">,
2585 InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2586 def warn_acquired_before : Warning<
2587 "%0 '%1' must be acquired before '%2'">,
2588 InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2589 def warn_acquired_before_after_cycle : Warning<
2590 "Cycle in acquired_before/after dependencies, starting with '%0'">,
2591 InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2594 // Thread safety warnings negative capabilities
2595 def warn_acquire_requires_negative_cap : Warning<
2596 "acquiring %0 '%1' requires negative capability '%2'">,
2597 InGroup<ThreadSafetyNegative>, DefaultIgnore;
2599 // Thread safety warnings on pass by reference
2600 def warn_guarded_pass_by_reference : Warning<
2601 "passing variable '%1' by reference requires holding %0 "
2602 "%select{'%2'|'%2' exclusively}3">,
2603 InGroup<ThreadSafetyReference>, DefaultIgnore;
2604 def warn_pt_guarded_pass_by_reference : Warning<
2605 "passing the value that '%1' points to by reference requires holding %0 "
2606 "%select{'%2'|'%2' exclusively}3">,
2607 InGroup<ThreadSafetyReference>, DefaultIgnore;
2609 // Imprecise thread safety warnings
2610 def warn_variable_requires_lock : Warning<
2611 "%select{reading|writing}3 variable '%1' requires holding %0 "
2612 "%select{'%2'|'%2' exclusively}3">,
2613 InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2614 def warn_var_deref_requires_lock : Warning<
2615 "%select{reading|writing}3 the value pointed to by '%1' requires "
2616 "holding %0 %select{'%2'|'%2' exclusively}3">,
2617 InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2618 def warn_fun_requires_lock : Warning<
2619 "calling function '%1' requires holding %0 %select{'%2'|'%2' exclusively}3">,
2620 InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2622 // Precise thread safety warnings
2623 def warn_variable_requires_lock_precise :
2624 Warning<warn_variable_requires_lock.Text>,
2625 InGroup<ThreadSafetyPrecise>, DefaultIgnore;
2626 def warn_var_deref_requires_lock_precise :
2627 Warning<warn_var_deref_requires_lock.Text>,
2628 InGroup<ThreadSafetyPrecise>, DefaultIgnore;
2629 def warn_fun_requires_lock_precise :
2630 Warning<warn_fun_requires_lock.Text>,
2631 InGroup<ThreadSafetyPrecise>, DefaultIgnore;
2632 def note_found_mutex_near_match : Note<"found near match '%0'">;
2634 // Verbose thread safety warnings
2635 def warn_thread_safety_verbose : Warning<"Thread safety verbose warning.">,
2636 InGroup<ThreadSafetyVerbose>, DefaultIgnore;
2637 def note_thread_warning_in_fun : Note<"Thread warning in function '%0'">;
2638 def note_guarded_by_declared_here : Note<"Guarded_by declared here.">;
2640 // Dummy warning that will trigger "beta" warnings from the analysis if enabled.
2641 def warn_thread_safety_beta : Warning<"Thread safety beta warning.">,
2642 InGroup<ThreadSafetyBeta>, DefaultIgnore;
2644 // Consumed warnings
2645 def warn_use_in_invalid_state : Warning<
2646 "invalid invocation of method '%0' on object '%1' while it is in the '%2' "
2647 "state">, InGroup<Consumed>, DefaultIgnore;
2648 def warn_use_of_temp_in_invalid_state : Warning<
2649 "invalid invocation of method '%0' on a temporary object while it is in the "
2650 "'%1' state">, InGroup<Consumed>, DefaultIgnore;
2651 def warn_attr_on_unconsumable_class : Warning<
2652 "consumed analysis attribute is attached to member of class '%0' which isn't "
2653 "marked as consumable">, InGroup<Consumed>, DefaultIgnore;
2654 def warn_return_typestate_for_unconsumable_type : Warning<
2655 "return state set for an unconsumable type '%0'">, InGroup<Consumed>,
2657 def warn_return_typestate_mismatch : Warning<
2658 "return value not in expected state; expected '%0', observed '%1'">,
2659 InGroup<Consumed>, DefaultIgnore;
2660 def warn_loop_state_mismatch : Warning<
2661 "state of variable '%0' must match at the entry and exit of loop">,
2662 InGroup<Consumed>, DefaultIgnore;
2663 def warn_param_return_typestate_mismatch : Warning<
2664 "parameter '%0' not in expected state when the function returns: expected "
2665 "'%1', observed '%2'">, InGroup<Consumed>, DefaultIgnore;
2666 def warn_param_typestate_mismatch : Warning<
2667 "argument not in expected state; expected '%0', observed '%1'">,
2668 InGroup<Consumed>, DefaultIgnore;
2670 // no_sanitize attribute
2671 def warn_unknown_sanitizer_ignored : Warning<
2672 "unknown sanitizer '%0' ignored">, InGroup<UnknownSanitizers>;
2674 def warn_impcast_vector_scalar : Warning<
2675 "implicit conversion turns vector to scalar: %0 to %1">,
2676 InGroup<Conversion>, DefaultIgnore;
2677 def warn_impcast_complex_scalar : Warning<
2678 "implicit conversion discards imaginary component: %0 to %1">,
2679 InGroup<Conversion>, DefaultIgnore;
2680 def warn_impcast_float_precision : Warning<
2681 "implicit conversion loses floating-point precision: %0 to %1">,
2682 InGroup<Conversion>, DefaultIgnore;
2683 def warn_impcast_double_promotion : Warning<
2684 "implicit conversion increases floating-point precision: %0 to %1">,
2685 InGroup<DoublePromotion>, DefaultIgnore;
2686 def warn_impcast_float_integer : Warning<
2687 "implicit conversion turns floating-point number into integer: %0 to %1">,
2688 InGroup<FloatConversion>, DefaultIgnore;
2689 def warn_impcast_integer_sign : Warning<
2690 "implicit conversion changes signedness: %0 to %1">,
2691 InGroup<SignConversion>, DefaultIgnore;
2692 def warn_impcast_integer_sign_conditional : Warning<
2693 "operand of ? changes signedness: %0 to %1">,
2694 InGroup<SignConversion>, DefaultIgnore;
2695 def warn_impcast_integer_precision : Warning<
2696 "implicit conversion loses integer precision: %0 to %1">,
2697 InGroup<Conversion>, DefaultIgnore;
2698 def warn_impcast_integer_64_32 : Warning<
2699 "implicit conversion loses integer precision: %0 to %1">,
2700 InGroup<Shorten64To32>, DefaultIgnore;
2701 def warn_impcast_integer_precision_constant : Warning<
2702 "implicit conversion from %2 to %3 changes value from %0 to %1">,
2703 InGroup<ConstantConversion>;
2704 def warn_impcast_bitfield_precision_constant : Warning<
2705 "implicit truncation from %2 to bitfield changes value from %0 to %1">,
2706 InGroup<BitFieldConstantConversion>;
2707 def warn_impcast_literal_float_to_integer : Warning<
2708 "implicit conversion from %0 to %1 changes value from %2 to %3">,
2709 InGroup<LiteralConversion>;
2710 def warn_impcast_string_literal_to_bool : Warning<
2711 "implicit conversion turns string literal into bool: %0 to %1">,
2712 InGroup<StringConversion>, DefaultIgnore;
2713 def warn_impcast_different_enum_types : Warning<
2714 "implicit conversion from enumeration type %0 to different enumeration type "
2715 "%1">, InGroup<EnumConversion>;
2716 def warn_impcast_bool_to_null_pointer : Warning<
2717 "initialization of pointer of type %0 to null from a constant boolean "
2718 "expression">, InGroup<BoolConversion>;
2719 def warn_non_literal_null_pointer : Warning<
2720 "expression which evaluates to zero treated as a null pointer constant of "
2721 "type %0">, InGroup<NonLiteralNullConversion>;
2722 def warn_impcast_null_pointer_to_integer : Warning<
2723 "implicit conversion of %select{NULL|nullptr}0 constant to %1">,
2724 InGroup<NullConversion>;
2725 def warn_impcast_floating_point_to_bool : Warning<
2726 "implicit conversion turns floating-point number into bool: %0 to %1">,
2727 InGroup<ImplicitConversionFloatingPointToBool>;
2728 def ext_ms_impcast_fn_obj : ExtWarn<
2729 "implicit conversion between pointer-to-function and pointer-to-object is a "
2730 "Microsoft extension">, InGroup<MicrosoftCast>;
2732 def warn_impcast_pointer_to_bool : Warning<
2733 "address of%select{| function| array}0 '%1' will always evaluate to "
2735 InGroup<PointerBoolConversion>;
2736 def warn_cast_nonnull_to_bool : Warning<
2737 "nonnull %select{function call|parameter}0 '%1' will evaluate to "
2738 "'true' on first encounter">,
2739 InGroup<PointerBoolConversion>;
2740 def warn_this_bool_conversion : Warning<
2741 "'this' pointer cannot be null in well-defined C++ code; pointer may be "
2742 "assumed to always convert to true">, InGroup<UndefinedBoolConversion>;
2743 def warn_address_of_reference_bool_conversion : Warning<
2744 "reference cannot be bound to dereferenced null pointer in well-defined C++ "
2745 "code; pointer may be assumed to always convert to true">,
2746 InGroup<UndefinedBoolConversion>;
2748 def warn_null_pointer_compare : Warning<
2749 "comparison of %select{address of|function|array}0 '%1' %select{not |}2"
2750 "equal to a null pointer is always %select{true|false}2">,
2751 InGroup<TautologicalPointerCompare>;
2752 def warn_nonnull_expr_compare : Warning<
2753 "comparison of nonnull %select{function call|parameter}0 '%1' "
2754 "%select{not |}2equal to a null pointer is '%select{true|false}2' on first "
2756 InGroup<TautologicalPointerCompare>;
2757 def warn_this_null_compare : Warning<
2758 "'this' pointer cannot be null in well-defined C++ code; comparison may be "
2759 "assumed to always evaluate to %select{true|false}0">,
2760 InGroup<TautologicalUndefinedCompare>;
2761 def warn_address_of_reference_null_compare : Warning<
2762 "reference cannot be bound to dereferenced null pointer in well-defined C++ "
2763 "code; comparison may be assumed to always evaluate to "
2764 "%select{true|false}0">,
2765 InGroup<TautologicalUndefinedCompare>;
2766 def note_reference_is_return_value : Note<"%0 returns a reference">;
2768 def note_function_warning_silence : Note<
2769 "prefix with the address-of operator to silence this warning">;
2770 def note_function_to_function_call : Note<
2771 "suffix with parentheses to turn this into a function call">;
2772 def warn_impcast_objective_c_literal_to_bool : Warning<
2773 "implicit boolean conversion of Objective-C object literal always "
2774 "evaluates to true">,
2775 InGroup<ObjCLiteralConversion>;
2777 def warn_cast_align : Warning<
2778 "cast from %0 to %1 increases required alignment from %2 to %3">,
2779 InGroup<CastAlign>, DefaultIgnore;
2780 def warn_old_style_cast : Warning<
2781 "use of old-style cast">, InGroup<OldStyleCast>, DefaultIgnore;
2783 // Separate between casts to void* and non-void* pointers.
2784 // Some APIs use (abuse) void* for something like a user context,
2785 // and often that value is an integer even if it isn't a pointer itself.
2786 // Having a separate warning flag allows users to control the warning
2787 // for their workflow.
2788 def warn_int_to_pointer_cast : Warning<
2789 "cast to %1 from smaller integer type %0">,
2790 InGroup<IntToPointerCast>;
2791 def warn_int_to_void_pointer_cast : Warning<
2792 "cast to %1 from smaller integer type %0">,
2793 InGroup<IntToVoidPointerCast>;
2795 def warn_attribute_packed_for_bitfield : Warning<
2796 "'packed' attribute was ignored on bit-fields with single-byte alignment "
2797 "in older versions of GCC and Clang">,
2798 InGroup<DiagGroup<"attribute-packed-for-bitfield">>;
2799 def warn_transparent_union_attribute_field_size_align : Warning<
2800 "%select{alignment|size}0 of field %1 (%2 bits) does not match the "
2801 "%select{alignment|size}0 of the first field in transparent union; "
2802 "transparent_union attribute ignored">,
2803 InGroup<IgnoredAttributes>;
2804 def note_transparent_union_first_field_size_align : Note<
2805 "%select{alignment|size}0 of first field is %1 bits">;
2806 def warn_transparent_union_attribute_not_definition : Warning<
2807 "transparent_union attribute can only be applied to a union definition; "
2808 "attribute ignored">,
2809 InGroup<IgnoredAttributes>;
2810 def warn_transparent_union_attribute_floating : Warning<
2811 "first field of a transparent union cannot have %select{floating point|"
2812 "vector}0 type %1; transparent_union attribute ignored">,
2813 InGroup<IgnoredAttributes>;
2814 def warn_transparent_union_attribute_zero_fields : Warning<
2815 "transparent union definition must contain at least one field; "
2816 "transparent_union attribute ignored">,
2817 InGroup<IgnoredAttributes>;
2818 def warn_attribute_type_not_supported : Warning<
2819 "%0 attribute argument not supported: %1">,
2820 InGroup<IgnoredAttributes>;
2821 def warn_attribute_unknown_visibility : Warning<"unknown visibility %0">,
2822 InGroup<IgnoredAttributes>;
2823 def warn_attribute_protected_visibility :
2824 Warning<"target does not support 'protected' visibility; using 'default'">,
2825 InGroup<DiagGroup<"unsupported-visibility">>;
2826 def err_mismatched_visibility: Error<"visibility does not match previous declaration">;
2827 def note_previous_attribute : Note<"previous attribute is here">;
2828 def note_conflicting_attribute : Note<"conflicting attribute is here">;
2829 def note_attribute : Note<"attribute is here">;
2830 def err_mismatched_ms_inheritance : Error<
2831 "inheritance model does not match %select{definition|previous declaration}0">;
2832 def warn_ignored_ms_inheritance : Warning<
2833 "inheritance model ignored on %select{primary template|partial specialization}0">,
2834 InGroup<IgnoredAttributes>;
2835 def note_previous_ms_inheritance : Note<
2836 "previous inheritance model specified here">;
2837 def err_machine_mode : Error<"%select{unknown|unsupported}0 machine mode %1">;
2838 def err_mode_not_primitive : Error<
2839 "mode attribute only supported for integer and floating-point types">;
2840 def err_mode_wrong_type : Error<
2841 "type of machine mode does not match type of base type">;
2842 def warn_vector_mode_deprecated : Warning<
2843 "specifying vector types with the 'mode' attribute is deprecated; "
2844 "use the 'vector_size' attribute instead">,
2845 InGroup<DeprecatedAttributes>;
2846 def err_complex_mode_vector_type : Error<
2847 "type of machine mode does not support base vector types">;
2848 def err_attr_wrong_decl : Error<
2849 "%0 attribute invalid on this declaration, requires typedef or value">;
2850 def warn_attribute_nonnull_no_pointers : Warning<
2851 "'nonnull' attribute applied to function with no pointer arguments">,
2852 InGroup<IgnoredAttributes>;
2853 def warn_attribute_nonnull_parm_no_args : Warning<
2854 "'nonnull' attribute when used on parameters takes no arguments">,
2855 InGroup<IgnoredAttributes>;
2856 def warn_attribute_sentinel_named_arguments : Warning<
2857 "'sentinel' attribute requires named arguments">,
2858 InGroup<IgnoredAttributes>;
2859 def warn_attribute_sentinel_not_variadic : Warning<
2860 "'sentinel' attribute only supported for variadic %select{functions|blocks}0">,
2861 InGroup<IgnoredAttributes>;
2862 def err_attribute_sentinel_less_than_zero : Error<
2863 "'sentinel' parameter 1 less than zero">;
2864 def err_attribute_sentinel_not_zero_or_one : Error<
2865 "'sentinel' parameter 2 not 0 or 1">;
2866 def warn_cleanup_ext : Warning<
2867 "GCC does not allow the 'cleanup' attribute argument to be anything other "
2868 "than a simple identifier">,
2870 def err_attribute_cleanup_arg_not_function : Error<
2871 "'cleanup' argument %select{|%1 |%1 }0is not a %select{||single }0function">;
2872 def err_attribute_cleanup_func_must_take_one_arg : Error<
2873 "'cleanup' function %0 must take 1 parameter">;
2874 def err_attribute_cleanup_func_arg_incompatible_type : Error<
2875 "'cleanup' function %0 parameter has "
2876 "%diff{type $ which is incompatible with type $|incompatible type}1,2">;
2877 def err_attribute_regparm_wrong_platform : Error<
2878 "'regparm' is not valid on this platform">;
2879 def err_attribute_regparm_invalid_number : Error<
2880 "'regparm' parameter must be between 0 and %0 inclusive">;
2881 def err_attribute_not_supported_in_lang : Error<
2882 "%0 attribute is not supported in %select{C|C++|Objective-C}1">;
2885 // Clang-Specific Attributes
2886 def warn_attribute_iboutlet : Warning<
2887 "%0 attribute can only be applied to instance variables or properties">,
2888 InGroup<IgnoredAttributes>;
2889 def err_iboutletcollection_type : Error<
2890 "invalid type %0 as argument of iboutletcollection attribute">;
2891 def err_iboutletcollection_builtintype : Error<
2892 "type argument of iboutletcollection attribute cannot be a builtin type">;
2893 def warn_iboutlet_object_type : Warning<
2894 "%select{instance variable|property}2 with %0 attribute must "
2895 "be an object type (invalid %1)">, InGroup<ObjCInvalidIBOutletProperty>;
2896 def warn_iboutletcollection_property_assign : Warning<
2897 "IBOutletCollection properties should be copy/strong and not assign">,
2898 InGroup<ObjCInvalidIBOutletProperty>;
2900 def err_attribute_overloadable_missing : Error<
2901 "%select{overloaded function|redeclaration of}0 %1 must have the "
2902 "'overloadable' attribute">;
2903 def note_attribute_overloadable_prev_overload : Note<
2904 "previous overload of function is here">;
2905 def err_attribute_overloadable_no_prototype : Error<
2906 "'overloadable' function %0 must have a prototype">;
2907 def warn_ns_attribute_wrong_return_type : Warning<
2908 "%0 attribute only applies to %select{functions|methods|properties}1 that "
2909 "return %select{an Objective-C object|a pointer|a non-retainable pointer}2">,
2910 InGroup<IgnoredAttributes>;
2911 def warn_ns_attribute_wrong_parameter_type : Warning<
2912 "%0 attribute only applies to "
2913 "%select{Objective-C object|pointer|pointer-to-CF-pointer}1 parameters">,
2914 InGroup<IgnoredAttributes>;
2915 def warn_objc_requires_super_protocol : Warning<
2916 "%0 attribute cannot be applied to %select{methods in protocols|dealloc}1">,
2917 InGroup<DiagGroup<"requires-super-attribute">>;
2918 def note_protocol_decl : Note<
2919 "protocol is declared here">;
2920 def note_protocol_decl_undefined : Note<
2921 "protocol %0 has no definition">;
2923 // objc_designated_initializer attribute diagnostics.
2924 def warn_objc_designated_init_missing_super_call : Warning<
2925 "designated initializer missing a 'super' call to a designated initializer of the super class">,
2926 InGroup<ObjCDesignatedInit>;
2927 def note_objc_designated_init_marked_here : Note<
2928 "method marked as designated initializer of the class here">;
2929 def warn_objc_designated_init_non_super_designated_init_call : Warning<
2930 "designated initializer should only invoke a designated initializer on 'super'">,
2931 InGroup<ObjCDesignatedInit>;
2932 def warn_objc_designated_init_non_designated_init_call : Warning<
2933 "designated initializer invoked a non-designated initializer">,
2934 InGroup<ObjCDesignatedInit>;
2935 def warn_objc_secondary_init_super_init_call : Warning<
2936 "convenience initializer should not invoke an initializer on 'super'">,
2937 InGroup<ObjCDesignatedInit>;
2938 def warn_objc_secondary_init_missing_init_call : Warning<
2939 "convenience initializer missing a 'self' call to another initializer">,
2940 InGroup<ObjCDesignatedInit>;
2941 def warn_objc_implementation_missing_designated_init_override : Warning<
2942 "method override for the designated initializer of the superclass %objcinstance0 not found">,
2943 InGroup<ObjCDesignatedInit>;
2945 // objc_bridge attribute diagnostics.
2946 def err_objc_attr_not_id : Error<
2947 "parameter of %0 attribute must be a single name of an Objective-C %select{class|protocol}1">;
2948 def err_objc_attr_typedef_not_id : Error<
2949 "parameter of %0 attribute must be 'id' when used on a typedef">;
2950 def err_objc_attr_typedef_not_void_pointer : Error<
2951 "'objc_bridge(id)' is only allowed on structs and typedefs of void pointers">;
2952 def err_objc_cf_bridged_not_interface : Error<
2953 "CF object of type %0 is bridged to %1, which is not an Objective-C class">;
2954 def err_objc_ns_bridged_invalid_cfobject : Error<
2955 "ObjectiveC object of type %0 is bridged to %1, which is not valid CF object">;
2956 def warn_objc_invalid_bridge : Warning<
2957 "%0 bridges to %1, not %2">, InGroup<ObjCBridge>;
2958 def warn_objc_invalid_bridge_to_cf : Warning<
2959 "%0 cannot bridge to %1">, InGroup<ObjCBridge>;
2961 // objc_bridge_related attribute diagnostics.
2962 def err_objc_bridged_related_invalid_class : Error<
2963 "could not find Objective-C class %0 to convert %1 to %2">;
2964 def err_objc_bridged_related_invalid_class_name : Error<
2965 "%0 must be name of an Objective-C class to be able to convert %1 to %2">;
2966 def err_objc_bridged_related_known_method : Error<
2967 "%0 must be explicitly converted to %1; use %select{%objcclass2|%objcinstance2}3 "
2968 "method for this conversion">;
2970 def err_objc_attr_protocol_requires_definition : Error<
2971 "attribute %0 can only be applied to @protocol definitions, not forward declarations">;
2973 // Function Parameter Semantic Analysis.
2974 def err_param_with_void_type : Error<"argument may not have 'void' type">;
2975 def err_void_only_param : Error<
2976 "'void' must be the first and only parameter if specified">;
2977 def err_void_param_qualified : Error<
2978 "'void' as parameter must not have type qualifiers">;
2979 def err_ident_list_in_fn_declaration : Error<
2980 "a parameter list without types is only allowed in a function definition">;
2981 def ext_param_not_declared : Extension<
2982 "parameter %0 was not declared, defaulting to type 'int'">;
2983 def err_param_default_argument : Error<
2984 "C does not support default arguments">;
2985 def err_param_default_argument_redefinition : Error<
2986 "redefinition of default argument">;
2987 def ext_param_default_argument_redefinition : ExtWarn<
2988 err_param_default_argument_redefinition.Text>,
2989 InGroup<MicrosoftDefaultArgRedefinition>;
2990 def err_param_default_argument_missing : Error<
2991 "missing default argument on parameter">;
2992 def err_param_default_argument_missing_name : Error<
2993 "missing default argument on parameter %0">;
2994 def err_param_default_argument_references_param : Error<
2995 "default argument references parameter %0">;
2996 def err_param_default_argument_references_local : Error<
2997 "default argument references local variable %0 of enclosing function">;
2998 def err_param_default_argument_references_this : Error<
2999 "default argument references 'this'">;
3000 def err_param_default_argument_nonfunc : Error<
3001 "default arguments can only be specified for parameters in a function "
3003 def err_param_default_argument_template_redecl : Error<
3004 "default arguments cannot be added to a function template that has already "
3006 def err_param_default_argument_member_template_redecl : Error<
3007 "default arguments cannot be added to an out-of-line definition of a member "
3008 "of a %select{class template|class template partial specialization|nested "
3009 "class in a template}0">;
3010 def err_param_default_argument_on_parameter_pack : Error<
3011 "parameter pack cannot have a default argument">;
3012 def err_uninitialized_member_for_assign : Error<
3013 "cannot define the implicit copy assignment operator for %0, because "
3014 "non-static %select{reference|const}1 member %2 cannot use copy "
3015 "assignment operator">;
3016 def err_uninitialized_member_in_ctor : Error<
3017 "%select{|implicit default |inheriting }0constructor for %1 must explicitly "
3018 "initialize the %select{reference|const}2 member %3">;
3019 def err_default_arg_makes_ctor_special : Error<
3020 "addition of default argument on redeclaration makes this constructor a "
3021 "%select{default|copy|move}0 constructor">;
3023 def err_use_of_default_argument_to_function_declared_later : Error<
3024 "use of default argument to function %0 that is declared later in class %1">;
3025 def note_default_argument_declared_here : Note<
3026 "default argument declared here">;
3028 def ext_param_promoted_not_compatible_with_prototype : ExtWarn<
3029 "%diff{promoted type $ of K&R function parameter is not compatible with the "
3030 "parameter type $|promoted type of K&R function parameter is not compatible "
3031 "with parameter type}0,1 declared in a previous prototype">,
3032 InGroup<KNRPromotedParameter>;
3035 // C++ Overloading Semantic Analysis.
3036 def err_ovl_diff_return_type : Error<
3037 "functions that differ only in their return type cannot be overloaded">;
3038 def err_ovl_static_nonstatic_member : Error<
3039 "static and non-static member functions with the same parameter types "
3040 "cannot be overloaded">;
3042 def err_ovl_no_viable_function_in_call : Error<
3043 "no matching function for call to %0">;
3044 def err_ovl_no_viable_member_function_in_call : Error<
3045 "no matching member function for call to %0">;
3046 def err_ovl_ambiguous_call : Error<
3047 "call to %0 is ambiguous">;
3048 def err_ovl_deleted_call : Error<
3049 "call to %select{unavailable|deleted}0 function %1%2">;
3050 def err_ovl_ambiguous_member_call : Error<
3051 "call to member function %0 is ambiguous">;
3052 def err_ovl_deleted_member_call : Error<
3053 "call to %select{unavailable|deleted}0 member function %1%2">;
3054 def note_ovl_too_many_candidates : Note<
3055 "remaining %0 candidate%s0 omitted; "
3056 "pass -fshow-overloads=all to show them">;
3057 def note_ovl_candidate : Note<"candidate "
3058 "%select{function|function|constructor|"
3059 "function |function |constructor |"
3060 "is the implicit default constructor|"
3061 "is the implicit copy constructor|"
3062 "is the implicit move constructor|"
3063 "is the implicit copy assignment operator|"
3064 "is the implicit move assignment operator|"
3065 "is an inherited constructor}0%1"
3066 "%select{| has different class%diff{ (expected $ but has $)|}3,4"
3067 "| has different number of parameters (expected %3 but has %4)"
3068 "| has type mismatch at %ordinal3 parameter"
3069 "%diff{ (expected $ but has $)|}4,5"
3070 "| has different return type%diff{ ($ expected but has $)|}3,4"
3071 "| has different qualifiers (expected "
3072 "%select{none|const|restrict|const and restrict|volatile|const and volatile"
3073 "|volatile and restrict|const, volatile, and restrict}3 but found "
3074 "%select{none|const|restrict|const and restrict|volatile|const and volatile"
3075 "|volatile and restrict|const, volatile, and restrict}4)}2">;
3077 def note_ovl_candidate_inherited_constructor : Note<"inherited from here">;
3078 def note_ovl_candidate_illegal_constructor : Note<
3079 "candidate %select{constructor|template}0 ignored: "
3080 "instantiation %select{takes|would take}0 its own class type by value">;
3081 def note_ovl_candidate_bad_deduction : Note<
3082 "candidate template ignored: failed template argument deduction">;
3083 def note_ovl_candidate_incomplete_deduction : Note<"candidate template ignored: "
3084 "couldn't infer template argument %0">;
3085 def note_ovl_candidate_inconsistent_deduction : Note<
3086 "candidate template ignored: deduced conflicting %select{types|values|"
3087 "templates}0 for parameter %1%diff{ ($ vs. $)|}2,3">;
3088 def note_ovl_candidate_explicit_arg_mismatch_named : Note<
3089 "candidate template ignored: invalid explicitly-specified argument "
3090 "for template parameter %0">;
3091 def note_ovl_candidate_explicit_arg_mismatch_unnamed : Note<
3092 "candidate template ignored: invalid explicitly-specified argument "
3093 "for %ordinal0 template parameter">;
3094 def note_ovl_candidate_instantiation_depth : Note<
3095 "candidate template ignored: substitution exceeded maximum template "
3096 "instantiation depth">;
3097 def note_ovl_candidate_underqualified : Note<
3098 "candidate template ignored: cannot deduce a type for %0 that would "
3099 "make %2 equal %1">;
3100 def note_ovl_candidate_substitution_failure : Note<
3101 "candidate template ignored: substitution failure%0%1">;
3102 def note_ovl_candidate_disabled_by_enable_if : Note<
3103 "candidate template ignored: disabled by %0%1">;
3104 def note_ovl_candidate_has_pass_object_size_params: Note<
3105 "candidate address cannot be taken because parameter %0 has "
3106 "pass_object_size attribute">;
3107 def note_ovl_candidate_disabled_by_enable_if_attr : Note<
3108 "candidate disabled: %0">;
3109 def err_addrof_function_disabled_by_enable_if_attr : Error<
3110 "cannot take address of function %0 becuase it has one or more "
3111 "non-tautological enable_if conditions">;
3112 def note_addrof_ovl_candidate_disabled_by_enable_if_attr : Note<
3113 "candidate function made ineligible by enable_if">;
3114 def note_ovl_candidate_failed_overload_resolution : Note<
3115 "candidate template ignored: couldn't resolve reference to overloaded "
3117 def note_ovl_candidate_deduced_mismatch : Note<
3118 "candidate template ignored: deduced type "
3119 "%diff{$ of %ordinal0 parameter does not match adjusted type $ of argument"
3120 "|of %ordinal0 parameter does not match adjusted type of argument}1,2%3">;
3121 def note_ovl_candidate_non_deduced_mismatch : Note<
3122 "candidate template ignored: could not match %diff{$ against $|types}0,1">;
3123 // This note is needed because the above note would sometimes print two
3124 // different types with the same name. Remove this note when the above note
3125 // can handle that case properly.
3126 def note_ovl_candidate_non_deduced_mismatch_qualified : Note<
3127 "candidate template ignored: could not match %q0 against %q1">;
3129 // Note that we don't treat templates differently for this diagnostic.
3130 def note_ovl_candidate_arity : Note<"candidate "
3131 "%select{function|function|constructor|function|function|constructor|"
3132 "constructor (the implicit default constructor)|"
3133 "constructor (the implicit copy constructor)|"
3134 "constructor (the implicit move constructor)|"
3135 "function (the implicit copy assignment operator)|"
3136 "function (the implicit move assignment operator)|"
3137 "constructor (inherited)}0 %select{|template }1"
3138 "not viable: requires%select{ at least| at most|}2 %3 argument%s3, but %4 "
3139 "%plural{1:was|:were}4 provided">;
3141 def note_ovl_candidate_arity_one : Note<"candidate "
3142 "%select{function|function|constructor|function|function|constructor|"
3143 "constructor (the implicit default constructor)|"
3144 "constructor (the implicit copy constructor)|"
3145 "constructor (the implicit move constructor)|"
3146 "function (the implicit copy assignment operator)|"
3147 "function (the implicit move assignment operator)|"
3148 "constructor (inherited)}0 %select{|template }1not viable: "
3149 "%select{requires at least|allows at most single|requires single}2 "
3150 "argument %3, but %plural{0:no|:%4}4 arguments were provided">;
3152 def note_ovl_candidate_deleted : Note<
3153 "candidate %select{function|function|constructor|"
3154 "function |function |constructor |"
3155 "constructor (the implicit default constructor)|"
3156 "constructor (the implicit copy constructor)|"
3157 "constructor (the implicit move constructor)|"
3158 "function (the implicit copy assignment operator)|"
3159 "function (the implicit move assignment operator)|"
3160 "constructor (inherited)}0%1 has been "
3161 "%select{explicitly made unavailable|explicitly deleted|"
3162 "implicitly deleted}2">;
3164 // Giving the index of the bad argument really clutters this message, and
3165 // it's relatively unimportant because 1) it's generally obvious which
3166 // argument(s) are of the given object type and 2) the fix is usually
3167 // to complete the type, which doesn't involve changes to the call line
3168 // anyway. If people complain, we can change it.
3169 def note_ovl_candidate_bad_conv_incomplete : Note<"candidate "
3170 "%select{function|function|constructor|"
3171 "function |function |constructor |"
3172 "constructor (the implicit default constructor)|"
3173 "constructor (the implicit copy constructor)|"
3174 "constructor (the implicit move constructor)|"
3175 "function (the implicit copy assignment operator)|"
3176 "function (the implicit move assignment operator)|"
3177 "constructor (inherited)}0%1 "
3178 "not viable: cannot convert argument of incomplete type "
3179 "%diff{$ to $|to parameter type}2,3">;
3180 def note_ovl_candidate_bad_list_argument : Note<"candidate "
3181 "%select{function|function|constructor|"
3182 "function |function |constructor |"
3183 "constructor (the implicit default constructor)|"
3184 "constructor (the implicit copy constructor)|"
3185 "constructor (the implicit move constructor)|"
3186 "function (the implicit copy assignment operator)|"
3187 "function (the implicit move assignment operator)|"
3188 "constructor (inherited)}0%1 "
3189 "not viable: cannot convert initializer list argument to %3">;
3190 def note_ovl_candidate_bad_overload : Note<"candidate "
3191 "%select{function|function|constructor|"
3192 "function |function |constructor |"
3193 "constructor (the implicit default constructor)|"
3194 "constructor (the implicit copy constructor)|"
3195 "constructor (the implicit move constructor)|"
3196 "function (the implicit copy assignment operator)|"
3197 "function (the implicit move assignment operator)|"
3198 "constructor (inherited)}0%1"
3199 " not viable: no overload of %3 matching %2 for %ordinal4 argument">;
3200 def note_ovl_candidate_bad_conv : Note<"candidate "
3201 "%select{function|function|constructor|"
3202 "function |function |constructor |"
3203 "constructor (the implicit default constructor)|"
3204 "constructor (the implicit copy constructor)|"
3205 "constructor (the implicit move constructor)|"
3206 "function (the implicit copy assignment operator)|"
3207 "function (the implicit move assignment operator)|"
3208 "constructor (inherited)}0%1"
3209 " not viable: no known conversion "
3210 "%diff{from $ to $|from argument type to parameter type}2,3 for "
3211 "%select{%ordinal5 argument|object argument}4"
3212 "%select{|; dereference the argument with *|"
3213 "; take the address of the argument with &|"
3216 def note_ovl_candidate_bad_arc_conv : Note<"candidate "
3217 "%select{function|function|constructor|"
3218 "function |function |constructor |"
3219 "constructor (the implicit default constructor)|"
3220 "constructor (the implicit copy constructor)|"
3221 "constructor (the implicit move constructor)|"
3222 "function (the implicit copy assignment operator)|"
3223 "function (the implicit move assignment operator)|"
3224 "constructor (inherited)}0%1"
3225 " not viable: cannot implicitly convert argument "
3226 "%diff{of type $ to $|type to parameter type}2,3 for "
3227 "%select{%ordinal5 argument|object argument}4 under ARC">;
3228 def note_ovl_candidate_bad_lvalue : Note<"candidate "
3229 "%select{function|function|constructor|"
3230 "function |function |constructor |"
3231 "constructor (the implicit default constructor)|"
3232 "constructor (the implicit copy constructor)|"
3233 "constructor (the implicit move constructor)|"
3234 "function (the implicit copy assignment operator)|"
3235 "function (the implicit move assignment operator)|"
3236 "constructor (inherited)}0%1"
3237 " not viable: expects an l-value for "
3238 "%select{%ordinal3 argument|object argument}2">;
3239 def note_ovl_candidate_bad_addrspace : Note<"candidate "
3240 "%select{function|function|constructor|"
3241 "function |function |constructor |"
3242 "constructor (the implicit default constructor)|"
3243 "constructor (the implicit copy constructor)|"
3244 "constructor (the implicit move constructor)|"
3245 "function (the implicit copy assignment operator)|"
3246 "function (the implicit move assignment operator)|"
3247 "constructor (inherited)}0%1 not viable: "
3248 "%select{%ordinal6|'this'}5 argument (%2) is in "
3249 "address space %3, but parameter must be in address space %4">;
3250 def note_ovl_candidate_bad_gc : Note<"candidate "
3251 "%select{function|function|constructor|"
3252 "function |function |constructor |"
3253 "constructor (the implicit default constructor)|"
3254 "constructor (the implicit copy constructor)|"
3255 "constructor (the implicit move constructor)|"
3256 "function (the implicit copy assignment operator)|"
3257 "function (the implicit move assignment operator)|"
3258 "constructor (inherited)}0%1 not viable: "
3259 "%select{%ordinal6|'this'}5 argument (%2) has %select{no|__weak|__strong}3 "
3260 "ownership, but parameter has %select{no|__weak|__strong}4 ownership">;
3261 def note_ovl_candidate_bad_ownership : Note<"candidate "
3262 "%select{function|function|constructor|"
3263 "function |function |constructor |"
3264 "constructor (the implicit default constructor)|"
3265 "constructor (the implicit copy constructor)|"
3266 "constructor (the implicit move constructor)|"
3267 "function (the implicit copy assignment operator)|"
3268 "function (the implicit move assignment operator)|"
3269 "constructor (inherited)}0%1 not viable: "
3270 "%select{%ordinal6|'this'}5 argument (%2) has "
3271 "%select{no|__unsafe_unretained|__strong|__weak|__autoreleasing}3 ownership,"
3272 " but parameter has %select{no|__unsafe_unretained|__strong|__weak|"
3273 "__autoreleasing}4 ownership">;
3274 def note_ovl_candidate_bad_cvr_this : Note<"candidate "
3275 "%select{|function|||function|||||"
3276 "function (the implicit copy assignment operator)|"
3277 "function (the implicit move assignment operator)|}0 not viable: "
3278 "'this' argument has type %2, but method is not marked "
3279 "%select{const|restrict|const or restrict|volatile|const or volatile|"
3280 "volatile or restrict|const, volatile, or restrict}3">;
3281 def note_ovl_candidate_bad_cvr : Note<"candidate "
3282 "%select{function|function|constructor|"
3283 "function |function |constructor |"
3284 "constructor (the implicit default constructor)|"
3285 "constructor (the implicit copy constructor)|"
3286 "constructor (the implicit move constructor)|"
3287 "function (the implicit copy assignment operator)|"
3288 "function (the implicit move assignment operator)|"
3289 "constructor (inherited)}0%1 not viable: "
3290 "%ordinal4 argument (%2) would lose "
3291 "%select{const|restrict|const and restrict|volatile|const and volatile|"
3292 "volatile and restrict|const, volatile, and restrict}3 qualifier"
3293 "%select{||s||s|s|s}3">;
3294 def note_ovl_candidate_bad_base_to_derived_conv : Note<"candidate "
3295 "%select{function|function|constructor|"
3296 "function |function |constructor |"
3297 "constructor (the implicit default constructor)|"
3298 "constructor (the implicit copy constructor)|"
3299 "constructor (the implicit move constructor)|"
3300 "function (the implicit copy assignment operator)|"
3301 "function (the implicit move assignment operator)|"
3302 "constructor (inherited)}0%1"
3303 " not viable: cannot %select{convert from|convert from|bind}2 "
3304 "%select{base class pointer|superclass|base class object of type}2 %3 to "
3305 "%select{derived class pointer|subclass|derived class reference}2 %4 for "
3306 "%ordinal5 argument">;
3307 def note_ovl_candidate_bad_target : Note<
3308 "candidate %select{function|function|constructor|"
3309 "function |function |constructor |"
3310 "constructor (the implicit default constructor)|"
3311 "constructor (the implicit copy constructor)|"
3312 "constructor (the implicit move constructor)|"
3313 "function (the implicit copy assignment operator)|"
3314 "function (the implicit move assignment operator)|"
3315 "constructor (inherited)}0 not viable: call to "
3316 "%select{__device__|__global__|__host__|__host__ __device__|invalid}1 function from"
3317 " %select{__device__|__global__|__host__|__host__ __device__|invalid}2 function">;
3318 def note_implicit_member_target_infer_collision : Note<
3320 "default constructor|"
3323 "copy assignment operator|"
3324 "move assignment operator|"
3325 "destructor}0 inferred target collision: call to both "
3326 "%select{__device__|__global__|__host__|__host__ __device__}1 and "
3327 "%select{__device__|__global__|__host__|__host__ __device__}2 members">;
3329 def note_ambiguous_type_conversion: Note<
3330 "because of ambiguity in conversion %diff{of $ to $|between types}0,1">;
3331 def note_ovl_builtin_binary_candidate : Note<
3332 "built-in candidate %0">;
3333 def note_ovl_builtin_unary_candidate : Note<
3334 "built-in candidate %0">;
3335 def err_ovl_no_viable_function_in_init : Error<
3336 "no matching constructor for initialization of %0">;
3337 def err_ovl_no_conversion_in_cast : Error<
3338 "cannot convert %1 to %2 without a conversion operator">;
3339 def err_ovl_no_viable_conversion_in_cast : Error<
3340 "no matching conversion for %select{|static_cast|reinterpret_cast|"
3341 "dynamic_cast|C-style cast|functional-style cast}0 from %1 to %2">;
3342 def err_ovl_ambiguous_conversion_in_cast : Error<
3343 "ambiguous conversion for %select{|static_cast|reinterpret_cast|"
3344 "dynamic_cast|C-style cast|functional-style cast}0 from %1 to %2">;
3345 def err_ovl_deleted_conversion_in_cast : Error<
3346 "%select{|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
3347 "functional-style cast}0 from %1 to %2 uses deleted function">;
3348 def err_ovl_ambiguous_init : Error<"call to constructor of %0 is ambiguous">;
3349 def err_ref_init_ambiguous : Error<
3350 "reference initialization of type %0 with initializer of type %1 is ambiguous">;
3351 def err_ovl_deleted_init : Error<
3352 "call to %select{unavailable|deleted}0 constructor of %1">;
3353 def err_ovl_deleted_special_init : Error<
3354 "call to implicitly-deleted %select{default constructor|copy constructor|"
3355 "move constructor|copy assignment operator|move assignment operator|"
3356 "destructor|function}0 of %1">;
3357 def err_ovl_ambiguous_oper_unary : Error<
3358 "use of overloaded operator '%0' is ambiguous (operand type %1)">;
3359 def err_ovl_ambiguous_oper_binary : Error<
3360 "use of overloaded operator '%0' is ambiguous (with operand types %1 and %2)">;
3361 def err_ovl_no_viable_oper : Error<"no viable overloaded '%0'">;
3362 def note_assign_lhs_incomplete : Note<"type %0 is incomplete">;
3363 def err_ovl_deleted_oper : Error<
3364 "overload resolution selected %select{unavailable|deleted}0 operator '%1'%2">;
3365 def err_ovl_deleted_special_oper : Error<
3366 "object of type %0 cannot be %select{constructed|copied|moved|assigned|"
3367 "assigned|destroyed}1 because its %select{default constructor|"
3368 "copy constructor|move constructor|copy assignment operator|"
3369 "move assignment operator|destructor}1 is implicitly deleted">;
3370 def err_ovl_no_viable_subscript :
3371 Error<"no viable overloaded operator[] for type %0">;
3372 def err_ovl_no_oper :
3373 Error<"type %0 does not provide a %select{subscript|call}1 operator">;
3374 def err_ovl_unresolvable : Error<
3375 "reference to overloaded function could not be resolved; "
3376 "did you mean to call it%select{| with no arguments}0?">;
3377 def err_bound_member_function : Error<
3378 "reference to non-static member function must be called"
3379 "%select{|; did you mean to call it with no arguments?}0">;
3380 def note_possible_target_of_call : Note<"possible target for call">;
3382 def err_ovl_no_viable_object_call : Error<
3383 "no matching function for call to object of type %0">;
3384 def err_ovl_ambiguous_object_call : Error<
3385 "call to object of type %0 is ambiguous">;
3386 def err_ovl_deleted_object_call : Error<
3387 "call to %select{unavailable|deleted}0 function call operator in type %1%2">;
3388 def note_ovl_surrogate_cand : Note<"conversion candidate of type %0">;
3389 def err_member_call_without_object : Error<
3390 "call to non-static member function without an object argument">;
3392 // C++ Address of Overloaded Function
3393 def err_addr_ovl_no_viable : Error<
3394 "address of overloaded function %0 does not match required type %1">;
3395 def err_addr_ovl_ambiguous : Error<
3396 "address of overloaded function %0 is ambiguous">;
3397 def err_addr_ovl_not_func_ptrref : Error<
3398 "address of overloaded function %0 cannot be converted to type %1">;
3399 def err_addr_ovl_no_qualifier : Error<
3400 "cannot form member pointer of type %0 without '&' and class name">;
3402 // C++11 Literal Operators
3403 def err_ovl_no_viable_literal_operator : Error<
3404 "no matching literal operator for call to %0"
3405 "%select{| with argument of type %2| with arguments of types %2 and %3}1"
3406 "%select{| or 'const char *'}4"
3407 "%select{|, and no matching literal operator template}5">;
3409 // C++ Template Declarations
3410 def err_template_param_shadow : Error<
3411 "declaration of %0 shadows template parameter">;
3412 def note_template_param_here : Note<"template parameter is declared here">;
3413 def warn_template_export_unsupported : Warning<
3414 "exported templates are unsupported">;
3415 def err_template_outside_namespace_or_class_scope : Error<
3416 "templates can only be declared in namespace or class scope">;
3417 def err_template_inside_local_class : Error<
3418 "templates cannot be declared inside of a local class">;
3419 def err_template_linkage : Error<"templates must have C++ linkage">;
3420 def err_template_typedef : Error<"a typedef cannot be a template">;
3421 def err_template_unnamed_class : Error<
3422 "cannot declare a class template with no name">;
3423 def err_template_param_list_different_arity : Error<
3424 "%select{too few|too many}0 template parameters in template "
3425 "%select{|template parameter }1redeclaration">;
3426 def note_template_param_list_different_arity : Note<
3427 "%select{too few|too many}0 template parameters in template template "
3429 def note_template_prev_declaration : Note<
3430 "previous template %select{declaration|template parameter}0 is here">;
3431 def err_template_param_different_kind : Error<
3432 "template parameter has a different kind in template "
3433 "%select{|template parameter }0redeclaration">;
3434 def note_template_param_different_kind : Note<
3435 "template parameter has a different kind in template argument">;
3437 def err_template_nontype_parm_different_type : Error<
3438 "template non-type parameter has a different type %0 in template "
3439 "%select{|template parameter }1redeclaration">;
3441 def note_template_nontype_parm_different_type : Note<
3442 "template non-type parameter has a different type %0 in template argument">;
3443 def note_template_nontype_parm_prev_declaration : Note<
3444 "previous non-type template parameter with type %0 is here">;
3445 def err_template_nontype_parm_bad_type : Error<
3446 "a non-type template parameter cannot have type %0">;
3447 def err_template_param_default_arg_redefinition : Error<
3448 "template parameter redefines default argument">;
3449 def note_template_param_prev_default_arg : Note<
3450 "previous default template argument defined here">;
3451 def err_template_param_default_arg_missing : Error<
3452 "template parameter missing a default argument">;
3453 def ext_template_parameter_default_in_function_template : ExtWarn<
3454 "default template arguments for a function template are a C++11 extension">,
3456 def warn_cxx98_compat_template_parameter_default_in_function_template : Warning<
3457 "default template arguments for a function template are incompatible with C++98">,
3458 InGroup<CXX98Compat>, DefaultIgnore;
3459 def err_template_parameter_default_template_member : Error<
3460 "cannot add a default template argument to the definition of a member of a "
3462 def err_template_parameter_default_friend_template : Error<
3463 "default template argument not permitted on a friend template">;
3464 def err_template_template_parm_no_parms : Error<
3465 "template template parameter must have its own template parameters">;
3467 def ext_variable_template : ExtWarn<"variable templates are a C++14 extension">,
3469 def warn_cxx11_compat_variable_template : Warning<
3470 "variable templates are incompatible with C++ standards before C++14">,
3471 InGroup<CXXPre14Compat>, DefaultIgnore;
3472 def err_template_variable_noparams : Error<
3473 "extraneous 'template<>' in declaration of variable %0">;
3474 def err_template_member : Error<"member %0 declared as a template">;
3475 def err_template_member_noparams : Error<
3476 "extraneous 'template<>' in declaration of member %0">;
3477 def err_template_tag_noparams : Error<
3478 "extraneous 'template<>' in declaration of %0 %1">;
3479 def err_template_decl_ref : Error<
3480 "cannot refer to %select{class|variable}0 template %1 without a template argument list">;
3482 // C++ Template Argument Lists
3483 def err_template_missing_args : Error<
3484 "use of class template %0 requires template arguments">;
3485 def err_template_arg_list_different_arity : Error<
3486 "%select{too few|too many}0 template arguments for "
3487 "%select{class template|function template|template template parameter"
3489 def note_template_decl_here : Note<"template is declared here">;
3490 def err_template_arg_must_be_type : Error<
3491 "template argument for template type parameter must be a type">;
3492 def err_template_arg_must_be_type_suggest : Error<
3493 "template argument for template type parameter must be a type; "
3494 "did you forget 'typename'?">;
3495 def ext_ms_template_type_arg_missing_typename : ExtWarn<
3496 "template argument for template type parameter must be a type; "
3497 "omitted 'typename' is a Microsoft extension">,
3498 InGroup<MicrosoftTemplate>;
3499 def err_template_arg_must_be_expr : Error<
3500 "template argument for non-type template parameter must be an expression">;
3501 def err_template_arg_nontype_ambig : Error<
3502 "template argument for non-type template parameter is treated as function type %0">;
3503 def err_template_arg_must_be_template : Error<
3504 "template argument for template template parameter must be a class template%select{| or type alias template}0">;
3505 def ext_template_arg_local_type : ExtWarn<
3506 "template argument uses local type %0">, InGroup<LocalTypeTemplateArgs>;
3507 def ext_template_arg_unnamed_type : ExtWarn<
3508 "template argument uses unnamed type">, InGroup<UnnamedTypeTemplateArgs>;
3509 def warn_cxx98_compat_template_arg_local_type : Warning<
3510 "local type %0 as template argument is incompatible with C++98">,
3511 InGroup<CXX98CompatLocalTypeTemplateArgs>, DefaultIgnore;
3512 def warn_cxx98_compat_template_arg_unnamed_type : Warning<
3513 "unnamed type as template argument is incompatible with C++98">,
3514 InGroup<CXX98CompatUnnamedTypeTemplateArgs>, DefaultIgnore;
3515 def note_template_unnamed_type_here : Note<
3516 "unnamed type used in template argument was declared here">;
3517 def err_template_arg_overload_type : Error<
3518 "template argument is the type of an unresolved overloaded function">;
3519 def err_template_arg_not_class_template : Error<
3520 "template argument does not refer to a class template or template "
3521 "template parameter">;
3522 def note_template_arg_refers_here_func : Note<
3523 "template argument refers to function template %0, here">;
3524 def err_template_arg_template_params_mismatch : Error<
3525 "template template argument has different template parameters than its "
3526 "corresponding template template parameter">;
3527 def err_template_arg_not_integral_or_enumeral : Error<
3528 "non-type template argument of type %0 must have an integral or enumeration"
3530 def err_template_arg_not_ice : Error<
3531 "non-type template argument of type %0 is not an integral constant "
3533 def err_template_arg_not_address_constant : Error<
3534 "non-type template argument of type %0 is not a constant expression">;
3535 def warn_cxx98_compat_template_arg_null : Warning<
3536 "use of null pointer as non-type template argument is incompatible with "
3537 "C++98">, InGroup<CXX98Compat>, DefaultIgnore;
3538 def err_template_arg_untyped_null_constant : Error<
3539 "null non-type template argument must be cast to template parameter type %0">;
3540 def err_template_arg_wrongtype_null_constant : Error<
3541 "null non-type template argument of type %0 does not match template parameter "
3543 def err_deduced_non_type_template_arg_type_mismatch : Error<
3544 "deduced non-type template argument does not have the same type as the "
3545 "its corresponding template parameter%diff{ ($ vs $)|}0,1">;
3546 def err_non_type_template_arg_subobject : Error<
3547 "non-type template argument refers to subobject '%0'">;
3548 def err_non_type_template_arg_addr_label_diff : Error<
3549 "template argument / label address difference / what did you expect?">;
3550 def err_template_arg_not_convertible : Error<
3551 "non-type template argument of type %0 cannot be converted to a value "
3553 def warn_template_arg_negative : Warning<
3554 "non-type template argument with value '%0' converted to '%1' for unsigned "
3555 "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
3556 def warn_template_arg_too_large : Warning<
3557 "non-type template argument value '%0' truncated to '%1' for "
3558 "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
3559 def err_template_arg_no_ref_bind : Error<
3560 "non-type template parameter of reference type "
3561 "%diff{$ cannot bind to template argument of type $"
3562 "|cannot bind to template of incompatible argument type}0,1">;
3563 def err_template_arg_ref_bind_ignores_quals : Error<
3564 "reference binding of non-type template parameter "
3565 "%diff{of type $ to template argument of type $|to template argument}0,1 "
3566 "ignores qualifiers">;
3567 def err_template_arg_not_decl_ref : Error<
3568 "non-type template argument does not refer to any declaration">;
3569 def err_template_arg_not_address_of : Error<
3570 "non-type template argument for template parameter of pointer type %0 must "
3571 "have its address taken">;
3572 def err_template_arg_address_of_non_pointer : Error<
3573 "address taken in non-type template argument for template parameter of "
3574 "reference type %0">;
3575 def err_template_arg_reference_var : Error<
3576 "non-type template argument of reference type %0 is not an object">;
3577 def err_template_arg_field : Error<
3578 "non-type template argument refers to non-static data member %0">;
3579 def err_template_arg_method : Error<
3580 "non-type template argument refers to non-static member function %0">;
3581 def err_template_arg_object_no_linkage : Error<
3582 "non-type template argument refers to %select{function|object}0 %1 that "
3583 "does not have linkage">;
3584 def warn_cxx98_compat_template_arg_object_internal : Warning<
3585 "non-type template argument referring to %select{function|object}0 %1 with "
3586 "internal linkage is incompatible with C++98">,
3587 InGroup<CXX98Compat>, DefaultIgnore;
3588 def ext_template_arg_object_internal : ExtWarn<
3589 "non-type template argument referring to %select{function|object}0 %1 with "
3590 "internal linkage is a C++11 extension">, InGroup<CXX11>;
3591 def err_template_arg_thread_local : Error<
3592 "non-type template argument refers to thread-local object">;
3593 def note_template_arg_internal_object : Note<
3594 "non-type template argument refers to %select{function|object}0 here">;
3595 def note_template_arg_refers_here : Note<
3596 "non-type template argument refers here">;
3597 def err_template_arg_not_object_or_func : Error<
3598 "non-type template argument does not refer to an object or function">;
3599 def err_template_arg_not_pointer_to_member_form : Error<
3600 "non-type template argument is not a pointer to member constant">;
3601 def err_template_arg_member_ptr_base_derived_not_supported : Error<
3602 "sorry, non-type template argument of pointer-to-member type %1 that refers "
3603 "to member %q0 of a different class is not supported yet">;
3604 def ext_template_arg_extra_parens : ExtWarn<
3605 "address non-type template argument cannot be surrounded by parentheses">;
3606 def warn_cxx98_compat_template_arg_extra_parens : Warning<
3607 "redundant parentheses surrounding address non-type template argument are "
3608 "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
3609 def err_pointer_to_member_type : Error<
3610 "invalid use of pointer to member type after %select{.*|->*}0">;
3611 def err_pointer_to_member_call_drops_quals : Error<
3612 "call to pointer to member function of type %0 drops '%1' qualifier%s2">;
3613 def err_pointer_to_member_oper_value_classify: Error<
3614 "pointer-to-member function type %0 can only be called on an "
3615 "%select{rvalue|lvalue}1">;
3616 def ext_ms_deref_template_argument: ExtWarn<
3617 "non-type template argument containing a dereference operation is a "
3618 "Microsoft extension">, InGroup<MicrosoftTemplate>;
3619 def ext_ms_delayed_template_argument: ExtWarn<
3620 "using the undeclared type %0 as a default template argument is a "
3621 "Microsoft extension">, InGroup<MicrosoftTemplate>;
3623 // C++ template specialization
3624 def err_template_spec_unknown_kind : Error<
3625 "can only provide an explicit specialization for a class template, function "
3626 "template, variable template, or a member function, static data member, "
3627 "%select{or member class|member class, or member enumeration}0 of a "
3629 def note_specialized_entity : Note<
3630 "explicitly specialized declaration is here">;
3631 def err_template_spec_decl_function_scope : Error<
3632 "explicit specialization of %0 in function scope">;
3633 def err_template_spec_decl_class_scope : Error<
3634 "explicit specialization of %0 in class scope">;
3635 def err_template_spec_decl_friend : Error<
3636 "cannot declare an explicit specialization in a friend">;
3637 def err_template_spec_decl_out_of_scope_global : Error<
3638 "%select{class template|class template partial|variable template|"
3639 "variable template partial|function template|member function|"
3640 "static data member|member class|member enumeration}0 "
3641 "specialization of %1 must originally be declared in the global scope">;
3642 def err_template_spec_decl_out_of_scope : Error<
3643 "%select{class template|class template partial|variable template|"
3644 "variable template partial|function template|member "
3645 "function|static data member|member class|member enumeration}0 "
3646 "specialization of %1 must originally be declared in namespace %2">;
3647 def ext_template_spec_decl_out_of_scope : ExtWarn<
3648 "first declaration of %select{class template|class template partial|"
3649 "variable template|variable template partial|"
3650 "function template|member function|static data member|member class|"
3651 "member enumeration}0 specialization of %1 outside namespace %2 is a "
3652 "C++11 extension">, InGroup<CXX11>;
3653 def warn_cxx98_compat_template_spec_decl_out_of_scope : Warning<
3654 "%select{class template|class template partial|variable template|"
3655 "variable template partial|function template|member "
3656 "function|static data member|member class|member enumeration}0 "
3657 "specialization of %1 outside namespace %2 is incompatible with C++98">,
3658 InGroup<CXX98Compat>, DefaultIgnore;
3659 def err_template_spec_redecl_out_of_scope : Error<
3660 "%select{class template|class template partial|variable template|"
3661 "variable template partial|function template|member "
3662 "function|static data member|member class|member enumeration}0 "
3663 "specialization of %1 not in a namespace enclosing %2">;
3664 def ext_ms_template_spec_redecl_out_of_scope: ExtWarn<
3665 "%select{class template|class template partial|variable template|"
3666 "variable template partial|function template|member "
3667 "function|static data member|member class|member enumeration}0 "
3668 "specialization of %1 outside namespace enclosing %2 "
3669 "is a Microsoft extension">, InGroup<MicrosoftTemplate>;
3670 def err_template_spec_redecl_global_scope : Error<
3671 "%select{class template|class template partial|variable template|"
3672 "variable template partial|function template|member "
3673 "function|static data member|member class|member enumeration}0 "
3674 "specialization of %1 must occur at global scope">;
3675 def err_spec_member_not_instantiated : Error<
3676 "specialization of member %q0 does not specialize an instantiated member">;
3677 def note_specialized_decl : Note<"attempt to specialize declaration here">;
3678 def err_specialization_after_instantiation : Error<
3679 "explicit specialization of %0 after instantiation">;
3680 def note_instantiation_required_here : Note<
3681 "%select{implicit|explicit}0 instantiation first required here">;
3682 def err_template_spec_friend : Error<
3683 "template specialization declaration cannot be a friend">;
3684 def err_template_spec_default_arg : Error<
3685 "default argument not permitted on an explicit "
3686 "%select{instantiation|specialization}0 of function %1">;
3687 def err_not_class_template_specialization : Error<
3688 "cannot specialize a %select{dependent template|template template "
3690 def err_function_specialization_in_class : Error<
3691 "cannot specialize a function %0 within class scope">;
3692 def ext_function_specialization_in_class : ExtWarn<
3693 "explicit specialization of %0 within class scope is a Microsoft extension">,
3694 InGroup<MicrosoftTemplate>;
3695 def ext_explicit_specialization_storage_class : ExtWarn<
3696 "explicit specialization cannot have a storage class">;
3697 def err_explicit_specialization_inconsistent_storage_class : Error<
3698 "explicit specialization has extraneous, inconsistent storage class "
3699 "'%select{none|extern|static|__private_extern__|auto|register}0'">;
3701 // C++ class template specializations and out-of-line definitions
3702 def err_template_spec_needs_header : Error<
3703 "template specialization requires 'template<>'">;
3704 def err_template_spec_needs_template_parameters : Error<
3705 "template specialization or definition requires a template parameter list "
3706 "corresponding to the nested type %0">;
3707 def err_template_param_list_matches_nontemplate : Error<
3708 "template parameter list matching the non-templated nested type %0 should "
3709 "be empty ('template<>')">;
3710 def err_alias_template_extra_headers : Error<
3711 "extraneous template parameter list in alias template declaration">;
3712 def err_template_spec_extra_headers : Error<
3713 "extraneous template parameter list in template specialization or "
3714 "out-of-line template definition">;
3715 def warn_template_spec_extra_headers : Warning<
3716 "extraneous template parameter list in template specialization">;
3717 def note_explicit_template_spec_does_not_need_header : Note<
3718 "'template<>' header not required for explicitly-specialized class %0 "
3720 def err_template_qualified_declarator_no_match : Error<
3721 "nested name specifier '%0' for declaration does not refer into a class, "
3722 "class template or class template partial specialization">;
3723 def err_specialize_member_of_template : Error<
3724 "cannot specialize %select{|(with 'template<>') }0a member of an "
3725 "unspecialized template">;
3727 // C++ Class Template Partial Specialization
3728 def err_default_arg_in_partial_spec : Error<
3729 "default template argument in a class template partial specialization">;
3730 def err_dependent_non_type_arg_in_partial_spec : Error<
3731 "non-type template argument depends on a template parameter of the "
3732 "partial specialization">;
3733 def note_dependent_non_type_default_arg_in_partial_spec : Note<
3734 "template parameter is used in default argument declared here">;
3735 def err_dependent_typed_non_type_arg_in_partial_spec : Error<
3736 "non-type template argument specializes a template parameter with "
3737 "dependent type %0">;
3738 def err_partial_spec_args_match_primary_template : Error<
3739 "%select{class|variable}0 template partial specialization does not "
3740 "specialize any template argument; to %select{declare|define}1 the "
3741 "primary template, remove the template argument list">;
3742 def warn_partial_specs_not_deducible : Warning<
3743 "%select{class|variable}0 template partial specialization contains "
3744 "%select{a template parameter|template parameters}1 that cannot be "
3745 "deduced; this partial specialization will never be used">;
3746 def note_partial_spec_unused_parameter : Note<
3747 "non-deducible template parameter %0">;
3748 def err_partial_spec_ordering_ambiguous : Error<
3749 "ambiguous partial specializations of %0">;
3750 def note_partial_spec_match : Note<"partial specialization matches %0">;
3751 def err_partial_spec_redeclared : Error<
3752 "class template partial specialization %0 cannot be redeclared">;
3753 def note_prev_partial_spec_here : Note<
3754 "previous declaration of class template partial specialization %0 is here">;
3755 def err_partial_spec_fully_specialized : Error<
3756 "partial specialization of %0 does not use any of its template parameters">;
3758 // C++ Variable Template Partial Specialization
3759 def err_var_partial_spec_redeclared : Error<
3760 "variable template partial specialization %0 cannot be redefined">;
3761 def note_var_prev_partial_spec_here : Note<
3762 "previous declaration of variable template partial specialization is here">;
3763 def err_var_spec_no_template : Error<
3764 "no variable template matches%select{| partial}0 specialization">;
3765 def err_var_spec_no_template_but_method : Error<
3766 "no variable template matches specialization; "
3767 "did you mean to use %0 as function template instead?">;
3769 // C++ Function template specializations
3770 def err_function_template_spec_no_match : Error<
3771 "no function template matches function template specialization %0">;
3772 def err_function_template_spec_ambiguous : Error<
3773 "function template specialization %0 ambiguously refers to more than one "
3774 "function template; explicitly specify%select{| additional}1 template "
3775 "arguments to identify a particular function template">;
3776 def note_function_template_spec_matched : Note<
3777 "function template matches specialization %0">;
3778 def err_function_template_partial_spec : Error<
3779 "function template partial specialization is not allowed">;
3781 // C++ Template Instantiation
3782 def err_template_recursion_depth_exceeded : Error<
3783 "recursive template instantiation exceeded maximum depth of %0">,
3784 DefaultFatal, NoSFINAE;
3785 def note_template_recursion_depth : Note<
3786 "use -ftemplate-depth=N to increase recursive template instantiation depth">;
3788 def err_template_instantiate_within_definition : Error<
3789 "%select{implicit|explicit}0 instantiation of template %1 within its"
3791 def err_template_instantiate_undefined : Error<
3792 "%select{implicit|explicit}0 instantiation of undefined template %1">;
3793 def err_implicit_instantiate_member_undefined : Error<
3794 "implicit instantiation of undefined member %0">;
3795 def note_template_class_instantiation_was_here : Note<
3796 "class template %0 was instantiated here">;
3797 def note_template_class_explicit_specialization_was_here : Note<
3798 "class template %0 was explicitly specialized here">;
3799 def note_template_class_instantiation_here : Note<
3800 "in instantiation of template class %0 requested here">;
3801 def note_template_member_class_here : Note<
3802 "in instantiation of member class %0 requested here">;
3803 def note_template_member_function_here : Note<
3804 "in instantiation of member function %q0 requested here">;
3805 def note_function_template_spec_here : Note<
3806 "in instantiation of function template specialization %q0 requested here">;
3807 def note_template_static_data_member_def_here : Note<
3808 "in instantiation of static data member %q0 requested here">;
3809 def note_template_variable_def_here : Note<
3810 "in instantiation of variable template specialization %q0 requested here">;
3811 def note_template_enum_def_here : Note<
3812 "in instantiation of enumeration %q0 requested here">;
3813 def note_template_nsdmi_here : Note<
3814 "in instantiation of default member initializer %q0 requested here">;
3815 def note_template_type_alias_instantiation_here : Note<
3816 "in instantiation of template type alias %0 requested here">;
3817 def note_template_exception_spec_instantiation_here : Note<
3818 "in instantiation of exception specification for %0 requested here">;
3820 def note_default_arg_instantiation_here : Note<
3821 "in instantiation of default argument for '%0' required here">;
3822 def note_default_function_arg_instantiation_here : Note<
3823 "in instantiation of default function argument expression "
3824 "for '%0' required here">;
3825 def note_explicit_template_arg_substitution_here : Note<
3826 "while substituting explicitly-specified template arguments into function "
3828 def note_function_template_deduction_instantiation_here : Note<
3829 "while substituting deduced template arguments into function template %0 "
3831 def note_partial_spec_deduct_instantiation_here : Note<
3832 "during template argument deduction for class template partial "
3833 "specialization %0 %1">;
3834 def note_prior_template_arg_substitution : Note<
3835 "while substituting prior template arguments into %select{non-type|template}0"
3836 " template parameter%1 %2">;
3837 def note_template_default_arg_checking : Note<
3838 "while checking a default template argument used here">;
3839 def note_instantiation_contexts_suppressed : Note<
3840 "(skipping %0 context%s0 in backtrace; use -ftemplate-backtrace-limit=0 to "
3843 def err_field_instantiates_to_function : Error<
3844 "data member instantiated with function type %0">;
3845 def err_variable_instantiates_to_function : Error<
3846 "%select{variable|static data member}0 instantiated with function type %1">;
3847 def err_nested_name_spec_non_tag : Error<
3848 "type %0 cannot be used prior to '::' because it has no members">;
3850 // C++ Explicit Instantiation
3851 def err_explicit_instantiation_duplicate : Error<
3852 "duplicate explicit instantiation of %0">;
3853 def ext_explicit_instantiation_duplicate : ExtWarn<
3854 "duplicate explicit instantiation of %0 ignored as a Microsoft extension">,
3855 InGroup<MicrosoftTemplate>;
3856 def note_previous_explicit_instantiation : Note<
3857 "previous explicit instantiation is here">;
3858 def ext_explicit_instantiation_after_specialization : Extension<
3859 "explicit instantiation of %0 that occurs after an explicit "
3860 "specialization will be ignored (C++11 extension)">,
3862 def warn_cxx98_compat_explicit_instantiation_after_specialization : Warning<
3863 "explicit instantiation of %0 that occurs after an explicit "
3864 "specialization is incompatible with C++98">,
3865 InGroup<CXX98CompatPedantic>, DefaultIgnore;
3866 def note_previous_template_specialization : Note<
3867 "previous template specialization is here">;
3868 def err_explicit_instantiation_nontemplate_type : Error<
3869 "explicit instantiation of non-templated type %0">;
3870 def note_nontemplate_decl_here : Note<
3871 "non-templated declaration is here">;
3872 def err_explicit_instantiation_in_class : Error<
3873 "explicit instantiation of %0 in class scope">;
3874 def err_explicit_instantiation_out_of_scope : Error<
3875 "explicit instantiation of %0 not in a namespace enclosing %1">;
3876 def err_explicit_instantiation_must_be_global : Error<
3877 "explicit instantiation of %0 must occur at global scope">;
3878 def warn_explicit_instantiation_out_of_scope_0x : Warning<
3879 "explicit instantiation of %0 not in a namespace enclosing %1">,
3880 InGroup<CXX11Compat>, DefaultIgnore;
3881 def warn_explicit_instantiation_must_be_global_0x : Warning<
3882 "explicit instantiation of %0 must occur at global scope">,
3883 InGroup<CXX11Compat>, DefaultIgnore;
3885 def err_explicit_instantiation_requires_name : Error<
3886 "explicit instantiation declaration requires a name">;
3887 def err_explicit_instantiation_of_typedef : Error<
3888 "explicit instantiation of typedef %0">;
3889 def err_explicit_instantiation_storage_class : Error<
3890 "explicit instantiation cannot have a storage class">;
3891 def err_explicit_instantiation_not_known : Error<
3892 "explicit instantiation of %0 does not refer to a function template, "
3893 "variable template, member function, member class, or static data member">;
3894 def note_explicit_instantiation_here : Note<
3895 "explicit instantiation refers here">;
3896 def err_explicit_instantiation_data_member_not_instantiated : Error<
3897 "explicit instantiation refers to static data member %q0 that is not an "
3899 def err_explicit_instantiation_member_function_not_instantiated : Error<
3900 "explicit instantiation refers to member function %q0 that is not an "
3902 def err_explicit_instantiation_ambiguous : Error<
3903 "partial ordering for explicit instantiation of %0 is ambiguous">;
3904 def note_explicit_instantiation_candidate : Note<
3905 "explicit instantiation candidate function template here %0">;
3906 def err_explicit_instantiation_inline : Error<
3907 "explicit instantiation cannot be 'inline'">;
3908 def warn_explicit_instantiation_inline_0x : Warning<
3909 "explicit instantiation cannot be 'inline'">, InGroup<CXX11Compat>,
3911 def err_explicit_instantiation_constexpr : Error<
3912 "explicit instantiation cannot be 'constexpr'">;
3913 def ext_explicit_instantiation_without_qualified_id : Extension<
3914 "qualifier in explicit instantiation of %q0 requires a template-id "
3915 "(a typedef is not permitted)">;
3916 def err_explicit_instantiation_without_template_id : Error<
3917 "explicit instantiation of %q0 must specify a template argument list">;
3918 def err_explicit_instantiation_unqualified_wrong_namespace : Error<
3919 "explicit instantiation of %q0 must occur in namespace %1">;
3920 def warn_explicit_instantiation_unqualified_wrong_namespace_0x : Warning<
3921 "explicit instantiation of %q0 must occur in namespace %1">,
3922 InGroup<CXX11Compat>, DefaultIgnore;
3923 def err_explicit_instantiation_undefined_member : Error<
3924 "explicit instantiation of undefined %select{member class|member function|"
3925 "static data member}0 %1 of class template %2">;
3926 def err_explicit_instantiation_undefined_func_template : Error<
3927 "explicit instantiation of undefined function template %0">;
3928 def err_explicit_instantiation_undefined_var_template : Error<
3929 "explicit instantiation of undefined variable template %q0">;
3930 def err_explicit_instantiation_declaration_after_definition : Error<
3931 "explicit instantiation declaration (with 'extern') follows explicit "
3932 "instantiation definition (without 'extern')">;
3933 def note_explicit_instantiation_definition_here : Note<
3934 "explicit instantiation definition is here">;
3935 def err_invalid_var_template_spec_type : Error<"type %2 "
3936 "of %select{explicit instantiation|explicit specialization|"
3937 "partial specialization|redeclaration}0 of %1 does not match"
3938 " expected type %3">;
3939 def err_mismatched_exception_spec_explicit_instantiation : Error<
3940 "exception specification in explicit instantiation does not match "
3941 "instantiated one">;
3942 def ext_mismatched_exception_spec_explicit_instantiation : ExtWarn<
3943 err_mismatched_exception_spec_explicit_instantiation.Text>,
3944 InGroup<MicrosoftExceptionSpec>;
3946 // C++ typename-specifiers
3947 def err_typename_nested_not_found : Error<"no type named %0 in %1">;
3948 def err_typename_nested_not_found_enable_if : Error<
3949 "no type named 'type' in %0; 'enable_if' cannot be used to disable "
3950 "this declaration">;
3951 def err_typename_nested_not_type : Error<
3952 "typename specifier refers to non-type member %0 in %1">;
3953 def note_typename_refers_here : Note<
3954 "referenced member %0 is declared here">;
3955 def err_typename_missing : Error<
3956 "missing 'typename' prior to dependent type name '%0%1'">;
3957 def ext_typename_missing : ExtWarn<
3958 "missing 'typename' prior to dependent type name '%0%1'">,
3959 InGroup<DiagGroup<"typename-missing">>;
3960 def ext_typename_outside_of_template : ExtWarn<
3961 "'typename' occurs outside of a template">, InGroup<CXX11>;
3962 def warn_cxx98_compat_typename_outside_of_template : Warning<
3963 "use of 'typename' outside of a template is incompatible with C++98">,
3964 InGroup<CXX98Compat>, DefaultIgnore;
3965 def err_typename_refers_to_using_value_decl : Error<
3966 "typename specifier refers to a dependent using declaration for a value "
3968 def note_using_value_decl_missing_typename : Note<
3969 "add 'typename' to treat this using declaration as a type">;
3971 def err_template_kw_refers_to_non_template : Error<
3972 "%0 following the 'template' keyword does not refer to a template">;
3973 def err_template_kw_refers_to_class_template : Error<
3974 "'%0%1' instantiated to a class template, not a function template">;
3975 def note_referenced_class_template : Error<
3976 "class template declared here">;
3977 def err_template_kw_missing : Error<
3978 "missing 'template' keyword prior to dependent template name '%0%1'">;
3979 def ext_template_outside_of_template : ExtWarn<
3980 "'template' keyword outside of a template">, InGroup<CXX11>;
3981 def warn_cxx98_compat_template_outside_of_template : Warning<
3982 "use of 'template' keyword outside of a template is incompatible with C++98">,
3983 InGroup<CXX98Compat>, DefaultIgnore;
3985 def err_non_type_template_in_nested_name_specifier : Error<
3986 "qualified name refers into a specialization of %select{function|variable}0 "
3988 def err_template_id_not_a_type : Error<
3989 "template name refers to non-type template %0">;
3990 def note_template_declared_here : Note<
3991 "%select{function template|class template|variable template"
3992 "|type alias template|template template parameter}0 "
3993 "%1 declared here">;
3994 def err_alias_template_expansion_into_fixed_list : Error<
3995 "pack expansion used as argument for non-pack parameter of alias template">;
3996 def note_parameter_type : Note<
3997 "parameter of type %0 is declared here">;
3999 // C++11 Variadic Templates
4000 def err_template_param_pack_default_arg : Error<
4001 "template parameter pack cannot have a default argument">;
4002 def err_template_param_pack_must_be_last_template_parameter : Error<
4003 "template parameter pack must be the last template parameter">;
4005 def err_template_parameter_pack_non_pack : Error<
4006 "%select{template type|non-type template|template template}0 parameter"
4007 "%select{| pack}1 conflicts with previous %select{template type|"
4008 "non-type template|template template}0 parameter%select{ pack|}1">;
4009 def note_template_parameter_pack_non_pack : Note<
4010 "%select{template type|non-type template|template template}0 parameter"
4011 "%select{| pack}1 does not match %select{template type|non-type template"
4012 "|template template}0 parameter%select{ pack|}1 in template argument">;
4013 def note_template_parameter_pack_here : Note<
4014 "previous %select{template type|non-type template|template template}0 "
4015 "parameter%select{| pack}1 declared here">;
4017 def err_unexpanded_parameter_pack : Error<
4018 "%select{expression|base type|declaration type|data member type|bit-field "
4019 "size|static assertion|fixed underlying type|enumerator value|"
4020 "using declaration|friend declaration|qualifier|initializer|default argument|"
4021 "non-type template parameter type|exception type|partial specialization|"
4022 "__if_exists name|__if_not_exists name|lambda|block}0 contains"
4023 "%plural{0: an|:}1 unexpanded parameter pack"
4024 "%plural{0:|1: %2|2:s %2 and %3|:s %2, %3, ...}1">;
4026 def err_pack_expansion_without_parameter_packs : Error<
4027 "pack expansion does not contain any unexpanded parameter packs">;
4028 def err_pack_expansion_length_conflict : Error<
4029 "pack expansion contains parameter packs %0 and %1 that have different "
4030 "lengths (%2 vs. %3)">;
4031 def err_pack_expansion_length_conflict_multilevel : Error<
4032 "pack expansion contains parameter pack %0 that has a different "
4033 "length (%1 vs. %2) from outer parameter packs">;
4034 def err_pack_expansion_member_init : Error<
4035 "pack expansion for initialization of member %0">;
4037 def err_function_parameter_pack_without_parameter_packs : Error<
4038 "type %0 of function parameter pack does not contain any unexpanded "
4040 def err_ellipsis_in_declarator_not_parameter : Error<
4041 "only function and template parameters can be parameter packs">;
4043 def err_sizeof_pack_no_pack_name : Error<
4044 "%0 does not refer to the name of a parameter pack">;
4046 def err_fold_expression_packs_both_sides : Error<
4047 "binary fold expression has unexpanded parameter packs in both operands">;
4048 def err_fold_expression_empty : Error<
4049 "unary fold expression has empty expansion for operator '%0' "
4050 "with no fallback value">;
4051 def err_fold_expression_bad_operand : Error<
4052 "expression not permitted as operand of fold expression">;
4054 def err_unexpected_typedef : Error<
4055 "unexpected type name %0: expected expression">;
4056 def err_unexpected_namespace : Error<
4057 "unexpected namespace name %0: expected expression">;
4058 def err_undeclared_var_use : Error<"use of undeclared identifier %0">;
4059 def ext_undeclared_unqual_id_with_dependent_base : ExtWarn<
4060 "use of undeclared identifier %0; "
4061 "unqualified lookup into dependent bases of class template %1 is a Microsoft extension">,
4062 InGroup<MicrosoftTemplate>;
4063 def ext_found_via_dependent_bases_lookup : ExtWarn<"use of identifier %0 "
4064 "found via unqualified lookup into dependent bases of class templates is a "
4065 "Microsoft extension">, InGroup<MicrosoftTemplate>;
4066 def note_dependent_var_use : Note<"must qualify identifier to find this "
4067 "declaration in dependent base class">;
4068 def err_not_found_by_two_phase_lookup : Error<"call to function %0 that is neither "
4069 "visible in the template definition nor found by argument-dependent lookup">;
4070 def note_not_found_by_two_phase_lookup : Note<"%0 should be declared prior to the "
4071 "call site%select{| or in %2| or in an associated namespace of one of its arguments}1">;
4072 def err_undeclared_use : Error<"use of undeclared %0">;
4073 def warn_partial_availability : Warning<"%0 is only available conditionally">,
4074 InGroup<PartialAvailability>, DefaultIgnore;
4075 def note_partial_availability_silence : Note<
4076 "explicitly redeclare %0 to silence this warning">;
4077 def warn_partial_message : Warning<"%0 is partial: %1">,
4078 InGroup<PartialAvailability>, DefaultIgnore;
4079 def warn_partial_fwdclass_message : Warning<
4080 "%0 may be partial because the receiver type is unknown">,
4081 InGroup<PartialAvailability>, DefaultIgnore;
4082 def warn_deprecated : Warning<"%0 is deprecated">,
4083 InGroup<DeprecatedDeclarations>;
4084 def warn_property_method_deprecated :
4085 Warning<"property access is using %0 method which is deprecated">,
4086 InGroup<DeprecatedDeclarations>;
4087 def warn_deprecated_message : Warning<"%0 is deprecated: %1">,
4088 InGroup<DeprecatedDeclarations>;
4089 def warn_deprecated_anonymous_namespace : Warning<
4090 "'deprecated' attribute on anonymous namespace ignored">,
4091 InGroup<IgnoredAttributes>;
4092 def warn_deprecated_fwdclass_message : Warning<
4093 "%0 may be deprecated because the receiver type is unknown">,
4094 InGroup<DeprecatedDeclarations>;
4095 def warn_deprecated_def : Warning<
4096 "Implementing deprecated %select{method|class|category}0">,
4097 InGroup<DeprecatedImplementations>, DefaultIgnore;
4098 def err_unavailable : Error<"%0 is unavailable">;
4099 def err_property_method_unavailable :
4100 Error<"property access is using %0 method which is unavailable">;
4101 def err_unavailable_message : Error<"%0 is unavailable: %1">;
4102 def warn_unavailable_fwdclass_message : Warning<
4103 "%0 may be unavailable because the receiver type is unknown">,
4104 InGroup<UnavailableDeclarations>;
4105 def note_availability_specified_here : Note<
4106 "%0 has been explicitly marked "
4107 "%select{unavailable|deleted|deprecated|partial}1 here">;
4108 def note_implicitly_deleted : Note<
4109 "explicitly defaulted function was implicitly deleted here">;
4110 def note_inherited_deleted_here : Note<
4111 "deleted constructor was inherited here">;
4112 def note_cannot_inherit : Note<
4113 "constructor cannot be inherited">;
4114 def warn_not_enough_argument : Warning<
4115 "not enough variable arguments in %0 declaration to fit a sentinel">,
4117 def warn_missing_sentinel : Warning <
4118 "missing sentinel in %select{function call|method dispatch|block call}0">,
4120 def note_sentinel_here : Note<
4121 "%select{function|method|block}0 has been explicitly marked sentinel here">;
4122 def warn_missing_prototype : Warning<
4123 "no previous prototype for function %0">,
4124 InGroup<DiagGroup<"missing-prototypes">>, DefaultIgnore;
4125 def note_declaration_not_a_prototype : Note<
4126 "this declaration is not a prototype; add 'void' to make it a prototype for a zero-parameter function">;
4127 def warn_missing_variable_declarations : Warning<
4128 "no previous extern declaration for non-static variable %0">,
4129 InGroup<DiagGroup<"missing-variable-declarations">>, DefaultIgnore;
4130 def err_static_data_member_reinitialization :
4131 Error<"static data member %0 already has an initializer">;
4132 def err_redefinition : Error<"redefinition of %0">;
4133 def err_alias_after_tentative :
4134 Error<"alias definition of %0 after tentative definition">;
4135 def err_alias_is_definition :
4136 Error<"definition %0 cannot also be an alias">;
4137 def err_definition_of_implicitly_declared_member : Error<
4138 "definition of implicitly declared %select{default constructor|copy "
4139 "constructor|move constructor|copy assignment operator|move assignment "
4140 "operator|destructor|function}1">;
4141 def err_definition_of_explicitly_defaulted_member : Error<
4142 "definition of explicitly defaulted %select{default constructor|copy "
4143 "constructor|move constructor|copy assignment operator|move assignment "
4144 "operator|destructor}0">;
4145 def err_redefinition_extern_inline : Error<
4146 "redefinition of a 'extern inline' function %0 is not supported in "
4147 "%select{C99 mode|C++}1">;
4149 def note_deleted_dtor_no_operator_delete : Note<
4150 "virtual destructor requires an unambiguous, accessible 'operator delete'">;
4151 def note_deleted_special_member_class_subobject : Note<
4152 "%select{default constructor|copy constructor|move constructor|"
4153 "copy assignment operator|move assignment operator|destructor}0 of "
4154 "%1 is implicitly deleted because "
4155 "%select{base class %3|%select{||||variant }4field %3}2 has "
4156 "%select{no|a deleted|multiple|an inaccessible|a non-trivial}4 "
4157 "%select{%select{default constructor|copy constructor|move constructor|copy "
4158 "assignment operator|move assignment operator|destructor}0|destructor}5"
4160 def note_deleted_default_ctor_uninit_field : Note<
4161 "default constructor of %0 is implicitly deleted because field %1 of "
4162 "%select{reference|const-qualified}3 type %2 would not be initialized">;
4163 def note_deleted_default_ctor_all_const : Note<
4164 "default constructor of %0 is implicitly deleted because all "
4165 "%select{data members|data members of an anonymous union member}1"
4166 " are const-qualified">;
4167 def note_deleted_copy_ctor_rvalue_reference : Note<
4168 "copy constructor of %0 is implicitly deleted because field %1 is of "
4169 "rvalue reference type %2">;
4170 def note_deleted_copy_user_declared_move : Note<
4171 "copy %select{constructor|assignment operator}0 is implicitly deleted because"
4172 " %1 has a user-declared move %select{constructor|assignment operator}2">;
4173 def note_deleted_assign_field : Note<
4174 "%select{copy|move}0 assignment operator of %1 is implicitly deleted "
4175 "because field %2 is of %select{reference|const-qualified}4 type %3">;
4177 // These should be errors.
4178 def warn_undefined_internal : Warning<
4179 "%select{function|variable}0 %q1 has internal linkage but is not defined">,
4180 InGroup<DiagGroup<"undefined-internal">>;
4181 def warn_undefined_inline : Warning<"inline function %q0 is not defined">,
4182 InGroup<DiagGroup<"undefined-inline">>;
4183 def note_used_here : Note<"used here">;
4185 def err_internal_linkage_redeclaration : Error<
4186 "'internal_linkage' attribute does not appear on the first declaration of %0">;
4187 def warn_internal_linkage_local_storage : Warning<
4188 "'internal_linkage' attribute on a non-static local variable is ignored">,
4189 InGroup<IgnoredAttributes>;
4191 def ext_internal_in_extern_inline : ExtWarn<
4192 "static %select{function|variable}0 %1 is used in an inline function with "
4193 "external linkage">, InGroup<StaticInInline>;
4194 def ext_internal_in_extern_inline_quiet : Extension<
4195 "static %select{function|variable}0 %1 is used in an inline function with "
4196 "external linkage">, InGroup<StaticInInline>;
4197 def warn_static_local_in_extern_inline : Warning<
4198 "non-constant static local variable in inline function may be different "
4199 "in different files">, InGroup<StaticLocalInInline>;
4200 def note_convert_inline_to_static : Note<
4201 "use 'static' to give inline function %0 internal linkage">;
4203 def ext_redefinition_of_typedef : ExtWarn<
4204 "redefinition of typedef %0 is a C11 feature">,
4205 InGroup<DiagGroup<"typedef-redefinition"> >;
4206 def err_redefinition_variably_modified_typedef : Error<
4207 "redefinition of %select{typedef|type alias}0 for variably-modified type %1">;
4209 def err_inline_decl_follows_def : Error<
4210 "inline declaration of %0 follows non-inline definition">;
4211 def err_inline_declaration_block_scope : Error<
4212 "inline declaration of %0 not allowed in block scope">;
4213 def err_static_non_static : Error<
4214 "static declaration of %0 follows non-static declaration">;
4215 def err_different_language_linkage : Error<
4216 "declaration of %0 has a different language linkage">;
4217 def ext_retained_language_linkage : Extension<
4218 "friend function %0 retaining previous language linkage is an extension">,
4219 InGroup<DiagGroup<"retained-language-linkage">>;
4220 def err_extern_c_global_conflict : Error<
4221 "declaration of %1 %select{with C language linkage|in global scope}0 "
4222 "conflicts with declaration %select{in global scope|with C language linkage}0">;
4223 def note_extern_c_global_conflict : Note<
4224 "declared %select{in global scope|with C language linkage}0 here">;
4225 def warn_weak_import : Warning <
4226 "an already-declared variable is made a weak_import declaration %0">;
4227 def ext_static_non_static : Extension<
4228 "redeclaring non-static %0 as static is a Microsoft extension">,
4229 InGroup<MicrosoftRedeclareStatic>;
4230 def err_non_static_static : Error<
4231 "non-static declaration of %0 follows static declaration">;
4232 def err_extern_non_extern : Error<
4233 "extern declaration of %0 follows non-extern declaration">;
4234 def err_non_extern_extern : Error<
4235 "non-extern declaration of %0 follows extern declaration">;
4236 def err_non_thread_thread : Error<
4237 "non-thread-local declaration of %0 follows thread-local declaration">;
4238 def err_thread_non_thread : Error<
4239 "thread-local declaration of %0 follows non-thread-local declaration">;
4240 def err_thread_thread_different_kind : Error<
4241 "thread-local declaration of %0 with %select{static|dynamic}1 initialization "
4242 "follows declaration with %select{dynamic|static}1 initialization">;
4243 def err_redefinition_different_type : Error<
4244 "redefinition of %0 with a different type%diff{: $ vs $|}1,2">;
4245 def err_redefinition_different_kind : Error<
4246 "redefinition of %0 as different kind of symbol">;
4247 def err_redefinition_different_namespace_alias : Error<
4248 "redefinition of %0 as an alias for a different namespace">;
4249 def note_previous_namespace_alias : Note<
4250 "previously defined as an alias for %0">;
4251 def warn_forward_class_redefinition : Warning<
4252 "redefinition of forward class %0 of a typedef name of an object type is ignored">,
4253 InGroup<DiagGroup<"objc-forward-class-redefinition">>;
4254 def err_redefinition_different_typedef : Error<
4255 "%select{typedef|type alias|type alias template}0 "
4256 "redefinition with different types%diff{ ($ vs $)|}1,2">;
4257 def err_tag_reference_non_tag : Error<
4258 "elaborated type refers to %select{a non-tag type|a typedef|a type alias|a template|a type alias template}0">;
4259 def err_tag_reference_conflict : Error<
4260 "implicit declaration introduced by elaborated type conflicts with "
4261 "%select{a declaration|a typedef|a type alias|a template}0 of the same name">;
4262 def err_dependent_tag_decl : Error<
4263 "%select{declaration|definition}0 of "
4264 "%select{struct|interface|union|class|enum}1 in a dependent scope">;
4265 def err_tag_definition_of_typedef : Error<
4266 "definition of type %0 conflicts with %select{typedef|type alias}1 of the same name">;
4267 def err_conflicting_types : Error<"conflicting types for %0">;
4268 def err_different_pass_object_size_params : Error<
4269 "conflicting pass_object_size attributes on parameters">;
4270 def err_late_asm_label_name : Error<
4271 "cannot apply asm label to %select{variable|function}0 after its first use">;
4272 def err_different_asm_label : Error<"conflicting asm label">;
4273 def err_nested_redefinition : Error<"nested redefinition of %0">;
4274 def err_use_with_wrong_tag : Error<
4275 "use of %0 with tag type that does not match previous declaration">;
4276 def warn_struct_class_tag_mismatch : Warning<
4277 "%select{struct|interface|class}0%select{| template}1 %2 was previously "
4278 "declared as a %select{struct|interface|class}3%select{| template}1">,
4279 InGroup<MismatchedTags>, DefaultIgnore;
4280 def warn_struct_class_previous_tag_mismatch : Warning<
4281 "%2 defined as %select{a struct|an interface|a class}0%select{| template}1 "
4282 "here but previously declared as "
4283 "%select{a struct|an interface|a class}3%select{| template}1">,
4284 InGroup<MismatchedTags>, DefaultIgnore;
4285 def note_struct_class_suggestion : Note<
4286 "did you mean %select{struct|interface|class}0 here?">;
4287 def ext_forward_ref_enum : Extension<
4288 "ISO C forbids forward references to 'enum' types">;
4289 def err_forward_ref_enum : Error<
4290 "ISO C++ forbids forward references to 'enum' types">;
4291 def ext_ms_forward_ref_enum : Extension<
4292 "forward references to 'enum' types are a Microsoft extension">,
4293 InGroup<MicrosoftEnumForwardReference>;
4294 def ext_forward_ref_enum_def : Extension<
4295 "redeclaration of already-defined enum %0 is a GNU extension">,
4296 InGroup<GNURedeclaredEnum>;
4298 def err_redefinition_of_enumerator : Error<"redefinition of enumerator %0">;
4299 def err_duplicate_member : Error<"duplicate member %0">;
4300 def err_misplaced_ivar : Error<
4301 "instance variables may not be placed in %select{categories|class extension}0">;
4302 def warn_ivars_in_interface : Warning<
4303 "declaration of instance variables in the interface is deprecated">,
4304 InGroup<DiagGroup<"objc-interface-ivars">>, DefaultIgnore;
4305 def ext_enum_value_not_int : Extension<
4306 "ISO C restricts enumerator values to range of 'int' (%0 is too "
4307 "%select{small|large}1)">;
4308 def ext_enum_too_large : ExtWarn<
4309 "enumeration values exceed range of largest integer">, InGroup<EnumTooLarge>;
4310 def ext_enumerator_increment_too_large : ExtWarn<
4311 "incremented enumerator value %0 is not representable in the "
4312 "largest integer type">, InGroup<EnumTooLarge>;
4313 def warn_flag_enum_constant_out_of_range : Warning<
4314 "enumeration value %0 is out of range of flags in enumeration type %1">,
4317 def warn_illegal_constant_array_size : Extension<
4318 "size of static array must be an integer constant expression">;
4319 def err_vm_decl_in_file_scope : Error<
4320 "variably modified type declaration not allowed at file scope">;
4321 def err_vm_decl_has_extern_linkage : Error<
4322 "variably modified type declaration cannot have 'extern' linkage">;
4323 def err_typecheck_field_variable_size : Error<
4324 "fields must have a constant size: 'variable length array in structure' "
4325 "extension will never be supported">;
4326 def err_vm_func_decl : Error<
4327 "function declaration cannot have variably modified type">;
4328 def err_array_too_large : Error<
4329 "array is too large (%0 elements)">;
4330 def warn_array_new_too_large : Warning<"array is too large (%0 elements)">,
4331 // FIXME PR11644: ", will throw std::bad_array_new_length at runtime"
4332 InGroup<BadArrayNewLength>;
4334 // -Wpadded, -Wpacked
4335 def warn_padded_struct_field : Warning<
4336 "padding %select{struct|interface|class}0 %1 with %2 "
4337 "%select{byte|bit}3%s2 to align %4">,
4338 InGroup<Padded>, DefaultIgnore;
4339 def warn_padded_struct_anon_field : Warning<
4340 "padding %select{struct|interface|class}0 %1 with %2 "
4341 "%select{byte|bit}3%s2 to align anonymous bit-field">,
4342 InGroup<Padded>, DefaultIgnore;
4343 def warn_padded_struct_size : Warning<
4344 "padding size of %0 with %1 %select{byte|bit}2%s1 to alignment boundary">,
4345 InGroup<Padded>, DefaultIgnore;
4346 def warn_unnecessary_packed : Warning<
4347 "packed attribute is unnecessary for %0">, InGroup<Packed>, DefaultIgnore;
4349 def err_typecheck_negative_array_size : Error<"array size is negative">;
4350 def warn_typecheck_negative_array_new_size : Warning<"array size is negative">,
4351 // FIXME PR11644: ", will throw std::bad_array_new_length at runtime"
4352 InGroup<BadArrayNewLength>;
4353 def warn_typecheck_function_qualifiers_ignored : Warning<
4354 "'%0' qualifier on function type %1 has no effect">,
4355 InGroup<IgnoredQualifiers>;
4356 def warn_typecheck_function_qualifiers_unspecified : Warning<
4357 "'%0' qualifier on function type %1 has unspecified behavior">;
4358 def warn_typecheck_reference_qualifiers : Warning<
4359 "'%0' qualifier on reference type %1 has no effect">,
4360 InGroup<IgnoredQualifiers>;
4361 def err_typecheck_invalid_restrict_not_pointer : Error<
4362 "restrict requires a pointer or reference (%0 is invalid)">;
4363 def err_typecheck_invalid_restrict_not_pointer_noarg : Error<
4364 "restrict requires a pointer or reference">;
4365 def err_typecheck_invalid_restrict_invalid_pointee : Error<
4366 "pointer to function type %0 may not be 'restrict' qualified">;
4367 def ext_typecheck_zero_array_size : Extension<
4368 "zero size arrays are an extension">, InGroup<ZeroLengthArray>;
4369 def err_typecheck_zero_array_size : Error<
4370 "zero-length arrays are not permitted in C++">;
4371 def warn_typecheck_zero_static_array_size : Warning<
4372 "'static' has no effect on zero-length arrays">,
4373 InGroup<ArrayBounds>;
4374 def err_array_size_non_int : Error<"size of array has non-integer type %0">;
4375 def err_init_element_not_constant : Error<
4376 "initializer element is not a compile-time constant">;
4377 def ext_aggregate_init_not_constant : Extension<
4378 "initializer for aggregate is not a compile-time constant">, InGroup<C99>;
4379 def err_local_cant_init : Error<
4380 "'__local' variable cannot have an initializer">;
4381 def err_block_extern_cant_init : Error<
4382 "'extern' variable cannot have an initializer">;
4383 def warn_extern_init : Warning<"'extern' variable has an initializer">,
4384 InGroup<DiagGroup<"extern-initializer">>;
4385 def err_variable_object_no_init : Error<
4386 "variable-sized object may not be initialized">;
4387 def err_excess_initializers : Error<
4388 "excess elements in %select{array|vector|scalar|union|struct}0 initializer">;
4389 def ext_excess_initializers : ExtWarn<
4390 "excess elements in %select{array|vector|scalar|union|struct}0 initializer">;
4391 def err_excess_initializers_in_char_array_initializer : Error<
4392 "excess elements in char array initializer">;
4393 def ext_excess_initializers_in_char_array_initializer : ExtWarn<
4394 "excess elements in char array initializer">;
4395 def err_initializer_string_for_char_array_too_long : Error<
4396 "initializer-string for char array is too long">;
4397 def ext_initializer_string_for_char_array_too_long : ExtWarn<
4398 "initializer-string for char array is too long">;
4399 def warn_missing_field_initializers : Warning<
4400 "missing field %0 initializer">,
4401 InGroup<MissingFieldInitializers>, DefaultIgnore;
4402 def warn_braces_around_scalar_init : Warning<
4403 "braces around scalar initializer">, InGroup<DiagGroup<"braced-scalar-init">>;
4404 def ext_many_braces_around_scalar_init : ExtWarn<
4405 "too many braces around scalar initializer">,
4406 InGroup<DiagGroup<"many-braces-around-scalar-init">>;
4407 def ext_complex_component_init : Extension<
4408 "complex initialization specifying real and imaginary components "
4409 "is an extension">, InGroup<DiagGroup<"complex-component-init">>;
4410 def err_empty_scalar_initializer : Error<"scalar initializer cannot be empty">;
4411 def warn_cxx98_compat_empty_scalar_initializer : Warning<
4412 "scalar initialized from empty initializer list is incompatible with C++98">,
4413 InGroup<CXX98Compat>, DefaultIgnore;
4414 def warn_cxx98_compat_reference_list_init : Warning<
4415 "reference initialized from initializer list is incompatible with C++98">,
4416 InGroup<CXX98Compat>, DefaultIgnore;
4417 def warn_cxx98_compat_initializer_list_init : Warning<
4418 "initialization of initializer_list object is incompatible with C++98">,
4419 InGroup<CXX98Compat>, DefaultIgnore;
4420 def warn_cxx98_compat_ctor_list_init : Warning<
4421 "constructor call from initializer list is incompatible with C++98">,
4422 InGroup<CXX98Compat>, DefaultIgnore;
4423 def err_illegal_initializer : Error<
4424 "illegal initializer (only variables can be initialized)">;
4425 def err_illegal_initializer_type : Error<"illegal initializer type %0">;
4426 def ext_init_list_type_narrowing : ExtWarn<
4427 "type %0 cannot be narrowed to %1 in initializer list">,
4428 InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
4429 def ext_init_list_variable_narrowing : ExtWarn<
4430 "non-constant-expression cannot be narrowed from type %0 to %1 in "
4431 "initializer list">, InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
4432 def ext_init_list_constant_narrowing : ExtWarn<
4433 "constant expression evaluates to %0 which cannot be narrowed to type %1">,
4434 InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
4435 def warn_init_list_type_narrowing : Warning<
4436 "type %0 cannot be narrowed to %1 in initializer list in C++11">,
4437 InGroup<CXX11Narrowing>, DefaultIgnore;
4438 def warn_init_list_variable_narrowing : Warning<
4439 "non-constant-expression cannot be narrowed from type %0 to %1 in "
4440 "initializer list in C++11">,
4441 InGroup<CXX11Narrowing>, DefaultIgnore;
4442 def warn_init_list_constant_narrowing : Warning<
4443 "constant expression evaluates to %0 which cannot be narrowed to type %1 in "
4445 InGroup<CXX11Narrowing>, DefaultIgnore;
4446 def note_init_list_narrowing_silence : Note<
4447 "insert an explicit cast to silence this issue">;
4448 def err_init_objc_class : Error<
4449 "cannot initialize Objective-C class type %0">;
4450 def err_implicit_empty_initializer : Error<
4451 "initializer for aggregate with no elements requires explicit braces">;
4452 def err_bitfield_has_negative_width : Error<
4453 "bit-field %0 has negative width (%1)">;
4454 def err_anon_bitfield_has_negative_width : Error<
4455 "anonymous bit-field has negative width (%0)">;
4456 def err_bitfield_has_zero_width : Error<"named bit-field %0 has zero width">;
4457 def err_bitfield_width_exceeds_type_width : Error<
4458 "width of bit-field %0 (%1 bits) exceeds %select{width|size}2 "
4459 "of its type (%3 bit%s3)">;
4460 def err_anon_bitfield_width_exceeds_type_width : Error<
4461 "width of anonymous bit-field (%0 bits) exceeds %select{width|size}1 "
4462 "of its type (%2 bit%s2)">;
4463 def err_incorrect_number_of_vector_initializers : Error<
4464 "number of elements must be either one or match the size of the vector">;
4466 // Used by C++ which allows bit-fields that are wider than the type.
4467 def warn_bitfield_width_exceeds_type_width: Warning<
4468 "width of bit-field %0 (%1 bits) exceeds the width of its type; value will "
4469 "be truncated to %2 bit%s2">, InGroup<BitFieldWidth>;
4470 def warn_anon_bitfield_width_exceeds_type_width : Warning<
4471 "width of anonymous bit-field (%0 bits) exceeds width of its type; value "
4472 "will be truncated to %1 bit%s1">, InGroup<BitFieldWidth>;
4474 def warn_missing_braces : Warning<
4475 "suggest braces around initialization of subobject">,
4476 InGroup<MissingBraces>, DefaultIgnore;
4478 def err_redefinition_of_label : Error<"redefinition of label %0">;
4479 def err_undeclared_label_use : Error<"use of undeclared label %0">;
4480 def err_goto_ms_asm_label : Error<
4481 "cannot jump from this goto statement to label %0 inside an inline assembly block">;
4482 def note_goto_ms_asm_label : Note<
4483 "inline assembly label %0 declared here">;
4484 def warn_unused_label : Warning<"unused label %0">,
4485 InGroup<UnusedLabel>, DefaultIgnore;
4487 def err_goto_into_protected_scope : Error<
4488 "cannot jump from this goto statement to its label">;
4489 def ext_goto_into_protected_scope : ExtWarn<
4490 "jump from this goto statement to its label is a Microsoft extension">,
4491 InGroup<MicrosoftGoto>;
4492 def warn_cxx98_compat_goto_into_protected_scope : Warning<
4493 "jump from this goto statement to its label is incompatible with C++98">,
4494 InGroup<CXX98Compat>, DefaultIgnore;
4495 def err_switch_into_protected_scope : Error<
4496 "cannot jump from switch statement to this case label">;
4497 def warn_cxx98_compat_switch_into_protected_scope : Warning<
4498 "jump from switch statement to this case label is incompatible with C++98">,
4499 InGroup<CXX98Compat>, DefaultIgnore;
4500 def err_indirect_goto_without_addrlabel : Error<
4501 "indirect goto in function with no address-of-label expressions">;
4502 def err_indirect_goto_in_protected_scope : Error<
4503 "cannot jump from this indirect goto statement to one of its possible targets">;
4504 def warn_cxx98_compat_indirect_goto_in_protected_scope : Warning<
4505 "jump from this indirect goto statement to one of its possible targets "
4506 "is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
4507 def note_indirect_goto_target : Note<
4508 "possible target of indirect goto statement">;
4509 def note_protected_by_variable_init : Note<
4510 "jump bypasses variable initialization">;
4511 def note_protected_by_variable_nontriv_destructor : Note<
4512 "jump bypasses variable with a non-trivial destructor">;
4513 def note_protected_by_variable_non_pod : Note<
4514 "jump bypasses initialization of non-POD variable">;
4515 def note_protected_by_cleanup : Note<
4516 "jump bypasses initialization of variable with __attribute__((cleanup))">;
4517 def note_protected_by_vla_typedef : Note<
4518 "jump bypasses initialization of VLA typedef">;
4519 def note_protected_by_vla_type_alias : Note<
4520 "jump bypasses initialization of VLA type alias">;
4521 def note_protected_by_vla : Note<
4522 "jump bypasses initialization of variable length array">;
4523 def note_protected_by_objc_try : Note<
4524 "jump bypasses initialization of @try block">;
4525 def note_protected_by_objc_catch : Note<
4526 "jump bypasses initialization of @catch block">;
4527 def note_protected_by_objc_finally : Note<
4528 "jump bypasses initialization of @finally block">;
4529 def note_protected_by_objc_synchronized : Note<
4530 "jump bypasses initialization of @synchronized block">;
4531 def note_protected_by_objc_autoreleasepool : Note<
4532 "jump bypasses auto release push of @autoreleasepool block">;
4533 def note_protected_by_cxx_try : Note<
4534 "jump bypasses initialization of try block">;
4535 def note_protected_by_cxx_catch : Note<
4536 "jump bypasses initialization of catch block">;
4537 def note_protected_by_seh_try : Note<
4538 "jump bypasses initialization of __try block">;
4539 def note_protected_by_seh_except : Note<
4540 "jump bypasses initialization of __except block">;
4541 def note_protected_by_seh_finally : Note<
4542 "jump bypasses initialization of __finally block">;
4543 def note_protected_by___block : Note<
4544 "jump bypasses setup of __block variable">;
4545 def note_protected_by_objc_strong_init : Note<
4546 "jump bypasses initialization of __strong variable">;
4547 def note_protected_by_objc_weak_init : Note<
4548 "jump bypasses initialization of __weak variable">;
4549 def note_enters_block_captures_cxx_obj : Note<
4550 "jump enters lifetime of block which captures a destructible C++ object">;
4551 def note_enters_block_captures_strong : Note<
4552 "jump enters lifetime of block which strongly captures a variable">;
4553 def note_enters_block_captures_weak : Note<
4554 "jump enters lifetime of block which weakly captures a variable">;
4556 def note_exits_cleanup : Note<
4557 "jump exits scope of variable with __attribute__((cleanup))">;
4558 def note_exits_dtor : Note<
4559 "jump exits scope of variable with non-trivial destructor">;
4560 def note_exits_temporary_dtor : Note<
4561 "jump exits scope of lifetime-extended temporary with non-trivial "
4563 def note_exits___block : Note<
4564 "jump exits scope of __block variable">;
4565 def note_exits_objc_try : Note<
4566 "jump exits @try block">;
4567 def note_exits_objc_catch : Note<
4568 "jump exits @catch block">;
4569 def note_exits_objc_finally : Note<
4570 "jump exits @finally block">;
4571 def note_exits_objc_synchronized : Note<
4572 "jump exits @synchronized block">;
4573 def note_exits_cxx_try : Note<
4574 "jump exits try block">;
4575 def note_exits_cxx_catch : Note<
4576 "jump exits catch block">;
4577 def note_exits_seh_try : Note<
4578 "jump exits __try block">;
4579 def note_exits_seh_except : Note<
4580 "jump exits __except block">;
4581 def note_exits_seh_finally : Note<
4582 "jump exits __finally block">;
4583 def note_exits_objc_autoreleasepool : Note<
4584 "jump exits autoreleasepool block">;
4585 def note_exits_objc_strong : Note<
4586 "jump exits scope of __strong variable">;
4587 def note_exits_objc_weak : Note<
4588 "jump exits scope of __weak variable">;
4589 def note_exits_block_captures_cxx_obj : Note<
4590 "jump exits lifetime of block which captures a destructible C++ object">;
4591 def note_exits_block_captures_strong : Note<
4592 "jump exits lifetime of block which strongly captures a variable">;
4593 def note_exits_block_captures_weak : Note<
4594 "jump exits lifetime of block which weakly captures a variable">;
4596 def err_func_returning_qualified_void : ExtWarn<
4597 "function cannot return qualified void type %0">,
4598 InGroup<DiagGroup<"qualified-void-return-type">>;
4599 def err_func_returning_array_function : Error<
4600 "function cannot return %select{array|function}0 type %1">;
4601 def err_field_declared_as_function : Error<"field %0 declared as a function">;
4602 def err_field_incomplete : Error<"field has incomplete type %0">;
4603 def ext_variable_sized_type_in_struct : ExtWarn<
4604 "field %0 with variable sized type %1 not at the end of a struct or class is"
4605 " a GNU extension">, InGroup<GNUVariableSizedTypeNotAtEnd>;
4607 def ext_c99_flexible_array_member : Extension<
4608 "flexible array members are a C99 feature">, InGroup<C99>;
4609 def err_flexible_array_virtual_base : Error<
4610 "flexible array member %0 not allowed in "
4611 "%select{struct|interface|union|class|enum}1 which has a virtual base class">;
4612 def err_flexible_array_empty_aggregate : Error<
4613 "flexible array member %0 not allowed in otherwise empty "
4614 "%select{struct|interface|union|class|enum}1">;
4615 def err_flexible_array_has_nontrivial_dtor : Error<
4616 "flexible array member %0 of type %1 with non-trivial destruction">;
4617 def ext_flexible_array_in_struct : Extension<
4618 "%0 may not be nested in a struct due to flexible array member">,
4619 InGroup<FlexibleArrayExtensions>;
4620 def ext_flexible_array_in_array : Extension<
4621 "%0 may not be used as an array element due to flexible array member">,
4622 InGroup<FlexibleArrayExtensions>;
4623 def err_flexible_array_init : Error<
4624 "initialization of flexible array member is not allowed">;
4625 def ext_flexible_array_empty_aggregate_ms : Extension<
4626 "flexible array member %0 in otherwise empty "
4627 "%select{struct|interface|union|class|enum}1 is a Microsoft extension">,
4628 InGroup<MicrosoftFlexibleArray>;
4629 def err_flexible_array_union : Error<
4630 "flexible array member %0 in a union is not allowed">;
4631 def ext_flexible_array_union_ms : Extension<
4632 "flexible array member %0 in a union is a Microsoft extension">,
4633 InGroup<MicrosoftFlexibleArray>;
4634 def ext_flexible_array_empty_aggregate_gnu : Extension<
4635 "flexible array member %0 in otherwise empty "
4636 "%select{struct|interface|union|class|enum}1 is a GNU extension">,
4637 InGroup<GNUEmptyStruct>;
4638 def ext_flexible_array_union_gnu : Extension<
4639 "flexible array member %0 in a union is a GNU extension">, InGroup<GNUFlexibleArrayUnionMember>;
4641 let CategoryName = "ARC Semantic Issue" in {
4643 // ARC-mode diagnostics.
4645 let CategoryName = "ARC Weak References" in {
4647 def err_arc_weak_no_runtime : Error<
4648 "cannot create __weak reference because the current deployment target "
4649 "does not support weak references">;
4650 def err_arc_weak_disabled : Error<
4651 "cannot create __weak reference in file using manual reference counting">;
4652 def err_synthesizing_arc_weak_property_disabled : Error<
4653 "cannot synthesize weak property in file using manual reference counting">;
4654 def err_synthesizing_arc_weak_property_no_runtime : Error<
4655 "cannot synthesize weak property because the current deployment target "
4656 "does not support weak references">;
4657 def err_arc_unsupported_weak_class : Error<
4658 "class is incompatible with __weak references">;
4659 def err_arc_weak_unavailable_assign : Error<
4660 "assignment of a weak-unavailable object to a __weak object">;
4661 def err_arc_weak_unavailable_property : Error<
4662 "synthesizing __weak instance variable of type %0, which does not "
4663 "support weak references">;
4664 def note_implemented_by_class : Note<
4665 "when implemented by class %0">;
4666 def err_arc_convesion_of_weak_unavailable : Error<
4667 "%select{implicit conversion|cast}0 of weak-unavailable object of type %1 to"
4668 " a __weak object of type %2">;
4670 } // end "ARC Weak References" category
4672 let CategoryName = "ARC Restrictions" in {
4674 def err_unavailable_in_arc : Error<
4675 "%0 is unavailable in ARC">;
4676 def note_arc_forbidden_type : Note<
4677 "declaration uses type that is ill-formed in ARC">;
4678 def note_performs_forbidden_arc_conversion : Note<
4679 "inline function performs a conversion which is forbidden in ARC">;
4680 def note_arc_init_returns_unrelated : Note<
4681 "init method must return a type related to its receiver type">;
4682 def note_arc_weak_disabled : Note<
4683 "declaration uses __weak, but ARC is disabled">;
4684 def note_arc_weak_no_runtime : Note<"declaration uses __weak, which "
4685 "the current deployment target does not support">;
4686 def note_arc_field_with_ownership : Note<
4687 "field has non-trivial ownership qualification">;
4689 def err_arc_illegal_explicit_message : Error<
4690 "ARC forbids explicit message send of %0">;
4691 def err_arc_unused_init_message : Error<
4692 "the result of a delegate init call must be immediately returned "
4693 "or assigned to 'self'">;
4694 def err_arc_mismatched_cast : Error<
4695 "%select{implicit conversion|cast}0 of "
4696 "%select{%2|a non-Objective-C pointer type %2|a block pointer|"
4697 "an Objective-C pointer|an indirect pointer to an Objective-C pointer}1"
4698 " to %3 is disallowed with ARC">;
4699 def err_arc_nolifetime_behavior : Error<
4700 "explicit ownership qualifier on cast result has no effect">;
4701 def err_arc_objc_object_in_tag : Error<
4702 "ARC forbids %select{Objective-C objects|blocks}0 in "
4703 "%select{struct|interface|union|<<ERROR>>|enum}1">;
4704 def err_arc_objc_property_default_assign_on_object : Error<
4705 "ARC forbids synthesizing a property of an Objective-C object "
4706 "with unspecified ownership or storage attribute">;
4707 def err_arc_illegal_selector : Error<
4708 "ARC forbids use of %0 in a @selector">;
4709 def err_arc_illegal_method_def : Error<
4710 "ARC forbids %select{implementation|synthesis}0 of %1">;
4711 def warn_arc_strong_pointer_objc_pointer : Warning<
4712 "method parameter of type %0 with no explicit ownership">,
4713 InGroup<DiagGroup<"explicit-ownership-type">>, DefaultIgnore;
4715 } // end "ARC Restrictions" category
4717 def err_arc_lost_method_convention : Error<
4718 "method was declared as %select{an 'alloc'|a 'copy'|an 'init'|a 'new'}0 "
4719 "method, but its implementation doesn't match because %select{"
4720 "its result type is not an object pointer|"
4721 "its result type is unrelated to its receiver type}1">;
4722 def note_arc_lost_method_convention : Note<"declaration in interface">;
4723 def err_arc_gained_method_convention : Error<
4724 "method implementation does not match its declaration">;
4725 def note_arc_gained_method_convention : Note<
4726 "declaration in interface is not in the '%select{alloc|copy|init|new}0' "
4727 "family because %select{its result type is not an object pointer|"
4728 "its result type is unrelated to its receiver type}1">;
4729 def err_typecheck_arc_assign_self : Error<
4730 "cannot assign to 'self' outside of a method in the init family">;
4731 def err_typecheck_arc_assign_self_class_method : Error<
4732 "cannot assign to 'self' in a class method">;
4733 def err_typecheck_arr_assign_enumeration : Error<
4734 "fast enumeration variables cannot be modified in ARC by default; "
4735 "declare the variable __strong to allow this">;
4736 def warn_arc_retained_assign : Warning<
4737 "assigning retained object to %select{weak|unsafe_unretained}0 "
4738 "%select{property|variable}1"
4739 "; object will be released after assignment">,
4740 InGroup<ARCUnsafeRetainedAssign>;
4741 def warn_arc_retained_property_assign : Warning<
4742 "assigning retained object to unsafe property"
4743 "; object will be released after assignment">,
4744 InGroup<ARCUnsafeRetainedAssign>;
4745 def warn_arc_literal_assign : Warning<
4746 "assigning %select{array literal|dictionary literal|numeric literal|boxed expression|<should not happen>|block literal}0"
4747 " to a weak %select{property|variable}1"
4748 "; object will be released after assignment">,
4749 InGroup<ARCUnsafeRetainedAssign>;
4750 def err_arc_new_array_without_ownership : Error<
4751 "'new' cannot allocate an array of %0 with no explicit ownership">;
4752 def err_arc_autoreleasing_var : Error<
4753 "%select{__block variables|global variables|fields|instance variables}0 cannot have "
4754 "__autoreleasing ownership">;
4755 def err_arc_autoreleasing_capture : Error<
4756 "cannot capture __autoreleasing variable in a "
4757 "%select{block|lambda by copy}0">;
4758 def err_arc_thread_ownership : Error<
4759 "thread-local variable has non-trivial ownership: type is %0">;
4760 def err_arc_indirect_no_ownership : Error<
4761 "%select{pointer|reference}1 to non-const type %0 with no explicit ownership">;
4762 def err_arc_array_param_no_ownership : Error<
4763 "must explicitly describe intended ownership of an object array parameter">;
4764 def err_arc_pseudo_dtor_inconstant_quals : Error<
4765 "pseudo-destructor destroys object of type %0 with inconsistently-qualified "
4767 def err_arc_init_method_unrelated_result_type : Error<
4768 "init methods must return a type related to the receiver type">;
4769 def err_arc_nonlocal_writeback : Error<
4770 "passing address of %select{non-local|non-scalar}0 object to "
4771 "__autoreleasing parameter for write-back">;
4772 def err_arc_method_not_found : Error<
4773 "no known %select{instance|class}1 method for selector %0">;
4774 def err_arc_receiver_forward_class : Error<
4775 "receiver %0 for class message is a forward declaration">;
4776 def err_arc_may_not_respond : Error<
4777 "no visible @interface for %0 declares the selector %1">;
4778 def err_arc_receiver_forward_instance : Error<
4779 "receiver type %0 for instance message is a forward declaration">;
4780 def warn_receiver_forward_instance : Warning<
4781 "receiver type %0 for instance message is a forward declaration">,
4782 InGroup<ForwardClassReceiver>, DefaultIgnore;
4783 def err_arc_collection_forward : Error<
4784 "collection expression type %0 is a forward declaration">;
4785 def err_arc_multiple_method_decl : Error<
4786 "multiple methods named %0 found with mismatched result, "
4787 "parameter type or attributes">;
4788 def warn_arc_lifetime_result_type : Warning<
4789 "ARC %select{unused|__unsafe_unretained|__strong|__weak|__autoreleasing}0 "
4790 "lifetime qualifier on return type is ignored">,
4791 InGroup<IgnoredQualifiers>;
4793 let CategoryName = "ARC Retain Cycle" in {
4795 def warn_arc_retain_cycle : Warning<
4796 "capturing %0 strongly in this block is likely to lead to a retain cycle">,
4797 InGroup<ARCRetainCycles>;
4798 def note_arc_retain_cycle_owner : Note<
4799 "block will be retained by %select{the captured object|an object strongly "
4800 "retained by the captured object}0">;
4802 } // end "ARC Retain Cycle" category
4804 def warn_arc_object_memaccess : Warning<
4805 "%select{destination for|source of}0 this %1 call is a pointer to "
4806 "ownership-qualified type %2">, InGroup<ARCNonPodMemAccess>;
4808 let CategoryName = "ARC and @properties" in {
4810 def err_arc_strong_property_ownership : Error<
4811 "existing instance variable %1 for strong property %0 may not be "
4812 "%select{|__unsafe_unretained||__weak}2">;
4813 def err_arc_assign_property_ownership : Error<
4814 "existing instance variable %1 for property %0 with %select{unsafe_unretained|assign}2 "
4815 "attribute must be __unsafe_unretained">;
4816 def err_arc_inconsistent_property_ownership : Error<
4817 "%select{|unsafe_unretained|strong|weak}1 property %0 may not also be "
4818 "declared %select{|__unsafe_unretained|__strong|__weak|__autoreleasing}2">;
4820 } // end "ARC and @properties" category
4822 def err_arc_atomic_ownership : Error<
4823 "cannot perform atomic operation on a pointer to type %0: type has "
4824 "non-trivial ownership">;
4826 let CategoryName = "ARC Casting Rules" in {
4828 def err_arc_bridge_cast_incompatible : Error<
4829 "incompatible types casting %0 to %1 with a %select{__bridge|"
4830 "__bridge_transfer|__bridge_retained}2 cast">;
4831 def err_arc_bridge_cast_wrong_kind : Error<
4832 "cast of %select{Objective-C|block|C}0 pointer type %1 to "
4833 "%select{Objective-C|block|C}2 pointer type %3 cannot use %select{__bridge|"
4834 "__bridge_transfer|__bridge_retained}4">;
4835 def err_arc_cast_requires_bridge : Error<
4836 "%select{cast|implicit conversion}0 of %select{Objective-C|block|C}1 "
4837 "pointer type %2 to %select{Objective-C|block|C}3 pointer type %4 "
4838 "requires a bridged cast">;
4839 def note_arc_bridge : Note<
4840 "use __bridge to convert directly (no change in ownership)">;
4841 def note_arc_cstyle_bridge : Note<
4842 "use __bridge with C-style cast to convert directly (no change in ownership)">;
4843 def note_arc_bridge_transfer : Note<
4844 "use %select{__bridge_transfer|CFBridgingRelease call}1 to transfer "
4845 "ownership of a +1 %0 into ARC">;
4846 def note_arc_cstyle_bridge_transfer : Note<
4847 "use __bridge_transfer with C-style cast to transfer "
4848 "ownership of a +1 %0 into ARC">;
4849 def note_arc_bridge_retained : Note<
4850 "use %select{__bridge_retained|CFBridgingRetain call}1 to make an "
4851 "ARC object available as a +1 %0">;
4852 def note_arc_cstyle_bridge_retained : Note<
4853 "use __bridge_retained with C-style cast to make an "
4854 "ARC object available as a +1 %0">;
4856 } // ARC Casting category
4858 } // ARC category name
4860 def err_flexible_array_init_needs_braces : Error<
4861 "flexible array requires brace-enclosed initializer">;
4862 def err_illegal_decl_array_of_functions : Error<
4863 "'%0' declared as array of functions of type %1">;
4864 def err_illegal_decl_array_incomplete_type : Error<
4865 "array has incomplete element type %0">;
4866 def err_illegal_message_expr_incomplete_type : Error<
4867 "Objective-C message has incomplete result type %0">;
4868 def err_illegal_decl_array_of_references : Error<
4869 "'%0' declared as array of references of type %1">;
4870 def err_decl_negative_array_size : Error<
4871 "'%0' declared as an array with a negative size">;
4872 def err_array_static_outside_prototype : Error<
4873 "%0 used in array declarator outside of function prototype">;
4874 def err_array_static_not_outermost : Error<
4875 "%0 used in non-outermost array type derivation">;
4876 def err_array_star_outside_prototype : Error<
4877 "star modifier used outside of function prototype">;
4878 def err_illegal_decl_pointer_to_reference : Error<
4879 "'%0' declared as a pointer to a reference of type %1">;
4880 def err_illegal_decl_mempointer_to_reference : Error<
4881 "'%0' declared as a member pointer to a reference of type %1">;
4882 def err_illegal_decl_mempointer_to_void : Error<
4883 "'%0' declared as a member pointer to void">;
4884 def err_illegal_decl_mempointer_in_nonclass : Error<
4885 "'%0' does not point into a class">;
4886 def err_mempointer_in_nonclass_type : Error<
4887 "member pointer refers into non-class type %0">;
4888 def err_reference_to_void : Error<"cannot form a reference to 'void'">;
4889 def err_nonfunction_block_type : Error<
4890 "block pointer to non-function type is invalid">;
4891 def err_return_block_has_expr : Error<"void block should not return a value">;
4892 def err_block_return_missing_expr : Error<
4893 "non-void block should return a value">;
4894 def err_func_def_incomplete_result : Error<
4895 "incomplete result type %0 in function definition">;
4896 def err_atomic_specifier_bad_type : Error<
4897 "_Atomic cannot be applied to "
4898 "%select{incomplete |array |function |reference |atomic |qualified |}0type "
4899 "%1 %select{||||||which is not trivially copyable}0">;
4902 def ext_sizeof_alignof_function_type : Extension<
4903 "invalid application of '%select{sizeof|alignof|vec_step}0' to a "
4904 "function type">, InGroup<PointerArith>;
4905 def ext_sizeof_alignof_void_type : Extension<
4906 "invalid application of '%select{sizeof|alignof|vec_step}0' to a void "
4907 "type">, InGroup<PointerArith>;
4908 def err_opencl_sizeof_alignof_type : Error<
4909 "invalid application of '%select{sizeof|alignof|vec_step|__builtin_omp_required_simd_align}0' to a void type">;
4910 def err_sizeof_alignof_incomplete_type : Error<
4911 "invalid application of '%select{sizeof|alignof|vec_step|__builtin_omp_required_simd_align}0' to an "
4912 "incomplete type %1">;
4913 def err_sizeof_alignof_function_type : Error<
4914 "invalid application of '%select{sizeof|alignof|vec_step|__builtin_omp_required_simd_align}0' to a "
4916 def err_openmp_default_simd_align_expr : Error<
4917 "invalid application of '__builtin_omp_required_simd_align' to an expression, only type is allowed">;
4918 def err_sizeof_alignof_typeof_bitfield : Error<
4919 "invalid application of '%select{sizeof|alignof|typeof}0' to bit-field">;
4920 def err_alignof_member_of_incomplete_type : Error<
4921 "invalid application of 'alignof' to a field of a class still being defined">;
4922 def err_vecstep_non_scalar_vector_type : Error<
4923 "'vec_step' requires built-in scalar or vector type, %0 invalid">;
4924 def err_offsetof_incomplete_type : Error<
4925 "offsetof of incomplete type %0">;
4926 def err_offsetof_record_type : Error<
4927 "offsetof requires struct, union, or class type, %0 invalid">;
4928 def err_offsetof_array_type : Error<"offsetof requires array type, %0 invalid">;
4929 def ext_offsetof_extended_field_designator : Extension<
4930 "using extended field designator is an extension">,
4931 InGroup<DiagGroup<"extended-offsetof">>;
4932 def ext_offsetof_non_pod_type : ExtWarn<"offset of on non-POD type %0">,
4933 InGroup<InvalidOffsetof>;
4934 def ext_offsetof_non_standardlayout_type : ExtWarn<
4935 "offset of on non-standard-layout type %0">, InGroup<InvalidOffsetof>;
4936 def err_offsetof_bitfield : Error<"cannot compute offset of bit-field %0">;
4937 def err_offsetof_field_of_virtual_base : Error<
4938 "invalid application of 'offsetof' to a field of a virtual base">;
4939 def warn_sub_ptr_zero_size_types : Warning<
4940 "subtraction of pointers to type %0 of zero size has undefined behavior">,
4941 InGroup<PointerArith>;
4943 def warn_floatingpoint_eq : Warning<
4944 "comparing floating point with == or != is unsafe">,
4945 InGroup<DiagGroup<"float-equal">>, DefaultIgnore;
4947 def warn_remainder_division_by_zero : Warning<
4948 "%select{remainder|division}0 by zero is undefined">,
4950 def warn_shift_lhs_negative : Warning<"shifting a negative signed value is undefined">,
4951 InGroup<DiagGroup<"shift-negative-value">>;
4952 def warn_shift_negative : Warning<"shift count is negative">,
4953 InGroup<DiagGroup<"shift-count-negative">>;
4954 def warn_shift_gt_typewidth : Warning<"shift count >= width of type">,
4955 InGroup<DiagGroup<"shift-count-overflow">>;
4956 def warn_shift_result_gt_typewidth : Warning<
4957 "signed shift result (%0) requires %1 bits to represent, but %2 only has "
4958 "%3 bits">, InGroup<DiagGroup<"shift-overflow">>;
4959 def warn_shift_result_sets_sign_bit : Warning<
4960 "signed shift result (%0) sets the sign bit of the shift expression's "
4961 "type (%1) and becomes negative">,
4962 InGroup<DiagGroup<"shift-sign-overflow">>, DefaultIgnore;
4964 def warn_precedence_bitwise_rel : Warning<
4965 "%0 has lower precedence than %1; %1 will be evaluated first">,
4966 InGroup<Parentheses>;
4967 def note_precedence_bitwise_first : Note<
4968 "place parentheses around the %0 expression to evaluate it first">;
4969 def note_precedence_silence : Note<
4970 "place parentheses around the '%0' expression to silence this warning">;
4972 def warn_precedence_conditional : Warning<
4973 "operator '?:' has lower precedence than '%0'; '%0' will be evaluated first">,
4974 InGroup<Parentheses>;
4975 def note_precedence_conditional_first : Note<
4976 "place parentheses around the '?:' expression to evaluate it first">;
4978 def warn_logical_instead_of_bitwise : Warning<
4979 "use of logical '%0' with constant operand">,
4980 InGroup<DiagGroup<"constant-logical-operand">>;
4981 def note_logical_instead_of_bitwise_change_operator : Note<
4982 "use '%0' for a bitwise operation">;
4983 def note_logical_instead_of_bitwise_remove_constant : Note<
4984 "remove constant to silence this warning">;
4986 def warn_bitwise_op_in_bitwise_op : Warning<
4987 "'%0' within '%1'">, InGroup<BitwiseOpParentheses>;
4989 def warn_logical_and_in_logical_or : Warning<
4990 "'&&' within '||'">, InGroup<LogicalOpParentheses>;
4992 def warn_overloaded_shift_in_comparison :Warning<
4993 "overloaded operator %select{>>|<<}0 has higher precedence than "
4994 "comparison operator">,
4995 InGroup<OverloadedShiftOpParentheses>;
4996 def note_evaluate_comparison_first :Note<
4997 "place parentheses around comparison expression to evaluate it first">;
4999 def warn_addition_in_bitshift : Warning<
5000 "operator '%0' has lower precedence than '%1'; "
5001 "'%1' will be evaluated first">, InGroup<ShiftOpParentheses>;
5003 def warn_self_assignment : Warning<
5004 "explicitly assigning value of variable of type %0 to itself">,
5005 InGroup<SelfAssignment>, DefaultIgnore;
5006 def warn_self_move : Warning<
5007 "explicitly moving variable of type %0 to itself">,
5008 InGroup<SelfMove>, DefaultIgnore;
5010 def warn_redundant_move_on_return : Warning<
5011 "redundant move in return statement">,
5012 InGroup<RedundantMove>, DefaultIgnore;
5013 def warn_pessimizing_move_on_return : Warning<
5014 "moving a local object in a return statement prevents copy elision">,
5015 InGroup<PessimizingMove>, DefaultIgnore;
5016 def warn_pessimizing_move_on_initialization : Warning<
5017 "moving a temporary object prevents copy elision">,
5018 InGroup<PessimizingMove>, DefaultIgnore;
5019 def note_remove_move : Note<"remove std::move call here">;
5021 def warn_string_plus_int : Warning<
5022 "adding %0 to a string does not append to the string">,
5023 InGroup<StringPlusInt>;
5024 def warn_string_plus_char : Warning<
5025 "adding %0 to a string pointer does not append to the string">,
5026 InGroup<StringPlusChar>;
5027 def note_string_plus_scalar_silence : Note<
5028 "use array indexing to silence this warning">;
5030 def warn_sizeof_array_param : Warning<
5031 "sizeof on array function parameter will return size of %0 instead of %1">,
5032 InGroup<SizeofArrayArgument>;
5034 def warn_sizeof_array_decay : Warning<
5035 "sizeof on pointer operation will return size of %0 instead of %1">,
5036 InGroup<SizeofArrayDecay>;
5038 def err_sizeof_nonfragile_interface : Error<
5039 "application of '%select{alignof|sizeof}1' to interface %0 is "
5040 "not supported on this architecture and platform">;
5041 def err_atdef_nonfragile_interface : Error<
5042 "use of @defs is not supported on this architecture and platform">;
5043 def err_subscript_nonfragile_interface : Error<
5044 "subscript requires size of interface %0, which is not constant for "
5045 "this architecture and platform">;
5047 def err_arithmetic_nonfragile_interface : Error<
5048 "arithmetic on pointer to interface %0, which is not a constant size for "
5049 "this architecture and platform">;
5052 def ext_subscript_non_lvalue : Extension<
5053 "ISO C90 does not allow subscripting non-lvalue array">;
5054 def err_typecheck_subscript_value : Error<
5055 "subscripted value is not an array, pointer, or vector">;
5056 def err_typecheck_subscript_not_integer : Error<
5057 "array subscript is not an integer">;
5058 def err_subscript_function_type : Error<
5059 "subscript of pointer to function type %0">;
5060 def err_subscript_incomplete_type : Error<
5061 "subscript of pointer to incomplete type %0">;
5062 def err_dereference_incomplete_type : Error<
5063 "dereference of pointer to incomplete type %0">;
5064 def ext_gnu_subscript_void_type : Extension<
5065 "subscript of a pointer to void is a GNU extension">, InGroup<PointerArith>;
5066 def err_typecheck_member_reference_struct_union : Error<
5067 "member reference base type %0 is not a structure or union">;
5068 def err_typecheck_member_reference_ivar : Error<
5069 "%0 does not have a member named %1">;
5070 def error_arc_weak_ivar_access : Error<
5071 "dereferencing a __weak pointer is not allowed due to possible "
5072 "null value caused by race condition, assign it to strong variable first">;
5073 def err_typecheck_member_reference_arrow : Error<
5074 "member reference type %0 is not a pointer">;
5075 def err_typecheck_member_reference_suggestion : Error<
5076 "member reference type %0 is %select{a|not a}1 pointer; did you mean to use '%select{->|.}1'?">;
5077 def note_typecheck_member_reference_suggestion : Note<
5078 "did you mean to use '.' instead?">;
5079 def note_member_reference_arrow_from_operator_arrow : Note<
5080 "'->' applied to return value of the operator->() declared here">;
5081 def err_typecheck_member_reference_type : Error<
5082 "cannot refer to type member %0 in %1 with '%select{.|->}2'">;
5083 def err_typecheck_member_reference_unknown : Error<
5084 "cannot refer to member %0 in %1 with '%select{.|->}2'">;
5085 def err_member_reference_needs_call : Error<
5086 "base of member reference is a function; perhaps you meant to call "
5087 "it%select{| with no arguments}0?">;
5088 def warn_subscript_is_char : Warning<"array subscript is of type 'char'">,
5089 InGroup<CharSubscript>, DefaultIgnore;
5091 def err_typecheck_incomplete_tag : Error<"incomplete definition of type %0">;
5092 def err_no_member : Error<"no member named %0 in %1">;
5093 def err_no_member_overloaded_arrow : Error<
5094 "no member named %0 in %1; did you mean to use '->' instead of '.'?">;
5096 def err_member_not_yet_instantiated : Error<
5097 "no member %0 in %1; it has not yet been instantiated">;
5098 def note_non_instantiated_member_here : Note<
5099 "not-yet-instantiated member is declared here">;
5101 def err_enumerator_does_not_exist : Error<
5102 "enumerator %0 does not exist in instantiation of %1">;
5103 def note_enum_specialized_here : Note<
5104 "enum %0 was explicitly specialized here">;
5106 def err_member_redeclared : Error<"class member cannot be redeclared">;
5107 def ext_member_redeclared : ExtWarn<"class member cannot be redeclared">,
5108 InGroup<RedeclaredClassMember>;
5109 def err_member_redeclared_in_instantiation : Error<
5110 "multiple overloads of %0 instantiate to the same signature %1">;
5111 def err_member_name_of_class : Error<"member %0 has the same name as its class">;
5112 def err_member_def_undefined_record : Error<
5113 "out-of-line definition of %0 from class %1 without definition">;
5114 def err_member_decl_does_not_match : Error<
5115 "out-of-line %select{declaration|definition}2 of %0 "
5116 "does not match any declaration in %1">;
5117 def err_friend_decl_with_def_arg_must_be_def : Error<
5118 "friend declaration specifying a default argument must be a definition">;
5119 def err_friend_decl_with_def_arg_redeclared : Error<
5120 "friend declaration specifying a default argument must be the only declaration">;
5121 def err_friend_decl_does_not_match : Error<
5122 "friend declaration of %0 does not match any declaration in %1">;
5123 def err_member_decl_does_not_match_suggest : Error<
5124 "out-of-line %select{declaration|definition}2 of %0 "
5125 "does not match any declaration in %1; did you mean %3?">;
5126 def err_member_def_does_not_match_ret_type : Error<
5127 "return type of out-of-line definition of %q0 differs from "
5128 "that in the declaration">;
5129 def err_nonstatic_member_out_of_line : Error<
5130 "non-static data member defined out-of-line">;
5131 def err_qualified_typedef_declarator : Error<
5132 "typedef declarator cannot be qualified">;
5133 def err_qualified_param_declarator : Error<
5134 "parameter declarator cannot be qualified">;
5135 def ext_out_of_line_declaration : ExtWarn<
5136 "out-of-line declaration of a member must be a definition">,
5137 InGroup<OutOfLineDeclaration>, DefaultError;
5138 def err_member_extra_qualification : Error<
5139 "extra qualification on member %0">;
5140 def warn_member_extra_qualification : Warning<
5141 err_member_extra_qualification.Text>, InGroup<MicrosoftExtraQualification>;
5142 def warn_namespace_member_extra_qualification : Warning<
5143 "extra qualification on member %0">,
5144 InGroup<DiagGroup<"extra-qualification">>;
5145 def err_member_qualification : Error<
5146 "non-friend class member %0 cannot have a qualified name">;
5147 def note_member_def_close_match : Note<"member declaration nearly matches">;
5148 def note_member_def_close_const_match : Note<
5149 "member declaration does not match because "
5150 "it %select{is|is not}0 const qualified">;
5151 def note_member_def_close_param_match : Note<
5152 "type of %ordinal0 parameter of member declaration does not match definition"
5153 "%diff{ ($ vs $)|}1,2">;
5154 def note_local_decl_close_match : Note<"local declaration nearly matches">;
5155 def note_local_decl_close_param_match : Note<
5156 "type of %ordinal0 parameter of local declaration does not match definition"
5157 "%diff{ ($ vs $)|}1,2">;
5158 def err_typecheck_ivar_variable_size : Error<
5159 "instance variables must have a constant size">;
5160 def err_ivar_reference_type : Error<
5161 "instance variables cannot be of reference type">;
5162 def err_typecheck_illegal_increment_decrement : Error<
5163 "cannot %select{decrement|increment}1 value of type %0">;
5164 def err_typecheck_expect_int : Error<
5165 "used type %0 where integer is required">;
5166 def err_typecheck_arithmetic_incomplete_type : Error<
5167 "arithmetic on a pointer to an incomplete type %0">;
5168 def err_typecheck_pointer_arith_function_type : Error<
5169 "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 "
5170 "function type%select{|s}2 %1%select{| and %3}2">;
5171 def err_typecheck_pointer_arith_void_type : Error<
5172 "arithmetic on%select{ a|}0 pointer%select{|s}0 to void">;
5173 def err_typecheck_decl_incomplete_type : Error<
5174 "variable has incomplete type %0">;
5175 def err_typecheck_decl_incomplete_type___float128 : Error<
5176 "support for type '__float128' is not yet implemented">;
5177 def ext_typecheck_decl_incomplete_type : ExtWarn<
5178 "tentative definition of variable with internal linkage has incomplete non-array type %0">,
5179 InGroup<DiagGroup<"tentative-definition-incomplete-type">>;
5180 def err_tentative_def_incomplete_type : Error<
5181 "tentative definition has type %0 that is never completed">;
5182 def warn_tentative_incomplete_array : Warning<
5183 "tentative array definition assumed to have one element">;
5184 def err_typecheck_incomplete_array_needs_initializer : Error<
5185 "definition of variable with array type needs an explicit size "
5186 "or an initializer">;
5187 def err_array_init_not_init_list : Error<
5188 "array initializer must be an initializer "
5189 "list%select{| or string literal| or wide string literal}0">;
5190 def err_array_init_narrow_string_into_wchar : Error<
5191 "initializing wide char array with non-wide string literal">;
5192 def err_array_init_wide_string_into_char : Error<
5193 "initializing char array with wide string literal">;
5194 def err_array_init_incompat_wide_string_into_wchar : Error<
5195 "initializing wide char array with incompatible wide string literal">;
5196 def err_array_init_different_type : Error<
5197 "cannot initialize array %diff{of type $ with array of type $|"
5198 "with different type of array}0,1">;
5199 def err_array_init_non_constant_array : Error<
5200 "cannot initialize array %diff{of type $ with non-constant array of type $|"
5201 "with different type of array}0,1">;
5202 def ext_array_init_copy : Extension<
5203 "initialization of an array "
5204 "%diff{of type $ from a compound literal of type $|"
5205 "from a compound literal}0,1 is a GNU extension">, InGroup<GNUCompoundLiteralInitializer>;
5206 // This is intentionally not disabled by -Wno-gnu.
5207 def ext_array_init_parens : ExtWarn<
5208 "parenthesized initialization of a member array is a GNU extension">,
5209 InGroup<DiagGroup<"gnu-array-member-paren-init">>, DefaultError;
5210 def warn_deprecated_string_literal_conversion : Warning<
5211 "conversion from string literal to %0 is deprecated">,
5212 InGroup<CXX11CompatDeprecatedWritableStr>;
5213 def ext_deprecated_string_literal_conversion : ExtWarn<
5214 "ISO C++11 does not allow conversion from string literal to %0">,
5215 InGroup<WritableStrings>, SFINAEFailure;
5216 def err_realimag_invalid_type : Error<"invalid type %0 to %1 operator">;
5217 def err_typecheck_sclass_fscope : Error<
5218 "illegal storage class on file-scoped variable">;
5219 def warn_standalone_specifier : Warning<"'%0' ignored on this declaration">,
5220 InGroup<MissingDeclarations>;
5221 def ext_standalone_specifier : ExtWarn<"'%0' is not permitted on a declaration "
5222 "of a type">, InGroup<MissingDeclarations>;
5223 def err_standalone_class_nested_name_specifier : Error<
5224 "forward declaration of %select{class|struct|interface|union|enum}0 cannot "
5225 "have a nested name specifier">;
5226 def err_typecheck_sclass_func : Error<"illegal storage class on function">;
5227 def err_static_block_func : Error<
5228 "function declared in block scope cannot have 'static' storage class">;
5229 def err_typecheck_address_of : Error<"address of %select{bit-field"
5230 "|vector element|property expression|register variable}0 requested">;
5231 def ext_typecheck_addrof_void : Extension<
5232 "ISO C forbids taking the address of an expression of type 'void'">;
5233 def err_unqualified_pointer_member_function : Error<
5234 "must explicitly qualify name of member function when taking its address">;
5235 def err_invalid_form_pointer_member_function : Error<
5236 "cannot create a non-constant pointer to member function">;
5237 def err_address_of_function_with_pass_object_size_params: Error<
5238 "cannot take address of function %0 because parameter %1 has "
5239 "pass_object_size attribute">;
5240 def err_parens_pointer_member_function : Error<
5241 "cannot parenthesize the name of a method when forming a member pointer">;
5242 def err_typecheck_invalid_lvalue_addrof_addrof_function : Error<
5243 "extra '&' taking address of overloaded function">;
5244 def err_typecheck_invalid_lvalue_addrof : Error<
5245 "cannot take the address of an rvalue of type %0">;
5246 def ext_typecheck_addrof_temporary : ExtWarn<
5247 "taking the address of a temporary object of type %0">,
5248 InGroup<DiagGroup<"address-of-temporary">>, DefaultError;
5249 def err_typecheck_addrof_temporary : Error<
5250 "taking the address of a temporary object of type %0">;
5251 def err_typecheck_addrof_dtor : Error<
5252 "taking the address of a destructor">;
5253 def err_typecheck_unary_expr : Error<
5254 "invalid argument type %0 to unary expression">;
5255 def err_typecheck_indirection_requires_pointer : Error<
5256 "indirection requires pointer operand (%0 invalid)">;
5257 def ext_typecheck_indirection_through_void_pointer : ExtWarn<
5258 "ISO C++ does not allow indirection on operand of type %0">,
5259 InGroup<DiagGroup<"void-ptr-dereference">>;
5260 def warn_indirection_through_null : Warning<
5261 "indirection of non-volatile null pointer will be deleted, not trap">, InGroup<NullDereference>;
5262 def note_indirection_through_null : Note<
5263 "consider using __builtin_trap() or qualifying pointer with 'volatile'">;
5264 def warn_pointer_indirection_from_incompatible_type : Warning<
5265 "dereference of type %1 that was reinterpret_cast from type %0 has undefined "
5267 InGroup<UndefinedReinterpretCast>, DefaultIgnore;
5269 def err_objc_object_assignment : Error<
5270 "cannot assign to class object (%0 invalid)">;
5271 def err_typecheck_invalid_operands : Error<
5272 "invalid operands to binary expression (%0 and %1)">;
5273 def err_typecheck_sub_ptr_compatible : Error<
5274 "%diff{$ and $ are not pointers to compatible types|"
5275 "pointers to incompatible types}0,1">;
5276 def ext_typecheck_ordered_comparison_of_pointer_integer : ExtWarn<
5277 "ordered comparison between pointer and integer (%0 and %1)">;
5278 def ext_typecheck_ordered_comparison_of_pointer_and_zero : Extension<
5279 "ordered comparison between pointer and zero (%0 and %1) is an extension">;
5280 def ext_typecheck_ordered_comparison_of_function_pointers : ExtWarn<
5281 "ordered comparison of function pointers (%0 and %1)">;
5282 def ext_typecheck_comparison_of_fptr_to_void : Extension<
5283 "equality comparison between function pointer and void pointer (%0 and %1)">;
5284 def err_typecheck_comparison_of_fptr_to_void : Error<
5285 "equality comparison between function pointer and void pointer (%0 and %1)">;
5286 def ext_typecheck_comparison_of_pointer_integer : ExtWarn<
5287 "comparison between pointer and integer (%0 and %1)">;
5288 def err_typecheck_comparison_of_pointer_integer : Error<
5289 "comparison between pointer and integer (%0 and %1)">;
5290 def ext_typecheck_comparison_of_distinct_pointers : ExtWarn<
5291 "comparison of distinct pointer types%diff{ ($ and $)|}0,1">,
5292 InGroup<CompareDistinctPointerType>;
5293 def ext_typecheck_cond_incompatible_operands : ExtWarn<
5294 "incompatible operand types (%0 and %1)">;
5295 def err_cond_voidptr_arc : Error <
5296 "operands to conditional of types%diff{ $ and $|}0,1 are incompatible "
5298 def err_typecheck_comparison_of_distinct_pointers : Error<
5299 "comparison of distinct pointer types%diff{ ($ and $)|}0,1">;
5300 def ext_typecheck_comparison_of_distinct_pointers_nonstandard : ExtWarn<
5301 "comparison of distinct pointer types (%0 and %1) uses non-standard "
5302 "composite pointer type %2">, InGroup<CompareDistinctPointerType>;
5303 def err_typecheck_op_on_nonoverlapping_address_space_pointers : Error<
5304 "%select{comparison between %diff{ ($ and $)|}0,1"
5305 "|arithmetic operation with operands of type %diff{ ($ and $)|}0,1}2"
5306 " which are pointers to non-overlapping address spaces">;
5308 def err_typecheck_assign_const : Error<
5310 "cannot assign to return value because function %1 returns a const value|"
5311 "cannot assign to variable %1 with const-qualified type %2|"
5312 "cannot assign to %select{non-|}1static data member %2 "
5313 "with const-qualified type %3|"
5314 "cannot assign to non-static data member within const member function %1|"
5315 "read-only variable is not assignable}0">;
5317 def note_typecheck_assign_const : Note<
5319 "function %1 which returns const-qualified type %2 declared here|"
5320 "variable %1 declared const here|"
5321 "%select{non-|}1static data member %2 declared const here|"
5322 "member function %q1 is declared const here}0">;
5324 def warn_mixed_sign_comparison : Warning<
5325 "comparison of integers of different signs: %0 and %1">,
5326 InGroup<SignCompare>, DefaultIgnore;
5327 def warn_lunsigned_always_true_comparison : Warning<
5328 "comparison of unsigned%select{| enum}2 expression %0 is always %1">,
5329 InGroup<TautologicalCompare>;
5330 def warn_out_of_range_compare : Warning<
5331 "comparison of %select{constant %0|true|false}1 with "
5332 "%select{expression of type %2|boolean expression}3 is always "
5333 "%select{false|true}4">, InGroup<TautologicalOutOfRangeCompare>;
5334 def warn_runsigned_always_true_comparison : Warning<
5335 "comparison of %0 unsigned%select{| enum}2 expression is always %1">,
5336 InGroup<TautologicalCompare>;
5337 def warn_comparison_of_mixed_enum_types : Warning<
5338 "comparison of two values with different enumeration types"
5339 "%diff{ ($ and $)|}0,1">,
5340 InGroup<DiagGroup<"enum-compare">>;
5341 def warn_null_in_arithmetic_operation : Warning<
5342 "use of NULL in arithmetic operation">,
5343 InGroup<NullArithmetic>;
5344 def warn_null_in_comparison_operation : Warning<
5345 "comparison between NULL and non-pointer "
5346 "%select{(%1 and NULL)|(NULL and %1)}0">,
5347 InGroup<NullArithmetic>;
5348 def err_shift_rhs_only_vector : Error<
5349 "requested shift is a vector of type %0 but the first operand is not a "
5352 def warn_logical_not_on_lhs_of_comparison : Warning<
5353 "logical not is only applied to the left hand side of this comparison">,
5354 InGroup<LogicalNotParentheses>;
5355 def note_logical_not_fix : Note<
5356 "add parentheses after the '!' to evaluate the comparison first">;
5357 def note_logical_not_silence_with_parens : Note<
5358 "add parentheses around left hand side expression to silence this warning">;
5360 def err_invalid_this_use : Error<
5361 "invalid use of 'this' outside of a non-static member function">;
5362 def err_this_static_member_func : Error<
5363 "'this' cannot be%select{| implicitly}0 used in a static member function "
5365 def err_invalid_member_use_in_static_method : Error<
5366 "invalid use of member %0 in static member function">;
5367 def err_invalid_qualified_function_type : Error<
5368 "%select{static |non-}0member function %select{of type %2 |}1"
5369 "cannot have '%3' qualifier">;
5370 def err_compound_qualified_function_type : Error<
5371 "%select{block pointer|pointer|reference}0 to function type %select{%2 |}1"
5372 "cannot have '%3' qualifier">;
5374 def err_ref_qualifier_overload : Error<
5375 "cannot overload a member function %select{without a ref-qualifier|with "
5376 "ref-qualifier '&'|with ref-qualifier '&&'}0 with a member function %select{"
5377 "without a ref-qualifier|with ref-qualifier '&'|with ref-qualifier '&&'}1">;
5379 def err_invalid_non_static_member_use : Error<
5380 "invalid use of non-static data member %0">;
5381 def err_nested_non_static_member_use : Error<
5382 "%select{call to non-static member function|use of non-static data member}0 "
5383 "%2 of %1 from nested type %3">;
5384 def warn_cxx98_compat_non_static_member_use : Warning<
5385 "use of non-static data member %0 in an unevaluated context is "
5386 "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
5387 def err_invalid_incomplete_type_use : Error<
5388 "invalid use of incomplete type %0">;
5389 def err_builtin_func_cast_more_than_one_arg : Error<
5390 "function-style cast to a builtin type can only take one argument">;
5391 def err_value_init_for_array_type : Error<
5392 "array types cannot be value-initialized">;
5393 def err_value_init_for_function_type : Error<
5394 "function types cannot be value-initialized">;
5395 def warn_format_nonliteral_noargs : Warning<
5396 "format string is not a string literal (potentially insecure)">,
5397 InGroup<FormatSecurity>;
5398 def warn_format_nonliteral : Warning<
5399 "format string is not a string literal">,
5400 InGroup<FormatNonLiteral>, DefaultIgnore;
5402 def err_unexpected_interface : Error<
5403 "unexpected interface name %0: expected expression">;
5404 def err_ref_non_value : Error<"%0 does not refer to a value">;
5405 def err_ref_vm_type : Error<
5406 "cannot refer to declaration with a variably modified type inside block">;
5407 def err_ref_flexarray_type : Error<
5408 "cannot refer to declaration of structure variable with flexible array member "
5410 def err_ref_array_type : Error<
5411 "cannot refer to declaration with an array type inside block">;
5412 def err_property_not_found : Error<
5413 "property %0 not found on object of type %1">;
5414 def err_invalid_property_name : Error<
5415 "%0 is not a valid property name (accessing an object of type %1)">;
5416 def err_getter_not_found : Error<
5417 "no getter method for read from property">;
5418 def err_objc_subscript_method_not_found : Error<
5419 "expected method to %select{read|write}1 %select{dictionary|array}2 element not "
5420 "found on object of type %0">;
5421 def err_objc_subscript_index_type : Error<
5422 "method index parameter type %0 is not integral type">;
5423 def err_objc_subscript_key_type : Error<
5424 "method key parameter type %0 is not object type">;
5425 def err_objc_subscript_dic_object_type : Error<
5426 "method object parameter type %0 is not object type">;
5427 def err_objc_subscript_object_type : Error<
5428 "cannot assign to this %select{dictionary|array}1 because assigning method's "
5429 "2nd parameter of type %0 is not an Objective-C pointer type">;
5430 def err_objc_subscript_base_type : Error<
5431 "%select{dictionary|array}1 subscript base type %0 is not an Objective-C object">;
5432 def err_objc_multiple_subscript_type_conversion : Error<
5433 "indexing expression is invalid because subscript type %0 has "
5434 "multiple type conversion functions">;
5435 def err_objc_subscript_type_conversion : Error<
5436 "indexing expression is invalid because subscript type %0 is not an integral"
5437 " or Objective-C pointer type">;
5438 def err_objc_subscript_pointer : Error<
5439 "indexing expression is invalid because subscript type %0 is not an"
5440 " Objective-C pointer">;
5441 def err_objc_indexing_method_result_type : Error<
5442 "method for accessing %select{dictionary|array}1 element must have Objective-C"
5443 " object return type instead of %0">;
5444 def err_objc_index_incomplete_class_type : Error<
5445 "Objective-C index expression has incomplete class type %0">;
5446 def err_illegal_container_subscripting_op : Error<
5447 "illegal operation on Objective-C container subscripting">;
5448 def err_property_not_found_forward_class : Error<
5449 "property %0 cannot be found in forward class object %1">;
5450 def err_property_not_as_forward_class : Error<
5451 "property %0 refers to an incomplete Objective-C class %1 "
5452 "(with no @interface available)">;
5453 def note_forward_class : Note<
5454 "forward declaration of class here">;
5455 def err_duplicate_property : Error<
5456 "property has a previous declaration">;
5457 def ext_gnu_void_ptr : Extension<
5458 "arithmetic on%select{ a|}0 pointer%select{|s}0 to void is a GNU extension">,
5459 InGroup<PointerArith>;
5460 def ext_gnu_ptr_func_arith : Extension<
5461 "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 function "
5462 "type%select{|s}2 %1%select{| and %3}2 is a GNU extension">,
5463 InGroup<PointerArith>;
5464 def error_readonly_message_assignment : Error<
5465 "assigning to 'readonly' return result of an Objective-C message not allowed">;
5466 def ext_integer_increment_complex : Extension<
5467 "ISO C does not support '++'/'--' on complex integer type %0">;
5468 def ext_integer_complement_complex : Extension<
5469 "ISO C does not support '~' for complex conjugation of %0">;
5470 def err_nosetter_property_assignment : Error<
5471 "%select{assignment to readonly property|"
5472 "no setter method %1 for assignment to property}0">;
5473 def err_nosetter_property_incdec : Error<
5474 "%select{%select{increment|decrement}1 of readonly property|"
5475 "no setter method %2 for %select{increment|decrement}1 of property}0">;
5476 def err_nogetter_property_compound_assignment : Error<
5477 "a getter method is needed to perform a compound assignment on a property">;
5478 def err_nogetter_property_incdec : Error<
5479 "no getter method %1 for %select{increment|decrement}0 of property">;
5480 def error_no_subobject_property_setting : Error<
5481 "expression is not assignable">;
5482 def err_qualified_objc_access : Error<
5483 "%select{property|instance variable}0 access cannot be qualified with '%1'">;
5485 def ext_freestanding_complex : Extension<
5486 "complex numbers are an extension in a freestanding C99 implementation">;
5488 // FIXME: Remove when we support imaginary.
5489 def err_imaginary_not_supported : Error<"imaginary types are not supported">;
5491 // Obj-c expressions
5492 def warn_root_inst_method_not_found : Warning<
5493 "instance method %0 is being used on 'Class' which is not in the root class">,
5494 InGroup<MethodAccess>;
5495 def warn_class_method_not_found : Warning<
5496 "class method %objcclass0 not found (return type defaults to 'id')">,
5497 InGroup<MethodAccess>;
5498 def warn_instance_method_on_class_found : Warning<
5499 "instance method %0 found instead of class method %1">,
5500 InGroup<MethodAccess>;
5501 def warn_inst_method_not_found : Warning<
5502 "instance method %objcinstance0 not found (return type defaults to 'id')">,
5503 InGroup<MethodAccess>;
5504 def warn_instance_method_not_found_with_typo : Warning<
5505 "instance method %objcinstance0 not found (return type defaults to 'id')"
5506 "; did you mean %objcinstance2?">, InGroup<MethodAccess>;
5507 def warn_class_method_not_found_with_typo : Warning<
5508 "class method %objcclass0 not found (return type defaults to 'id')"
5509 "; did you mean %objcclass2?">, InGroup<MethodAccess>;
5510 def error_method_not_found_with_typo : Error<
5511 "%select{instance|class}1 method %0 not found "
5512 "; did you mean %2?">;
5513 def error_no_super_class_message : Error<
5514 "no @interface declaration found in class messaging of %0">;
5515 def error_root_class_cannot_use_super : Error<
5516 "%0 cannot use 'super' because it is a root class">;
5517 def err_invalid_receiver_to_message_super : Error<
5518 "'super' is only valid in a method body">;
5519 def err_invalid_receiver_class_message : Error<
5520 "receiver type %0 is not an Objective-C class">;
5521 def err_missing_open_square_message_send : Error<
5522 "missing '[' at start of message send expression">;
5523 def warn_bad_receiver_type : Warning<
5524 "receiver type %0 is not 'id' or interface pointer, consider "
5525 "casting it to 'id'">,InGroup<ObjCReceiver>;
5526 def err_bad_receiver_type : Error<"bad receiver type %0">;
5527 def err_incomplete_receiver_type : Error<"incomplete receiver type %0">;
5528 def err_unknown_receiver_suggest : Error<
5529 "unknown receiver %0; did you mean %1?">;
5530 def error_objc_throw_expects_object : Error<
5531 "@throw requires an Objective-C object type (%0 invalid)">;
5532 def error_objc_synchronized_expects_object : Error<
5533 "@synchronized requires an Objective-C object type (%0 invalid)">;
5534 def error_rethrow_used_outside_catch : Error<
5535 "@throw (rethrow) used outside of a @catch block">;
5536 def err_attribute_multiple_objc_gc : Error<
5537 "multiple garbage collection attributes specified for type">;
5538 def err_catch_param_not_objc_type : Error<
5539 "@catch parameter is not a pointer to an interface type">;
5540 def err_illegal_qualifiers_on_catch_parm : Error<
5541 "illegal qualifiers on @catch parameter">;
5542 def err_storage_spec_on_catch_parm : Error<
5543 "@catch parameter cannot have storage specifier '%0'">;
5544 def warn_register_objc_catch_parm : Warning<
5545 "'register' storage specifier on @catch parameter will be ignored">;
5546 def err_qualified_objc_catch_parm : Error<
5547 "@catch parameter declarator cannot be qualified">;
5548 def warn_objc_pointer_cxx_catch_fragile : Warning<
5549 "cannot catch an exception thrown with @throw in C++ in the non-unified "
5550 "exception model">, InGroup<ObjCNonUnifiedException>;
5551 def err_objc_object_catch : Error<
5552 "cannot catch an Objective-C object by value">;
5553 def err_incomplete_type_objc_at_encode : Error<
5554 "'@encode' of incomplete type %0">;
5555 def warn_objc_circular_container : Warning<
5556 "adding '%0' to '%1' might cause circular dependency in container">,
5557 InGroup<DiagGroup<"objc-circular-container">>;
5558 def note_objc_circular_container_declared_here : Note<"'%0' declared here">;
5560 def warn_setter_getter_impl_required : Warning<
5561 "property %0 requires method %1 to be defined - "
5562 "use @synthesize, @dynamic or provide a method implementation "
5563 "in this class implementation">,
5564 InGroup<ObjCPropertyImpl>;
5565 def warn_setter_getter_impl_required_in_category : Warning<
5566 "property %0 requires method %1 to be defined - "
5567 "use @dynamic or provide a method implementation in this category">,
5568 InGroup<ObjCPropertyImpl>;
5569 def note_parameter_named_here : Note<
5570 "passing argument to parameter %0 here">;
5571 def note_parameter_here : Note<
5572 "passing argument to parameter here">;
5573 def note_method_return_type_change : Note<
5574 "compiler has implicitly changed method %0 return type">;
5577 // These messages adhere to the TryCast pattern: %0 is an int specifying the
5578 // cast type, %1 is the source type, %2 is the destination type.
5579 def err_bad_reinterpret_cast_overload : Error<
5580 "reinterpret_cast cannot resolve overloaded function %0 to type %1">;
5582 def warn_reinterpret_different_from_static : Warning<
5583 "'reinterpret_cast' %select{from|to}3 class %0 %select{to|from}3 its "
5584 "%select{virtual base|base at non-zero offset}2 %1 behaves differently from "
5585 "'static_cast'">, InGroup<ReinterpretBaseClass>;
5586 def note_reinterpret_updowncast_use_static: Note<
5587 "use 'static_cast' to adjust the pointer correctly while "
5588 "%select{upcasting|downcasting}0">;
5590 def err_bad_static_cast_overload : Error<
5591 "address of overloaded function %0 cannot be static_cast to type %1">;
5593 def err_bad_cstyle_cast_overload : Error<
5594 "address of overloaded function %0 cannot be cast to type %1">;
5597 def err_bad_cxx_cast_generic : Error<
5598 "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
5599 "functional-style cast}0 from %1 to %2 is not allowed">;
5600 def err_bad_cxx_cast_unrelated_class : Error<
5601 "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
5602 "functional-style cast}0 from %1 to %2, which are not related by "
5603 "inheritance, is not allowed">;
5604 def note_type_incomplete : Note<"%0 is incomplete">;
5605 def err_bad_cxx_cast_rvalue : Error<
5606 "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
5607 "functional-style cast}0 from rvalue to reference type %2">;
5608 def err_bad_cxx_cast_bitfield : Error<
5609 "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
5610 "functional-style cast}0 from bit-field lvalue to reference type %2">;
5611 def err_bad_cxx_cast_qualifiers_away : Error<
5612 "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
5613 "functional-style cast}0 from %1 to %2 casts away qualifiers">;
5614 def err_bad_const_cast_dest : Error<
5615 "%select{const_cast||||C-style cast|functional-style cast}0 to %2, "
5616 "which is not a reference, pointer-to-object, or pointer-to-data-member">;
5617 def ext_cast_fn_obj : Extension<
5618 "cast between pointer-to-function and pointer-to-object is an extension">;
5619 def ext_ms_cast_fn_obj : ExtWarn<
5620 "static_cast between pointer-to-function and pointer-to-object is a "
5621 "Microsoft extension">, InGroup<MicrosoftCast>;
5622 def warn_cxx98_compat_cast_fn_obj : Warning<
5623 "cast between pointer-to-function and pointer-to-object is incompatible with C++98">,
5624 InGroup<CXX98CompatPedantic>, DefaultIgnore;
5625 def err_bad_reinterpret_cast_small_int : Error<
5626 "cast from pointer to smaller type %2 loses information">;
5627 def err_bad_cxx_cast_vector_to_scalar_different_size : Error<
5628 "%select{||reinterpret_cast||C-style cast|}0 from vector %1 "
5629 "to scalar %2 of different size">;
5630 def err_bad_cxx_cast_scalar_to_vector_different_size : Error<
5631 "%select{||reinterpret_cast||C-style cast|}0 from scalar %1 "
5632 "to vector %2 of different size">;
5633 def err_bad_cxx_cast_vector_to_vector_different_size : Error<
5634 "%select{||reinterpret_cast||C-style cast|}0 from vector %1 "
5635 "to vector %2 of different size">;
5636 def err_bad_lvalue_to_rvalue_cast : Error<
5637 "cannot cast from lvalue of type %1 to rvalue reference type %2; types are "
5639 def err_bad_static_cast_pointer_nonpointer : Error<
5640 "cannot cast from type %1 to pointer type %2">;
5641 def err_bad_static_cast_member_pointer_nonmp : Error<
5642 "cannot cast from type %1 to member pointer type %2">;
5643 def err_bad_cxx_cast_member_pointer_size : Error<
5644 "cannot %select{||reinterpret_cast||C-style cast|}0 from member pointer "
5645 "type %1 to member pointer type %2 of different size">;
5646 def err_bad_reinterpret_cast_reference : Error<
5647 "reinterpret_cast of a %0 to %1 needs its address, which is not allowed">;
5648 def warn_undefined_reinterpret_cast : Warning<
5649 "reinterpret_cast from %0 to %1 has undefined behavior">,
5650 InGroup<UndefinedReinterpretCast>, DefaultIgnore;
5652 // These messages don't adhere to the pattern.
5653 // FIXME: Display the path somehow better.
5654 def err_ambiguous_base_to_derived_cast : Error<
5655 "ambiguous cast from base %0 to derived %1:%2">;
5656 def err_static_downcast_via_virtual : Error<
5657 "cannot cast %0 to %1 via virtual base %2">;
5658 def err_downcast_from_inaccessible_base : Error<
5659 "cannot cast %select{private|protected}2 base class %1 to %0">;
5660 def err_upcast_to_inaccessible_base : Error<
5661 "cannot cast %0 to its %select{private|protected}2 base class %1">;
5662 def err_bad_dynamic_cast_not_ref_or_ptr : Error<
5663 "%0 is not a reference or pointer">;
5664 def err_bad_dynamic_cast_not_class : Error<"%0 is not a class">;
5665 def err_bad_dynamic_cast_incomplete : Error<"%0 is an incomplete type">;
5666 def err_bad_dynamic_cast_not_ptr : Error<"%0 is not a pointer">;
5667 def err_bad_dynamic_cast_not_polymorphic : Error<"%0 is not polymorphic">;
5669 // Other C++ expressions
5670 def err_need_header_before_typeid : Error<
5671 "you need to include <typeinfo> before using the 'typeid' operator">;
5672 def err_need_header_before_ms_uuidof : Error<
5673 "you need to include <guiddef.h> before using the '__uuidof' operator">;
5674 def err_ms___leave_not_in___try : Error<
5675 "'__leave' statement not in __try block">;
5676 def err_uuidof_without_guid : Error<
5677 "cannot call operator __uuidof on a type with no GUID">;
5678 def err_uuidof_with_multiple_guids : Error<
5679 "cannot call operator __uuidof on a type with multiple GUIDs">;
5680 def err_incomplete_typeid : Error<"'typeid' of incomplete type %0">;
5681 def err_variably_modified_typeid : Error<"'typeid' of variably modified type %0">;
5682 def err_static_illegal_in_new : Error<
5683 "the 'static' modifier for the array size is not legal in new expressions">;
5684 def err_array_new_needs_size : Error<
5685 "array size must be specified in new expressions">;
5686 def err_bad_new_type : Error<
5687 "cannot allocate %select{function|reference}1 type %0 with new">;
5688 def err_new_incomplete_type : Error<
5689 "allocation of incomplete type %0">;
5690 def err_new_array_nonconst : Error<
5691 "only the first dimension of an allocated array may have dynamic size">;
5692 def err_new_array_init_args : Error<
5693 "array 'new' cannot have initialization arguments">;
5694 def ext_new_paren_array_nonconst : ExtWarn<
5695 "when type is in parentheses, array cannot have dynamic size">;
5696 def err_placement_new_non_placement_delete : Error<
5697 "'new' expression with placement arguments refers to non-placement "
5698 "'operator delete'">;
5699 def err_array_size_not_integral : Error<
5700 "array size expression must have integral or %select{|unscoped }0"
5701 "enumeration type, not %1">;
5702 def err_array_size_incomplete_type : Error<
5703 "array size expression has incomplete class type %0">;
5704 def err_array_size_explicit_conversion : Error<
5705 "array size expression of type %0 requires explicit conversion to type %1">;
5706 def note_array_size_conversion : Note<
5707 "conversion to %select{integral|enumeration}0 type %1 declared here">;
5708 def err_array_size_ambiguous_conversion : Error<
5709 "ambiguous conversion of array size expression of type %0 to an integral or "
5710 "enumeration type">;
5711 def ext_array_size_conversion : Extension<
5712 "implicit conversion from array size expression of type %0 to "
5713 "%select{integral|enumeration}1 type %2 is a C++11 extension">,
5715 def warn_cxx98_compat_array_size_conversion : Warning<
5716 "implicit conversion from array size expression of type %0 to "
5717 "%select{integral|enumeration}1 type %2 is incompatible with C++98">,
5718 InGroup<CXX98CompatPedantic>, DefaultIgnore;
5719 def err_address_space_qualified_new : Error<
5720 "'new' cannot allocate objects of type %0 in address space '%1'">;
5721 def err_address_space_qualified_delete : Error<
5722 "'delete' cannot delete objects of type %0 in address space '%1'">;
5724 def err_default_init_const : Error<
5725 "default initialization of an object of const type %0"
5726 "%select{| without a user-provided default constructor}1">;
5727 def ext_default_init_const : ExtWarn<
5728 "default initialization of an object of const type %0"
5729 "%select{| without a user-provided default constructor}1 "
5730 "is a Microsoft extension">,
5731 InGroup<MicrosoftConstInit>;
5732 def err_delete_operand : Error<"cannot delete expression of type %0">;
5733 def ext_delete_void_ptr_operand : ExtWarn<
5734 "cannot delete expression with pointer-to-'void' type %0">,
5735 InGroup<DeleteIncomplete>;
5736 def err_ambiguous_delete_operand : Error<
5737 "ambiguous conversion of delete expression of type %0 to a pointer">;
5738 def warn_delete_incomplete : Warning<
5739 "deleting pointer to incomplete type %0 may cause undefined behavior">,
5740 InGroup<DeleteIncomplete>;
5741 def err_delete_incomplete_class_type : Error<
5742 "deleting incomplete class type %0; no conversions to pointer type">;
5743 def err_delete_explicit_conversion : Error<
5744 "converting delete expression from type %0 to type %1 invokes an explicit "
5745 "conversion function">;
5746 def note_delete_conversion : Note<"conversion to pointer type %0">;
5747 def warn_delete_array_type : Warning<
5748 "'delete' applied to a pointer-to-array type %0 treated as 'delete[]'">;
5749 def warn_mismatched_delete_new : Warning<
5750 "'delete%select{|[]}0' applied to a pointer that was allocated with "
5751 "'new%select{[]|}0'; did you mean 'delete%select{[]|}0'?">,
5752 InGroup<DiagGroup<"mismatched-new-delete">>;
5753 def note_allocated_here : Note<"allocated with 'new%select{[]|}0' here">;
5754 def err_no_suitable_delete_member_function_found : Error<
5755 "no suitable member %0 in %1">;
5756 def err_ambiguous_suitable_delete_member_function_found : Error<
5757 "multiple suitable %0 functions in %1">;
5758 def note_member_declared_here : Note<
5759 "member %0 declared here">;
5760 def err_decrement_bool : Error<"cannot decrement expression of type bool">;
5761 def warn_increment_bool : Warning<
5762 "incrementing expression of type bool is deprecated and "
5763 "incompatible with C++1z">, InGroup<DeprecatedIncrementBool>;
5764 def ext_increment_bool : ExtWarn<
5765 "ISO C++1z does not allow incrementing expression of type bool">,
5766 DefaultError, InGroup<IncrementBool>;
5767 def err_increment_decrement_enum : Error<
5768 "cannot %select{decrement|increment}0 expression of enum type %1">;
5769 def err_catch_incomplete_ptr : Error<
5770 "cannot catch pointer to incomplete type %0">;
5771 def err_catch_incomplete_ref : Error<
5772 "cannot catch reference to incomplete type %0">;
5773 def err_catch_incomplete : Error<"cannot catch incomplete type %0">;
5774 def err_catch_rvalue_ref : Error<"cannot catch exceptions by rvalue reference">;
5775 def err_qualified_catch_declarator : Error<
5776 "exception declarator cannot be qualified">;
5777 def err_early_catch_all : Error<"catch-all handler must come last">;
5778 def err_bad_memptr_rhs : Error<
5779 "right hand operand to %0 has non-pointer-to-member type %1">;
5780 def err_bad_memptr_lhs : Error<
5781 "left hand operand to %0 must be a %select{|pointer to }1class "
5782 "compatible with the right hand operand, but is %2">;
5783 def warn_exception_caught_by_earlier_handler : Warning<
5784 "exception of type %0 will be caught by earlier handler">,
5785 InGroup<Exceptions>;
5786 def note_previous_exception_handler : Note<"for type %0">;
5787 def err_exceptions_disabled : Error<
5788 "cannot use '%0' with exceptions disabled">;
5789 def err_objc_exceptions_disabled : Error<
5790 "cannot use '%0' with Objective-C exceptions disabled">;
5791 def err_seh_try_outside_functions : Error<
5792 "cannot use SEH '__try' in blocks, captured regions, or Obj-C method decls">;
5793 def err_mixing_cxx_try_seh_try : Error<
5794 "cannot use C++ 'try' in the same function as SEH '__try'">;
5795 def err_seh_try_unsupported : Error<
5796 "SEH '__try' is not supported on this target">;
5797 def note_conflicting_try_here : Note<
5798 "conflicting %0 here">;
5799 def warn_jump_out_of_seh_finally : Warning<
5800 "jump out of __finally block has undefined behavior">,
5801 InGroup<DiagGroup<"jump-seh-finally">>;
5802 def warn_non_virtual_dtor : Warning<
5803 "%0 has virtual functions but non-virtual destructor">,
5804 InGroup<NonVirtualDtor>, DefaultIgnore;
5805 def warn_delete_non_virtual_dtor : Warning<
5806 "delete called on non-final %0 that has virtual functions "
5807 "but non-virtual destructor">,
5808 InGroup<DeleteNonVirtualDtor>, DefaultIgnore;
5809 def warn_delete_abstract_non_virtual_dtor : Warning<
5810 "delete called on %0 that is abstract but has non-virtual destructor">,
5811 InGroup<DeleteNonVirtualDtor>;
5812 def warn_overloaded_virtual : Warning<
5813 "%q0 hides overloaded virtual %select{function|functions}1">,
5814 InGroup<OverloadedVirtual>, DefaultIgnore;
5815 def note_hidden_overloaded_virtual_declared_here : Note<
5816 "hidden overloaded virtual function %q0 declared here"
5817 "%select{|: different classes%diff{ ($ vs $)|}2,3"
5818 "|: different number of parameters (%2 vs %3)"
5819 "|: type mismatch at %ordinal2 parameter%diff{ ($ vs $)|}3,4"
5820 "|: different return type%diff{ ($ vs $)|}2,3"
5821 "|: different qualifiers ("
5822 "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
5823 "volatile and restrict|const, volatile, and restrict}2 vs "
5824 "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
5825 "volatile and restrict|const, volatile, and restrict}3)}1">;
5826 def warn_using_directive_in_header : Warning<
5827 "using namespace directive in global context in header">,
5828 InGroup<HeaderHygiene>, DefaultIgnore;
5829 def warn_overaligned_type : Warning<
5830 "type %0 requires %1 bytes of alignment and the default allocator only "
5831 "guarantees %2 bytes">,
5832 InGroup<OveralignedType>, DefaultIgnore;
5834 def err_conditional_void_nonvoid : Error<
5835 "%select{left|right}1 operand to ? is void, but %select{right|left}1 operand "
5837 def err_conditional_ambiguous : Error<
5838 "conditional expression is ambiguous; "
5839 "%diff{$ can be converted to $ and vice versa|"
5840 "types can be convert to each other}0,1">;
5841 def err_conditional_ambiguous_ovl : Error<
5842 "conditional expression is ambiguous; %diff{$ and $|types}0,1 "
5843 "can be converted to several common types">;
5844 def err_conditional_vector_size : Error<
5845 "vector condition type %0 and result type %1 do not have the same number "
5847 def err_conditional_vector_element_size : Error<
5848 "vector condition type %0 and result type %1 do not have elements of the "
5851 def err_throw_incomplete : Error<
5852 "cannot throw object of incomplete type %0">;
5853 def err_throw_incomplete_ptr : Error<
5854 "cannot throw pointer to object of incomplete type %0">;
5855 def err_return_in_constructor_handler : Error<
5856 "return in the catch of a function try block of a constructor is illegal">;
5857 def warn_cdtor_function_try_handler_mem_expr : Warning<
5858 "cannot refer to a non-static member from the handler of a "
5859 "%select{constructor|destructor}0 function try block">, InGroup<Exceptions>;
5861 let CategoryName = "Lambda Issue" in {
5862 def err_capture_more_than_once : Error<
5863 "%0 can appear only once in a capture list">;
5864 def err_reference_capture_with_reference_default : Error<
5865 "'&' cannot precede a capture when the capture default is '&'">;
5866 def err_this_capture_with_copy_default : Error<
5867 "'this' cannot be explicitly captured when the capture default is '='">;
5868 def err_copy_capture_with_copy_default : Error<
5869 "'&' must precede a capture when the capture default is '='">;
5870 def err_capture_does_not_name_variable : Error<
5871 "%0 in capture list does not name a variable">;
5872 def err_capture_non_automatic_variable : Error<
5873 "%0 cannot be captured because it does not have automatic storage "
5875 def err_this_capture : Error<
5876 "'this' cannot be %select{implicitly |}0captured in this context">;
5877 def err_lambda_capture_anonymous_var : Error<
5878 "unnamed variable cannot be implicitly captured in a lambda expression">;
5879 def err_lambda_capture_flexarray_type : Error<
5880 "variable %0 with flexible array member cannot be captured in "
5881 "a lambda expression">;
5882 def err_lambda_impcap : Error<
5883 "variable %0 cannot be implicitly captured in a lambda with no "
5884 "capture-default specified">;
5885 def note_lambda_decl : Note<"lambda expression begins here">;
5886 def err_lambda_unevaluated_operand : Error<
5887 "lambda expression in an unevaluated operand">;
5888 def err_lambda_in_constant_expression : Error<
5889 "a lambda expression may not appear inside of a constant expression">;
5890 def err_lambda_return_init_list : Error<
5891 "cannot deduce lambda return type from initializer list">;
5892 def err_lambda_capture_default_arg : Error<
5893 "lambda expression in default argument cannot capture any entity">;
5894 def err_lambda_incomplete_result : Error<
5895 "incomplete result type %0 in lambda expression">;
5896 def err_noreturn_lambda_has_return_expr : Error<
5897 "lambda declared 'noreturn' should not return">;
5898 def warn_maybe_falloff_nonvoid_lambda : Warning<
5899 "control may reach end of non-void lambda">,
5900 InGroup<ReturnType>;
5901 def warn_falloff_nonvoid_lambda : Warning<
5902 "control reaches end of non-void lambda">,
5903 InGroup<ReturnType>;
5904 def err_access_lambda_capture : Error<
5905 // The ERRORs represent other special members that aren't constructors, in
5906 // hopes that someone will bother noticing and reporting if they appear
5907 "capture of variable '%0' as type %1 calls %select{private|protected}3 "
5908 "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}2constructor">,
5910 def note_lambda_to_block_conv : Note<
5911 "implicit capture of lambda object due to conversion to block pointer "
5914 // C++14 lambda init-captures.
5915 def warn_cxx11_compat_init_capture : Warning<
5916 "initialized lambda captures are incompatible with C++ standards "
5917 "before C++14">, InGroup<CXXPre14Compat>, DefaultIgnore;
5918 def ext_init_capture : ExtWarn<
5919 "initialized lambda captures are a C++14 extension">, InGroup<CXX14>;
5920 def err_init_capture_no_expression : Error<
5921 "initializer missing for lambda capture %0">;
5922 def err_init_capture_multiple_expressions : Error<
5923 "initializer for lambda capture %0 contains multiple expressions">;
5924 def err_init_capture_paren_braces : Error<
5925 "cannot deduce type for lambda capture %1 from "
5926 "%select{parenthesized|nested}0 initializer list">;
5927 def err_init_capture_deduction_failure : Error<
5928 "cannot deduce type for lambda capture %0 from initializer of type %2">;
5929 def err_init_capture_deduction_failure_from_init_list : Error<
5930 "cannot deduce type for lambda capture %0 from initializer list">;
5933 def err_return_in_captured_stmt : Error<
5934 "cannot return from %0">;
5935 def err_capture_block_variable : Error<
5936 "__block variable %0 cannot be captured in a "
5937 "%select{lambda expression|captured statement}1">;
5939 def err_operator_arrow_circular : Error<
5940 "circular pointer delegation detected">;
5941 def err_operator_arrow_depth_exceeded : Error<
5942 "use of 'operator->' on type %0 would invoke a sequence of more than %1 "
5943 "'operator->' calls">;
5944 def note_operator_arrow_here : Note<
5945 "'operator->' declared here produces an object of type %0">;
5946 def note_operator_arrows_suppressed : Note<
5947 "(skipping %0 'operator->'%s0 in backtrace)">;
5948 def note_operator_arrow_depth : Note<
5949 "use -foperator-arrow-depth=N to increase 'operator->' limit">;
5951 def err_pseudo_dtor_base_not_scalar : Error<
5952 "object expression of non-scalar type %0 cannot be used in a "
5953 "pseudo-destructor expression">;
5954 def ext_pseudo_dtor_on_void : ExtWarn<
5955 "pseudo-destructors on type void are a Microsoft extension">,
5956 InGroup<MicrosoftVoidPseudoDtor>;
5957 def err_pseudo_dtor_type_mismatch : Error<
5958 "the type of object expression "
5959 "%diff{($) does not match the type being destroyed ($)|"
5960 "does not match the type being destroyed}0,1 "
5961 "in pseudo-destructor expression">;
5962 def err_pseudo_dtor_call_with_args : Error<
5963 "call to pseudo-destructor cannot have any arguments">;
5964 def err_dtor_expr_without_call : Error<
5965 "reference to %select{destructor|pseudo-destructor}0 must be called"
5966 "%select{|; did you mean to call it with no arguments?}1">;
5967 def err_pseudo_dtor_destructor_non_type : Error<
5968 "%0 does not refer to a type name in pseudo-destructor expression; expected "
5969 "the name of type %1">;
5970 def err_invalid_use_of_function_type : Error<
5971 "a function type is not allowed here">;
5972 def err_invalid_use_of_array_type : Error<"an array type is not allowed here">;
5973 def err_typecheck_bool_condition : Error<
5974 "value of type %0 is not contextually convertible to 'bool'">;
5975 def err_typecheck_ambiguous_condition : Error<
5976 "conversion %diff{from $ to $|between types}0,1 is ambiguous">;
5977 def err_typecheck_nonviable_condition : Error<
5978 "no viable conversion%select{%diff{ from $ to $|}1,2|"
5979 "%diff{ from returned value of type $ to function return type $|}1,2}0">;
5980 def err_typecheck_nonviable_condition_incomplete : Error<
5981 "no viable conversion%diff{ from $ to incomplete type $|}0,1">;
5982 def err_typecheck_deleted_function : Error<
5983 "conversion function %diff{from $ to $|between types}0,1 "
5984 "invokes a deleted function">;
5986 def err_expected_class_or_namespace : Error<"%0 is not a class"
5987 "%select{ or namespace|, namespace, or enumeration}1">;
5988 def err_invalid_declarator_scope : Error<"cannot define or redeclare %0 here "
5989 "because namespace %1 does not enclose namespace %2">;
5990 def err_invalid_declarator_global_scope : Error<
5991 "definition or redeclaration of %0 cannot name the global scope">;
5992 def err_invalid_declarator_in_function : Error<
5993 "definition or redeclaration of %0 not allowed inside a function">;
5994 def err_invalid_declarator_in_block : Error<
5995 "definition or redeclaration of %0 not allowed inside a block">;
5996 def err_not_tag_in_scope : Error<
5997 "no %select{struct|interface|union|class|enum}0 named %1 in %2">;
5999 def err_no_typeid_with_fno_rtti : Error<
6000 "cannot use typeid with -fno-rtti">;
6001 def err_no_dynamic_cast_with_fno_rtti : Error<
6002 "cannot use dynamic_cast with -fno-rtti">;
6004 def err_cannot_form_pointer_to_member_of_reference_type : Error<
6005 "cannot form a pointer-to-member to member %0 of reference type %1">;
6006 def err_incomplete_object_call : Error<
6007 "incomplete type in call to object of type %0">;
6009 def warn_condition_is_assignment : Warning<"using the result of an "
6010 "assignment as a condition without parentheses">,
6011 InGroup<Parentheses>;
6012 // Completely identical except off by default.
6013 def warn_condition_is_idiomatic_assignment : Warning<"using the result "
6014 "of an assignment as a condition without parentheses">,
6015 InGroup<DiagGroup<"idiomatic-parentheses">>, DefaultIgnore;
6016 def note_condition_assign_to_comparison : Note<
6017 "use '==' to turn this assignment into an equality comparison">;
6018 def note_condition_or_assign_to_comparison : Note<
6019 "use '!=' to turn this compound assignment into an inequality comparison">;
6020 def note_condition_assign_silence : Note<
6021 "place parentheses around the assignment to silence this warning">;
6023 def warn_equality_with_extra_parens : Warning<"equality comparison with "
6024 "extraneous parentheses">, InGroup<ParenthesesOnEquality>;
6025 def note_equality_comparison_to_assign : Note<
6026 "use '=' to turn this equality comparison into an assignment">;
6027 def note_equality_comparison_silence : Note<
6028 "remove extraneous parentheses around the comparison to silence this warning">;
6030 // assignment related diagnostics (also for argument passing, returning, etc).
6031 // In most of these diagnostics the %2 is a value from the
6032 // Sema::AssignmentAction enumeration
6033 def err_typecheck_convert_incompatible : Error<
6034 "%select{%diff{assigning to $ from incompatible type $|"
6035 "assigning to type from incompatible type}0,1"
6036 "|%diff{passing $ to parameter of incompatible type $|"
6037 "passing type to parameter of incompatible type}0,1"
6038 "|%diff{returning $ from a function with incompatible result type $|"
6039 "returning type from a function with incompatible result type}0,1"
6040 "|%diff{converting $ to incompatible type $|"
6041 "converting type to incompatible type}0,1"
6042 "|%diff{initializing $ with an expression of incompatible type $|"
6043 "initializing type with an expression of incompatible type}0,1"
6044 "|%diff{sending $ to parameter of incompatible type $|"
6045 "sending type to parameter of incompatible type}0,1"
6046 "|%diff{casting $ to incompatible type $|"
6047 "casting type to incompatible type}0,1}2"
6048 "%select{|; dereference with *|"
6049 "; take the address with &|"
6052 "%select{|: different classes%diff{ ($ vs $)|}5,6"
6053 "|: different number of parameters (%5 vs %6)"
6054 "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7"
6055 "|: different return type%diff{ ($ vs $)|}5,6"
6056 "|: different qualifiers ("
6057 "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
6058 "volatile and restrict|const, volatile, and restrict}5 vs "
6059 "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
6060 "volatile and restrict|const, volatile, and restrict}6)}4">;
6061 def err_typecheck_missing_return_type_incompatible : Error<
6062 "%diff{return type $ must match previous return type $|"
6063 "return type must match previous return type}0,1 when %select{block "
6064 "literal|lambda expression}2 has unspecified explicit return type">;
6066 def not_incomplete_class_and_qualified_id : Note<
6067 "conformance of forward class %0 to protocol %1 can not be confirmed">;
6068 def warn_incompatible_qualified_id : Warning<
6069 "%select{%diff{assigning to $ from incompatible type $|"
6070 "assigning to type from incompatible type}0,1"
6071 "|%diff{passing $ to parameter of incompatible type $|"
6072 "passing type to parameter of incompatible type}0,1"
6073 "|%diff{returning $ from a function with incompatible result type $|"
6074 "returning type from a function with incompatible result type}0,1"
6075 "|%diff{converting $ to incompatible type $|"
6076 "converting type to incompatible type}0,1"
6077 "|%diff{initializing $ with an expression of incompatible type $|"
6078 "initializing type with an expression of incompatible type}0,1"
6079 "|%diff{sending $ to parameter of incompatible type $|"
6080 "sending type to parameter of incompatible type}0,1"
6081 "|%diff{casting $ to incompatible type $|"
6082 "casting type to incompatible type}0,1}2">;
6083 def ext_typecheck_convert_pointer_int : ExtWarn<
6084 "incompatible pointer to integer conversion "
6085 "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6086 "|%diff{passing $ to parameter of type $|"
6087 "passing to parameter of different type}0,1"
6088 "|%diff{returning $ from a function with result type $|"
6089 "returning from function with different return type}0,1"
6090 "|%diff{converting $ to type $|converting between types}0,1"
6091 "|%diff{initializing $ with an expression of type $|"
6092 "initializing with expression of different type}0,1"
6093 "|%diff{sending $ to parameter of type $|"
6094 "sending to parameter of different type}0,1"
6095 "|%diff{casting $ to type $|casting between types}0,1}2"
6096 "%select{|; dereference with *|"
6097 "; take the address with &|"
6100 InGroup<IntConversion>;
6101 def ext_typecheck_convert_int_pointer : ExtWarn<
6102 "incompatible integer to pointer conversion "
6103 "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6104 "|%diff{passing $ to parameter of type $|"
6105 "passing to parameter of different type}0,1"
6106 "|%diff{returning $ from a function with result type $|"
6107 "returning from function with different return type}0,1"
6108 "|%diff{converting $ to type $|converting between types}0,1"
6109 "|%diff{initializing $ with an expression of type $|"
6110 "initializing with expression of different type}0,1"
6111 "|%diff{sending $ to parameter of type $|"
6112 "sending to parameter of different type}0,1"
6113 "|%diff{casting $ to type $|casting between types}0,1}2"
6114 "%select{|; dereference with *|"
6115 "; take the address with &|"
6118 InGroup<IntConversion>;
6119 def ext_typecheck_convert_pointer_void_func : Extension<
6120 "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6121 "|%diff{passing $ to parameter of type $|"
6122 "passing to parameter of different type}0,1"
6123 "|%diff{returning $ from a function with result type $|"
6124 "returning from function with different return type}0,1"
6125 "|%diff{converting $ to type $|converting between types}0,1"
6126 "|%diff{initializing $ with an expression of type $|"
6127 "initializing with expression of different type}0,1"
6128 "|%diff{sending $ to parameter of type $|"
6129 "sending to parameter of different type}0,1"
6130 "|%diff{casting $ to type $|casting between types}0,1}2"
6131 " converts between void pointer and function pointer">;
6132 def ext_typecheck_convert_incompatible_pointer_sign : ExtWarn<
6133 "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6134 "|%diff{passing $ to parameter of type $|"
6135 "passing to parameter of different type}0,1"
6136 "|%diff{returning $ from a function with result type $|"
6137 "returning from function with different return type}0,1"
6138 "|%diff{converting $ to type $|converting between types}0,1"
6139 "|%diff{initializing $ with an expression of type $|"
6140 "initializing with expression of different type}0,1"
6141 "|%diff{sending $ to parameter of type $|"
6142 "sending to parameter of different type}0,1"
6143 "|%diff{casting $ to type $|casting between types}0,1}2"
6144 " converts between pointers to integer types with different sign">,
6145 InGroup<DiagGroup<"pointer-sign">>;
6146 def ext_typecheck_convert_incompatible_pointer : ExtWarn<
6147 "incompatible pointer types "
6148 "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6149 "|%diff{passing $ to parameter of type $|"
6150 "passing to parameter of different type}0,1"
6151 "|%diff{returning $ from a function with result type $|"
6152 "returning from function with different return type}0,1"
6153 "|%diff{converting $ to type $|converting between types}0,1"
6154 "|%diff{initializing $ with an expression of type $|"
6155 "initializing with expression of different type}0,1"
6156 "|%diff{sending $ to parameter of type $|"
6157 "sending to parameter of different type}0,1"
6158 "|%diff{casting $ to type $|casting between types}0,1}2"
6159 "%select{|; dereference with *|"
6160 "; take the address with &|"
6163 InGroup<IncompatiblePointerTypes>;
6164 def ext_typecheck_convert_discards_qualifiers : ExtWarn<
6165 "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6166 "|%diff{passing $ to parameter of type $|"
6167 "passing to parameter of different type}0,1"
6168 "|%diff{returning $ from a function with result type $|"
6169 "returning from function with different return type}0,1"
6170 "|%diff{converting $ to type $|converting between types}0,1"
6171 "|%diff{initializing $ with an expression of type $|"
6172 "initializing with expression of different type}0,1"
6173 "|%diff{sending $ to parameter of type $|"
6174 "sending to parameter of different type}0,1"
6175 "|%diff{casting $ to type $|casting between types}0,1}2"
6176 " discards qualifiers">,
6177 InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
6178 def ext_nested_pointer_qualifier_mismatch : ExtWarn<
6179 "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6180 "|%diff{passing $ to parameter of type $|"
6181 "passing to parameter of different type}0,1"
6182 "|%diff{returning $ from a function with result type $|"
6183 "returning from function with different return type}0,1"
6184 "|%diff{converting $ to type $|converting between types}0,1"
6185 "|%diff{initializing $ with an expression of type $|"
6186 "initializing with expression of different type}0,1"
6187 "|%diff{sending $ to parameter of type $|"
6188 "sending to parameter of different type}0,1"
6189 "|%diff{casting $ to type $|casting between types}0,1}2"
6190 " discards qualifiers in nested pointer types">,
6191 InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
6192 def warn_incompatible_vectors : Warning<
6193 "incompatible vector types "
6194 "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6195 "|%diff{passing $ to parameter of type $|"
6196 "passing to parameter of different type}0,1"
6197 "|%diff{returning $ from a function with result type $|"
6198 "returning from function with different return type}0,1"
6199 "|%diff{converting $ to type $|converting between types}0,1"
6200 "|%diff{initializing $ with an expression of type $|"
6201 "initializing with expression of different type}0,1"
6202 "|%diff{sending $ to parameter of type $|"
6203 "sending to parameter of different type}0,1"
6204 "|%diff{casting $ to type $|casting between types}0,1}2">,
6205 InGroup<VectorConversion>, DefaultIgnore;
6206 def err_int_to_block_pointer : Error<
6207 "invalid block pointer conversion "
6208 "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6209 "|%diff{passing $ to parameter of type $|"
6210 "passing to parameter of different type}0,1"
6211 "|%diff{returning $ from a function with result type $|"
6212 "returning from function with different return type}0,1"
6213 "|%diff{converting $ to type $|converting between types}0,1"
6214 "|%diff{initializing $ with an expression of type $|"
6215 "initializing with expression of different type}0,1"
6216 "|%diff{sending $ to parameter of type $|"
6217 "sending to parameter of different type}0,1"
6218 "|%diff{casting $ to type $|casting between types}0,1}2">;
6219 def err_typecheck_convert_incompatible_block_pointer : Error<
6220 "incompatible block pointer types "
6221 "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6222 "|%diff{passing $ to parameter of type $|"
6223 "passing to parameter of different type}0,1"
6224 "|%diff{returning $ from a function with result type $|"
6225 "returning from function with different return type}0,1"
6226 "|%diff{converting $ to type $|converting between types}0,1"
6227 "|%diff{initializing $ with an expression of type $|"
6228 "initializing with expression of different type}0,1"
6229 "|%diff{sending $ to parameter of type $|"
6230 "sending to parameter of different type}0,1"
6231 "|%diff{casting $ to type $|casting between types}0,1}2">;
6232 def err_typecheck_incompatible_address_space : Error<
6233 "%select{%diff{assigning $ to $|assigning to different types}1,0"
6234 "|%diff{passing $ to parameter of type $|"
6235 "passing to parameter of different type}0,1"
6236 "|%diff{returning $ from a function with result type $|"
6237 "returning from function with different return type}0,1"
6238 "|%diff{converting $ to type $|converting between types}0,1"
6239 "|%diff{initializing $ with an expression of type $|"
6240 "initializing with expression of different type}0,1"
6241 "|%diff{sending $ to parameter of type $|"
6242 "sending to parameter of different type}0,1"
6243 "|%diff{casting $ to type $|casting between types}0,1}2"
6244 " changes address space of pointer">;
6245 def err_typecheck_incompatible_ownership : Error<
6246 "%select{%diff{assigning $ to $|assigning to different types}1,0"
6247 "|%diff{passing $ to parameter of type $|"
6248 "passing to parameter of different type}0,1"
6249 "|%diff{returning $ from a function with result type $|"
6250 "returning from function with different return type}0,1"
6251 "|%diff{converting $ to type $|converting between types}0,1"
6252 "|%diff{initializing $ with an expression of type $|"
6253 "initializing with expression of different type}0,1"
6254 "|%diff{sending $ to parameter of type $|"
6255 "sending to parameter of different type}0,1"
6256 "|%diff{casting $ to type $|casting between types}0,1}2"
6257 " changes retain/release properties of pointer">;
6258 def err_typecheck_comparison_of_distinct_blocks : Error<
6259 "comparison of distinct block types%diff{ ($ and $)|}0,1">;
6261 def err_typecheck_array_not_modifiable_lvalue : Error<
6262 "array type %0 is not assignable">;
6263 def err_typecheck_non_object_not_modifiable_lvalue : Error<
6264 "non-object type %0 is not assignable">;
6265 def err_typecheck_expression_not_modifiable_lvalue : Error<
6266 "expression is not assignable">;
6267 def err_typecheck_incomplete_type_not_modifiable_lvalue : Error<
6268 "incomplete type %0 is not assignable">;
6269 def err_typecheck_lvalue_casts_not_supported : Error<
6270 "assignment to cast is illegal, lvalue casts are not supported">;
6272 def err_typecheck_duplicate_vector_components_not_mlvalue : Error<
6273 "vector is not assignable (contains duplicate components)">;
6274 def err_block_decl_ref_not_modifiable_lvalue : Error<
6275 "variable is not assignable (missing __block type specifier)">;
6276 def err_lambda_decl_ref_not_modifiable_lvalue : Error<
6277 "cannot assign to a variable captured by copy in a non-mutable lambda">;
6278 def err_typecheck_call_not_function : Error<
6279 "called object type %0 is not a function or function pointer">;
6280 def err_call_incomplete_return : Error<
6281 "calling function with incomplete return type %0">;
6282 def err_call_function_incomplete_return : Error<
6283 "calling %0 with incomplete return type %1">;
6284 def err_call_incomplete_argument : Error<
6285 "argument type %0 is incomplete">;
6286 def err_typecheck_call_too_few_args : Error<
6287 "too few %select{|||execution configuration }0arguments to "
6288 "%select{function|block|method|kernel function}0 call, "
6289 "expected %1, have %2">;
6290 def err_typecheck_call_too_few_args_one : Error<
6291 "too few %select{|||execution configuration }0arguments to "
6292 "%select{function|block|method|kernel function}0 call, "
6293 "single argument %1 was not specified">;
6294 def err_typecheck_call_too_few_args_at_least : Error<
6295 "too few %select{|||execution configuration }0arguments to "
6296 "%select{function|block|method|kernel function}0 call, "
6297 "expected at least %1, have %2">;
6298 def err_typecheck_call_too_few_args_at_least_one : Error<
6299 "too few %select{|||execution configuration }0arguments to "
6300 "%select{function|block|method|kernel function}0 call, "
6301 "at least argument %1 must be specified">;
6302 def err_typecheck_call_too_few_args_suggest : Error<
6303 "too few %select{|||execution configuration }0arguments to "
6304 "%select{function|block|method|kernel function}0 call, "
6305 "expected %1, have %2; did you mean %3?">;
6306 def err_typecheck_call_too_few_args_at_least_suggest : Error<
6307 "too few %select{|||execution configuration }0arguments to "
6308 "%select{function|block|method|kernel function}0 call, "
6309 "expected at least %1, have %2; did you mean %3?">;
6310 def err_typecheck_call_too_many_args : Error<
6311 "too many %select{|||execution configuration }0arguments to "
6312 "%select{function|block|method|kernel function}0 call, "
6313 "expected %1, have %2">;
6314 def err_typecheck_call_too_many_args_one : Error<
6315 "too many %select{|||execution configuration }0arguments to "
6316 "%select{function|block|method|kernel function}0 call, "
6317 "expected single argument %1, have %2 arguments">;
6318 def err_typecheck_call_too_many_args_at_most : Error<
6319 "too many %select{|||execution configuration }0arguments to "
6320 "%select{function|block|method|kernel function}0 call, "
6321 "expected at most %1, have %2">;
6322 def err_typecheck_call_too_many_args_at_most_one : Error<
6323 "too many %select{|||execution configuration }0arguments to "
6324 "%select{function|block|method|kernel function}0 call, "
6325 "expected at most single argument %1, have %2 arguments">;
6326 def err_typecheck_call_too_many_args_suggest : Error<
6327 "too many %select{|||execution configuration }0arguments to "
6328 "%select{function|block|method|kernel function}0 call, "
6329 "expected %1, have %2; did you mean %3?">;
6330 def err_typecheck_call_too_many_args_at_most_suggest : Error<
6331 "too many %select{|||execution configuration }0arguments to "
6332 "%select{function|block|method|kernel function}0 call, "
6333 "expected at most %1, have %2; did you mean %3?">;
6335 def err_arc_typecheck_convert_incompatible_pointer : Error<
6336 "incompatible pointer types passing retainable parameter of type %0"
6337 "to a CF function expecting %1 type">;
6339 def err_builtin_fn_use : Error<"builtin functions must be directly called">;
6341 def warn_call_wrong_number_of_arguments : Warning<
6342 "too %select{few|many}0 arguments in call to %1">;
6343 def err_atomic_builtin_must_be_pointer : Error<
6344 "address argument to atomic builtin must be a pointer (%0 invalid)">;
6345 def err_atomic_builtin_must_be_pointer_intptr : Error<
6346 "address argument to atomic builtin must be a pointer to integer or pointer"
6348 def err_atomic_builtin_must_be_pointer_intfltptr : Error<
6349 "address argument to atomic builtin must be a pointer to integer,"
6350 " floating-point or pointer (%0 invalid)">;
6351 def err_atomic_builtin_pointer_size : Error<
6352 "address argument to atomic builtin must be a pointer to 1,2,4,8 or 16 byte "
6353 "type (%0 invalid)">;
6354 def err_atomic_exclusive_builtin_pointer_size : Error<
6355 "address argument to load or store exclusive builtin must be a pointer to"
6356 " 1,2,4 or 8 byte type (%0 invalid)">;
6357 def err_atomic_op_needs_atomic : Error<
6358 "address argument to atomic operation must be a pointer to _Atomic "
6359 "type (%0 invalid)">;
6360 def err_atomic_op_needs_non_const_atomic : Error<
6361 "address argument to atomic operation must be a pointer to non-const _Atomic "
6362 "type (%0 invalid)">;
6363 def err_atomic_op_needs_non_const_pointer : Error<
6364 "address argument to atomic operation must be a pointer to non-const "
6365 "type (%0 invalid)">;
6366 def err_atomic_op_needs_trivial_copy : Error<
6367 "address argument to atomic operation must be a pointer to a "
6368 "trivially-copyable type (%0 invalid)">;
6369 def err_atomic_op_needs_atomic_int_or_ptr : Error<
6370 "address argument to atomic operation must be a pointer to %select{|atomic }0"
6371 "integer or pointer (%1 invalid)">;
6372 def err_atomic_op_bitwise_needs_atomic_int : Error<
6373 "address argument to bitwise atomic operation must be a pointer to "
6374 "%select{|atomic }0integer (%1 invalid)">;
6375 def warn_atomic_op_has_invalid_memory_order : Warning<
6376 "memory order argument to atomic operation is invalid">,
6377 InGroup<DiagGroup<"atomic-memory-ordering">>;
6379 def err_overflow_builtin_must_be_int : Error<
6380 "operand argument to overflow builtin must be an integer (%0 invalid)">;
6381 def err_overflow_builtin_must_be_ptr_int : Error<
6382 "result argument to overflow builtin must be a pointer "
6383 "to a non-const integer (%0 invalid)">;
6385 def err_atomic_load_store_uses_lib : Error<
6386 "atomic %select{load|store}0 requires runtime support that is not "
6387 "available for this target">;
6389 def err_nontemporal_builtin_must_be_pointer : Error<
6390 "address argument to nontemporal builtin must be a pointer (%0 invalid)">;
6391 def err_nontemporal_builtin_must_be_pointer_intfltptr_or_vector : Error<
6392 "address argument to nontemporal builtin must be a pointer to integer, float, "
6393 "pointer, or a vector of such types (%0 invalid)">;
6395 def err_deleted_function_use : Error<"attempt to use a deleted function">;
6397 def err_kern_type_not_void_return : Error<
6398 "kernel function type %0 must have void return type">;
6399 def err_config_scalar_return : Error<
6400 "CUDA special function 'cudaConfigureCall' must have scalar return type">;
6401 def err_kern_call_not_global_function : Error<
6402 "kernel call to non-global function %0">;
6403 def err_global_call_not_config : Error<
6404 "call to global function %0 not configured">;
6405 def err_ref_bad_target : Error<
6406 "reference to %select{__device__|__global__|__host__|__host__ __device__}0 "
6407 "function %1 in %select{__device__|__global__|__host__|__host__ __device__}2 function">;
6408 def warn_host_calls_from_host_device : Warning<
6409 "calling __host__ function %0 from __host__ __device__ function %1 can lead to runtime errors">,
6410 InGroup<CudaCompat>;
6412 def warn_non_pod_vararg_with_format_string : Warning<
6413 "cannot pass %select{non-POD|non-trivial}0 object of type %1 to variadic "
6414 "%select{function|block|method|constructor}2; expected type from format "
6415 "string was %3">, InGroup<NonPODVarargs>, DefaultError;
6416 // The arguments to this diagnostic should match the warning above.
6417 def err_cannot_pass_objc_interface_to_vararg_format : Error<
6418 "cannot pass object with interface type %1 by value to variadic "
6419 "%select{function|block|method|constructor}2; expected type from format "
6422 def err_cannot_pass_objc_interface_to_vararg : Error<
6423 "cannot pass object with interface type %0 by value through variadic "
6424 "%select{function|block|method|constructor}1">;
6425 def warn_cannot_pass_non_pod_arg_to_vararg : Warning<
6426 "cannot pass object of %select{non-POD|non-trivial}0 type %1 through variadic"
6427 " %select{function|block|method|constructor}2; call will abort at runtime">,
6428 InGroup<NonPODVarargs>, DefaultError;
6429 def warn_cxx98_compat_pass_non_pod_arg_to_vararg : Warning<
6430 "passing object of trivial but non-POD type %0 through variadic"
6431 " %select{function|block|method|constructor}1 is incompatible with C++98">,
6432 InGroup<CXX98Compat>, DefaultIgnore;
6433 def warn_pass_class_arg_to_vararg : Warning<
6434 "passing object of class type %0 through variadic "
6435 "%select{function|block|method|constructor}1"
6436 "%select{|; did you mean to call '%3'?}2">,
6437 InGroup<ClassVarargs>, DefaultIgnore;
6438 def err_cannot_pass_to_vararg : Error<
6439 "cannot pass %select{expression of type %1|initializer list}0 to variadic "
6440 "%select{function|block|method|constructor}2">;
6441 def err_cannot_pass_to_vararg_format : Error<
6442 "cannot pass %select{expression of type %1|initializer list}0 to variadic "
6443 "%select{function|block|method|constructor}2; expected type from format "
6446 def err_typecheck_call_invalid_ordered_compare : Error<
6447 "ordered compare requires two args of floating point type"
6448 "%diff{ ($ and $)|}0,1">;
6449 def err_typecheck_call_invalid_unary_fp : Error<
6450 "floating point classification requires argument of floating point type "
6452 def err_typecheck_cond_expect_int_float : Error<
6453 "used type %0 where integer or floating point type is required">;
6454 def err_typecheck_cond_expect_scalar : Error<
6455 "used type %0 where arithmetic or pointer type is required">;
6456 def err_typecheck_cond_expect_nonfloat : Error<
6457 "used type %0 where floating point type is not allowed">;
6458 def ext_typecheck_cond_one_void : Extension<
6459 "C99 forbids conditional expressions with only one void side">;
6460 def err_typecheck_cast_to_incomplete : Error<
6461 "cast to incomplete type %0">;
6462 def ext_typecheck_cast_nonscalar : Extension<
6463 "C99 forbids casting nonscalar type %0 to the same type">;
6464 def ext_typecheck_cast_to_union : Extension<
6465 "cast to union type is a GNU extension">,
6466 InGroup<GNUUnionCast>;
6467 def err_typecheck_cast_to_union_no_type : Error<
6468 "cast to union type from type %0 not present in union">;
6469 def err_cast_pointer_from_non_pointer_int : Error<
6470 "operand of type %0 cannot be cast to a pointer type">;
6471 def warn_cast_pointer_from_sel : Warning<
6472 "cast of type %0 to %1 is deprecated; use sel_getName instead">,
6473 InGroup<SelTypeCast>;
6474 def warn_function_def_in_objc_container : Warning<
6475 "function definition inside an Objective-C container is deprecated">,
6476 InGroup<FunctionDefInObjCContainer>;
6478 def warn_bad_function_cast : Warning<
6479 "cast from function call of type %0 to non-matching type %1">,
6480 InGroup<BadFunctionCast>, DefaultIgnore;
6481 def err_cast_pointer_to_non_pointer_int : Error<
6482 "pointer cannot be cast to type %0">;
6483 def err_typecheck_expect_scalar_operand : Error<
6484 "operand of type %0 where arithmetic or pointer type is required">;
6485 def err_typecheck_cond_incompatible_operands : Error<
6486 "incompatible operand types%diff{ ($ and $)|}0,1">;
6487 def ext_typecheck_cond_incompatible_operands_nonstandard : ExtWarn<
6488 "incompatible operand types%diff{ ($ and $)|}0,1 use non-standard composite "
6490 def err_cast_selector_expr : Error<
6491 "cannot type cast @selector expression">;
6492 def ext_typecheck_cond_incompatible_pointers : ExtWarn<
6493 "pointer type mismatch%diff{ ($ and $)|}0,1">,
6494 InGroup<DiagGroup<"pointer-type-mismatch">>;
6495 def ext_typecheck_cond_pointer_integer_mismatch : ExtWarn<
6496 "pointer/integer type mismatch in conditional expression"
6497 "%diff{ ($ and $)|}0,1">,
6498 InGroup<DiagGroup<"conditional-type-mismatch">>;
6499 def err_typecheck_choose_expr_requires_constant : Error<
6500 "'__builtin_choose_expr' requires a constant expression">;
6501 def warn_unused_expr : Warning<"expression result unused">,
6502 InGroup<UnusedValue>;
6503 def warn_unused_voidptr : Warning<
6504 "expression result unused; should this cast be to 'void'?">,
6505 InGroup<UnusedValue>;
6506 def warn_unused_property_expr : Warning<
6507 "property access result unused - getters should not be used for side effects">,
6508 InGroup<UnusedGetterReturnValue>;
6509 def warn_unused_container_subscript_expr : Warning<
6510 "container access result unused - container access should not be used for side effects">,
6511 InGroup<UnusedValue>;
6512 def warn_unused_call : Warning<
6513 "ignoring return value of function declared with %0 attribute">,
6514 InGroup<UnusedValue>;
6515 def warn_side_effects_unevaluated_context : Warning<
6516 "expression with side effects has no effect in an unevaluated context">,
6517 InGroup<UnevaluatedExpression>;
6518 def warn_side_effects_typeid : Warning<
6519 "expression with side effects will be evaluated despite being used as an "
6520 "operand to 'typeid'">, InGroup<PotentiallyEvaluatedExpression>;
6521 def warn_unused_result : Warning<
6522 "ignoring return value of function declared with warn_unused_result "
6523 "attribute">, InGroup<DiagGroup<"unused-result">>;
6524 def warn_unused_volatile : Warning<
6525 "expression result unused; assign into a variable to force a volatile load">,
6526 InGroup<DiagGroup<"unused-volatile-lvalue">>;
6528 def warn_unused_comparison : Warning<
6529 "%select{%select{|in}1equality|relational}0 comparison result unused">,
6530 InGroup<UnusedComparison>;
6531 def note_inequality_comparison_to_or_assign : Note<
6532 "use '|=' to turn this inequality comparison into an or-assignment">;
6534 def err_incomplete_type_used_in_type_trait_expr : Error<
6535 "incomplete type %0 used in type trait expression">;
6537 def err_dimension_expr_not_constant_integer : Error<
6538 "dimension expression does not evaluate to a constant unsigned int">;
6540 def err_typecheck_cond_incompatible_operands_null : Error<
6541 "non-pointer operand type %0 incompatible with %select{NULL|nullptr}1">;
6542 def ext_empty_struct_union : Extension<
6543 "empty %select{struct|union}0 is a GNU extension">, InGroup<GNUEmptyStruct>;
6544 def ext_no_named_members_in_struct_union : Extension<
6545 "%select{struct|union}0 without named members is a GNU extension">, InGroup<GNUEmptyStruct>;
6546 def warn_zero_size_struct_union_compat : Warning<"%select{|empty }0"
6547 "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">,
6548 InGroup<CXXCompat>, DefaultIgnore;
6549 def warn_zero_size_struct_union_in_extern_c : Warning<"%select{|empty }0"
6550 "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">,
6551 InGroup<ExternCCompat>;
6552 def warn_cast_qual : Warning<"cast from %0 to %1 drops %select{const and "
6553 "volatile qualifiers|const qualifier|volatile qualifier}2">,
6554 InGroup<CastQual>, DefaultIgnore;
6555 def warn_cast_qual2 : Warning<"cast from %0 to %1 must have all intermediate "
6556 "pointers const qualified to be safe">, InGroup<CastQual>, DefaultIgnore;
6557 def warn_redefine_extname_not_applied : Warning<
6558 "#pragma redefine_extname is applicable to external C declarations only; "
6559 "not applied to %select{function|variable}0 %1">,
6561 } // End of general sema category.
6564 let CategoryName = "Inline Assembly Issue" in {
6565 def err_asm_invalid_lvalue_in_output : Error<"invalid lvalue in asm output">;
6566 def err_asm_invalid_output_constraint : Error<
6567 "invalid output constraint '%0' in asm">;
6568 def err_asm_invalid_lvalue_in_input : Error<
6569 "invalid lvalue in asm input for constraint '%0'">;
6570 def err_asm_invalid_input_constraint : Error<
6571 "invalid input constraint '%0' in asm">;
6572 def err_asm_immediate_expected : Error<"constraint '%0' expects "
6573 "an integer constant expression">;
6574 def err_asm_invalid_type_in_input : Error<
6575 "invalid type %0 in asm input for constraint '%1'">;
6576 def err_asm_tying_incompatible_types : Error<
6577 "unsupported inline asm: input with type "
6578 "%diff{$ matching output with type $|}0,1">;
6579 def err_asm_unexpected_constraint_alternatives : Error<
6580 "asm constraint has an unexpected number of alternatives: %0 vs %1">;
6581 def err_asm_incomplete_type : Error<"asm operand has incomplete type %0">;
6582 def err_asm_unknown_register_name : Error<"unknown register name '%0' in asm">;
6583 def err_asm_invalid_global_var_reg : Error<"register '%0' unsuitable for "
6584 "global register variables on this target">;
6585 def err_asm_register_size_mismatch : Error<"size of register '%0' does not "
6586 "match variable size">;
6587 def err_asm_bad_register_type : Error<"bad type for named register variable">;
6588 def err_asm_invalid_input_size : Error<
6589 "invalid input size for constraint '%0'">;
6590 def err_asm_invalid_output_size : Error<
6591 "invalid output size for constraint '%0'">;
6592 def err_invalid_asm_cast_lvalue : Error<
6593 "invalid use of a cast in a inline asm context requiring an l-value: "
6594 "remove the cast or build with -fheinous-gnu-extensions">;
6595 def err_invalid_asm_value_for_constraint
6596 : Error <"value '%0' out of range for constraint '%1'">;
6597 def err_asm_non_addr_value_in_memory_constraint : Error <
6598 "reference to a %select{bit-field|vector element|global register variable}0"
6599 " in asm %select{input|output}1 with a memory constraint '%2'">;
6600 def err_asm_input_duplicate_match : Error<
6601 "more than one input constraint matches the same output '%0'">;
6603 def warn_asm_label_on_auto_decl : Warning<
6604 "ignored asm label '%0' on automatic variable">;
6605 def warn_invalid_asm_cast_lvalue : Warning<
6606 "invalid use of a cast in an inline asm context requiring an l-value: "
6607 "accepted due to -fheinous-gnu-extensions, but clang may remove support "
6608 "for this in the future">;
6609 def warn_asm_mismatched_size_modifier : Warning<
6610 "value size does not match register size specified by the constraint "
6612 InGroup<ASMOperandWidths>;
6614 def note_asm_missing_constraint_modifier : Note<
6615 "use constraint modifier \"%0\"">;
6616 def note_asm_input_duplicate_first : Note<
6617 "constraint '%0' is already present here">;
6620 let CategoryName = "Semantic Issue" in {
6622 def err_invalid_conversion_between_vectors : Error<
6623 "invalid conversion between vector type%diff{ $ and $|}0,1 of different "
6625 def err_invalid_conversion_between_vector_and_integer : Error<
6626 "invalid conversion between vector type %0 and integer type %1 "
6627 "of different size">;
6629 def err_opencl_function_pointer_variable : Error<
6630 "pointers to functions are not allowed">;
6632 def err_opencl_taking_function_address : Error<
6633 "taking address of function is not allowed">;
6635 def err_invalid_conversion_between_vector_and_scalar : Error<
6636 "invalid conversion between vector type %0 and scalar type %1">;
6638 // C++ member initializers.
6639 def err_only_constructors_take_base_inits : Error<
6640 "only constructors take base initializers">;
6642 def err_multiple_mem_initialization : Error <
6643 "multiple initializations given for non-static member %0">;
6644 def err_multiple_mem_union_initialization : Error <
6645 "initializing multiple members of union">;
6646 def err_multiple_base_initialization : Error <
6647 "multiple initializations given for base %0">;
6649 def err_mem_init_not_member_or_class : Error<
6650 "member initializer %0 does not name a non-static data member or base "
6653 def warn_initializer_out_of_order : Warning<
6654 "%select{field|base class}0 %1 will be initialized after "
6655 "%select{field|base}2 %3">,
6656 InGroup<Reorder>, DefaultIgnore;
6657 def warn_abstract_vbase_init_ignored : Warning<
6658 "initializer for virtual base class %0 of abstract class %1 "
6659 "will never be used">,
6660 InGroup<DiagGroup<"abstract-vbase-init">>, DefaultIgnore;
6662 def err_base_init_does_not_name_class : Error<
6663 "constructor initializer %0 does not name a class">;
6664 def err_base_init_direct_and_virtual : Error<
6665 "base class initializer %0 names both a direct base class and an "
6666 "inherited virtual base class">;
6667 def err_not_direct_base_or_virtual : Error<
6668 "type %0 is not a direct or virtual base of %1">;
6670 def err_in_class_initializer_non_const : Error<
6671 "non-const static data member must be initialized out of line">;
6672 def err_in_class_initializer_volatile : Error<
6673 "static const volatile data member must be initialized out of line">;
6674 def err_in_class_initializer_bad_type : Error<
6675 "static data member of type %0 must be initialized out of line">;
6676 def ext_in_class_initializer_float_type : ExtWarn<
6677 "in-class initializer for static data member of type %0 is a GNU extension">,
6678 InGroup<GNUStaticFloatInit>;
6679 def ext_in_class_initializer_float_type_cxx11 : ExtWarn<
6680 "in-class initializer for static data member of type %0 requires "
6681 "'constexpr' specifier">, InGroup<StaticFloatInit>, DefaultError;
6682 def note_in_class_initializer_float_type_cxx11 : Note<"add 'constexpr'">;
6683 def err_in_class_initializer_literal_type : Error<
6684 "in-class initializer for static data member of type %0 requires "
6685 "'constexpr' specifier">;
6686 def err_in_class_initializer_non_constant : Error<
6687 "in-class initializer for static data member is not a constant expression">;
6688 def err_in_class_initializer_not_yet_parsed
6689 : Error<"cannot use defaulted default constructor of %0 within the class "
6690 "outside of member functions because %1 has an initializer">;
6691 def err_in_class_initializer_not_yet_parsed_outer_class
6692 : Error<"cannot use defaulted default constructor of %0 within "
6693 "%1 outside of member functions because %2 has an initializer">;
6695 def ext_in_class_initializer_non_constant : Extension<
6696 "in-class initializer for static data member is not a constant expression; "
6697 "folding it to a constant is a GNU extension">, InGroup<GNUFoldingConstant>;
6699 def err_thread_dynamic_init : Error<
6700 "initializer for thread-local variable must be a constant expression">;
6701 def err_thread_nontrivial_dtor : Error<
6702 "type of thread-local variable has non-trivial destruction">;
6703 def note_use_thread_local : Note<
6704 "use 'thread_local' to allow this">;
6706 // C++ anonymous unions and GNU anonymous structs/unions
6707 def ext_anonymous_union : Extension<
6708 "anonymous unions are a C11 extension">, InGroup<C11>;
6709 def ext_gnu_anonymous_struct : Extension<
6710 "anonymous structs are a GNU extension">, InGroup<GNUAnonymousStruct>;
6711 def ext_c11_anonymous_struct : Extension<
6712 "anonymous structs are a C11 extension">, InGroup<C11>;
6713 def err_anonymous_union_not_static : Error<
6714 "anonymous unions at namespace or global scope must be declared 'static'">;
6715 def err_anonymous_union_with_storage_spec : Error<
6716 "anonymous union at class scope must not have a storage specifier">;
6717 def err_anonymous_struct_not_member : Error<
6718 "anonymous %select{structs|structs and classes}0 must be "
6719 "%select{struct or union|class}0 members">;
6720 def err_anonymous_record_member_redecl : Error<
6721 "member of anonymous %select{struct|union}0 redeclares %1">;
6722 def err_anonymous_record_with_type : Error<
6723 "types cannot be declared in an anonymous %select{struct|union}0">;
6724 def ext_anonymous_record_with_type : Extension<
6725 "types declared in an anonymous %select{struct|union}0 are a Microsoft "
6726 "extension">, InGroup<MicrosoftAnonTag>;
6727 def ext_anonymous_record_with_anonymous_type : Extension<
6728 "anonymous types declared in an anonymous %select{struct|union}0 "
6729 "are an extension">, InGroup<DiagGroup<"nested-anon-types">>;
6730 def err_anonymous_record_with_function : Error<
6731 "functions cannot be declared in an anonymous %select{struct|union}0">;
6732 def err_anonymous_record_with_static : Error<
6733 "static members cannot be declared in an anonymous %select{struct|union}0">;
6734 def err_anonymous_record_bad_member : Error<
6735 "anonymous %select{struct|union}0 can only contain non-static data members">;
6736 def err_anonymous_record_nonpublic_member : Error<
6737 "anonymous %select{struct|union}0 cannot contain a "
6738 "%select{private|protected}1 data member">;
6739 def ext_ms_anonymous_record : ExtWarn<
6740 "anonymous %select{structs|unions}0 are a Microsoft extension">,
6741 InGroup<MicrosoftAnonTag>;
6743 // C++ local classes
6744 def err_reference_to_local_var_in_enclosing_function : Error<
6745 "reference to local variable %0 declared in enclosing function %1">;
6746 def err_reference_to_local_var_in_enclosing_block : Error<
6747 "reference to local variable %0 declared in enclosing block literal">;
6748 def err_reference_to_local_var_in_enclosing_lambda : Error<
6749 "reference to local variable %0 declared in enclosing lambda expression">;
6750 def err_reference_to_local_var_in_enclosing_context : Error<
6751 "reference to local variable %0 declared in enclosing context">;
6753 def err_static_data_member_not_allowed_in_local_class : Error<
6754 "static data member %0 not allowed in local class %1">;
6756 // C++ derived classes
6757 def err_base_clause_on_union : Error<"unions cannot have base classes">;
6758 def err_base_must_be_class : Error<"base specifier must name a class">;
6759 def err_union_as_base_class : Error<"unions cannot be base classes">;
6760 def err_circular_inheritance : Error<
6761 "circular inheritance between %0 and %1">;
6762 def err_base_class_has_flexible_array_member : Error<
6763 "base class %0 has a flexible array member">;
6764 def err_incomplete_base_class : Error<"base class has incomplete type">;
6765 def err_duplicate_base_class : Error<
6766 "base class %0 specified more than once as a direct base class">;
6767 def warn_inaccessible_base_class : Warning<
6768 "direct base %0 is inaccessible due to ambiguity:%1">,
6769 InGroup<DiagGroup<"inaccessible-base">>;
6770 // FIXME: better way to display derivation? Pass entire thing into diagclient?
6771 def err_ambiguous_derived_to_base_conv : Error<
6772 "ambiguous conversion from derived class %0 to base class %1:%2">;
6773 def err_ambiguous_memptr_conv : Error<
6774 "ambiguous conversion from pointer to member of %select{base|derived}0 "
6775 "class %1 to pointer to member of %select{derived|base}0 class %2:%3">;
6777 def err_memptr_conv_via_virtual : Error<
6778 "conversion from pointer to member of class %0 to pointer to member "
6779 "of class %1 via virtual base %2 is not allowed">;
6781 // C++ member name lookup
6782 def err_ambiguous_member_multiple_subobjects : Error<
6783 "non-static member %0 found in multiple base-class subobjects of type %1:%2">;
6784 def err_ambiguous_member_multiple_subobject_types : Error<
6785 "member %0 found in multiple base classes of different types">;
6786 def note_ambiguous_member_found : Note<"member found by ambiguous name lookup">;
6787 def err_ambiguous_reference : Error<"reference to %0 is ambiguous">;
6788 def note_ambiguous_candidate : Note<"candidate found by name lookup is %q0">;
6789 def err_ambiguous_tag_hiding : Error<"a type named %0 is hidden by a "
6790 "declaration in a different namespace">;
6791 def note_hidden_tag : Note<"type declaration hidden">;
6792 def note_hiding_object : Note<"declaration hides type">;
6794 // C++ operator overloading
6795 def err_operator_overload_needs_class_or_enum : Error<
6796 "overloaded %0 must have at least one parameter of class "
6797 "or enumeration type">;
6799 def err_operator_overload_variadic : Error<"overloaded %0 cannot be variadic">;
6800 def err_operator_overload_static : Error<
6801 "overloaded %0 cannot be a static member function">;
6802 def err_operator_overload_default_arg : Error<
6803 "parameter of overloaded %0 cannot have a default argument">;
6804 def err_operator_overload_must_be : Error<
6805 "overloaded %0 must be a %select{unary|binary|unary or binary}2 operator "
6806 "(has %1 parameter%s1)">;
6808 def err_operator_overload_must_be_member : Error<
6809 "overloaded %0 must be a non-static member function">;
6810 def err_operator_overload_post_incdec_must_be_int : Error<
6811 "parameter of overloaded post-%select{increment|decrement}1 operator must "
6812 "have type 'int' (not %0)">;
6814 // C++ allocation and deallocation functions.
6815 def err_operator_new_delete_declared_in_namespace : Error<
6816 "%0 cannot be declared inside a namespace">;
6817 def err_operator_new_delete_declared_static : Error<
6818 "%0 cannot be declared static in global scope">;
6819 def ext_operator_new_delete_declared_inline : ExtWarn<
6820 "replacement function %0 cannot be declared 'inline'">,
6821 InGroup<DiagGroup<"inline-new-delete">>;
6822 def err_operator_new_delete_invalid_result_type : Error<
6823 "%0 must return type %1">;
6824 def err_operator_new_delete_dependent_result_type : Error<
6825 "%0 cannot have a dependent return type; use %1 instead">;
6826 def err_operator_new_delete_too_few_parameters : Error<
6827 "%0 must have at least one parameter">;
6828 def err_operator_new_delete_template_too_few_parameters : Error<
6829 "%0 template must have at least two parameters">;
6830 def warn_operator_new_returns_null : Warning<
6831 "%0 should not return a null pointer unless it is declared 'throw()'"
6832 "%select{| or 'noexcept'}1">, InGroup<OperatorNewReturnsNull>;
6834 def err_operator_new_dependent_param_type : Error<
6835 "%0 cannot take a dependent type as first parameter; "
6836 "use size_t (%1) instead">;
6837 def err_operator_new_param_type : Error<
6838 "%0 takes type size_t (%1) as first parameter">;
6839 def err_operator_new_default_arg: Error<
6840 "parameter of %0 cannot have a default argument">;
6841 def err_operator_delete_dependent_param_type : Error<
6842 "%0 cannot take a dependent type as first parameter; use %1 instead">;
6843 def err_operator_delete_param_type : Error<
6844 "first parameter of %0 must have type %1">;
6846 // C++ literal operators
6847 def err_literal_operator_outside_namespace : Error<
6848 "literal operator %0 must be in a namespace or global scope">;
6849 def err_literal_operator_id_outside_namespace : Error<
6850 "non-namespace scope '%0' cannot have a literal operator member">;
6851 def err_literal_operator_default_argument : Error<
6852 "literal operator cannot have a default argument">;
6853 // FIXME: This diagnostic sucks
6854 def err_literal_operator_params : Error<
6855 "parameter declaration for literal operator %0 is not valid">;
6856 def err_literal_operator_extern_c : Error<
6857 "literal operator must have C++ linkage">;
6858 def ext_string_literal_operator_template : ExtWarn<
6859 "string literal operator templates are a GNU extension">,
6860 InGroup<GNUStringLiteralOperatorTemplate>;
6861 def warn_user_literal_reserved : Warning<
6862 "user-defined literal suffixes not starting with '_' are reserved"
6863 "%select{; no literal will invoke this operator|}0">,
6864 InGroup<UserDefinedLiterals>;
6866 // C++ conversion functions
6867 def err_conv_function_not_member : Error<
6868 "conversion function must be a non-static member function">;
6869 def err_conv_function_return_type : Error<
6870 "conversion function cannot have a return type">;
6871 def err_conv_function_with_params : Error<
6872 "conversion function cannot have any parameters">;
6873 def err_conv_function_variadic : Error<
6874 "conversion function cannot be variadic">;
6875 def err_conv_function_to_array : Error<
6876 "conversion function cannot convert to an array type">;
6877 def err_conv_function_to_function : Error<
6878 "conversion function cannot convert to a function type">;
6879 def err_conv_function_with_complex_decl : Error<
6880 "cannot specify any part of a return type in the "
6881 "declaration of a conversion function"
6883 "; put the complete type after 'operator'|"
6884 "; use a typedef to declare a conversion to %1|"
6885 "; use an alias template to declare a conversion to %1|"
6887 def err_conv_function_redeclared : Error<
6888 "conversion function cannot be redeclared">;
6889 def warn_conv_to_self_not_used : Warning<
6890 "conversion function converting %0 to itself will never be used">;
6891 def warn_conv_to_base_not_used : Warning<
6892 "conversion function converting %0 to its base class %1 will never be used">;
6893 def warn_conv_to_void_not_used : Warning<
6894 "conversion function converting %0 to %1 will never be used">;
6896 def warn_not_compound_assign : Warning<
6897 "use of unary operator that may be intended as compound assignment (%0=)">;
6899 // C++11 explicit conversion operators
6900 def ext_explicit_conversion_functions : ExtWarn<
6901 "explicit conversion functions are a C++11 extension">, InGroup<CXX11>;
6902 def warn_cxx98_compat_explicit_conversion_functions : Warning<
6903 "explicit conversion functions are incompatible with C++98">,
6904 InGroup<CXX98Compat>, DefaultIgnore;
6906 // C++11 defaulted functions
6907 def err_defaulted_special_member_params : Error<
6908 "an explicitly-defaulted %select{|copy |move }0constructor cannot "
6909 "have default arguments">;
6910 def err_defaulted_special_member_variadic : Error<
6911 "an explicitly-defaulted %select{|copy |move }0constructor cannot "
6913 def err_defaulted_special_member_return_type : Error<
6914 "explicitly-defaulted %select{copy|move}0 assignment operator must "
6916 def err_defaulted_special_member_quals : Error<
6917 "an explicitly-defaulted %select{copy|move}0 assignment operator may not "
6918 "have 'const'%select{, 'constexpr'|}1 or 'volatile' qualifiers">;
6919 def err_defaulted_special_member_volatile_param : Error<
6920 "the parameter for an explicitly-defaulted %select{<<ERROR>>|"
6921 "copy constructor|move constructor|copy assignment operator|"
6922 "move assignment operator|<<ERROR>>}0 may not be volatile">;
6923 def err_defaulted_special_member_move_const_param : Error<
6924 "the parameter for an explicitly-defaulted move "
6925 "%select{constructor|assignment operator}0 may not be const">;
6926 def err_defaulted_special_member_copy_const_param : Error<
6927 "the parameter for this explicitly-defaulted copy "
6928 "%select{constructor|assignment operator}0 is const, but a member or base "
6929 "requires it to be non-const">;
6930 def err_defaulted_copy_assign_not_ref : Error<
6931 "the parameter for an explicitly-defaulted copy assignment operator must be an "
6932 "lvalue reference type">;
6933 def err_incorrect_defaulted_exception_spec : Error<
6934 "exception specification of explicitly defaulted %select{default constructor|"
6935 "copy constructor|move constructor|copy assignment operator|move assignment "
6936 "operator|destructor}0 does not match the "
6938 def err_incorrect_defaulted_constexpr : Error<
6939 "defaulted definition of %select{default constructor|copy constructor|"
6940 "move constructor|copy assignment operator|move assignment operator}0 "
6941 "is not constexpr">;
6942 def err_out_of_line_default_deletes : Error<
6943 "defaulting this %select{default constructor|copy constructor|move "
6944 "constructor|copy assignment operator|move assignment operator|destructor}0 "
6945 "would delete it after its first declaration">;
6946 def warn_vbase_moved_multiple_times : Warning<
6947 "defaulted move assignment operator of %0 will move assign virtual base "
6948 "class %1 multiple times">, InGroup<DiagGroup<"multiple-move-vbase">>;
6949 def note_vbase_moved_here : Note<
6950 "%select{%1 is a virtual base class of base class %2 declared here|"
6951 "virtual base class %1 declared here}0">;
6953 def ext_implicit_exception_spec_mismatch : ExtWarn<
6954 "function previously declared with an %select{explicit|implicit}0 exception "
6955 "specification redeclared with an %select{implicit|explicit}0 exception "
6956 "specification">, InGroup<DiagGroup<"implicit-exception-spec-mismatch">>;
6958 def warn_ptr_arith_precedes_bounds : Warning<
6959 "the pointer decremented by %0 refers before the beginning of the array">,
6960 InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore;
6961 def warn_ptr_arith_exceeds_bounds : Warning<
6962 "the pointer incremented by %0 refers past the end of the array (that "
6963 "contains %1 element%s2)">,
6964 InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore;
6965 def warn_array_index_precedes_bounds : Warning<
6966 "array index %0 is before the beginning of the array">,
6967 InGroup<ArrayBounds>;
6968 def warn_array_index_exceeds_bounds : Warning<
6969 "array index %0 is past the end of the array (which contains %1 "
6970 "element%s2)">, InGroup<ArrayBounds>;
6971 def note_array_index_out_of_bounds : Note<
6972 "array %0 declared here">;
6974 def warn_printf_insufficient_data_args : Warning<
6975 "more '%%' conversions than data arguments">, InGroup<Format>;
6976 def warn_printf_data_arg_not_used : Warning<
6977 "data argument not used by format string">, InGroup<FormatExtraArgs>;
6978 def warn_format_invalid_conversion : Warning<
6979 "invalid conversion specifier '%0'">, InGroup<FormatInvalidSpecifier>;
6980 def warn_printf_incomplete_specifier : Warning<
6981 "incomplete format specifier">, InGroup<Format>;
6982 def warn_missing_format_string : Warning<
6983 "format string missing">, InGroup<Format>;
6984 def warn_scanf_nonzero_width : Warning<
6985 "zero field width in scanf format string is unused">,
6987 def warn_format_conversion_argument_type_mismatch : Warning<
6988 "format specifies type %0 but the argument has "
6989 "%select{type|underlying type}2 %1">,
6991 def warn_format_conversion_argument_type_mismatch_pedantic : Extension<
6992 "format specifies type %0 but the argument has "
6993 "%select{type|underlying type}2 %1">,
6994 InGroup<FormatPedantic>;
6995 def warn_format_argument_needs_cast : Warning<
6996 "%select{values of type|enum values with underlying type}2 '%0' should not "
6997 "be used as format arguments; add an explicit cast to %1 instead">,
6999 def warn_printf_positional_arg_exceeds_data_args : Warning <
7000 "data argument position '%0' exceeds the number of data arguments (%1)">,
7002 def warn_format_zero_positional_specifier : Warning<
7003 "position arguments in format strings start counting at 1 (not 0)">,
7005 def warn_format_invalid_positional_specifier : Warning<
7006 "invalid position specified for %select{field width|field precision}0">,
7008 def warn_format_mix_positional_nonpositional_args : Warning<
7009 "cannot mix positional and non-positional arguments in format string">,
7011 def warn_static_array_too_small : Warning<
7012 "array argument is too small; contains %0 elements, callee requires at least %1">,
7013 InGroup<ArrayBounds>;
7014 def note_callee_static_array : Note<
7015 "callee declares array parameter as static here">;
7016 def warn_empty_format_string : Warning<
7017 "format string is empty">, InGroup<FormatZeroLength>;
7018 def warn_format_string_is_wide_literal : Warning<
7019 "format string should not be a wide string">, InGroup<Format>;
7020 def warn_printf_format_string_contains_null_char : Warning<
7021 "format string contains '\\0' within the string body">, InGroup<Format>;
7022 def warn_printf_format_string_not_null_terminated : Warning<
7023 "format string is not null-terminated">, InGroup<Format>;
7024 def warn_printf_asterisk_missing_arg : Warning<
7025 "'%select{*|.*}0' specified field %select{width|precision}0 is missing a matching 'int' argument">,
7027 def warn_printf_asterisk_wrong_type : Warning<
7028 "field %select{width|precision}0 should have type %1, but argument has type %2">,
7030 def warn_printf_nonsensical_optional_amount: Warning<
7031 "%select{field width|precision}0 used with '%1' conversion specifier, resulting in undefined behavior">,
7033 def warn_printf_nonsensical_flag: Warning<
7034 "flag '%0' results in undefined behavior with '%1' conversion specifier">,
7036 def warn_format_nonsensical_length: Warning<
7037 "length modifier '%0' results in undefined behavior or no effect with '%1' conversion specifier">,
7039 def warn_format_non_standard_positional_arg: Warning<
7040 "positional arguments are not supported by ISO C">, InGroup<FormatNonStandard>, DefaultIgnore;
7041 def warn_format_non_standard: Warning<
7042 "'%0' %select{length modifier|conversion specifier}1 is not supported by ISO C">,
7043 InGroup<FormatNonStandard>, DefaultIgnore;
7044 def warn_format_non_standard_conversion_spec: Warning<
7045 "using length modifier '%0' with conversion specifier '%1' is not supported by ISO C">,
7046 InGroup<FormatNonStandard>, DefaultIgnore;
7047 def warn_printf_ignored_flag: Warning<
7048 "flag '%0' is ignored when flag '%1' is present">,
7050 def warn_printf_empty_objc_flag: Warning<
7051 "missing object format flag">,
7053 def warn_printf_ObjCflags_without_ObjCConversion: Warning<
7054 "object format flags cannot be used with '%0' conversion specifier">,
7056 def warn_printf_invalid_objc_flag: Warning<
7057 "'%0' is not a valid object format flag">,
7059 def warn_scanf_scanlist_incomplete : Warning<
7060 "no closing ']' for '%%[' in scanf format string">,
7062 def note_format_string_defined : Note<"format string is defined here">;
7063 def note_format_fix_specifier : Note<"did you mean to use '%0'?">;
7064 def note_printf_c_str: Note<"did you mean to call the %0 method?">;
7066 def warn_null_arg : Warning<
7067 "null passed to a callee that requires a non-null argument">,
7069 def warn_null_ret : Warning<
7070 "null returned from %select{function|method}0 that requires a non-null return value">,
7073 // CHECK: returning address/reference of stack memory
7074 def warn_ret_stack_addr_ref : Warning<
7075 "%select{address of|reference to}0 stack memory associated with local "
7076 "variable %1 returned">,
7077 InGroup<ReturnStackAddress>;
7078 def warn_ret_local_temp_addr_ref : Warning<
7079 "returning %select{address of|reference to}0 local temporary object">,
7080 InGroup<ReturnStackAddress>;
7081 def warn_ret_addr_label : Warning<
7082 "returning address of label, which is local">,
7083 InGroup<ReturnStackAddress>;
7084 def err_ret_local_block : Error<
7085 "returning block that lives on the local stack">;
7086 def note_ref_var_local_bind : Note<
7087 "binding reference variable %0 here">;
7089 // Check for initializing a member variable with the address or a reference to
7090 // a constructor parameter.
7091 def warn_bind_ref_member_to_parameter : Warning<
7092 "binding reference member %0 to stack allocated parameter %1">,
7093 InGroup<DanglingField>;
7094 def warn_init_ptr_member_to_parameter_addr : Warning<
7095 "initializing pointer member %0 with the stack address of parameter %1">,
7096 InGroup<DanglingField>;
7097 def warn_bind_ref_member_to_temporary : Warning<
7098 "binding reference %select{|subobject of }1member %0 to a temporary value">,
7099 InGroup<DanglingField>;
7100 def note_ref_or_ptr_member_declared_here : Note<
7101 "%select{reference|pointer}0 member declared here">;
7102 def note_ref_subobject_of_member_declared_here : Note<
7103 "member with reference subobject declared here">;
7105 // For non-floating point, expressions of the form x == x or x != x
7106 // should result in a warning, since these always evaluate to a constant.
7107 // Array comparisons have similar warnings
7108 def warn_comparison_always : Warning<
7109 "%select{self-|array }0comparison always evaluates to %select{false|true|a constant}1">,
7110 InGroup<TautologicalCompare>;
7111 def warn_comparison_bitwise_always : Warning<
7112 "bitwise comparison always evaluates to %select{false|true}0">,
7113 InGroup<TautologicalCompare>;
7114 def warn_tautological_overlap_comparison : Warning<
7115 "overlapping comparisons always evaluate to %select{false|true}0">,
7116 InGroup<TautologicalOverlapCompare>, DefaultIgnore;
7118 def warn_stringcompare : Warning<
7119 "result of comparison against %select{a string literal|@encode}0 is "
7120 "unspecified (use strncmp instead)">,
7121 InGroup<StringCompare>;
7123 def warn_identity_field_assign : Warning<
7124 "assigning %select{field|instance variable}0 to itself">,
7125 InGroup<SelfAssignmentField>;
7127 // Type safety attributes
7128 def err_type_tag_for_datatype_not_ice : Error<
7129 "'type_tag_for_datatype' attribute requires the initializer to be "
7130 "an %select{integer|integral}0 constant expression">;
7131 def err_type_tag_for_datatype_too_large : Error<
7132 "'type_tag_for_datatype' attribute requires the initializer to be "
7133 "an %select{integer|integral}0 constant expression "
7134 "that can be represented by a 64 bit integer">;
7135 def warn_type_tag_for_datatype_wrong_kind : Warning<
7136 "this type tag was not designed to be used with this function">,
7137 InGroup<TypeSafety>;
7138 def warn_type_safety_type_mismatch : Warning<
7139 "argument type %0 doesn't match specified %1 type tag "
7140 "%select{that requires %3|}2">, InGroup<TypeSafety>;
7141 def warn_type_safety_null_pointer_required : Warning<
7142 "specified %0 type tag requires a null pointer">, InGroup<TypeSafety>;
7144 // Generic selections.
7145 def err_assoc_type_incomplete : Error<
7146 "type %0 in generic association incomplete">;
7147 def err_assoc_type_nonobject : Error<
7148 "type %0 in generic association not an object type">;
7149 def err_assoc_type_variably_modified : Error<
7150 "type %0 in generic association is a variably modified type">;
7151 def err_assoc_compatible_types : Error<
7152 "type %0 in generic association compatible with previously specified type %1">;
7153 def note_compat_assoc : Note<
7154 "compatible type %0 specified here">;
7155 def err_generic_sel_no_match : Error<
7156 "controlling expression type %0 not compatible with any generic association type">;
7157 def err_generic_sel_multi_match : Error<
7158 "controlling expression type %0 compatible with %1 generic association types">;
7162 def err_blocks_disable : Error<"blocks support disabled - compile with -fblocks"
7163 " or pick a deployment target that supports them">;
7164 def err_block_returning_array_function : Error<
7165 "block cannot return %select{array|function}0 type %1">;
7167 // Builtin annotation
7168 def err_builtin_annotation_first_arg : Error<
7169 "first argument to __builtin_annotation must be an integer">;
7170 def err_builtin_annotation_second_arg : Error<
7171 "second argument to __builtin_annotation must be a non-wide string constant">;
7173 // CFString checking
7174 def err_cfstring_literal_not_string_constant : Error<
7175 "CFString literal is not a string constant">;
7176 def warn_cfstring_truncated : Warning<
7177 "input conversion stopped due to an input byte that does not "
7178 "belong to the input codeset UTF-8">,
7179 InGroup<DiagGroup<"CFString-literal">>;
7182 def err_continue_not_in_loop : Error<
7183 "'continue' statement not in loop statement">;
7184 def err_break_not_in_loop_or_switch : Error<
7185 "'break' statement not in loop or switch statement">;
7186 def warn_loop_ctrl_binds_to_inner : Warning<
7187 "'%0' is bound to current loop, GCC binds it to the enclosing loop">,
7189 def warn_break_binds_to_switch : Warning<
7190 "'break' is bound to loop, GCC binds it to switch">,
7192 def err_default_not_in_switch : Error<
7193 "'default' statement not in switch statement">;
7194 def err_case_not_in_switch : Error<"'case' statement not in switch statement">;
7195 def warn_bool_switch_condition : Warning<
7196 "switch condition has boolean value">, InGroup<SwitchBool>;
7197 def warn_case_value_overflow : Warning<
7198 "overflow converting case value to switch condition type (%0 to %1)">,
7200 def err_duplicate_case : Error<"duplicate case value '%0'">;
7201 def err_duplicate_case_differing_expr : Error<
7202 "duplicate case value: '%0' and '%1' both equal '%2'">;
7203 def warn_case_empty_range : Warning<"empty case range specified">;
7204 def warn_missing_case_for_condition :
7205 Warning<"no case matching constant switch condition '%0'">;
7207 def warn_def_missing_case : Warning<"%plural{"
7208 "1:enumeration value %1 not explicitly handled in switch|"
7209 "2:enumeration values %1 and %2 not explicitly handled in switch|"
7210 "3:enumeration values %1, %2, and %3 not explicitly handled in switch|"
7211 ":%0 enumeration values not explicitly handled in switch: %1, %2, %3...}0">,
7212 InGroup<SwitchEnum>, DefaultIgnore;
7214 def warn_missing_case : Warning<"%plural{"
7215 "1:enumeration value %1 not handled in switch|"
7216 "2:enumeration values %1 and %2 not handled in switch|"
7217 "3:enumeration values %1, %2, and %3 not handled in switch|"
7218 ":%0 enumeration values not handled in switch: %1, %2, %3...}0">,
7221 def warn_unannotated_fallthrough : Warning<
7222 "unannotated fall-through between switch labels">,
7223 InGroup<ImplicitFallthrough>, DefaultIgnore;
7224 def warn_unannotated_fallthrough_per_function : Warning<
7225 "unannotated fall-through between switch labels in partly-annotated "
7226 "function">, InGroup<ImplicitFallthroughPerFunction>, DefaultIgnore;
7227 def note_insert_fallthrough_fixit : Note<
7228 "insert '%0;' to silence this warning">;
7229 def note_insert_break_fixit : Note<
7230 "insert 'break;' to avoid fall-through">;
7231 def err_fallthrough_attr_wrong_target : Error<
7232 "clang::fallthrough attribute is only allowed on empty statements">;
7233 def note_fallthrough_insert_semi_fixit : Note<"did you forget ';'?">;
7234 def err_fallthrough_attr_outside_switch : Error<
7235 "fallthrough annotation is outside switch statement">;
7236 def warn_fallthrough_attr_invalid_placement : Warning<
7237 "fallthrough annotation does not directly precede switch label">,
7238 InGroup<ImplicitFallthrough>;
7239 def warn_fallthrough_attr_unreachable : Warning<
7240 "fallthrough annotation in unreachable code">,
7241 InGroup<ImplicitFallthrough>;
7243 def warn_unreachable_default : Warning<
7244 "default label in switch which covers all enumeration values">,
7245 InGroup<CoveredSwitchDefault>, DefaultIgnore;
7246 def warn_not_in_enum : Warning<"case value not in enumerated type %0">,
7248 def warn_not_in_enum_assignment : Warning<"integer constant not in range "
7249 "of enumerated type %0">, InGroup<DiagGroup<"assign-enum">>, DefaultIgnore;
7250 def err_typecheck_statement_requires_scalar : Error<
7251 "statement requires expression of scalar type (%0 invalid)">;
7252 def err_typecheck_statement_requires_integer : Error<
7253 "statement requires expression of integer type (%0 invalid)">;
7254 def err_multiple_default_labels_defined : Error<
7255 "multiple default labels in one switch">;
7256 def err_switch_multiple_conversions : Error<
7257 "multiple conversions from switch condition type %0 to an integral or "
7258 "enumeration type">;
7259 def note_switch_conversion : Note<
7260 "conversion to %select{integral|enumeration}0 type %1">;
7261 def err_switch_explicit_conversion : Error<
7262 "switch condition type %0 requires explicit conversion to %1">;
7263 def err_switch_incomplete_class_type : Error<
7264 "switch condition has incomplete class type %0">;
7266 def warn_empty_if_body : Warning<
7267 "if statement has empty body">, InGroup<EmptyBody>;
7268 def warn_empty_for_body : Warning<
7269 "for loop has empty body">, InGroup<EmptyBody>;
7270 def warn_empty_range_based_for_body : Warning<
7271 "range-based for loop has empty body">, InGroup<EmptyBody>;
7272 def warn_empty_while_body : Warning<
7273 "while loop has empty body">, InGroup<EmptyBody>;
7274 def warn_empty_switch_body : Warning<
7275 "switch statement has empty body">, InGroup<EmptyBody>;
7276 def note_empty_body_on_separate_line : Note<
7277 "put the semicolon on a separate line to silence this warning">;
7279 def err_va_start_used_in_non_variadic_function : Error<
7280 "'va_start' used in function with fixed args">;
7281 def err_va_start_used_in_wrong_abi_function : Error<
7282 "'va_start' used in %select{System V|Win64}0 ABI function">;
7283 def err_ms_va_start_used_in_sysv_function : Error<
7284 "'__builtin_ms_va_start' used in System V ABI function">;
7285 def warn_second_parameter_of_va_start_not_last_named_argument : Warning<
7286 "second parameter of 'va_start' not last named argument">, InGroup<Varargs>;
7287 def warn_va_start_of_reference_type_is_undefined : Warning<
7288 "'va_start' has undefined behavior with reference types">, InGroup<Varargs>;
7289 def err_first_argument_to_va_arg_not_of_type_va_list : Error<
7290 "first argument to 'va_arg' is of type %0 and not 'va_list'">;
7291 def err_second_parameter_to_va_arg_incomplete: Error<
7292 "second argument to 'va_arg' is of incomplete type %0">;
7293 def err_second_parameter_to_va_arg_abstract: Error<
7294 "second argument to 'va_arg' is of abstract type %0">;
7295 def warn_second_parameter_to_va_arg_not_pod : Warning<
7296 "second argument to 'va_arg' is of non-POD type %0">,
7297 InGroup<NonPODVarargs>, DefaultError;
7298 def warn_second_parameter_to_va_arg_ownership_qualified : Warning<
7299 "second argument to 'va_arg' is of ARC ownership-qualified type %0">,
7300 InGroup<NonPODVarargs>, DefaultError;
7301 def warn_second_parameter_to_va_arg_never_compatible : Warning<
7302 "second argument to 'va_arg' is of promotable type %0; this va_arg has "
7303 "undefined behavior because arguments will be promoted to %1">, InGroup<Varargs>;
7305 def warn_return_missing_expr : Warning<
7306 "non-void %select{function|method}1 %0 should return a value">, DefaultError,
7307 InGroup<ReturnType>;
7308 def ext_return_missing_expr : ExtWarn<
7309 "non-void %select{function|method}1 %0 should return a value">, DefaultError,
7310 InGroup<ReturnType>;
7311 def ext_return_has_expr : ExtWarn<
7312 "%select{void function|void method|constructor|destructor}1 %0 "
7313 "should not return a value">,
7314 DefaultError, InGroup<ReturnType>;
7315 def ext_return_has_void_expr : Extension<
7316 "void %select{function|method|block}1 %0 should not return void expression">;
7317 def err_return_init_list : Error<
7318 "%select{void function|void method|constructor|destructor}1 %0 "
7319 "must not return a value">;
7320 def err_ctor_dtor_returns_void : Error<
7321 "%select{constructor|destructor}1 %0 must not return void expression">;
7322 def warn_noreturn_function_has_return_expr : Warning<
7323 "function %0 declared 'noreturn' should not return">,
7324 InGroup<InvalidNoreturn>;
7325 def warn_falloff_noreturn_function : Warning<
7326 "function declared 'noreturn' should not return">,
7327 InGroup<InvalidNoreturn>;
7328 def err_noreturn_block_has_return_expr : Error<
7329 "block declared 'noreturn' should not return">;
7330 def err_noreturn_missing_on_first_decl : Error<
7331 "function declared '[[noreturn]]' after its first declaration">;
7332 def note_noreturn_missing_first_decl : Note<
7333 "declaration missing '[[noreturn]]' attribute is here">;
7334 def err_carries_dependency_missing_on_first_decl : Error<
7335 "%select{function|parameter}0 declared '[[carries_dependency]]' "
7336 "after its first declaration">;
7337 def note_carries_dependency_missing_first_decl : Note<
7338 "declaration missing '[[carries_dependency]]' attribute is here">;
7339 def err_carries_dependency_param_not_function_decl : Error<
7340 "'[[carries_dependency]]' attribute only allowed on parameter in a function "
7341 "declaration or lambda">;
7342 def err_block_on_nonlocal : Error<
7343 "__block attribute not allowed, only allowed on local variables">;
7344 def err_block_on_vm : Error<
7345 "__block attribute not allowed on declaration with a variably modified type">;
7347 def err_shufflevector_non_vector : Error<
7348 "first two arguments to __builtin_shufflevector must be vectors">;
7349 def err_shufflevector_incompatible_vector : Error<
7350 "first two arguments to __builtin_shufflevector must have the same type">;
7351 def err_shufflevector_nonconstant_argument : Error<
7352 "index for __builtin_shufflevector must be a constant integer">;
7353 def err_shufflevector_argument_too_large : Error<
7354 "index for __builtin_shufflevector must be less than the total number "
7355 "of vector elements">;
7357 def err_convertvector_non_vector : Error<
7358 "first argument to __builtin_convertvector must be a vector">;
7359 def err_convertvector_non_vector_type : Error<
7360 "second argument to __builtin_convertvector must be a vector type">;
7361 def err_convertvector_incompatible_vector : Error<
7362 "first two arguments to __builtin_convertvector must have the same number of elements">;
7364 def err_first_argument_to_cwsc_not_call : Error<
7365 "first argument to __builtin_call_with_static_chain must be a non-member call expression">;
7366 def err_first_argument_to_cwsc_block_call : Error<
7367 "first argument to __builtin_call_with_static_chain must not be a block call">;
7368 def err_first_argument_to_cwsc_builtin_call : Error<
7369 "first argument to __builtin_call_with_static_chain must not be a builtin call">;
7370 def err_first_argument_to_cwsc_pdtor_call : Error<
7371 "first argument to __builtin_call_with_static_chain must not be a pseudo-destructor call">;
7372 def err_second_argument_to_cwsc_not_pointer : Error<
7373 "second argument to __builtin_call_with_static_chain must be of pointer type">;
7375 def err_vector_incorrect_num_initializers : Error<
7376 "%select{too many|too few}0 elements in vector initialization (expected %1 elements, have %2)">;
7377 def err_altivec_empty_initializer : Error<"expected initializer">;
7379 def err_invalid_neon_type_code : Error<
7380 "incompatible constant for this __builtin_neon function">;
7381 def err_argument_invalid_range : Error<
7382 "argument should be a value from %0 to %1">;
7383 def warn_neon_vector_initializer_non_portable : Warning<
7384 "vector initializers are not compatible with NEON intrinsics in big endian "
7385 "mode">, InGroup<DiagGroup<"nonportable-vector-initialization">>;
7386 def note_neon_vector_initializer_non_portable : Note<
7387 "consider using vld1_%0%1() to initialize a vector from memory, or "
7388 "vcreate_%0%1() to initialize from an integer constant">;
7389 def note_neon_vector_initializer_non_portable_q : Note<
7390 "consider using vld1q_%0%1() to initialize a vector from memory, or "
7391 "vcombine_%0%1(vcreate_%0%1(), vcreate_%0%1()) to initialize from integer "
7393 def err_systemz_invalid_tabort_code : Error<
7394 "invalid transaction abort code">;
7395 def err_64_bit_builtin_32_bit_tgt : Error<
7396 "this builtin is only available on 64-bit targets">;
7397 def err_ppc_builtin_only_on_pwr7 : Error<
7398 "this builtin is only valid on POWER7 or later CPUs">;
7399 def err_x86_builtin_32_bit_tgt : Error<
7400 "this builtin is only available on x86-64 targets">;
7402 def err_builtin_longjmp_unsupported : Error<
7403 "__builtin_longjmp is not supported for the current target">;
7404 def err_builtin_setjmp_unsupported : Error<
7405 "__builtin_setjmp is not supported for the current target">;
7407 def err_builtin_longjmp_invalid_val : Error<
7408 "argument to __builtin_longjmp must be a constant 1">;
7409 def err_builtin_requires_language : Error<"'%0' is only available in %1">;
7411 def err_constant_integer_arg_type : Error<
7412 "argument to %0 must be a constant integer">;
7414 def ext_mixed_decls_code : Extension<
7415 "ISO C90 forbids mixing declarations and code">,
7416 InGroup<DiagGroup<"declaration-after-statement">>;
7418 def err_non_local_variable_decl_in_for : Error<
7419 "declaration of non-local variable in 'for' loop">;
7420 def err_non_variable_decl_in_for : Error<
7421 "non-variable declaration in 'for' loop">;
7422 def err_toomany_element_decls : Error<
7423 "only one element declaration is allowed">;
7424 def err_selector_element_not_lvalue : Error<
7425 "selector element is not a valid lvalue">;
7426 def err_selector_element_type : Error<
7427 "selector element type %0 is not a valid object">;
7428 def err_selector_element_const_type : Error<
7429 "selector element of type %0 cannot be a constant l-value expression">;
7430 def err_collection_expr_type : Error<
7431 "the type %0 is not a pointer to a fast-enumerable object">;
7432 def warn_collection_expr_type : Warning<
7433 "collection expression type %0 may not respond to %1">;
7435 def err_invalid_conversion_between_ext_vectors : Error<
7436 "invalid conversion between ext-vector type %0 and %1">;
7438 def warn_duplicate_attribute_exact : Warning<
7439 "attribute %0 is already applied">, InGroup<IgnoredAttributes>;
7441 def warn_duplicate_attribute : Warning<
7442 "attribute %0 is already applied with different parameters">,
7443 InGroup<IgnoredAttributes>;
7445 def warn_sync_fetch_and_nand_semantics_change : Warning<
7446 "the semantics of this intrinsic changed with GCC "
7447 "version 4.4 - the newer semantics are provided here">,
7448 InGroup<DiagGroup<"sync-fetch-and-nand-semantics-changed">>;
7451 def ext_invalid_sign_spec : Extension<"'%0' cannot be signed or unsigned">;
7452 def warn_receiver_forward_class : Warning<
7453 "receiver %0 is a forward class and corresponding @interface may not exist">,
7454 InGroup<ForwardClassReceiver>;
7455 def note_method_sent_forward_class : Note<"method %0 is used for the forward class">;
7456 def ext_missing_declspec : ExtWarn<
7457 "declaration specifier missing, defaulting to 'int'">;
7458 def ext_missing_type_specifier : ExtWarn<
7459 "type specifier missing, defaults to 'int'">,
7460 InGroup<ImplicitInt>;
7461 def err_decimal_unsupported : Error<
7462 "GNU decimal type extension not supported">;
7463 def err_missing_type_specifier : Error<
7464 "C++ requires a type specifier for all declarations">;
7465 def err_objc_array_of_interfaces : Error<
7466 "array of interface %0 is invalid (probably should be an array of pointers)">;
7467 def ext_c99_array_usage : Extension<
7468 "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 "
7469 "feature">, InGroup<C99>;
7470 def err_c99_array_usage_cxx : Error<
7471 "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 "
7472 "feature, not permitted in C++">;
7473 def err_type_requires_extension : Error<
7474 "use of type %0 requires %1 extension to be enabled">;
7475 def err_int128_unsupported : Error<
7476 "__int128 is not supported on this target">;
7477 def err_nsconsumed_attribute_mismatch : Error<
7478 "overriding method has mismatched ns_consumed attribute on its"
7480 def err_nsreturns_retained_attribute_mismatch : Error<
7481 "overriding method has mismatched ns_returns_%select{not_retained|retained}0"
7484 def note_getter_unavailable : Note<
7485 "or because setter is declared here, but no getter method %0 is found">;
7486 def err_invalid_protocol_qualifiers : Error<
7487 "invalid protocol qualifiers on non-ObjC type">;
7488 def warn_ivar_use_hidden : Warning<
7489 "local declaration of %0 hides instance variable">,
7490 InGroup<DiagGroup<"shadow-ivar">>;
7491 def warn_direct_initialize_call : Warning<
7492 "explicit call to +initialize results in duplicate call to +initialize">,
7493 InGroup<ExplicitInitializeCall>;
7494 def warn_direct_super_initialize_call : Warning<
7495 "explicit call to [super initialize] should only be in implementation "
7497 InGroup<ExplicitInitializeCall>;
7498 def error_ivar_use_in_class_method : Error<
7499 "instance variable %0 accessed in class method">;
7500 def error_implicit_ivar_access : Error<
7501 "instance variable %0 cannot be accessed because 'self' has been redeclared">;
7502 def error_private_ivar_access : Error<"instance variable %0 is private">,
7504 def error_protected_ivar_access : Error<"instance variable %0 is protected">,
7506 def warn_maynot_respond : Warning<"%0 may not respond to %1">;
7507 def ext_typecheck_base_super : Warning<
7508 "method parameter type "
7509 "%diff{$ does not match super class method parameter type $|"
7510 "does not match super class method parameter type}0,1">,
7511 InGroup<SuperSubClassMismatch>, DefaultIgnore;
7512 def warn_missing_method_return_type : Warning<
7513 "method has no return type specified; defaults to 'id'">,
7514 InGroup<MissingMethodReturnType>, DefaultIgnore;
7515 def warn_direct_ivar_access : Warning<"instance variable %0 is being "
7516 "directly accessed">, InGroup<DiagGroup<"direct-ivar-access">>, DefaultIgnore;
7518 // Spell-checking diagnostics
7519 def err_unknown_typename : Error<
7520 "unknown type name %0">;
7521 def err_unknown_type_or_class_name_suggest : Error<
7522 "unknown %select{type|class}1 name %0; did you mean %2?">;
7523 def err_unknown_typename_suggest : Error<
7524 "unknown type name %0; did you mean %1?">;
7525 def err_unknown_nested_typename_suggest : Error<
7526 "no type named %0 in %1; did you mean %select{|simply }2%3?">;
7527 def err_no_member_suggest : Error<"no member named %0 in %1; did you mean %select{|simply }2%3?">;
7528 def err_undeclared_use_suggest : Error<
7529 "use of undeclared %0; did you mean %1?">;
7530 def err_undeclared_var_use_suggest : Error<
7531 "use of undeclared identifier %0; did you mean %1?">;
7532 def err_no_template_suggest : Error<"no template named %0; did you mean %1?">;
7533 def err_no_member_template_suggest : Error<
7534 "no template named %0 in %1; did you mean %select{|simply }2%3?">;
7535 def err_mem_init_not_member_or_class_suggest : Error<
7536 "initializer %0 does not name a non-static data member or base "
7537 "class; did you mean the %select{base class|member}1 %2?">;
7538 def err_field_designator_unknown_suggest : Error<
7539 "field designator %0 does not refer to any field in type %1; did you mean "
7541 def err_typecheck_member_reference_ivar_suggest : Error<
7542 "%0 does not have a member named %1; did you mean %2?">;
7543 def err_property_not_found_suggest : Error<
7544 "property %0 not found on object of type %1; did you mean %2?">;
7545 def err_ivar_access_using_property_syntax_suggest : Error<
7546 "property %0 not found on object of type %1; did you mean to access instance variable %2?">;
7547 def warn_property_access_suggest : Warning<
7548 "property %0 not found on object of type %1; did you mean to access property %2?">,
7549 InGroup<PropertyAccessDotSyntax>;
7550 def err_property_found_suggest : Error<
7551 "property %0 found on object of type %1; did you mean to access "
7552 "it with the \".\" operator?">;
7553 def err_undef_interface_suggest : Error<
7554 "cannot find interface declaration for %0; did you mean %1?">;
7555 def warn_undef_interface_suggest : Warning<
7556 "cannot find interface declaration for %0; did you mean %1?">;
7557 def err_undef_superclass_suggest : Error<
7558 "cannot find interface declaration for %0, superclass of %1; did you mean "
7560 def err_undeclared_protocol_suggest : Error<
7561 "cannot find protocol declaration for %0; did you mean %1?">;
7562 def note_base_class_specified_here : Note<
7563 "base class %0 specified here">;
7564 def err_using_directive_suggest : Error<
7565 "no namespace named %0; did you mean %1?">;
7566 def err_using_directive_member_suggest : Error<
7567 "no namespace named %0 in %1; did you mean %select{|simply }2%3?">;
7568 def note_namespace_defined_here : Note<"namespace %0 defined here">;
7569 def err_sizeof_pack_no_pack_name_suggest : Error<
7570 "%0 does not refer to the name of a parameter pack; did you mean %1?">;
7571 def note_parameter_pack_here : Note<"parameter pack %0 declared here">;
7573 def err_uncasted_use_of_unknown_any : Error<
7574 "%0 has unknown type; cast it to its declared type to use it">;
7575 def err_uncasted_call_of_unknown_any : Error<
7576 "%0 has unknown return type; cast the call to its declared return type">;
7577 def err_uncasted_send_to_unknown_any_method : Error<
7578 "no known method %select{%objcinstance1|%objcclass1}0; cast the "
7579 "message send to the method's return type">;
7580 def err_unsupported_unknown_any_decl : Error<
7581 "%0 has unknown type, which is not supported for this kind of declaration">;
7582 def err_unsupported_unknown_any_expr : Error<
7583 "unsupported expression with unknown type">;
7584 def err_unsupported_unknown_any_call : Error<
7585 "call to unsupported expression with unknown type">;
7586 def err_unknown_any_addrof : Error<
7587 "the address of a declaration with unknown type "
7588 "can only be cast to a pointer type">;
7589 def err_unknown_any_var_function_type : Error<
7590 "variable %0 with unknown type cannot be given a function type">;
7591 def err_unknown_any_function : Error<
7592 "function %0 with unknown type must be given a function type">;
7594 def err_filter_expression_integral : Error<
7595 "filter expression type should be an integral value not %0">;
7597 def err_non_asm_stmt_in_naked_function : Error<
7598 "non-ASM statement in naked function is not supported">;
7599 def err_asm_naked_this_ref : Error<
7600 "'this' pointer references not allowed in naked functions">;
7601 def err_asm_naked_parm_ref : Error<
7602 "parameter references not allowed in naked functions">;
7604 def ext_deprecated_attr_is_a_cxx14_extension : ExtWarn<
7605 "use of the 'deprecated' attribute is a C++14 extension">, InGroup<CXX14>;
7607 // OpenCL warnings and errors.
7608 def err_invalid_astype_of_different_size : Error<
7609 "invalid reinterpretation: sizes of %0 and %1 must match">;
7610 def err_static_kernel : Error<
7611 "kernel functions cannot be declared static">;
7612 def err_opencl_ptrptr_kernel_param : Error<
7613 "kernel parameter cannot be declared as a pointer to a pointer">;
7614 def err_opencl_private_ptr_kernel_param : Error<
7615 "kernel parameter cannot be declared as a pointer to the __private address space">;
7616 def err_opencl_non_kernel_variable : Error<
7617 "non-kernel function variable cannot be declared in %0 address space">;
7618 def err_static_function_scope : Error<
7619 "variables in function scope cannot be declared static">;
7620 def err_opencl_bitfields : Error<
7621 "bitfields are not supported in OpenCL">;
7622 def err_opencl_vla : Error<
7623 "variable length arrays are not supported in OpenCL">;
7624 def err_bad_kernel_param_type : Error<
7625 "%0 cannot be used as the type of a kernel parameter">;
7626 def err_record_with_pointers_kernel_param : Error<
7627 "%select{struct|union}0 kernel parameters may not contain pointers">;
7628 def note_within_field_of_type : Note<
7629 "within field of type %0 declared here">;
7630 def note_illegal_field_declared_here : Note<
7631 "field of illegal %select{type|pointer type}0 %1 declared here">;
7632 def err_event_t_global_var : Error<
7633 "the event_t type cannot be used to declare a program scope variable">;
7634 def err_event_t_struct_field : Error<
7635 "the event_t type cannot be used to declare a structure or union field">;
7636 def err_event_t_addr_space_qual : Error<
7637 "the event_t type can only be used with __private address space qualifier">;
7638 def err_expected_kernel_void_return_type : Error<
7639 "kernel must have void return type">;
7640 def err_sampler_argument_required : Error<
7641 "sampler_t variable required - got %0">;
7642 def err_wrong_sampler_addressspace: Error<
7643 "sampler type cannot be used with the __local and __global address space qualifiers">;
7644 def err_opencl_global_invalid_addr_space : Error<
7645 "program scope variable must reside in %0 address space">;
7646 def err_opencl_no_main : Error<"%select{function|kernel}0 cannot be called 'main'">;
7647 def err_opencl_kernel_attr :
7648 Error<"attribute %0 can only be applied to a kernel function">;
7649 def err_opencl_return_value_with_address_space : Error<
7650 "return value cannot be qualified with address space">;
7651 def err_opencl_constant_no_init : Error<
7652 "variable in constant address space must be initialized">;
7653 def err_atomic_init_constant : Error<
7654 "atomic variable can only be assigned to a compile time constant"
7655 " in the declaration statement in the program scope">;
7656 def err_opencl_implicit_vector_conversion : Error<
7657 "implicit conversions between vector types (%0 and %1) are not permitted">;
7659 // OpenCL Section 6.8.g
7660 def err_opencl_unknown_type_specifier : Error<
7661 "OpenCL does not support the '%0' %select{type qualifier|storage class specifier}1">;
7663 } // end of sema category
7665 let CategoryName = "OpenMP Issue" in {
7667 def err_omp_expected_var_arg : Error<
7668 "%0 is not a global variable, static local variable or static data member">;
7669 def err_omp_expected_var_arg_suggest : Error<
7670 "%0 is not a global variable, static local variable or static data member; "
7672 def err_omp_global_var_arg : Error<
7673 "arguments of '#pragma omp %0' must have %select{global storage|static storage duration}1">;
7674 def err_omp_ref_type_arg : Error<
7675 "arguments of '#pragma omp %0' cannot be of reference type %1">;
7676 def err_omp_var_scope : Error<
7677 "'#pragma omp %0' must appear in the scope of the %q1 variable declaration">;
7678 def err_omp_var_used : Error<
7679 "'#pragma omp %0' must precede all references to variable %q1">;
7680 def err_omp_var_thread_local : Error<
7681 "variable %0 cannot be threadprivate because it is %select{thread-local|a global named register variable}1">;
7682 def err_omp_private_incomplete_type : Error<
7683 "a private variable with incomplete type %0">;
7684 def err_omp_firstprivate_incomplete_type : Error<
7685 "a firstprivate variable with incomplete type %0">;
7686 def err_omp_lastprivate_incomplete_type : Error<
7687 "a lastprivate variable with incomplete type %0">;
7688 def err_omp_reduction_incomplete_type : Error<
7689 "a reduction list item with incomplete type %0">;
7690 def err_omp_unexpected_clause_value : Error<
7691 "expected %0 in OpenMP clause '%1'">;
7692 def err_omp_expected_var_name : Error<
7693 "expected variable name">;
7694 def err_omp_expected_var_name_or_array_item : Error<
7695 "expected variable name, array element or array section">;
7696 def note_omp_task_predetermined_firstprivate_here : Note<
7697 "predetermined as a firstprivate in a task construct here">;
7698 def err_omp_threadprivate_incomplete_type : Error<
7699 "threadprivate variable with incomplete type %0">;
7700 def err_omp_no_dsa_for_variable : Error<
7701 "variable %0 must have explicitly specified data sharing attributes">;
7702 def err_omp_wrong_dsa : Error<
7703 "%0 variable cannot be %1">;
7704 def err_omp_variably_modified_type_not_supported : Error<
7705 "arguments of OpenMP clause '%0' in '#pragma omp %2' directive cannot be of variably-modified type %1">;
7706 def note_omp_explicit_dsa : Note<
7708 def note_omp_predetermined_dsa : Note<
7709 "%select{static data member is predetermined as shared|"
7710 "variable with static storage duration is predetermined as shared|"
7711 "loop iteration variable is predetermined as private|"
7712 "loop iteration variable is predetermined as linear|"
7713 "loop iteration variable is predetermined as lastprivate|"
7714 "constant variable is predetermined as shared|"
7715 "global variable is predetermined as shared|"
7716 "non-shared variable in a task construct is predetermined as firstprivate|"
7717 "variable with automatic storage duration is predetermined as private}0"
7718 "%select{|; perhaps you forget to enclose 'omp %2' directive into a parallel or another task region?}1">;
7719 def note_omp_implicit_dsa : Note<
7720 "implicitly determined as %0">;
7721 def err_omp_loop_var_dsa : Error<
7722 "loop iteration variable in the associated loop of 'omp %1' directive may not be %0, predetermined as %2">;
7723 def err_omp_not_for : Error<
7724 "%select{statement after '#pragma omp %1' must be a for loop|"
7725 "expected %2 for loops after '#pragma omp %1'%select{|, but found only %4}3}0">;
7726 def note_omp_collapse_ordered_expr : Note<
7727 "as specified in %select{'collapse'|'ordered'|'collapse' and 'ordered'}0 clause%select{||s}0">;
7728 def err_omp_negative_expression_in_clause : Error<
7729 "argument to '%0' clause must be a %select{non-negative|strictly positive}1 integer value">;
7730 def err_omp_not_integral : Error<
7731 "expression must have integral or unscoped enumeration "
7733 def err_omp_incomplete_type : Error<
7734 "expression has incomplete class type %0">;
7735 def err_omp_explicit_conversion : Error<
7736 "expression requires explicit conversion from %0 to %1">;
7737 def note_omp_conversion_here : Note<
7738 "conversion to %select{integral|enumeration}0 type %1 declared here">;
7739 def err_omp_ambiguous_conversion : Error<
7740 "ambiguous conversion from type %0 to an integral or unscoped "
7741 "enumeration type">;
7742 def err_omp_required_access : Error<
7743 "%0 variable must be %1">;
7744 def err_omp_const_variable : Error<
7745 "const-qualified variable cannot be %0">;
7746 def err_omp_const_reduction_list_item : Error<
7747 "const-qualified list item cannot be reduction">;
7748 def err_omp_linear_incomplete_type : Error<
7749 "a linear variable with incomplete type %0">;
7750 def err_omp_linear_expected_int_or_ptr : Error<
7751 "argument of a linear clause should be of integral or pointer "
7753 def warn_omp_linear_step_zero : Warning<
7754 "zero linear step (%0 %select{|and other variables in clause }1should probably be const)">,
7755 InGroup<OpenMPClauses>;
7756 def warn_omp_alignment_not_power_of_two : Warning<
7757 "aligned clause will be ignored because the requested alignment is not a power of 2">,
7758 InGroup<OpenMPClauses>;
7759 def err_omp_aligned_expected_array_or_ptr : Error<
7760 "argument of aligned clause should be array"
7761 "%select{ or pointer|, pointer, reference to array or reference to pointer}1"
7763 def err_omp_aligned_twice : Error<
7764 "a variable cannot appear in more than one aligned clause">;
7765 def err_omp_local_var_in_threadprivate_init : Error<
7766 "variable with local storage in initial value of threadprivate variable">;
7767 def err_omp_loop_not_canonical_init : Error<
7768 "initialization clause of OpenMP for loop is not in canonical form "
7769 "('var = init' or 'T var = init')">;
7770 def ext_omp_loop_not_canonical_init : ExtWarn<
7771 "initialization clause of OpenMP for loop is not in canonical form "
7772 "('var = init' or 'T var = init')">, InGroup<OpenMPLoopForm>;
7773 def err_omp_loop_not_canonical_cond : Error<
7774 "condition of OpenMP for loop must be a relational comparison "
7775 "('<', '<=', '>', or '>=') of loop variable %0">;
7776 def err_omp_loop_not_canonical_incr : Error<
7777 "increment clause of OpenMP for loop must perform simple addition "
7778 "or subtraction on loop variable %0">;
7779 def err_omp_loop_variable_type : Error<
7780 "variable must be of integer or %select{pointer|random access iterator}0 type">;
7781 def err_omp_loop_incr_not_compatible : Error<
7782 "increment expression must cause %0 to %select{decrease|increase}1 "
7783 "on each iteration of OpenMP for loop">;
7784 def note_omp_loop_cond_requres_compatible_incr : Note<
7785 "loop step is expected to be %select{negative|positive}0 due to this condition">;
7786 def err_omp_loop_diff_cxx : Error<
7787 "could not calculate number of iterations calling 'operator-' with "
7788 "upper and lower loop bounds">;
7789 def err_omp_loop_cannot_use_stmt : Error<
7790 "'%0' statement cannot be used in OpenMP for loop">;
7791 def err_omp_simd_region_cannot_use_stmt : Error<
7792 "'%0' statement cannot be used in OpenMP simd region">;
7793 def warn_omp_loop_64_bit_var : Warning<
7794 "OpenMP loop iteration variable cannot have more than 64 bits size and will be narrowed">,
7795 InGroup<OpenMPLoopForm>;
7796 def err_omp_unknown_reduction_identifier : Error<
7797 "incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max'">;
7798 def err_omp_reduction_type_array : Error<
7799 "a reduction list item with array type %0">;
7800 def err_omp_reduction_ref_type_arg : Error<
7801 "argument of OpenMP clause 'reduction' must reference the same object in all threads">;
7802 def err_omp_clause_not_arithmetic_type_arg : Error<
7803 "arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of %select{scalar|arithmetic}0 type">;
7804 def err_omp_clause_floating_type_arg : Error<
7805 "arguments of OpenMP clause 'reduction' with bitwise operators cannot be of floating type">;
7806 def err_omp_once_referenced : Error<
7807 "variable can appear only once in OpenMP '%0' clause">;
7808 def note_omp_referenced : Note<
7809 "previously referenced here">;
7810 def err_omp_reduction_in_task : Error<
7811 "reduction variables may not be accessed in an explicit task">;
7812 def err_omp_reduction_id_not_compatible : Error<
7813 "list item of type %0 is not valid for specified reduction operation: unable to provide default initialization value">;
7814 def err_omp_prohibited_region : Error<
7815 "region cannot be%select{| closely}0 nested inside '%1' region"
7816 "%select{|; perhaps you forget to enclose 'omp %3' directive into a parallel region?|"
7817 "; perhaps you forget to enclose 'omp %3' directive into a for or a parallel for region with 'ordered' clause?|"
7818 "; perhaps you forget to enclose 'omp %3' directive into a target region?|"
7819 "; perhaps you forget to enclose 'omp %3' directive into a teams region?}2">;
7820 def err_omp_prohibited_region_simd : Error<
7821 "OpenMP constructs may not be nested inside a simd region">;
7822 def err_omp_prohibited_region_atomic : Error<
7823 "OpenMP constructs may not be nested inside an atomic region">;
7824 def err_omp_prohibited_region_critical_same_name : Error<
7825 "cannot nest 'critical' regions having the same name %0">;
7826 def note_omp_previous_critical_region : Note<
7827 "previous 'critical' region starts here">;
7828 def err_omp_sections_not_compound_stmt : Error<
7829 "the statement for '#pragma omp sections' must be a compound statement">;
7830 def err_omp_parallel_sections_not_compound_stmt : Error<
7831 "the statement for '#pragma omp parallel sections' must be a compound statement">;
7832 def err_omp_orphaned_section_directive : Error<
7833 "%select{orphaned 'omp section' directives are prohibited, it|'omp section' directive}0"
7834 " must be closely nested to a sections region%select{|, not a %1 region}0">;
7835 def err_omp_sections_substmt_not_section : Error<
7836 "statement in 'omp sections' directive must be enclosed into a section region">;
7837 def err_omp_parallel_sections_substmt_not_section : Error<
7838 "statement in 'omp parallel sections' directive must be enclosed into a section region">;
7839 def err_omp_parallel_reduction_in_task_firstprivate : Error<
7840 "argument of a reduction clause of a %0 construct must not appear in a firstprivate clause on a task construct">;
7841 def err_omp_atomic_read_not_expression_statement : Error<
7842 "the statement for 'atomic read' must be an expression statement of form 'v = x;',"
7843 " where v and x are both lvalue expressions with scalar type">;
7844 def note_omp_atomic_read_write: Note<
7845 "%select{expected an expression statement|expected built-in assignment operator|expected expression of scalar type|expected lvalue expression}0">;
7846 def err_omp_atomic_write_not_expression_statement : Error<
7847 "the statement for 'atomic write' must be an expression statement of form 'x = expr;',"
7848 " where x is a lvalue expression with scalar type">;
7849 def err_omp_atomic_update_not_expression_statement : Error<
7850 "the statement for 'atomic update' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x',"
7851 " where x is an l-value expression with scalar type">;
7852 def err_omp_atomic_not_expression_statement : Error<
7853 "the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x',"
7854 " where x is an l-value expression with scalar type">;
7855 def note_omp_atomic_update: Note<
7856 "%select{expected an expression statement|expected built-in binary or unary operator|expected unary decrement/increment operation|"
7857 "expected expression of scalar type|expected assignment expression|expected built-in binary operator|"
7858 "expected one of '+', '*', '-', '/', '&', '^', '%|', '<<', or '>>' built-in operations|expected in right hand side of expression}0">;
7859 def err_omp_atomic_capture_not_expression_statement : Error<
7860 "the statement for 'atomic capture' must be an expression statement of form 'v = ++x;', 'v = --x;', 'v = x++;', 'v = x--;', 'v = x binop= expr;', 'v = x = x binop expr' or 'v = x = expr binop x',"
7861 " where x and v are both l-value expressions with scalar type">;
7862 def err_omp_atomic_capture_not_compound_statement : Error<
7863 "the statement for 'atomic capture' must be a compound statement of form '{v = x; x binop= expr;}', '{x binop= expr; v = x;}',"
7864 " '{v = x; x = x binop expr;}', '{v = x; x = expr binop x;}', '{x = x binop expr; v = x;}', '{x = expr binop x; v = x;}' or '{v = x; x = expr;}',"
7865 " '{v = x; x++;}', '{v = x; ++x;}', '{++x; v = x;}', '{x++; v = x;}', '{v = x; x--;}', '{v = x; --x;}', '{--x; v = x;}', '{x--; v = x;}'"
7866 " where x is an l-value expression with scalar type">;
7867 def note_omp_atomic_capture: Note<
7868 "%select{expected assignment expression|expected compound statement|expected exactly two expression statements|expected in right hand side of the first expression}0">;
7869 def err_omp_atomic_several_clauses : Error<
7870 "directive '#pragma omp atomic' cannot contain more than one 'read', 'write', 'update' or 'capture' clause">;
7871 def note_omp_atomic_previous_clause : Note<
7872 "'%0' clause used here">;
7873 def err_omp_target_contains_not_only_teams : Error<
7874 "target construct with nested teams region contains statements outside of the teams construct">;
7875 def note_omp_nested_teams_construct_here : Note<
7876 "nested teams construct here">;
7877 def note_omp_nested_statement_here : Note<
7878 "%select{statement|directive}0 outside teams construct here">;
7879 def err_omp_single_copyprivate_with_nowait : Error<
7880 "the 'copyprivate' clause must not be used with the 'nowait' clause">;
7881 def note_omp_nowait_clause_here : Note<
7882 "'nowait' clause is here">;
7883 def err_omp_wrong_cancel_region : Error<
7884 "one of 'for', 'parallel', 'sections' or 'taskgroup' is expected">;
7885 def err_omp_parent_cancel_region_nowait : Error<
7886 "parent region for 'omp %select{cancellation point/cancel}0' construct cannot be nowait">;
7887 def err_omp_parent_cancel_region_ordered : Error<
7888 "parent region for 'omp %select{cancellation point/cancel}0' construct cannot be ordered">;
7889 def err_omp_array_section_use : Error<"OpenMP array section is not allowed here">;
7890 def err_omp_typecheck_section_value : Error<
7891 "subscripted value is not an array or pointer">;
7892 def err_omp_typecheck_section_not_integer : Error<
7893 "array section %select{lower bound|length}0 is not an integer">;
7894 def err_omp_section_function_type : Error<
7895 "section of pointer to function type %0">;
7896 def warn_omp_section_is_char : Warning<"array section %select{lower bound|length}0 is of type 'char'">,
7897 InGroup<CharSubscript>, DefaultIgnore;
7898 def err_omp_section_incomplete_type : Error<
7899 "section of pointer to incomplete type %0">;
7900 def err_omp_section_negative : Error<
7901 "section %select{lower bound|length}0 is evaluated to a negative value %1">;
7902 def err_omp_section_length_undefined : Error<
7903 "section length is unspecified and cannot be inferred because subscripted value is %select{not an array|an array of unknown bound}0">;
7904 def err_omp_wrong_linear_modifier : Error<
7905 "expected %select{'val' modifier|one of 'ref', val' or 'uval' modifiers}0">;
7906 def err_omp_wrong_linear_modifier_non_reference : Error<
7907 "variable of non-reference type %0 can be used only with 'val' modifier, but used with '%1'">;
7908 def err_omp_wrong_simdlen_safelen_values : Error<
7909 "the value of 'simdlen' parameter must be less than or equal to the value of the 'safelen' parameter">;
7910 def err_omp_wrong_if_directive_name_modifier : Error<
7911 "directive name modifier '%0' is not allowed for '#pragma omp %1'">;
7912 def err_omp_no_more_if_clause : Error<
7913 "no more 'if' clause is allowed">;
7914 def err_omp_unnamed_if_clause : Error<
7915 "expected %select{|one of}0 %1 directive name modifier%select{|s}0">;
7916 def note_omp_previous_named_if_clause : Note<
7917 "previous clause with directive name modifier specified here">;
7918 def err_omp_ordered_directive_with_param : Error<
7919 "'ordered' directive %select{without any clauses|with 'threads' clause}0 cannot be closely nested inside ordered region with specified parameter">;
7920 def err_omp_ordered_directive_without_param : Error<
7921 "'ordered' directive with 'depend' clause cannot be closely nested inside ordered region without specified parameter">;
7922 def note_omp_ordered_param : Note<
7923 "'ordered' clause with specified parameter">;
7924 def err_omp_expected_base_var_name : Error<
7925 "expected variable name as a base of the array %select{subscript|section}0">;
7926 def err_omp_map_shared_storage : Error<
7927 "variable already marked as mapped in current construct">;
7928 def err_omp_not_mappable_type : Error<
7929 "type %0 is not mappable to target">;
7930 def note_omp_polymorphic_in_target : Note<
7931 "mappable type cannot be polymorphic">;
7932 def note_omp_static_member_in_target : Note<
7933 "mappable type cannot contain static members">;
7934 def err_omp_threadprivate_in_map : Error<
7935 "threadprivate variables are not allowed in map clause">;
7936 def err_omp_wrong_ordered_loop_count : Error<
7937 "the parameter of the 'ordered' clause must be greater than or equal to the parameter of the 'collapse' clause">;
7938 def note_collapse_loop_count : Note<
7939 "parameter of the 'collapse' clause">;
7940 def err_omp_grainsize_num_tasks_mutually_exclusive : Error<
7941 "'%0' and '%1' clause are mutually exclusive and may not appear on the same directive">;
7942 def note_omp_previous_grainsize_num_tasks : Note<
7943 "'%0' clause is specified here">;
7944 def err_omp_hint_clause_no_name : Error<
7945 "the name of the construct must be specified in presence of 'hint' clause">;
7946 def err_omp_critical_with_hint : Error<
7947 "constructs with the same name must have a 'hint' clause with the same value">;
7948 def note_omp_critical_hint_here : Note<
7949 "%select{|previous }0'hint' clause with value '%1'">;
7950 def note_omp_critical_no_hint : Note<
7951 "%select{|previous }0directive with no 'hint' clause specified">;
7952 def err_omp_firstprivate_distribute_private_teams : Error<
7953 "private variable in '#pragma omp teams' cannot be firstprivate in '#pragma omp distribute'">;
7954 def err_omp_firstprivate_and_lastprivate_in_distribute : Error<
7955 "lastprivate variable cannot be firstprivate in '#pragma omp distribute'">;
7956 def err_omp_firstprivate_distribute_in_teams_reduction : Error<
7957 "reduction variable in '#pragma omp teams' cannot be firstprivate in '#pragma omp distribute'">;
7958 def err_omp_depend_clause_thread_simd : Error<
7959 "'depend' clauses cannot be mixed with '%0' clause">;
7960 def err_omp_depend_sink_wrong_expr : Error<
7961 "expected expression form x[+-d], where x is the loop iteration variable and d is a constant non-negative integer">;
7962 def err_omp_depend_sink_expected_loop_iteration : Error<
7963 "expected %0 loop iteration variable">;
7964 def err_omp_depend_sink_unexpected_expr : Error<
7965 "unexpected expression: number of expressions is larger than the number of associated loops">;
7966 def err_omp_depend_sink_expected_plus_minus : Error<
7967 "expected '+' or '-' operation">;
7968 def err_omp_depend_sink_source_not_allowed : Error<
7969 "'depend(%select{source|sink:vec}0)' clause%select{|s}0 cannot be mixed with 'depend(%select{sink:vec|source}0)' clause%select{s|}0">;
7970 def err_omp_linear_ordered : Error<
7971 "'linear' clause cannot be specified along with 'ordered' clause with a parameter">;
7972 def err_omp_unexpected_schedule_modifier : Error<
7973 "modifier '%0' cannot be used along with modifier '%1'">;
7974 def err_omp_schedule_nonmonotonic_static : Error<
7975 "'nonmonotonic' modifier can only be specified with 'dynamic' or 'guided' schedule kind">;
7976 def err_omp_schedule_nonmonotonic_ordered : Error<
7977 "'schedule' clause with 'nonmonotonic' modifier cannot be specified if an 'ordered' clause is specified">;
7978 def err_omp_ordered_simd : Error<
7979 "'ordered' clause with a parameter can not be specified in '#pragma omp %0' directive">;
7980 } // end of OpenMP category
7982 let CategoryName = "Related Result Type Issue" in {
7983 // Objective-C related result type compatibility
7984 def warn_related_result_type_compatibility_class : Warning<
7985 "method is expected to return an instance of its class type "
7986 "%diff{$, but is declared to return $|"
7987 ", but is declared to return different type}0,1">;
7988 def warn_related_result_type_compatibility_protocol : Warning<
7989 "protocol method is expected to return an instance of the implementing "
7990 "class, but is declared to return %0">;
7991 def note_related_result_type_family : Note<
7992 "%select{overridden|current}0 method is part of the '%select{|alloc|copy|init|"
7993 "mutableCopy|new|autorelease|dealloc|finalize|release|retain|retainCount|"
7994 "self}1' method family%select{| and is expected to return an instance of its "
7996 def note_related_result_type_overridden : Note<
7997 "overridden method returns an instance of its class type">;
7998 def note_related_result_type_inferred : Note<
7999 "%select{class|instance}0 method %1 is assumed to return an instance of "
8000 "its receiver type (%2)">;
8001 def note_related_result_type_explicit : Note<
8002 "%select{overridden|current}0 method is explicitly declared 'instancetype'"
8003 "%select{| and is expected to return an instance of its class type}0">;
8007 let CategoryName = "Modules Issue" in {
8008 def err_module_private_specialization : Error<
8009 "%select{template|partial|member}0 specialization cannot be "
8010 "declared __module_private__">;
8011 def err_module_private_local : Error<
8012 "%select{local variable|parameter|typedef}0 %1 cannot be declared "
8013 "__module_private__">;
8014 def err_module_private_local_class : Error<
8015 "local %select{struct|interface|union|class|enum}0 cannot be declared "
8016 "__module_private__">;
8017 def err_module_unimported_use : Error<
8018 "%select{declaration|definition|default argument}0 of %1 must be imported "
8019 "from module '%2' before it is required">;
8020 def err_module_unimported_use_multiple : Error<
8021 "%select{declaration|definition|default argument}0 of %1 must be imported "
8022 "from one of the following modules before it is required:%2">;
8023 def ext_module_import_in_extern_c : ExtWarn<
8024 "import of C++ module '%0' appears within extern \"C\" language linkage "
8025 "specification">, DefaultError,
8026 InGroup<DiagGroup<"module-import-in-extern-c">>;
8027 def note_module_import_in_extern_c : Note<
8028 "extern \"C\" language linkage specification begins here">;
8029 def err_module_import_not_at_top_level_fatal : Error<
8030 "import of module '%0' appears within %1">, DefaultFatal;
8031 def ext_module_import_not_at_top_level_noop : ExtWarn<
8032 "redundant #include of module '%0' appears within %1">, DefaultError,
8033 InGroup<DiagGroup<"modules-import-nested-redundant">>;
8034 def note_module_import_not_at_top_level : Note<"%0 begins here">;
8035 def err_module_self_import : Error<
8036 "import of module '%0' appears within same top-level module '%1'">;
8037 def err_module_import_in_implementation : Error<
8038 "@import of module '%0' in implementation of '%1'; use #import">;
8040 def ext_equivalent_internal_linkage_decl_in_modules : ExtWarn<
8041 "ambiguous use of internal linkage declaration %0 defined in multiple modules">,
8042 InGroup<DiagGroup<"modules-ambiguous-internal-linkage">>;
8043 def note_equivalent_internal_linkage_decl : Note<
8044 "declared here%select{ in module '%1'|}0">;
8047 let CategoryName = "Coroutines Issue" in {
8048 def err_return_in_coroutine : Error<
8049 "return statement not allowed in coroutine; did you mean 'co_return'?">;
8050 def note_declared_coroutine_here : Note<
8051 "function is a coroutine due to use of "
8052 "'%select{co_await|co_yield|co_return}0' here">;
8053 def err_coroutine_objc_method : Error<
8054 "Objective-C methods as coroutines are not yet supported">;
8055 def err_coroutine_unevaluated_context : Error<
8056 "'%0' cannot be used in an unevaluated context">;
8057 def err_coroutine_outside_function : Error<
8058 "'%0' cannot be used outside a function">;
8059 def err_coroutine_ctor_dtor : Error<
8060 "'%1' cannot be used in a %select{constructor|destructor}0">;
8061 def err_coroutine_constexpr : Error<
8062 "'%0' cannot be used in a constexpr function">;
8063 def err_coroutine_varargs : Error<
8064 "'%0' cannot be used in a varargs function">;
8065 def ext_coroutine_without_co_await_co_yield : ExtWarn<
8066 "'co_return' used in a function "
8067 "that uses neither 'co_await' nor 'co_yield'">,
8068 InGroup<DiagGroup<"coreturn-without-coawait">>;
8069 def err_implied_std_coroutine_traits_not_found : Error<
8070 "you need to include <coroutine> before defining a coroutine">;
8071 def err_malformed_std_coroutine_traits : Error<
8072 "'std::coroutine_traits' must be a class template">;
8073 def err_implied_std_coroutine_traits_promise_type_not_found : Error<
8074 "this function cannot be a coroutine: %q0 has no member named 'promise_type'">;
8075 def err_implied_std_coroutine_traits_promise_type_not_class : Error<
8076 "this function cannot be a coroutine: %0 is not a class">;
8077 def err_coroutine_traits_missing_specialization : Error<
8078 "this function cannot be a coroutine: missing definition of "
8079 "specialization %q0">;
8082 let CategoryName = "Documentation Issue" in {
8083 def warn_not_a_doxygen_trailing_member_comment : Warning<
8084 "not a Doxygen trailing comment">, InGroup<Documentation>, DefaultIgnore;
8085 } // end of documentation issue category
8087 let CategoryName = "Instrumentation Issue" in {
8088 def warn_profile_data_out_of_date : Warning<
8089 "profile data may be out of date: of %0 function%s0, %1 %plural{1:has|:have}1"
8090 " no data and %2 %plural{1:has|:have}2 mismatched data that will be ignored">,
8091 InGroup<ProfileInstrOutOfDate>;
8092 def warn_profile_data_unprofiled : Warning<
8093 "no profile data available for file \"%0\"">,
8094 InGroup<ProfileInstrUnprofiled>;
8096 } // end of instrumentation issue category
8098 let CategoryName = "Nullability Issue" in {
8100 def warn_mismatched_nullability_attr : Warning<
8101 "nullability specifier %0 conflicts with existing specifier %1">,
8102 InGroup<Nullability>;
8104 def warn_nullability_declspec : Warning<
8105 "nullability specifier %0 cannot be applied "
8106 "to non-pointer type %1; did you mean to apply the specifier to the "
8107 "%select{pointer|block pointer|member pointer|function pointer|"
8108 "member function pointer}2?">,
8109 InGroup<NullabilityDeclSpec>,
8112 def note_nullability_here : Note<"%0 specified here">;
8114 def err_nullability_nonpointer : Error<
8115 "nullability specifier %0 cannot be applied to non-pointer type %1">;
8117 def warn_nullability_lost : Warning<
8118 "implicit conversion from nullable pointer %0 to non-nullable pointer "
8120 InGroup<NullableToNonNullConversion>, DefaultIgnore;
8122 def err_nullability_cs_multilevel : Error<
8123 "nullability keyword %0 cannot be applied to multi-level pointer type %1">;
8124 def note_nullability_type_specifier : Note<
8125 "use nullability type specifier %0 to affect the innermost "
8126 "pointer type of %1">;
8128 def warn_null_resettable_setter : Warning<
8129 "synthesized setter %0 for null_resettable property %1 does not handle nil">,
8130 InGroup<Nullability>;
8132 def warn_nullability_missing : Warning<
8133 "%select{pointer|block pointer|member pointer}0 is missing a nullability "
8134 "type specifier (_Nonnull, _Nullable, or _Null_unspecified)">,
8135 InGroup<NullabilityCompleteness>;
8137 def err_objc_type_arg_explicit_nullability : Error<
8138 "type argument %0 cannot explicitly specify nullability">;
8140 def err_objc_type_param_bound_explicit_nullability : Error<
8141 "type parameter %0 bound %1 cannot explicitly specify nullability">;
8145 let CategoryName = "Generics Issue" in {
8147 def err_objc_type_param_bound_nonobject : Error<
8148 "type bound %0 for type parameter %1 is not an Objective-C pointer type">;
8150 def err_objc_type_param_bound_missing_pointer : Error<
8151 "missing '*' in type bound %0 for type parameter %1">;
8152 def err_objc_type_param_bound_qualified : Error<
8153 "type bound %1 for type parameter %0 cannot be qualified with '%2'">;
8155 def err_objc_type_param_redecl : Error<
8156 "redeclaration of type parameter %0">;
8158 def err_objc_type_param_arity_mismatch : Error<
8159 "%select{forward class declaration|class definition|category|extension}0 has "
8160 "too %select{few|many}1 type parameters (expected %2, have %3)">;
8162 def err_objc_type_param_bound_conflict : Error<
8163 "type bound %0 for type parameter %1 conflicts with "
8164 "%select{implicit|previous}2 bound %3%select{for type parameter %5|}4">;
8166 def err_objc_type_param_variance_conflict : Error<
8167 "%select{in|co|contra}0variant type parameter %1 conflicts with previous "
8168 "%select{in|co|contra}2variant type parameter %3">;
8170 def note_objc_type_param_here : Note<"type parameter %0 declared here">;
8172 def err_objc_type_param_bound_missing : Error<
8173 "missing type bound %0 for type parameter %1 in %select{@interface|@class}2">;
8175 def err_objc_parameterized_category_nonclass : Error<
8176 "%select{extension|category}0 of non-parameterized class %1 cannot have type "
8179 def err_objc_parameterized_forward_class : Error<
8180 "forward declaration of non-parameterized class %0 cannot have type "
8183 def err_objc_parameterized_forward_class_first : Error<
8184 "class %0 previously declared with type parameters">;
8186 def err_objc_type_arg_missing_star : Error<
8187 "type argument %0 must be a pointer (requires a '*')">;
8188 def err_objc_type_arg_qualified : Error<
8189 "type argument %0 cannot be qualified with '%1'">;
8191 def err_objc_type_arg_missing : Error<
8192 "no type or protocol named %0">;
8194 def err_objc_type_args_and_protocols : Error<
8195 "angle brackets contain both a %select{type|protocol}0 (%1) and a "
8196 "%select{protocol|type}0 (%2)">;
8198 def err_objc_type_args_non_class : Error<
8199 "type arguments cannot be applied to non-class type %0">;
8201 def err_objc_type_args_non_parameterized_class : Error<
8202 "type arguments cannot be applied to non-parameterized class %0">;
8204 def err_objc_type_args_specialized_class : Error<
8205 "type arguments cannot be applied to already-specialized class type %0">;
8207 def err_objc_type_args_wrong_arity : Error<
8208 "too %select{many|few}0 type arguments for class %1 (have %2, expected %3)">;
8211 def err_objc_type_arg_not_id_compatible : Error<
8212 "type argument %0 is neither an Objective-C object nor a block type">;
8214 def err_objc_type_arg_does_not_match_bound : Error<
8215 "type argument %0 does not satisfy the bound (%1) of type parameter %2">;
8217 def warn_objc_redundant_qualified_class_type : Warning<
8218 "parameterized class %0 already conforms to the protocols listed; did you "
8219 "forget a '*'?">, InGroup<ObjCProtocolQualifiers>;
8221 } // end of sema component.