1 //==--- DiagnosticSemaKinds.td - libsema diagnostics ----------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 //===----------------------------------------------------------------------===//
12 //===----------------------------------------------------------------------===//
14 let Component = "Sema" in {
15 let CategoryName = "Semantic Issue" in {
17 def note_previous_decl : Note<"%0 declared here">;
18 def note_entity_declared_at : Note<"%0 declared here">;
19 def note_callee_decl : Note<"%0 declared here">;
20 def note_defined_here : Note<"%0 defined here">;
23 def warn_variables_not_in_loop_body : Warning<
24 "variable%select{s| %1|s %1 and %2|s %1, %2, and %3|s %1, %2, %3, and %4}0 "
25 "used in loop condition not modified in loop body">,
26 InGroup<ForLoopAnalysis>, DefaultIgnore;
27 def warn_redundant_loop_iteration : Warning<
28 "variable %0 is %select{decremented|incremented}1 both in the loop header "
29 "and in the loop body">,
30 InGroup<ForLoopAnalysis>, DefaultIgnore;
31 def note_loop_iteration_here : Note<"%select{decremented|incremented}0 here">;
33 def warn_duplicate_enum_values : Warning<
34 "element %0 has been implicitly assigned %1 which another element has "
35 "been assigned">, InGroup<DiagGroup<"duplicate-enum">>, DefaultIgnore;
36 def note_duplicate_element : Note<"element %0 also has value %1">;
38 // Absolute value functions
39 def warn_unsigned_abs : Warning<
40 "taking the absolute value of unsigned type %0 has no effect">,
41 InGroup<AbsoluteValue>;
42 def note_remove_abs : Note<
43 "remove the call to '%0' since unsigned values cannot be negative">;
44 def warn_abs_too_small : Warning<
45 "absolute value function %0 given an argument of type %1 but has parameter "
46 "of type %2 which may cause truncation of value">, InGroup<AbsoluteValue>;
47 def warn_wrong_absolute_value_type : Warning<
48 "using %select{integer|floating point|complex}1 absolute value function %0 "
49 "when argument is of %select{integer|floating point|complex}2 type">,
50 InGroup<AbsoluteValue>;
51 def note_replace_abs_function : Note<"use function '%0' instead">;
52 def warn_pointer_abs : Warning<
53 "taking the absolute value of %select{pointer|function|array}0 type %1 is suspicious">,
54 InGroup<AbsoluteValue>;
56 def warn_max_unsigned_zero : Warning<
58 "%select{a value and unsigned zero|unsigned zero and a value}0 "
59 "is always equal to the other value">,
60 InGroup<MaxUnsignedZero>;
61 def note_remove_max_call : Note<
62 "remove call to max function and unsigned zero argument">;
64 def warn_infinite_recursive_function : Warning<
65 "all paths through this function will call itself">,
66 InGroup<InfiniteRecursion>, DefaultIgnore;
68 def warn_comma_operator : Warning<"possible misuse of comma operator here">,
69 InGroup<DiagGroup<"comma">>, DefaultIgnore;
70 def note_cast_to_void : Note<"cast expression to void to silence warning">;
72 // Constant expressions
73 def err_expr_not_ice : Error<
74 "expression is not an %select{integer|integral}0 constant expression">;
75 def ext_expr_not_ice : Extension<
76 "expression is not an %select{integer|integral}0 constant expression; "
77 "folding it to a constant is a GNU extension">, InGroup<GNUFoldingConstant>;
78 def err_typecheck_converted_constant_expression : Error<
79 "value of type %0 is not implicitly convertible to %1">;
80 def err_typecheck_converted_constant_expression_disallowed : Error<
81 "conversion from %0 to %1 is not allowed in a converted constant expression">;
82 def err_typecheck_converted_constant_expression_indirect : Error<
83 "conversion from %0 to %1 in converted constant expression would "
84 "bind reference to a temporary">;
85 def err_expr_not_cce : Error<
86 "%select{case value|enumerator value|non-type template argument|"
87 "array size|constexpr if condition}0 "
88 "is not a constant expression">;
89 def ext_cce_narrowing : ExtWarn<
90 "%select{case value|enumerator value|non-type template argument|"
91 "array size|constexpr if condition}0 "
92 "%select{cannot be narrowed from type %2 to %3|"
93 "evaluates to %2, which cannot be narrowed to type %3}1">,
94 InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
95 def err_ice_not_integral : Error<
96 "integral constant expression must have integral or unscoped enumeration "
98 def err_ice_incomplete_type : Error<
99 "integral constant expression has incomplete class type %0">;
100 def err_ice_explicit_conversion : Error<
101 "integral constant expression requires explicit conversion from %0 to %1">;
102 def note_ice_conversion_here : Note<
103 "conversion to %select{integral|enumeration}0 type %1 declared here">;
104 def err_ice_ambiguous_conversion : Error<
105 "ambiguous conversion from type %0 to an integral or unscoped "
107 def err_ice_too_large : Error<
108 "integer constant expression evaluates to value %0 that cannot be "
109 "represented in a %1-bit %select{signed|unsigned}2 integer type">;
110 def err_expr_not_string_literal : Error<"expression is not a string literal">;
112 // Semantic analysis of constant literals.
113 def ext_predef_outside_function : Warning<
114 "predefined identifier is only valid inside function">,
115 InGroup<DiagGroup<"predefined-identifier-outside-function">>;
116 def warn_float_overflow : Warning<
117 "magnitude of floating-point constant too large for type %0; maximum is %1">,
118 InGroup<LiteralRange>;
119 def warn_float_underflow : Warning<
120 "magnitude of floating-point constant too small for type %0; minimum is %1">,
121 InGroup<LiteralRange>;
122 def warn_double_const_requires_fp64 : Warning<
123 "double precision constant requires cl_khr_fp64, casting to single precision">;
124 def err_half_const_requires_fp16 : Error<
125 "half precision constant requires cl_khr_fp16">;
127 // C99 variable-length arrays
128 def ext_vla : Extension<"variable length arrays are a C99 feature">,
129 InGroup<VLAExtension>;
130 def warn_vla_used : Warning<"variable length array used">,
131 InGroup<VLA>, DefaultIgnore;
132 def err_vla_in_sfinae : Error<
133 "variable length array cannot be formed during template argument deduction">;
134 def err_array_star_in_function_definition : Error<
135 "variable length array must be bound in function definition">;
136 def err_vla_decl_in_file_scope : Error<
137 "variable length array declaration not allowed at file scope">;
138 def err_vla_decl_has_static_storage : Error<
139 "variable length array declaration cannot have 'static' storage duration">;
140 def err_vla_decl_has_extern_linkage : Error<
141 "variable length array declaration cannot have 'extern' linkage">;
142 def ext_vla_folded_to_constant : Extension<
143 "variable length array folded to constant array as an extension">, InGroup<GNUFoldingConstant>;
144 def err_vla_unsupported : Error<
145 "variable length arrays are not supported for the current target">;
146 def note_vla_unsupported : Note<
147 "variable length arrays are not supported for the current target">;
149 // C99 variably modified types
150 def err_variably_modified_template_arg : Error<
151 "variably modified type %0 cannot be used as a template argument">;
152 def err_variably_modified_nontype_template_param : Error<
153 "non-type template parameter of variably modified type %0">;
154 def err_variably_modified_new_type : Error<
155 "'new' cannot allocate object of variably modified type %0">;
157 // C99 Designated Initializers
158 def ext_designated_init : Extension<
159 "designated initializers are a C99 feature">, InGroup<C99>;
160 def err_array_designator_negative : Error<
161 "array designator value '%0' is negative">;
162 def err_array_designator_empty_range : Error<
163 "array designator range [%0, %1] is empty">;
164 def err_array_designator_non_array : Error<
165 "array designator cannot initialize non-array type %0">;
166 def err_array_designator_too_large : Error<
167 "array designator index (%0) exceeds array bounds (%1)">;
168 def err_field_designator_non_aggr : Error<
169 "field designator cannot initialize a "
170 "%select{non-struct, non-union|non-class}0 type %1">;
171 def err_field_designator_unknown : Error<
172 "field designator %0 does not refer to any field in type %1">;
173 def err_field_designator_nonfield : Error<
174 "field designator %0 does not refer to a non-static data member">;
175 def note_field_designator_found : Note<"field designator refers here">;
176 def err_designator_for_scalar_init : Error<
177 "designator in initializer for scalar type %0">;
178 def warn_subobject_initializer_overrides : Warning<
179 "subobject initialization overrides initialization of other fields "
180 "within its enclosing subobject">, InGroup<InitializerOverrides>;
181 def warn_initializer_overrides : Warning<
182 "initializer overrides prior initialization of this subobject">,
183 InGroup<InitializerOverrides>;
184 def note_previous_initializer : Note<
185 "previous initialization %select{|with side effects }0is here"
186 "%select{| (side effects may not occur at run time)}0">;
187 def err_designator_into_flexible_array_member : Error<
188 "designator into flexible array member subobject">;
189 def note_flexible_array_member : Note<
190 "initialized flexible array member %0 is here">;
191 def ext_flexible_array_init : Extension<
192 "flexible array initialization is a GNU extension">, InGroup<GNUFlexibleArrayInitializer>;
195 def ext_duplicate_declspec : ExtWarn<"duplicate '%0' declaration specifier">,
196 InGroup<DuplicateDeclSpecifier>;
197 def warn_duplicate_declspec : Warning<"duplicate '%0' declaration specifier">,
198 InGroup<DuplicateDeclSpecifier>;
199 def ext_plain_complex : ExtWarn<
200 "plain '_Complex' requires a type specifier; assuming '_Complex double'">;
201 def ext_imaginary_constant : Extension<
202 "imaginary constants are a GNU extension">, InGroup<GNUImaginaryConstant>;
203 def ext_integer_complex : Extension<
204 "complex integer types are a GNU extension">, InGroup<GNUComplexInteger>;
206 def err_invalid_saturation_spec : Error<"'_Sat' specifier is only valid on "
207 "'_Fract' or '_Accum', not '%0'">;
208 def err_invalid_sign_spec : Error<"'%0' cannot be signed or unsigned">;
209 def err_invalid_width_spec : Error<
210 "'%select{|short|long|long long}0 %1' is invalid">;
211 def err_invalid_complex_spec : Error<"'_Complex %0' is invalid">;
212 def err_friend_decl_spec : Error<"'%0' is invalid in friend declarations">;
214 def ext_auto_type_specifier : ExtWarn<
215 "'auto' type specifier is a C++11 extension">, InGroup<CXX11>;
216 def warn_auto_storage_class : Warning<
217 "'auto' storage class specifier is redundant and incompatible with C++11">,
218 InGroup<CXX11Compat>, DefaultIgnore;
220 def warn_deprecated_register : Warning<
221 "'register' storage class specifier is deprecated "
222 "and incompatible with C++17">, InGroup<DeprecatedRegister>;
223 def ext_register_storage_class : ExtWarn<
224 "ISO C++17 does not allow 'register' storage class specifier">,
225 DefaultError, InGroup<Register>;
227 def err_invalid_decl_spec_combination : Error<
228 "cannot combine with previous '%0' declaration specifier">;
229 def err_invalid_vector_decl_spec_combination : Error<
230 "cannot combine with previous '%0' declaration specifier. "
231 "'__vector' must be first">;
232 def err_invalid_pixel_decl_spec_combination : Error<
233 "'__pixel' must be preceded by '__vector'. "
234 "'%0' declaration specifier not allowed here">;
235 def err_invalid_vector_bool_decl_spec : Error<
236 "cannot use '%0' with '__vector bool'">;
237 def err_invalid_vector_long_decl_spec : Error<
238 "cannot use 'long' with '__vector'">;
239 def err_invalid_vector_float_decl_spec : Error<
240 "cannot use 'float' with '__vector'">;
241 def err_invalid_vector_double_decl_spec : Error <
242 "use of 'double' with '__vector' requires VSX support to be enabled "
243 "(available on POWER7 or later)">;
244 def err_invalid_vector_long_long_decl_spec : Error <
245 "use of 'long long' with '__vector bool' requires VSX support (available on "
246 "POWER7 or later) or extended Altivec support (available on POWER8 or later) "
248 def err_invalid_vector_long_double_decl_spec : Error<
249 "cannot use 'long double' with '__vector'">;
250 def warn_vector_long_decl_spec_combination : Warning<
251 "Use of 'long' with '__vector' is deprecated">, InGroup<Deprecated>;
253 def err_use_of_tag_name_without_tag : Error<
254 "must use '%1' tag to refer to type %0%select{| in this scope}2">;
256 def err_redeclaration_different_type : Error<
257 "redeclaration of %0 with a different type%diff{: $ vs $|}1,2">;
258 def err_bad_variable_name : Error<
259 "%0 cannot be the name of a variable or data member">;
260 def err_bad_parameter_name : Error<
261 "%0 cannot be the name of a parameter">;
262 def err_parameter_name_omitted : Error<"parameter name omitted">;
263 def err_anyx86_interrupt_attribute : Error<
264 "%select{x86|x86-64}0 'interrupt' attribute only applies to functions that "
265 "have %select{a 'void' return type|"
266 "only a pointer parameter optionally followed by an integer parameter|"
267 "a pointer as the first parameter|a %2 type as the second parameter}1">;
268 def err_anyx86_interrupt_called : Error<
269 "interrupt service routine cannot be called directly">;
270 def warn_arm_interrupt_calling_convention : Warning<
271 "call to function without interrupt attribute could clobber interruptee's VFP registers">,
273 def warn_mips_interrupt_attribute : Warning<
274 "MIPS 'interrupt' attribute only applies to functions that have "
275 "%select{no parameters|a 'void' return type}0">,
276 InGroup<IgnoredAttributes>;
277 def warn_riscv_repeated_interrupt_attribute : Warning<
278 "repeated RISC-V 'interrupt' attribute">, InGroup<IgnoredAttributes>;
279 def note_riscv_repeated_interrupt_attribute : Note<
280 "repeated RISC-V 'interrupt' attribute is here">;
281 def warn_riscv_interrupt_attribute : Warning<
282 "RISC-V 'interrupt' attribute only applies to functions that have "
283 "%select{no parameters|a 'void' return type}0">,
284 InGroup<IgnoredAttributes>;
285 def warn_unused_parameter : Warning<"unused parameter %0">,
286 InGroup<UnusedParameter>, DefaultIgnore;
287 def warn_unused_variable : Warning<"unused variable %0">,
288 InGroup<UnusedVariable>, DefaultIgnore;
289 def warn_unused_local_typedef : Warning<
290 "unused %select{typedef|type alias}0 %1">,
291 InGroup<UnusedLocalTypedef>, DefaultIgnore;
292 def warn_unused_property_backing_ivar :
293 Warning<"ivar %0 which backs the property is not "
294 "referenced in this property's accessor">,
295 InGroup<UnusedPropertyIvar>, DefaultIgnore;
296 def warn_unused_const_variable : Warning<"unused variable %0">,
297 InGroup<UnusedConstVariable>, DefaultIgnore;
298 def warn_unused_exception_param : Warning<"unused exception parameter %0">,
299 InGroup<UnusedExceptionParameter>, DefaultIgnore;
300 def warn_decl_in_param_list : Warning<
301 "declaration of %0 will not be visible outside of this function">,
303 def warn_redefinition_in_param_list : Warning<
304 "redefinition of %0 will not be visible outside of this function">,
306 def warn_empty_parens_are_function_decl : Warning<
307 "empty parentheses interpreted as a function declaration">,
308 InGroup<VexingParse>;
309 def warn_parens_disambiguated_as_function_declaration : Warning<
310 "parentheses were disambiguated as a function declaration">,
311 InGroup<VexingParse>;
312 def warn_parens_disambiguated_as_variable_declaration : Warning<
313 "parentheses were disambiguated as redundant parentheses around declaration "
314 "of variable named %0">, InGroup<VexingParse>;
315 def warn_redundant_parens_around_declarator : Warning<
316 "redundant parentheses surrounding declarator">,
317 InGroup<DiagGroup<"redundant-parens">>, DefaultIgnore;
318 def note_additional_parens_for_variable_declaration : Note<
319 "add a pair of parentheses to declare a variable">;
320 def note_raii_guard_add_name : Note<
321 "add a variable name to declare a %0 initialized with %1">;
322 def note_function_style_cast_add_parentheses : Note<
323 "add enclosing parentheses to perform a function-style cast">;
324 def note_remove_parens_for_variable_declaration : Note<
325 "remove parentheses to silence this warning">;
326 def note_empty_parens_function_call : Note<
327 "change this ',' to a ';' to call %0">;
328 def note_empty_parens_default_ctor : Note<
329 "remove parentheses to declare a variable">;
330 def note_empty_parens_zero_initialize : Note<
331 "replace parentheses with an initializer to declare a variable">;
332 def warn_unused_function : Warning<"unused function %0">,
333 InGroup<UnusedFunction>, DefaultIgnore;
334 def warn_unused_template : Warning<"unused %select{function|variable}0 template %1">,
335 InGroup<UnusedTemplate>, DefaultIgnore;
336 def warn_unused_member_function : Warning<"unused member function %0">,
337 InGroup<UnusedMemberFunction>, DefaultIgnore;
338 def warn_used_but_marked_unused: Warning<"%0 was marked unused but was used">,
339 InGroup<UsedButMarkedUnused>, DefaultIgnore;
340 def warn_unneeded_internal_decl : Warning<
341 "%select{function|variable}0 %1 is not needed and will not be emitted">,
342 InGroup<UnneededInternalDecl>, DefaultIgnore;
343 def warn_unneeded_static_internal_decl : Warning<
344 "'static' function %0 declared in header file "
345 "should be declared 'static inline'">,
346 InGroup<UnneededInternalDecl>, DefaultIgnore;
347 def warn_unneeded_member_function : Warning<
348 "member function %0 is not needed and will not be emitted">,
349 InGroup<UnneededMemberFunction>, DefaultIgnore;
350 def warn_unused_private_field: Warning<"private field %0 is not used">,
351 InGroup<UnusedPrivateField>, DefaultIgnore;
352 def warn_unused_lambda_capture: Warning<"lambda capture %0 is not "
353 "%select{used|required to be captured for this use}1">,
354 InGroup<UnusedLambdaCapture>, DefaultIgnore;
356 def warn_parameter_size: Warning<
357 "%0 is a large (%1 bytes) pass-by-value argument; "
358 "pass it by reference instead ?">, InGroup<LargeByValueCopy>;
359 def warn_return_value_size: Warning<
360 "return value of %0 is a large (%1 bytes) pass-by-value object; "
361 "pass it by reference instead ?">, InGroup<LargeByValueCopy>;
362 def warn_return_value_udt: Warning<
363 "%0 has C-linkage specified, but returns user-defined type %1 which is "
364 "incompatible with C">, InGroup<ReturnTypeCLinkage>;
365 def warn_return_value_udt_incomplete: Warning<
366 "%0 has C-linkage specified, but returns incomplete type %1 which could be "
367 "incompatible with C">, InGroup<ReturnTypeCLinkage>;
368 def warn_implicit_function_decl : Warning<
369 "implicit declaration of function %0">,
370 InGroup<ImplicitFunctionDeclare>, DefaultIgnore;
371 def ext_implicit_function_decl : ExtWarn<
372 "implicit declaration of function %0 is invalid in %select{C99|OpenCL}1">,
373 InGroup<ImplicitFunctionDeclare>;
374 def note_function_suggestion : Note<"did you mean %0?">;
376 def err_ellipsis_first_param : Error<
377 "ISO C requires a named parameter before '...'">;
378 def err_declarator_need_ident : Error<"declarator requires an identifier">;
379 def err_language_linkage_spec_unknown : Error<"unknown linkage language">;
380 def err_language_linkage_spec_not_ascii : Error<
381 "string literal in language linkage specifier cannot have an "
383 def ext_use_out_of_scope_declaration : ExtWarn<
384 "use of out-of-scope declaration of %0%select{| whose type is not "
385 "compatible with that of an implicit declaration}1">,
386 InGroup<DiagGroup<"out-of-scope-function">>;
387 def err_inline_non_function : Error<
388 "'inline' can only appear on functions%select{| and non-local variables}0">;
389 def err_noreturn_non_function : Error<
390 "'_Noreturn' can only appear on functions">;
391 def warn_qual_return_type : Warning<
392 "'%0' type qualifier%s1 on return type %plural{1:has|:have}1 no effect">,
393 InGroup<IgnoredQualifiers>, DefaultIgnore;
394 def warn_deprecated_redundant_constexpr_static_def : Warning<
395 "out-of-line definition of constexpr static data member is redundant "
396 "in C++17 and is deprecated">,
397 InGroup<Deprecated>, DefaultIgnore;
399 def warn_decl_shadow :
400 Warning<"declaration shadows a %select{"
403 "static data member of %2|"
406 "type alias in %2}1">,
407 InGroup<Shadow>, DefaultIgnore;
408 def warn_decl_shadow_uncaptured_local :
409 Warning<warn_decl_shadow.Text>,
410 InGroup<ShadowUncapturedLocal>, DefaultIgnore;
411 def warn_ctor_parm_shadows_field:
412 Warning<"constructor parameter %0 shadows the field %1 of %2">,
413 InGroup<ShadowFieldInConstructor>, DefaultIgnore;
414 def warn_modifying_shadowing_decl :
415 Warning<"modifying constructor parameter %0 that shadows a "
417 InGroup<ShadowFieldInConstructorModified>, DefaultIgnore;
419 // C++ decomposition declarations
420 def err_decomp_decl_context : Error<
421 "decomposition declaration not permitted in this context">;
422 def warn_cxx14_compat_decomp_decl : Warning<
423 "decomposition declarations are incompatible with "
424 "C++ standards before C++17">, DefaultIgnore, InGroup<CXXPre17Compat>;
425 def ext_decomp_decl : ExtWarn<
426 "decomposition declarations are a C++17 extension">, InGroup<CXX17>;
427 def ext_decomp_decl_cond : ExtWarn<
428 "ISO C++17 does not permit structured binding declaration in a condition">,
429 InGroup<DiagGroup<"binding-in-condition">>;
430 def err_decomp_decl_spec : Error<
431 "decomposition declaration cannot be declared "
432 "%plural{1:'%1'|:with '%1' specifiers}0">;
433 def err_decomp_decl_type : Error<
434 "decomposition declaration cannot be declared with type %0; "
435 "declared type must be 'auto' or reference to 'auto'">;
436 def err_decomp_decl_parens : Error<
437 "decomposition declaration cannot be declared with parentheses">;
438 def err_decomp_decl_template : Error<
439 "decomposition declaration template not supported">;
440 def err_decomp_decl_not_alone : Error<
441 "decomposition declaration must be the only declaration in its group">;
442 def err_decomp_decl_requires_init : Error<
443 "decomposition declaration %0 requires an initializer">;
444 def err_decomp_decl_wrong_number_bindings : Error<
445 "type %0 decomposes into %2 elements, but %select{only |}3%1 "
446 "names were provided">;
447 def err_decomp_decl_unbindable_type : Error<
448 "cannot decompose %select{union|non-class, non-array}1 type %2">;
449 def err_decomp_decl_multiple_bases_with_members : Error<
450 "cannot decompose class type %1: "
451 "%select{its base classes %2 and|both it and its base class}0 %3 "
452 "have non-static data members">;
453 def err_decomp_decl_ambiguous_base : Error<
454 "cannot decompose members of ambiguous base class %1 of %0:%2">;
455 def err_decomp_decl_non_public_base : Error<
456 "cannot decompose members of non-public base class %1 of %0">;
457 def err_decomp_decl_non_public_member : Error<
458 "cannot decompose non-public member %0 of %1">;
459 def err_decomp_decl_anon_union_member : Error<
460 "cannot decompose class type %0 because it has an anonymous "
461 "%select{struct|union}1 member">;
462 def err_decomp_decl_std_tuple_element_not_specialized : Error<
463 "cannot decompose this type; 'std::tuple_element<%0>::type' "
464 "does not name a type">;
465 def err_decomp_decl_std_tuple_size_not_constant : Error<
466 "cannot decompose this type; 'std::tuple_size<%0>::value' "
467 "is not a valid integral constant expression">;
468 def note_in_binding_decl_init : Note<
469 "in implicit initialization of binding declaration %0">;
471 def err_std_type_trait_not_class_template : Error<
472 "unsupported standard library implementation: "
473 "'std::%0' is not a class template">;
475 // C++ using declarations
476 def err_using_requires_qualname : Error<
477 "using declaration requires a qualified name">;
478 def err_using_typename_non_type : Error<
479 "'typename' keyword used on a non-type">;
480 def err_using_dependent_value_is_type : Error<
481 "dependent using declaration resolved to type without 'typename'">;
482 def err_using_decl_nested_name_specifier_is_not_class : Error<
483 "using declaration in class refers into '%0', which is not a class">;
484 def err_using_decl_nested_name_specifier_is_current_class : Error<
485 "using declaration refers to its own class">;
486 def err_using_decl_nested_name_specifier_is_not_base_class : Error<
487 "using declaration refers into '%0', which is not a base class of %1">;
488 def err_using_decl_constructor_not_in_direct_base : Error<
489 "%0 is not a direct base of %1, cannot inherit constructors">;
490 def err_using_decl_can_not_refer_to_class_member : Error<
491 "using declaration cannot refer to class member">;
492 def err_ambiguous_inherited_constructor : Error<
493 "constructor of %0 inherited from multiple base class subobjects">;
494 def note_ambiguous_inherited_constructor_using : Note<
495 "inherited from base class %0 here">;
496 def note_using_decl_class_member_workaround : Note<
497 "use %select{an alias declaration|a typedef declaration|a reference|"
498 "a const variable|a constexpr variable}0 instead">;
499 def err_using_decl_can_not_refer_to_namespace : Error<
500 "using declaration cannot refer to a namespace">;
501 def err_using_decl_can_not_refer_to_scoped_enum : Error<
502 "using declaration cannot refer to a scoped enumerator">;
503 def err_using_decl_constructor : Error<
504 "using declaration cannot refer to a constructor">;
505 def warn_cxx98_compat_using_decl_constructor : Warning<
506 "inheriting constructors are incompatible with C++98">,
507 InGroup<CXX98Compat>, DefaultIgnore;
508 def err_using_decl_destructor : Error<
509 "using declaration cannot refer to a destructor">;
510 def err_using_decl_template_id : Error<
511 "using declaration cannot refer to a template specialization">;
512 def note_using_decl_target : Note<"target of using declaration">;
513 def note_using_decl_conflict : Note<"conflicting declaration">;
514 def err_using_decl_redeclaration : Error<"redeclaration of using declaration">;
515 def err_using_decl_conflict : Error<
516 "target of using declaration conflicts with declaration already in scope">;
517 def err_using_decl_conflict_reverse : Error<
518 "declaration conflicts with target of using declaration already in scope">;
519 def note_using_decl : Note<"%select{|previous }0using declaration">;
520 def err_using_decl_redeclaration_expansion : Error<
521 "using declaration pack expansion at block scope produces multiple values">;
523 def warn_access_decl_deprecated : Warning<
524 "access declarations are deprecated; use using declarations instead">,
526 def err_access_decl : Error<
527 "ISO C++11 does not allow access declarations; "
528 "use using declarations instead">;
529 def ext_dynamic_exception_spec : ExtWarn<
530 "ISO C++17 does not allow dynamic exception specifications">,
531 InGroup<DynamicExceptionSpec>, DefaultError;
532 def warn_exception_spec_deprecated : Warning<
533 "dynamic exception specifications are deprecated">,
534 InGroup<DeprecatedDynamicExceptionSpec>, DefaultIgnore;
535 def note_exception_spec_deprecated : Note<"use '%0' instead">;
536 def warn_deprecated_copy_operation : Warning<
537 "definition of implicit copy %select{constructor|assignment operator}1 "
538 "for %0 is deprecated because it has a user-declared "
539 "%select{copy %select{assignment operator|constructor}1|destructor}2">,
540 InGroup<Deprecated>, DefaultIgnore;
541 def warn_cxx17_compat_exception_spec_in_signature : Warning<
542 "mangled name of %0 will change in C++17 due to non-throwing exception "
543 "specification in function signature">, InGroup<CXX17CompatMangling>;
545 def warn_global_constructor : Warning<
546 "declaration requires a global constructor">,
547 InGroup<GlobalConstructors>, DefaultIgnore;
548 def warn_global_destructor : Warning<
549 "declaration requires a global destructor">,
550 InGroup<GlobalConstructors>, DefaultIgnore;
551 def warn_exit_time_destructor : Warning<
552 "declaration requires an exit-time destructor">,
553 InGroup<ExitTimeDestructors>, DefaultIgnore;
555 def err_invalid_thread : Error<
556 "'%0' is only allowed on variable declarations">;
557 def err_thread_non_global : Error<
558 "'%0' variables must have global storage">;
559 def err_thread_unsupported : Error<
560 "thread-local storage is not supported for the current target">;
562 def warn_maybe_falloff_nonvoid_function : Warning<
563 "control may reach end of non-void function">,
565 def warn_falloff_nonvoid_function : Warning<
566 "control reaches end of non-void function">,
568 def err_maybe_falloff_nonvoid_block : Error<
569 "control may reach end of non-void block">;
570 def err_falloff_nonvoid_block : Error<
571 "control reaches end of non-void block">;
572 def warn_maybe_falloff_nonvoid_coroutine : Warning<
573 "control may reach end of coroutine; which is undefined behavior because the promise type %0 does not declare 'return_void()'">,
575 def warn_falloff_nonvoid_coroutine : Warning<
576 "control reaches end of coroutine; which is undefined behavior because the promise type %0 does not declare 'return_void()'">,
578 def warn_suggest_noreturn_function : Warning<
579 "%select{function|method}0 %1 could be declared with attribute 'noreturn'">,
580 InGroup<MissingNoreturn>, DefaultIgnore;
581 def warn_suggest_noreturn_block : Warning<
582 "block could be declared with attribute 'noreturn'">,
583 InGroup<MissingNoreturn>, DefaultIgnore;
586 def warn_unreachable : Warning<
587 "code will never be executed">,
588 InGroup<UnreachableCode>, DefaultIgnore;
589 def warn_unreachable_break : Warning<
590 "'break' will never be executed">,
591 InGroup<UnreachableCodeBreak>, DefaultIgnore;
592 def warn_unreachable_return : Warning<
593 "'return' will never be executed">,
594 InGroup<UnreachableCodeReturn>, DefaultIgnore;
595 def warn_unreachable_loop_increment : Warning<
596 "loop will run at most once (loop increment never executed)">,
597 InGroup<UnreachableCodeLoopIncrement>, DefaultIgnore;
598 def note_unreachable_silence : Note<
599 "silence by adding parentheses to mark code as explicitly dead">;
601 /// Built-in functions.
602 def ext_implicit_lib_function_decl : ExtWarn<
603 "implicitly declaring library function '%0' with type %1">,
604 InGroup<ImplicitFunctionDeclare>;
605 def note_include_header_or_declare : Note<
606 "include the header <%0> or explicitly provide a declaration for '%1'">;
607 def note_previous_builtin_declaration : Note<"%0 is a builtin with type %1">;
608 def warn_implicit_decl_requires_sysheader : Warning<
609 "declaration of built-in function '%1' requires inclusion of the header <%0>">,
610 InGroup<BuiltinRequiresHeader>;
611 def warn_redecl_library_builtin : Warning<
612 "incompatible redeclaration of library function %0">,
613 InGroup<DiagGroup<"incompatible-library-redeclaration">>;
614 def err_builtin_definition : Error<"definition of builtin function %0">;
615 def err_builtin_redeclare : Error<"cannot redeclare builtin function %0">;
616 def err_arm_invalid_specialreg : Error<"invalid special register for builtin">;
617 def err_invalid_cpu_supports : Error<"invalid cpu feature string for builtin">;
618 def err_invalid_cpu_is : Error<"invalid cpu name for builtin">;
619 def err_invalid_cpu_specific_dispatch_value : Error<
620 "invalid option '%0' for %select{cpu_specific|cpu_dispatch}1">;
621 def err_builtin_needs_feature : Error<"%0 needs target feature %1">;
622 def err_function_needs_feature
623 : Error<"always_inline function %1 requires target feature '%2', but would "
624 "be inlined into function %0 that is compiled without support for "
626 def warn_builtin_unknown : Warning<"use of unknown builtin %0">,
627 InGroup<ImplicitFunctionDeclare>, DefaultError;
628 def warn_cstruct_memaccess : Warning<
629 "%select{destination for|source of|first operand of|second operand of}0 this "
630 "%1 call is a pointer to record %2 that is not trivial to "
631 "%select{primitive-default-initialize|primitive-copy}3">,
632 InGroup<NonTrivialMemaccess>;
633 def note_nontrivial_field : Note<
634 "field is non-trivial to %select{copy|default-initialize}0">;
635 def warn_dyn_class_memaccess : Warning<
636 "%select{destination for|source of|first operand of|second operand of}0 this "
637 "%1 call is a pointer to %select{|class containing a }2dynamic class %3; "
638 "vtable pointer will be %select{overwritten|copied|moved|compared}4">,
639 InGroup<DynamicClassMemaccess>;
640 def note_bad_memaccess_silence : Note<
641 "explicitly cast the pointer to silence this warning">;
642 def warn_sizeof_pointer_expr_memaccess : Warning<
643 "'%0' call operates on objects of type %1 while the size is based on a "
644 "different type %2">,
645 InGroup<SizeofPointerMemaccess>;
646 def warn_sizeof_pointer_expr_memaccess_note : Note<
647 "did you mean to %select{dereference the argument to 'sizeof' (and multiply "
648 "it by the number of elements)|remove the addressof in the argument to "
649 "'sizeof' (and multiply it by the number of elements)|provide an explicit "
651 def warn_sizeof_pointer_type_memaccess : Warning<
652 "argument to 'sizeof' in %0 call is the same pointer type %1 as the "
653 "%select{destination|source}2; expected %3 or an explicit length">,
654 InGroup<SizeofPointerMemaccess>;
655 def warn_strlcpycat_wrong_size : Warning<
656 "size argument in %0 call appears to be size of the source; "
657 "expected the size of the destination">,
658 InGroup<DiagGroup<"strlcpy-strlcat-size">>;
659 def note_strlcpycat_wrong_size : Note<
660 "change size argument to be the size of the destination">;
661 def warn_memsize_comparison : Warning<
662 "size argument in %0 call is a comparison">,
663 InGroup<DiagGroup<"memsize-comparison">>;
664 def note_memsize_comparison_paren : Note<
665 "did you mean to compare the result of %0 instead?">;
666 def note_memsize_comparison_cast_silence : Note<
667 "explicitly cast the argument to size_t to silence this warning">;
668 def warn_suspicious_sizeof_memset : Warning<
669 "%select{'size' argument to memset is '0'|"
670 "setting buffer to a 'sizeof' expression}0"
671 "; did you mean to transpose the last two arguments?">,
672 InGroup<MemsetTransposedArgs>;
673 def note_suspicious_sizeof_memset_silence : Note<
674 "%select{parenthesize the third argument|"
675 "cast the second argument to 'int'}0 to silence">;
676 def warn_suspicious_bzero_size : Warning<"'size' argument to bzero is '0'">,
677 InGroup<SuspiciousBzero>;
678 def note_suspicious_bzero_size_silence : Note<
679 "parenthesize the second argument to silence">;
681 def warn_strncat_large_size : Warning<
682 "the value of the size argument in 'strncat' is too large, might lead to a "
683 "buffer overflow">, InGroup<StrncatSize>;
684 def warn_strncat_src_size : Warning<"size argument in 'strncat' call appears "
685 "to be size of the source">, InGroup<StrncatSize>;
686 def warn_strncat_wrong_size : Warning<
687 "the value of the size argument to 'strncat' is wrong">, InGroup<StrncatSize>;
688 def note_strncat_wrong_size : Note<
689 "change the argument to be the free space in the destination buffer minus "
690 "the terminating null byte">;
692 def warn_assume_side_effects : Warning<
693 "the argument to %0 has side effects that will be discarded">,
694 InGroup<DiagGroup<"assume">>;
696 def warn_memcpy_chk_overflow : Warning<
697 "%0 will always overflow destination buffer">,
698 InGroup<DiagGroup<"builtin-memcpy-chk-size">>;
701 // static main() is not an error in C, just in C++.
702 def warn_static_main : Warning<"'main' should not be declared static">,
704 def err_static_main : Error<"'main' is not allowed to be declared static">;
705 def err_inline_main : Error<"'main' is not allowed to be declared inline">;
706 def ext_variadic_main : ExtWarn<
707 "'main' is not allowed to be declared variadic">, InGroup<Main>;
708 def ext_noreturn_main : ExtWarn<
709 "'main' is not allowed to be declared _Noreturn">, InGroup<Main>;
710 def note_main_remove_noreturn : Note<"remove '_Noreturn'">;
711 def err_constexpr_main : Error<
712 "'main' is not allowed to be declared constexpr">;
713 def err_deleted_main : Error<"'main' is not allowed to be deleted">;
714 def err_mainlike_template_decl : Error<"%0 cannot be a template">;
715 def err_main_returns_nonint : Error<"'main' must return 'int'">;
716 def ext_main_returns_nonint : ExtWarn<"return type of 'main' is not 'int'">,
717 InGroup<MainReturnType>;
718 def note_main_change_return_type : Note<"change return type to 'int'">;
719 def err_main_surplus_args : Error<"too many parameters (%0) for 'main': "
720 "must be 0, 2, or 3">;
721 def warn_main_one_arg : Warning<"only one parameter on 'main' declaration">,
723 def err_main_arg_wrong : Error<"%select{first|second|third|fourth}0 "
724 "parameter of 'main' (%select{argument count|argument array|environment|"
725 "platform-specific data}0) must be of type %1">;
726 def warn_main_returns_bool_literal : Warning<"bool literal returned from "
727 "'main'">, InGroup<Main>;
728 def err_main_global_variable :
729 Error<"main cannot be declared as global variable">;
730 def warn_main_redefined : Warning<"variable named 'main' with external linkage "
731 "has undefined behavior">, InGroup<Main>;
732 def ext_main_used : Extension<
733 "ISO C++ does not allow 'main' to be used by a program">, InGroup<Main>;
735 /// parser diagnostics
736 def ext_no_declarators : ExtWarn<"declaration does not declare anything">,
737 InGroup<MissingDeclarations>;
738 def ext_typedef_without_a_name : ExtWarn<"typedef requires a name">,
739 InGroup<MissingDeclarations>;
740 def err_typedef_not_identifier : Error<"typedef name must be an identifier">;
741 def err_typedef_changes_linkage : Error<"unsupported: typedef changes linkage"
742 " of anonymous type, but linkage was already computed">;
743 def note_typedef_changes_linkage : Note<"use a tag name here to establish "
744 "linkage prior to definition">;
745 def err_statically_allocated_object : Error<
746 "interface type cannot be statically allocated">;
747 def err_object_cannot_be_passed_returned_by_value : Error<
748 "interface type %1 cannot be %select{returned|passed}0 by value"
749 "; did you forget * in %1?">;
750 def err_parameters_retval_cannot_have_fp16_type : Error<
751 "%select{parameters|function return value}0 cannot have __fp16 type; did you forget * ?">;
752 def err_opencl_half_load_store : Error<
753 "%select{loading directly from|assigning directly to}0 pointer to type %1 requires "
754 "cl_khr_fp16. Use vector data %select{load|store}0 builtin functions instead">;
755 def err_opencl_cast_to_half : Error<"casting to type %0 is not allowed">;
756 def err_opencl_half_declaration : Error<
757 "declaring variable of type %0 is not allowed">;
758 def err_opencl_half_param : Error<
759 "declaring function parameter of type %0 is not allowed; did you forget * ?">;
760 def err_opencl_invalid_return : Error<
761 "declaring function return value of type %0 is not allowed %select{; did you forget * ?|}1">;
762 def warn_enum_value_overflow : Warning<"overflow in enumeration value">;
763 def warn_pragma_options_align_reset_failed : Warning<
764 "#pragma options align=reset failed: %0">,
765 InGroup<IgnoredPragmas>;
766 def err_pragma_options_align_mac68k_target_unsupported : Error<
767 "mac68k alignment pragma is not supported on this target">;
768 def warn_pragma_pack_invalid_alignment : Warning<
769 "expected #pragma pack parameter to be '1', '2', '4', '8', or '16'">,
770 InGroup<IgnoredPragmas>;
771 def warn_pragma_pack_non_default_at_include : Warning<
772 "non-default #pragma pack value changes the alignment of struct or union "
773 "members in the included file">, InGroup<PragmaPackSuspiciousInclude>,
775 def warn_pragma_pack_modified_after_include : Warning<
776 "the current #pragma pack aligment value is modified in the included "
777 "file">, InGroup<PragmaPack>;
778 def warn_pragma_pack_no_pop_eof : Warning<"unterminated "
779 "'#pragma pack (push, ...)' at end of file">, InGroup<PragmaPack>;
780 def note_pragma_pack_here : Note<
781 "previous '#pragma pack' directive that modifies alignment is here">;
782 def note_pragma_pack_pop_instead_reset : Note<
783 "did you intend to use '#pragma pack (pop)' instead of '#pragma pack()'?">;
784 // Follow the Microsoft implementation.
785 def warn_pragma_pack_show : Warning<"value of #pragma pack(show) == %0">;
786 def warn_pragma_pack_pop_identifier_and_alignment : Warning<
787 "specifying both a name and alignment to 'pop' is undefined">;
788 def warn_pragma_pop_failed : Warning<"#pragma %0(pop, ...) failed: %1">,
789 InGroup<IgnoredPragmas>;
790 def warn_cxx_ms_struct :
791 Warning<"ms_struct may not produce Microsoft-compatible layouts for classes "
792 "with base classes or virtual functions">,
793 DefaultError, InGroup<IncompatibleMSStruct>;
794 def warn_npot_ms_struct :
795 Warning<"ms_struct may not produce Microsoft-compatible layouts with fundamental "
796 "data types with sizes that aren't a power of two">,
797 DefaultError, InGroup<IncompatibleMSStruct>;
798 def err_section_conflict : Error<"%0 causes a section type conflict with %1">;
799 def err_no_base_classes : Error<"invalid use of '__super', %0 has no base classes">;
800 def err_invalid_super_scope : Error<"invalid use of '__super', "
801 "this keyword can only be used inside class or member function scope">;
802 def err_super_in_lambda_unsupported : Error<
803 "use of '__super' inside a lambda is unsupported">;
805 def warn_pragma_unused_undeclared_var : Warning<
806 "undeclared variable %0 used as an argument for '#pragma unused'">,
807 InGroup<IgnoredPragmas>;
808 def warn_atl_uuid_deprecated : Warning<
809 "specifying 'uuid' as an ATL attribute is deprecated; use __declspec instead">,
810 InGroup<DeprecatedDeclarations>;
811 def warn_pragma_unused_expected_var_arg : Warning<
812 "only variables can be arguments to '#pragma unused'">,
813 InGroup<IgnoredPragmas>;
814 def err_pragma_push_visibility_mismatch : Error<
815 "#pragma visibility push with no matching #pragma visibility pop">;
816 def note_surrounding_namespace_ends_here : Note<
817 "surrounding namespace with visibility attribute ends here">;
818 def err_pragma_pop_visibility_mismatch : Error<
819 "#pragma visibility pop with no matching #pragma visibility push">;
820 def note_surrounding_namespace_starts_here : Note<
821 "surrounding namespace with visibility attribute starts here">;
822 def err_pragma_loop_invalid_argument_type : Error<
823 "invalid argument of type %0; expected an integer type">;
824 def err_pragma_loop_invalid_argument_value : Error<
825 "%select{invalid value '%0'; must be positive|value '%0' is too large}1">;
826 def err_pragma_loop_compatibility : Error<
827 "%select{incompatible|duplicate}0 directives '%1' and '%2'">;
828 def err_pragma_loop_precedes_nonloop : Error<
829 "expected a for, while, or do-while loop to follow '%0'">;
831 def err_pragma_attribute_matcher_subrule_contradicts_rule : Error<
832 "redundant attribute subject matcher sub-rule '%0'; '%1' already matches "
833 "those declarations">;
834 def err_pragma_attribute_matcher_negated_subrule_contradicts_subrule : Error<
835 "negated attribute subject matcher sub-rule '%0' contradicts sub-rule '%1'">;
836 def err_pragma_attribute_invalid_matchers : Error<
837 "attribute %0 can't be applied to %1">;
838 def err_pragma_attribute_stack_mismatch : Error<
839 "'#pragma clang attribute pop' with no matching '#pragma clang attribute push'">;
840 def warn_pragma_attribute_unused : Warning<
841 "unused attribute %0 in '#pragma clang attribute push' region">,
842 InGroup<PragmaClangAttribute>;
843 def note_pragma_attribute_region_ends_here : Note<
844 "'#pragma clang attribute push' regions ends here">;
845 def err_pragma_attribute_no_pop_eof : Error<"unterminated "
846 "'#pragma clang attribute push' at end of file">;
847 def note_pragma_attribute_applied_decl_here : Note<
848 "when applied to this declaration">;
850 /// Objective-C parser diagnostics
851 def err_duplicate_class_def : Error<
852 "duplicate interface definition for class %0">;
853 def err_undef_superclass : Error<
854 "cannot find interface declaration for %0, superclass of %1">;
855 def err_forward_superclass : Error<
856 "attempting to use the forward class %0 as superclass of %1">;
857 def err_no_nsconstant_string_class : Error<
858 "cannot find interface declaration for %0">;
859 def err_recursive_superclass : Error<
860 "trying to recursively use %0 as superclass of %1">;
861 def err_conflicting_aliasing_type : Error<"conflicting types for alias %0">;
862 def warn_undef_interface : Warning<"cannot find interface declaration for %0">;
863 def warn_duplicate_protocol_def : Warning<
864 "duplicate protocol definition of %0 is ignored">,
865 InGroup<DiagGroup<"duplicate-protocol">>;
866 def err_protocol_has_circular_dependency : Error<
867 "protocol has circular dependency">;
868 def err_undeclared_protocol : Error<"cannot find protocol declaration for %0">;
869 def warn_undef_protocolref : Warning<"cannot find protocol definition for %0">;
870 def warn_atprotocol_protocol : Warning<
871 "@protocol is using a forward protocol declaration of %0">, InGroup<AtProtocol>;
872 def warn_readonly_property : Warning<
873 "attribute 'readonly' of property %0 restricts attribute "
874 "'readwrite' of property inherited from %1">,
875 InGroup<PropertyAttr>;
877 def warn_property_attribute : Warning<
878 "'%1' attribute on property %0 does not match the property inherited from %2">,
879 InGroup<PropertyAttr>;
880 def warn_property_types_are_incompatible : Warning<
881 "property type %0 is incompatible with type %1 inherited from %2">,
882 InGroup<DiagGroup<"incompatible-property-type">>;
883 def warn_protocol_property_mismatch : Warning<
884 "property %select{of type %1|with attribute '%1'|without attribute '%1'|with "
885 "getter %1|with setter %1}0 was selected for synthesis">,
886 InGroup<DiagGroup<"protocol-property-synthesis-ambiguity">>;
887 def err_protocol_property_mismatch: Error<warn_protocol_property_mismatch.Text>;
888 def err_undef_interface : Error<"cannot find interface declaration for %0">;
889 def err_category_forward_interface : Error<
890 "cannot define %select{category|class extension}0 for undefined class %1">;
891 def err_class_extension_after_impl : Error<
892 "cannot declare class extension for %0 after class implementation">;
893 def note_implementation_declared : Note<
894 "class implementation is declared here">;
895 def note_while_in_implementation : Note<
896 "detected while default synthesizing properties in class implementation">;
897 def note_class_declared : Note<
898 "class is declared here">;
899 def note_receiver_class_declared : Note<
900 "receiver is instance of class declared here">;
901 def note_receiver_expr_here : Note<
902 "receiver expression is here">;
903 def note_receiver_is_id : Note<
904 "receiver is treated with 'id' type for purpose of method lookup">;
905 def note_suppressed_class_declare : Note<
906 "class with specified objc_requires_property_definitions attribute is declared here">;
907 def err_objc_root_class_subclass : Error<
908 "objc_root_class attribute may only be specified on a root class declaration">;
909 def err_restricted_superclass_mismatch : Error<
910 "cannot subclass a class that was declared with the "
911 "'objc_subclassing_restricted' attribute">;
912 def warn_objc_root_class_missing : Warning<
913 "class %0 defined without specifying a base class">,
914 InGroup<ObjCRootClass>;
915 def err_objc_runtime_visible_category : Error<
916 "cannot implement a category for class %0 that is only visible via the "
917 "Objective-C runtime">;
918 def err_objc_runtime_visible_subclass : Error<
919 "cannot implement subclass %0 of a superclass %1 that is only visible via the "
920 "Objective-C runtime">;
921 def note_objc_needs_superclass : Note<
922 "add a super class to fix this problem">;
923 def warn_dup_category_def : Warning<
924 "duplicate definition of category %1 on interface %0">;
925 def err_conflicting_super_class : Error<"conflicting super class name %0">;
926 def err_dup_implementation_class : Error<"reimplementation of class %0">;
927 def err_dup_implementation_category : Error<
928 "reimplementation of category %1 for class %0">;
929 def err_conflicting_ivar_type : Error<
930 "instance variable %0 has conflicting type%diff{: $ vs $|}1,2">;
931 def err_duplicate_ivar_declaration : Error<
932 "instance variable is already declared">;
933 def warn_on_superclass_use : Warning<
934 "class implementation may not have super class">;
935 def err_conflicting_ivar_bitwidth : Error<
936 "instance variable %0 has conflicting bit-field width">;
937 def err_conflicting_ivar_name : Error<
938 "conflicting instance variable names: %0 vs %1">;
939 def err_inconsistent_ivar_count : Error<
940 "inconsistent number of instance variables specified">;
941 def warn_undef_method_impl : Warning<"method definition for %0 not found">,
942 InGroup<DiagGroup<"incomplete-implementation">>;
944 def warn_conflicting_overriding_ret_types : Warning<
945 "conflicting return type in "
946 "declaration of %0%diff{: $ vs $|}1,2">,
947 InGroup<OverridingMethodMismatch>, DefaultIgnore;
949 def warn_conflicting_ret_types : Warning<
950 "conflicting return type in "
951 "implementation of %0%diff{: $ vs $|}1,2">,
952 InGroup<MismatchedReturnTypes>;
954 def warn_conflicting_overriding_ret_type_modifiers : Warning<
955 "conflicting distributed object modifiers on return type "
956 "in declaration of %0">,
957 InGroup<OverridingMethodMismatch>, DefaultIgnore;
959 def warn_conflicting_ret_type_modifiers : Warning<
960 "conflicting distributed object modifiers on return type "
961 "in implementation of %0">,
962 InGroup<DistributedObjectModifiers>;
964 def warn_non_covariant_overriding_ret_types : Warning<
965 "conflicting return type in "
966 "declaration of %0: %1 vs %2">,
967 InGroup<OverridingMethodMismatch>, DefaultIgnore;
969 def warn_non_covariant_ret_types : Warning<
970 "conflicting return type in "
971 "implementation of %0: %1 vs %2">,
972 InGroup<MethodSignatures>, DefaultIgnore;
974 def warn_conflicting_overriding_param_types : Warning<
975 "conflicting parameter types in "
976 "declaration of %0%diff{: $ vs $|}1,2">,
977 InGroup<OverridingMethodMismatch>, DefaultIgnore;
979 def warn_conflicting_param_types : Warning<
980 "conflicting parameter types in "
981 "implementation of %0%diff{: $ vs $|}1,2">,
982 InGroup<MismatchedParameterTypes>;
984 def warn_conflicting_param_modifiers : Warning<
985 "conflicting distributed object modifiers on parameter type "
986 "in implementation of %0">,
987 InGroup<DistributedObjectModifiers>;
989 def warn_conflicting_overriding_param_modifiers : Warning<
990 "conflicting distributed object modifiers on parameter type "
991 "in declaration of %0">,
992 InGroup<OverridingMethodMismatch>, DefaultIgnore;
994 def warn_non_contravariant_overriding_param_types : Warning<
995 "conflicting parameter types in "
996 "declaration of %0: %1 vs %2">,
997 InGroup<OverridingMethodMismatch>, DefaultIgnore;
999 def warn_non_contravariant_param_types : Warning<
1000 "conflicting parameter types in "
1001 "implementation of %0: %1 vs %2">,
1002 InGroup<MethodSignatures>, DefaultIgnore;
1004 def warn_conflicting_overriding_variadic :Warning<
1005 "conflicting variadic declaration of method and its "
1007 InGroup<OverridingMethodMismatch>, DefaultIgnore;
1009 def warn_conflicting_variadic :Warning<
1010 "conflicting variadic declaration of method and its "
1013 def warn_category_method_impl_match:Warning<
1014 "category is implementing a method which will also be implemented"
1015 " by its primary class">, InGroup<ObjCProtocolMethodImpl>;
1017 def warn_implements_nscopying : Warning<
1018 "default assign attribute on property %0 which implements "
1019 "NSCopying protocol is not appropriate with -fobjc-gc[-only]">;
1021 def warn_multiple_method_decl : Warning<"multiple methods named %0 found">,
1022 InGroup<ObjCMultipleMethodNames>;
1023 def warn_strict_multiple_method_decl : Warning<
1024 "multiple methods named %0 found">, InGroup<StrictSelector>, DefaultIgnore;
1025 def warn_accessor_property_type_mismatch : Warning<
1026 "type of property %0 does not match type of accessor %1">;
1027 def note_conv_function_declared_at : Note<"type conversion function declared here">;
1028 def note_method_declared_at : Note<"method %0 declared here">;
1029 def note_property_attribute : Note<"property %0 is declared "
1030 "%select{deprecated|unavailable|partial}1 here">;
1031 def err_setter_type_void : Error<"type of setter must be void">;
1032 def err_duplicate_method_decl : Error<"duplicate declaration of method %0">;
1033 def warn_duplicate_method_decl :
1034 Warning<"multiple declarations of method %0 found and ignored">,
1035 InGroup<MethodDuplicate>, DefaultIgnore;
1036 def warn_objc_cdirective_format_string :
1037 Warning<"using %0 directive in %select{NSString|CFString}1 "
1038 "which is being passed as a formatting argument to the formatting "
1039 "%select{method|CFfunction}2">,
1040 InGroup<ObjCCStringFormat>, DefaultIgnore;
1041 def err_objc_var_decl_inclass :
1042 Error<"cannot declare variable inside @interface or @protocol">;
1043 def err_missing_method_context : Error<
1044 "missing context for method declaration">;
1045 def err_objc_property_attr_mutually_exclusive : Error<
1046 "property attributes '%0' and '%1' are mutually exclusive">;
1047 def err_objc_property_requires_object : Error<
1048 "property with '%0' attribute must be of object type">;
1049 def warn_objc_property_no_assignment_attribute : Warning<
1050 "no 'assign', 'retain', or 'copy' attribute is specified - "
1051 "'assign' is assumed">,
1052 InGroup<ObjCPropertyNoAttribute>;
1053 def warn_objc_isa_use : Warning<
1054 "direct access to Objective-C's isa is deprecated in favor of "
1055 "object_getClass()">, InGroup<DeprecatedObjCIsaUsage>;
1056 def warn_objc_isa_assign : Warning<
1057 "assignment to Objective-C's isa is deprecated in favor of "
1058 "object_setClass()">, InGroup<DeprecatedObjCIsaUsage>;
1059 def warn_objc_pointer_masking : Warning<
1060 "bitmasking for introspection of Objective-C object pointers is strongly "
1062 InGroup<ObjCPointerIntrospect>;
1063 def warn_objc_pointer_masking_performSelector : Warning<warn_objc_pointer_masking.Text>,
1064 InGroup<ObjCPointerIntrospectPerformSelector>;
1065 def warn_objc_property_default_assign_on_object : Warning<
1066 "default property attribute 'assign' not appropriate for object">,
1067 InGroup<ObjCPropertyNoAttribute>;
1068 def warn_property_attr_mismatch : Warning<
1069 "property attribute in class extension does not match the primary class">,
1070 InGroup<PropertyAttr>;
1071 def warn_property_implicitly_mismatched : Warning <
1072 "primary property declaration is implicitly strong while redeclaration "
1073 "in class extension is weak">,
1074 InGroup<DiagGroup<"objc-property-implicit-mismatch">>;
1075 def warn_objc_property_copy_missing_on_block : Warning<
1076 "'copy' attribute must be specified for the block property "
1077 "when -fobjc-gc-only is specified">;
1078 def warn_objc_property_retain_of_block : Warning<
1079 "retain'ed block property does not copy the block "
1080 "- use copy attribute instead">, InGroup<ObjCRetainBlockProperty>;
1081 def warn_objc_readonly_property_has_setter : Warning<
1082 "setter cannot be specified for a readonly property">,
1083 InGroup<ObjCReadonlyPropertyHasSetter>;
1084 def warn_atomic_property_rule : Warning<
1085 "writable atomic property %0 cannot pair a synthesized %select{getter|setter}1 "
1086 "with a user defined %select{getter|setter}2">,
1087 InGroup<DiagGroup<"atomic-property-with-user-defined-accessor">>;
1088 def note_atomic_property_fixup_suggest : Note<"setter and getter must both be "
1089 "synthesized, or both be user defined,or the property must be nonatomic">;
1090 def err_atomic_property_nontrivial_assign_op : Error<
1091 "atomic property of reference type %0 cannot have non-trivial assignment"
1093 def warn_cocoa_naming_owned_rule : Warning<
1094 "property follows Cocoa naming"
1095 " convention for returning 'owned' objects">,
1096 InGroup<DiagGroup<"objc-property-matches-cocoa-ownership-rule">>;
1097 def err_cocoa_naming_owned_rule : Error<
1098 "property follows Cocoa naming"
1099 " convention for returning 'owned' objects">;
1100 def note_cocoa_naming_declare_family : Note<
1101 "explicitly declare getter %objcinstance0 with '%1' to return an 'unowned' "
1103 def warn_auto_synthesizing_protocol_property :Warning<
1104 "auto property synthesis will not synthesize property %0"
1105 " declared in protocol %1">,
1106 InGroup<DiagGroup<"objc-protocol-property-synthesis">>;
1107 def note_add_synthesize_directive : Note<
1108 "add a '@synthesize' directive">;
1109 def warn_no_autosynthesis_shared_ivar_property : Warning <
1110 "auto property synthesis will not synthesize property "
1111 "%0 because it cannot share an ivar with another synthesized property">,
1112 InGroup<ObjCNoPropertyAutoSynthesis>;
1113 def warn_no_autosynthesis_property : Warning<
1114 "auto property synthesis will not synthesize property "
1115 "%0 because it is 'readwrite' but it will be synthesized 'readonly' "
1116 "via another property">,
1117 InGroup<ObjCNoPropertyAutoSynthesis>;
1118 def warn_autosynthesis_property_in_superclass : Warning<
1119 "auto property synthesis will not synthesize property "
1120 "%0; it will be implemented by its superclass, use @dynamic to "
1121 "acknowledge intention">,
1122 InGroup<ObjCNoPropertyAutoSynthesis>;
1123 def warn_autosynthesis_property_ivar_match :Warning<
1124 "autosynthesized property %0 will use %select{|synthesized}1 instance variable "
1125 "%2, not existing instance variable %3">,
1126 InGroup<DiagGroup<"objc-autosynthesis-property-ivar-name-match">>;
1127 def warn_missing_explicit_synthesis : Warning <
1128 "auto property synthesis is synthesizing property not explicitly synthesized">,
1129 InGroup<DiagGroup<"objc-missing-property-synthesis">>, DefaultIgnore;
1130 def warn_property_getter_owning_mismatch : Warning<
1131 "property declared as returning non-retained objects"
1132 "; getter returning retained objects">;
1133 def warn_property_redecl_getter_mismatch : Warning<
1134 "getter name mismatch between property redeclaration (%1) and its original "
1135 "declaration (%0)">, InGroup<PropertyAttr>;
1136 def err_property_setter_ambiguous_use : Error<
1137 "synthesized properties %0 and %1 both claim setter %2 -"
1138 " use of this setter will cause unexpected behavior">;
1139 def warn_default_atomic_custom_getter_setter : Warning<
1140 "atomic by default property %0 has a user defined %select{getter|setter}1 "
1141 "(property should be marked 'atomic' if this is intended)">,
1142 InGroup<CustomAtomic>, DefaultIgnore;
1143 def err_use_continuation_class : Error<
1144 "illegal redeclaration of property in class extension %0"
1145 " (attribute must be 'readwrite', while its primary must be 'readonly')">;
1146 def err_type_mismatch_continuation_class : Error<
1147 "type of property %0 in class extension does not match "
1148 "property type in primary class">;
1149 def err_use_continuation_class_redeclaration_readwrite : Error<
1150 "illegal redeclaration of 'readwrite' property in class extension %0"
1151 " (perhaps you intended this to be a 'readwrite' redeclaration of a "
1152 "'readonly' public property?)">;
1153 def err_continuation_class : Error<"class extension has no primary class">;
1154 def err_property_type : Error<"property cannot have array or function type %0">;
1155 def err_missing_property_context : Error<
1156 "missing context for property implementation declaration">;
1157 def err_bad_property_decl : Error<
1158 "property implementation must have its declaration in interface %0 or one of "
1160 def err_category_property : Error<
1161 "property declared in category %0 cannot be implemented in "
1162 "class implementation">;
1163 def note_property_declare : Note<
1164 "property declared here">;
1165 def note_protocol_property_declare : Note<
1166 "it could also be property "
1167 "%select{of type %1|without attribute '%1'|with attribute '%1'|with getter "
1168 "%1|with setter %1}0 declared here">;
1169 def note_property_synthesize : Note<
1170 "property synthesized here">;
1171 def err_synthesize_category_decl : Error<
1172 "@synthesize not allowed in a category's implementation">;
1173 def err_synthesize_on_class_property : Error<
1174 "@synthesize not allowed on a class property %0">;
1175 def err_missing_property_interface : Error<
1176 "property implementation in a category with no category declaration">;
1177 def err_bad_category_property_decl : Error<
1178 "property implementation must have its declaration in the category %0">;
1179 def err_bad_property_context : Error<
1180 "property implementation must be in a class or category implementation">;
1181 def err_missing_property_ivar_decl : Error<
1182 "synthesized property %0 must either be named the same as a compatible"
1183 " instance variable or must explicitly name an instance variable">;
1184 def err_arc_perform_selector_retains : Error<
1185 "performSelector names a selector which retains the object">;
1186 def warn_arc_perform_selector_leaks : Warning<
1187 "performSelector may cause a leak because its selector is unknown">,
1188 InGroup<DiagGroup<"arc-performSelector-leaks">>;
1189 def warn_dealloc_in_category : Warning<
1190 "-dealloc is being overridden in a category">,
1191 InGroup<DeallocInCategory>;
1192 def err_gc_weak_property_strong_type : Error<
1193 "weak attribute declared on a __strong type property in GC mode">;
1194 def warn_arc_repeated_use_of_weak : Warning <
1195 "weak %select{variable|property|implicit property|instance variable}0 %1 is "
1196 "accessed multiple times in this %select{function|method|block|lambda}2 "
1197 "but may be unpredictably set to nil; assign to a strong variable to keep "
1198 "the object alive">,
1199 InGroup<ARCRepeatedUseOfWeak>, DefaultIgnore;
1200 def warn_implicitly_retains_self : Warning <
1201 "block implicitly retains 'self'; explicitly mention 'self' to indicate "
1202 "this is intended behavior">,
1203 InGroup<DiagGroup<"implicit-retain-self">>, DefaultIgnore;
1204 def warn_arc_possible_repeated_use_of_weak : Warning <
1205 "weak %select{variable|property|implicit property|instance variable}0 %1 may "
1206 "be accessed multiple times in this %select{function|method|block|lambda}2 "
1207 "and may be unpredictably set to nil; assign to a strong variable to keep "
1208 "the object alive">,
1209 InGroup<ARCRepeatedUseOfWeakMaybe>, DefaultIgnore;
1210 def note_arc_weak_also_accessed_here : Note<
1211 "also accessed here">;
1212 def err_incomplete_synthesized_property : Error<
1213 "cannot synthesize property %0 with incomplete type %1">;
1215 def err_property_ivar_type : Error<
1216 "type of property %0 (%1) does not match type of instance variable %2 (%3)">;
1217 def err_property_accessor_type : Error<
1218 "type of property %0 (%1) does not match type of accessor %2 (%3)">;
1219 def err_ivar_in_superclass_use : Error<
1220 "property %0 attempting to use instance variable %1 declared in super class %2">;
1221 def err_weak_property : Error<
1222 "existing instance variable %1 for __weak property %0 must be __weak">;
1223 def err_strong_property : Error<
1224 "existing instance variable %1 for strong property %0 may not be __weak">;
1225 def err_dynamic_property_ivar_decl : Error<
1226 "dynamic property cannot have instance variable specification">;
1227 def err_duplicate_ivar_use : Error<
1228 "synthesized properties %0 and %1 both claim instance variable %2">;
1229 def err_property_implemented : Error<"property %0 is already implemented">;
1230 def warn_objc_missing_super_call : Warning<
1231 "method possibly missing a [super %0] call">,
1232 InGroup<ObjCMissingSuperCalls>;
1233 def err_dealloc_bad_result_type : Error<
1234 "dealloc return type must be correctly specified as 'void' under ARC, "
1236 def warn_undeclared_selector : Warning<
1237 "undeclared selector %0">, InGroup<UndeclaredSelector>, DefaultIgnore;
1238 def warn_undeclared_selector_with_typo : Warning<
1239 "undeclared selector %0; did you mean %1?">,
1240 InGroup<UndeclaredSelector>, DefaultIgnore;
1241 def warn_implicit_atomic_property : Warning<
1242 "property is assumed atomic by default">, InGroup<ImplicitAtomic>, DefaultIgnore;
1243 def note_auto_readonly_iboutlet_fixup_suggest : Note<
1244 "property should be changed to be readwrite">;
1245 def warn_auto_readonly_iboutlet_property : Warning<
1246 "readonly IBOutlet property %0 when auto-synthesized may "
1247 "not work correctly with 'nib' loader">,
1248 InGroup<DiagGroup<"readonly-iboutlet-property">>;
1249 def warn_auto_implicit_atomic_property : Warning<
1250 "property is assumed atomic when auto-synthesizing the property">,
1251 InGroup<ImplicitAtomic>, DefaultIgnore;
1252 def warn_unimplemented_selector: Warning<
1253 "no method with selector %0 is implemented in this translation unit">,
1254 InGroup<Selector>, DefaultIgnore;
1255 def warn_unimplemented_protocol_method : Warning<
1256 "method %0 in protocol %1 not implemented">, InGroup<Protocol>;
1257 def warn_multiple_selectors: Warning<
1258 "several methods with selector %0 of mismatched types are found "
1259 "for the @selector expression">,
1260 InGroup<SelectorTypeMismatch>, DefaultIgnore;
1262 def err_objc_kindof_nonobject : Error<
1263 "'__kindof' specifier cannot be applied to non-object type %0">;
1264 def err_objc_kindof_wrong_position : Error<
1265 "'__kindof' type specifier must precede the declarator">;
1267 def err_objc_method_unsupported_param_ret_type : Error<
1268 "%0 %select{parameter|return}1 type is unsupported; "
1269 "support for vector types for this target is introduced in %2">;
1271 def warn_messaging_unqualified_id : Warning<
1272 "messaging unqualified id">, DefaultIgnore,
1273 InGroup<DiagGroup<"objc-messaging-id">>;
1276 def err_static_assert_expression_is_not_constant : Error<
1277 "static_assert expression is not an integral constant expression">;
1278 def err_static_assert_failed : Error<"static_assert failed%select{ %1|}0">;
1279 def err_static_assert_requirement_failed : Error<
1280 "static_assert failed due to requirement '%0'%select{ %2|}1">;
1281 def ext_static_assert_no_message : ExtWarn<
1282 "static_assert with no message is a C++17 extension">, InGroup<CXX17>;
1283 def warn_cxx14_compat_static_assert_no_message : Warning<
1284 "static_assert with no message is incompatible with C++ standards before C++17">,
1285 DefaultIgnore, InGroup<CXXPre17Compat>;
1287 def ext_inline_variable : ExtWarn<
1288 "inline variables are a C++17 extension">, InGroup<CXX17>;
1289 def warn_cxx14_compat_inline_variable : Warning<
1290 "inline variables are incompatible with C++ standards before C++17">,
1291 DefaultIgnore, InGroup<CXXPre17Compat>;
1293 def warn_inline_namespace_reopened_noninline : Warning<
1294 "inline namespace reopened as a non-inline namespace">;
1295 def err_inline_namespace_mismatch : Error<
1296 "non-inline namespace cannot be reopened as inline">;
1298 def err_unexpected_friend : Error<
1299 "friends can only be classes or functions">;
1300 def ext_enum_friend : ExtWarn<
1301 "befriending enumeration type %0 is a C++11 extension">, InGroup<CXX11>;
1302 def warn_cxx98_compat_enum_friend : Warning<
1303 "befriending enumeration type %0 is incompatible with C++98">,
1304 InGroup<CXX98Compat>, DefaultIgnore;
1305 def ext_nonclass_type_friend : ExtWarn<
1306 "non-class friend type %0 is a C++11 extension">, InGroup<CXX11>;
1307 def warn_cxx98_compat_nonclass_type_friend : Warning<
1308 "non-class friend type %0 is incompatible with C++98">,
1309 InGroup<CXX98Compat>, DefaultIgnore;
1310 def err_friend_is_member : Error<
1311 "friends cannot be members of the declaring class">;
1312 def warn_cxx98_compat_friend_is_member : Warning<
1313 "friend declaration naming a member of the declaring class is incompatible "
1314 "with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
1315 def ext_unelaborated_friend_type : ExtWarn<
1316 "unelaborated friend declaration is a C++11 extension; specify "
1317 "'%select{struct|interface|union|class|enum}0' to befriend %1">,
1319 def warn_cxx98_compat_unelaborated_friend_type : Warning<
1320 "befriending %1 without '%select{struct|interface|union|class|enum}0' "
1321 "keyword is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
1322 def err_qualified_friend_not_found : Error<
1323 "no function named %0 with type %1 was found in the specified scope">;
1324 def err_introducing_special_friend : Error<
1325 "%plural{[0,2]:must use a qualified name when declaring|3:cannot declare}0"
1326 " a %select{constructor|destructor|conversion operator|deduction guide}0 "
1328 def err_tagless_friend_type_template : Error<
1329 "friend type templates must use an elaborated type">;
1330 def err_no_matching_local_friend : Error<
1331 "no matching function found in local scope">;
1332 def err_no_matching_local_friend_suggest : Error<
1333 "no matching function %0 found in local scope; did you mean %3?">;
1334 def err_partial_specialization_friend : Error<
1335 "partial specialization cannot be declared as a friend">;
1336 def err_qualified_friend_def : Error<
1337 "friend function definition cannot be qualified with '%0'">;
1338 def err_friend_def_in_local_class : Error<
1339 "friend function cannot be defined in a local class">;
1340 def err_friend_not_first_in_declaration : Error<
1341 "'friend' must appear first in a non-function declaration">;
1342 def err_using_decl_friend : Error<
1343 "cannot befriend target of using declaration">;
1344 def warn_template_qualified_friend_unsupported : Warning<
1345 "dependent nested name specifier '%0' for friend class declaration is "
1346 "not supported; turning off access control for %1">,
1347 InGroup<UnsupportedFriend>;
1348 def warn_template_qualified_friend_ignored : Warning<
1349 "dependent nested name specifier '%0' for friend template declaration is "
1350 "not supported; ignoring this friend declaration">,
1351 InGroup<UnsupportedFriend>;
1352 def ext_friend_tag_redecl_outside_namespace : ExtWarn<
1353 "unqualified friend declaration referring to type outside of the nearest "
1354 "enclosing namespace is a Microsoft extension; add a nested name specifier">,
1355 InGroup<MicrosoftUnqualifiedFriend>;
1356 def err_pure_friend : Error<"friend declaration cannot have a pure-specifier">;
1358 def err_invalid_member_in_interface : Error<
1359 "%select{data member |non-public member function |static member function |"
1360 "user-declared constructor|user-declared destructor|operator |"
1361 "nested class }0%1 is not permitted within an interface type">;
1362 def err_invalid_base_in_interface : Error<
1363 "interface type cannot inherit from "
1364 "%select{struct|non-public interface|class}0 %1">;
1366 def err_abstract_type_in_decl : Error<
1367 "%select{return|parameter|variable|field|instance variable|"
1368 "synthesized instance variable}0 type %1 is an abstract class">;
1369 def err_allocation_of_abstract_type : Error<
1370 "allocating an object of abstract class type %0">;
1371 def err_throw_abstract_type : Error<
1372 "cannot throw an object of abstract type %0">;
1373 def err_array_of_abstract_type : Error<"array of abstract class type %0">;
1374 def err_capture_of_abstract_type : Error<
1375 "by-copy capture of value of abstract type %0">;
1376 def err_capture_of_incomplete_type : Error<
1377 "by-copy capture of variable %0 with incomplete type %1">;
1378 def err_capture_default_non_local : Error<
1379 "non-local lambda expression cannot have a capture-default">;
1381 def err_multiple_final_overriders : Error<
1382 "virtual function %q0 has more than one final overrider in %1">;
1383 def note_final_overrider : Note<"final overrider of %q0 in %1">;
1385 def err_type_defined_in_type_specifier : Error<
1386 "%0 cannot be defined in a type specifier">;
1387 def err_type_defined_in_result_type : Error<
1388 "%0 cannot be defined in the result type of a function">;
1389 def err_type_defined_in_param_type : Error<
1390 "%0 cannot be defined in a parameter type">;
1391 def err_type_defined_in_alias_template : Error<
1392 "%0 cannot be defined in a type alias template">;
1393 def err_type_defined_in_condition : Error<
1394 "%0 cannot be defined in a condition">;
1395 def err_type_defined_in_enum : Error<
1396 "%0 cannot be defined in an enumeration">;
1398 def note_pure_virtual_function : Note<
1399 "unimplemented pure virtual method %0 in %1">;
1401 def note_pure_qualified_call_kext : Note<
1402 "qualified call to %0::%1 is treated as a virtual call to %1 due to -fapple-kext">;
1404 def err_deleted_decl_not_first : Error<
1405 "deleted definition must be first declaration">;
1407 def err_deleted_override : Error<
1408 "deleted function %0 cannot override a non-deleted function">;
1410 def err_non_deleted_override : Error<
1411 "non-deleted function %0 cannot override a deleted function">;
1413 def warn_weak_vtable : Warning<
1414 "%0 has no out-of-line virtual method definitions; its vtable will be "
1415 "emitted in every translation unit">,
1416 InGroup<DiagGroup<"weak-vtables">>, DefaultIgnore;
1417 def warn_weak_template_vtable : Warning<
1418 "explicit template instantiation %0 will emit a vtable in every "
1419 "translation unit">,
1420 InGroup<DiagGroup<"weak-template-vtables">>, DefaultIgnore;
1422 def ext_using_undefined_std : ExtWarn<
1423 "using directive refers to implicitly-defined namespace 'std'">;
1425 // C++ exception specifications
1426 def err_exception_spec_in_typedef : Error<
1427 "exception specifications are not allowed in %select{typedefs|type aliases}0">;
1428 def err_distant_exception_spec : Error<
1429 "exception specifications are not allowed beyond a single level "
1431 def err_incomplete_in_exception_spec : Error<
1432 "%select{|pointer to |reference to }0incomplete type %1 is not allowed "
1433 "in exception specification">;
1434 def ext_incomplete_in_exception_spec : ExtWarn<err_incomplete_in_exception_spec.Text>,
1435 InGroup<MicrosoftExceptionSpec>;
1436 def err_rref_in_exception_spec : Error<
1437 "rvalue reference type %0 is not allowed in exception specification">;
1438 def err_mismatched_exception_spec : Error<
1439 "exception specification in declaration does not match previous declaration">;
1440 def ext_mismatched_exception_spec : ExtWarn<err_mismatched_exception_spec.Text>,
1441 InGroup<MicrosoftExceptionSpec>;
1442 def err_override_exception_spec : Error<
1443 "exception specification of overriding function is more lax than "
1445 def ext_override_exception_spec : ExtWarn<err_override_exception_spec.Text>,
1446 InGroup<MicrosoftExceptionSpec>;
1447 def err_incompatible_exception_specs : Error<
1448 "target exception specification is not superset of source">;
1449 def warn_incompatible_exception_specs : Warning<
1450 err_incompatible_exception_specs.Text>, InGroup<IncompatibleExceptionSpec>;
1451 def err_deep_exception_specs_differ : Error<
1452 "exception specifications of %select{return|argument}0 types differ">;
1453 def warn_deep_exception_specs_differ : Warning<
1454 err_deep_exception_specs_differ.Text>, InGroup<IncompatibleExceptionSpec>;
1455 def err_missing_exception_specification : Error<
1456 "%0 is missing exception specification '%1'">;
1457 def ext_missing_exception_specification : ExtWarn<
1458 err_missing_exception_specification.Text>,
1459 InGroup<DiagGroup<"missing-exception-spec">>;
1460 def ext_ms_missing_exception_specification : ExtWarn<
1461 err_missing_exception_specification.Text>,
1462 InGroup<MicrosoftExceptionSpec>;
1463 def err_noexcept_needs_constant_expression : Error<
1464 "argument to noexcept specifier must be a constant expression">;
1465 def err_exception_spec_not_parsed : Error<
1466 "exception specification is not available until end of class definition">;
1468 // C++ access checking
1469 def err_class_redeclared_with_different_access : Error<
1470 "%0 redeclared with '%1' access">;
1471 def err_access : Error<
1472 "%1 is a %select{private|protected}0 member of %3">, AccessControl;
1473 def ext_ms_using_declaration_inaccessible : ExtWarn<
1474 "using declaration referring to inaccessible member '%0' (which refers "
1475 "to accessible member '%1') is a Microsoft compatibility extension">,
1476 AccessControl, InGroup<MicrosoftUsingDecl>;
1477 def err_access_ctor : Error<
1478 "calling a %select{private|protected}0 constructor of class %2">,
1480 def ext_rvalue_to_reference_access_ctor : Extension<
1481 "C++98 requires an accessible copy constructor for class %2 when binding "
1482 "a reference to a temporary; was %select{private|protected}0">,
1483 AccessControl, InGroup<BindToTemporaryCopy>;
1484 def err_access_base_ctor : Error<
1485 // The ERRORs represent other special members that aren't constructors, in
1486 // hopes that someone will bother noticing and reporting if they appear
1487 "%select{base class|inherited virtual base class}0 %1 has %select{private|"
1488 "protected}3 %select{default |copy |move |*ERROR* |*ERROR* "
1489 "|*ERROR*|}2constructor">, AccessControl;
1490 def err_access_field_ctor : Error<
1491 // The ERRORs represent other special members that aren't constructors, in
1492 // hopes that someone will bother noticing and reporting if they appear
1493 "field of type %0 has %select{private|protected}2 "
1494 "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}1constructor">,
1496 def err_access_friend_function : Error<
1497 "friend function %1 is a %select{private|protected}0 member of %3">,
1500 def err_access_dtor : Error<
1501 "calling a %select{private|protected}1 destructor of class %0">,
1503 def err_access_dtor_base :
1504 Error<"base class %0 has %select{private|protected}1 destructor">,
1506 def err_access_dtor_vbase :
1507 Error<"inherited virtual base class %1 has "
1508 "%select{private|protected}2 destructor">,
1510 def err_access_dtor_temp :
1511 Error<"temporary of type %0 has %select{private|protected}1 destructor">,
1513 def err_access_dtor_exception :
1514 Error<"exception object of type %0 has %select{private|protected}1 "
1515 "destructor">, AccessControl;
1516 def err_access_dtor_field :
1517 Error<"field of type %1 has %select{private|protected}2 destructor">,
1519 def err_access_dtor_var :
1520 Error<"variable of type %1 has %select{private|protected}2 destructor">,
1522 def err_access_dtor_ivar :
1523 Error<"instance variable of type %0 has %select{private|protected}1 "
1526 def note_previous_access_declaration : Note<
1527 "previously declared '%1' here">;
1528 def note_access_natural : Note<
1529 "%select{|implicitly }1declared %select{private|protected}0 here">;
1530 def note_access_constrained_by_path : Note<
1531 "constrained by %select{|implicitly }1%select{private|protected}0"
1532 " inheritance here">;
1533 def note_access_protected_restricted_noobject : Note<
1534 "must name member using the type of the current context %0">;
1535 def note_access_protected_restricted_ctordtor : Note<
1536 "protected %select{constructor|destructor}0 can only be used to "
1537 "%select{construct|destroy}0 a base class subobject">;
1538 def note_access_protected_restricted_object : Note<
1539 "can only access this member on an object of type %0">;
1540 def warn_cxx98_compat_sfinae_access_control : Warning<
1541 "substitution failure due to access control is incompatible with C++98">,
1542 InGroup<CXX98Compat>, DefaultIgnore, NoSFINAE;
1545 def err_incomplete_nested_name_spec : Error<
1546 "incomplete type %0 named in nested name specifier">;
1547 def err_dependent_nested_name_spec : Error<
1548 "nested name specifier for a declaration cannot depend on a template "
1550 def err_nested_name_member_ref_lookup_ambiguous : Error<
1551 "lookup of %0 in member access expression is ambiguous">;
1552 def ext_nested_name_member_ref_lookup_ambiguous : ExtWarn<
1553 "lookup of %0 in member access expression is ambiguous; using member of %1">,
1554 InGroup<AmbigMemberTemplate>;
1555 def note_ambig_member_ref_object_type : Note<
1556 "lookup in the object type %0 refers here">;
1557 def note_ambig_member_ref_scope : Note<
1558 "lookup from the current scope refers here">;
1559 def err_qualified_member_nonclass : Error<
1560 "qualified member access refers to a member in %0">;
1561 def err_incomplete_member_access : Error<
1562 "member access into incomplete type %0">;
1563 def err_incomplete_type : Error<
1564 "incomplete type %0 where a complete type is required">;
1565 def warn_cxx98_compat_enum_nested_name_spec : Warning<
1566 "enumeration type in nested name specifier is incompatible with C++98">,
1567 InGroup<CXX98Compat>, DefaultIgnore;
1568 def err_nested_name_spec_is_not_class : Error<
1569 "%0 cannot appear before '::' because it is not a class"
1570 "%select{ or namespace|, namespace, or enumeration}1; did you mean ':'?">;
1571 def ext_nested_name_spec_is_enum : ExtWarn<
1572 "use of enumeration in a nested name specifier is a C++11 extension">,
1574 def err_out_of_line_qualified_id_type_names_constructor : Error<
1575 "qualified reference to %0 is a constructor name rather than a "
1576 "%select{template name|type}1 in this context">;
1577 def ext_out_of_line_qualified_id_type_names_constructor : ExtWarn<
1578 "ISO C++ specifies that "
1579 "qualified reference to %0 is a constructor name rather than a "
1580 "%select{template name|type}1 in this context, despite preceding "
1581 "%select{'typename'|'template'}2 keyword">, SFINAEFailure,
1582 InGroup<DiagGroup<"injected-class-name">>;
1584 // C++ class members
1585 def err_storageclass_invalid_for_member : Error<
1586 "storage class specified for a member declaration">;
1587 def err_mutable_function : Error<"'mutable' cannot be applied to functions">;
1588 def err_mutable_reference : Error<"'mutable' cannot be applied to references">;
1589 def ext_mutable_reference : ExtWarn<
1590 "'mutable' on a reference type is a Microsoft extension">,
1591 InGroup<MicrosoftMutableReference>;
1592 def err_mutable_const : Error<"'mutable' and 'const' cannot be mixed">;
1593 def err_mutable_nonmember : Error<
1594 "'mutable' can only be applied to member variables">;
1595 def err_virtual_in_union : Error<
1596 "unions cannot have virtual functions">;
1597 def err_virtual_non_function : Error<
1598 "'virtual' can only appear on non-static member functions">;
1599 def err_virtual_out_of_class : Error<
1600 "'virtual' can only be specified inside the class definition">;
1601 def err_virtual_member_function_template : Error<
1602 "'virtual' cannot be specified on member function templates">;
1603 def err_static_overrides_virtual : Error<
1604 "'static' member function %0 overrides a virtual function in a base class">;
1605 def err_explicit_non_function : Error<
1606 "'explicit' can only appear on non-static member functions">;
1607 def err_explicit_out_of_class : Error<
1608 "'explicit' can only be specified inside the class definition">;
1609 def err_explicit_non_ctor_or_conv_function : Error<
1610 "'explicit' can only be applied to a constructor or conversion function">;
1611 def err_static_not_bitfield : Error<"static member %0 cannot be a bit-field">;
1612 def err_static_out_of_line : Error<
1613 "'static' can only be specified inside the class definition">;
1614 def err_storage_class_for_static_member : Error<
1615 "static data member definition cannot specify a storage class">;
1616 def err_typedef_not_bitfield : Error<"typedef member %0 cannot be a bit-field">;
1617 def err_not_integral_type_bitfield : Error<
1618 "bit-field %0 has non-integral type %1">;
1619 def err_not_integral_type_anon_bitfield : Error<
1620 "anonymous bit-field has non-integral type %0">;
1621 def err_anon_bitfield_qualifiers : Error<
1622 "anonymous bit-field cannot have qualifiers">;
1623 def err_member_function_initialization : Error<
1624 "initializer on function does not look like a pure-specifier">;
1625 def err_non_virtual_pure : Error<
1626 "%0 is not virtual and cannot be declared pure">;
1627 def ext_pure_function_definition : ExtWarn<
1628 "function definition with pure-specifier is a Microsoft extension">,
1629 InGroup<MicrosoftPureDefinition>;
1630 def err_qualified_member_of_unrelated : Error<
1631 "%q0 is not a member of class %1">;
1633 def err_member_function_call_bad_cvr : Error<
1634 "'this' argument to member function %0 has type %1, but function is not marked "
1635 "%select{const|restrict|const or restrict|volatile|const or volatile|"
1636 "volatile or restrict|const, volatile, or restrict}2">;
1637 def err_member_function_call_bad_ref : Error<
1638 "'this' argument to member function %0 is an %select{lvalue|rvalue}1, "
1639 "but function has %select{non-const lvalue|rvalue}2 ref-qualifier">;
1640 def err_member_function_call_bad_type : Error<
1641 "cannot initialize object parameter of type %0 with an expression "
1644 def warn_call_to_pure_virtual_member_function_from_ctor_dtor : Warning<
1645 "call to pure virtual member function %0 has undefined behavior; "
1646 "overrides of %0 in subclasses are not available in the "
1647 "%select{constructor|destructor}1 of %2">;
1649 def select_special_member_kind : TextSubstitution<
1650 "%select{default constructor|copy constructor|move constructor|"
1651 "copy assignment operator|move assignment operator|destructor}0">;
1653 def note_member_declared_at : Note<"member is declared here">;
1654 def note_ivar_decl : Note<"instance variable is declared here">;
1655 def note_bitfield_decl : Note<"bit-field is declared here">;
1656 def note_implicit_param_decl : Note<"%0 is an implicit parameter">;
1657 def note_member_synthesized_at : Note<
1658 "in implicit %sub{select_special_member_kind}0 for %1 "
1659 "first required here">;
1660 def err_missing_default_ctor : Error<
1661 "%select{constructor for %1 must explicitly initialize the|"
1662 "implicit default constructor for %1 must explicitly initialize the|"
1663 "cannot use constructor inherited from base class %4;}0 "
1664 "%select{base class|member}2 %3 %select{which|which|of %1}0 "
1665 "does not have a default constructor">;
1666 def note_due_to_dllexported_class : Note<
1667 "due to %0 being dllexported%select{|; try compiling in C++11 mode}1">;
1669 def err_illegal_union_or_anon_struct_member : Error<
1670 "%select{anonymous struct|union}0 member %1 has a non-trivial "
1671 "%sub{select_special_member_kind}2">;
1672 def warn_cxx98_compat_nontrivial_union_or_anon_struct_member : Warning<
1673 "%select{anonymous struct|union}0 member %1 with a non-trivial "
1674 "%sub{select_special_member_kind}2 is incompatible with C++98">,
1675 InGroup<CXX98Compat>, DefaultIgnore;
1677 def note_nontrivial_virtual_dtor : Note<
1678 "destructor for %0 is not trivial because it is virtual">;
1679 def note_nontrivial_has_virtual : Note<
1680 "because type %0 has a virtual %select{member function|base class}1">;
1681 def note_nontrivial_no_def_ctor : Note<
1682 "because %select{base class of |field of |}0type %1 has no "
1683 "default constructor">;
1684 def note_user_declared_ctor : Note<
1685 "implicit default constructor suppressed by user-declared constructor">;
1686 def note_nontrivial_no_copy : Note<
1687 "because no %select{<<ERROR>>|constructor|constructor|assignment operator|"
1688 "assignment operator|<<ERROR>>}2 can be used to "
1689 "%select{<<ERROR>>|copy|move|copy|move|<<ERROR>>}2 "
1690 "%select{base class|field|an object}0 of type %3">;
1691 def note_nontrivial_user_provided : Note<
1692 "because %select{base class of |field of |}0type %1 has a user-provided "
1693 "%sub{select_special_member_kind}2">;
1694 def note_nontrivial_in_class_init : Note<
1695 "because field %0 has an initializer">;
1696 def note_nontrivial_param_type : Note<
1697 "because its parameter is %diff{of type $, not $|of the wrong type}2,3">;
1698 def note_nontrivial_default_arg : Note<"because it has a default argument">;
1699 def note_nontrivial_variadic : Note<"because it is a variadic function">;
1700 def note_nontrivial_subobject : Note<
1701 "because the function selected to %select{construct|copy|move|copy|move|"
1702 "destroy}2 %select{base class|field}0 of type %1 is not trivial">;
1703 def note_nontrivial_objc_ownership : Note<
1704 "because type %0 has a member with %select{no|no|__strong|__weak|"
1705 "__autoreleasing}1 ownership">;
1707 def err_static_data_member_not_allowed_in_anon_struct : Error<
1708 "static data member %0 not allowed in anonymous struct">;
1709 def ext_static_data_member_in_union : ExtWarn<
1710 "static data member %0 in union is a C++11 extension">, InGroup<CXX11>;
1711 def warn_cxx98_compat_static_data_member_in_union : Warning<
1712 "static data member %0 in union is incompatible with C++98">,
1713 InGroup<CXX98Compat>, DefaultIgnore;
1714 def ext_union_member_of_reference_type : ExtWarn<
1715 "union member %0 has reference type %1, which is a Microsoft extension">,
1716 InGroup<MicrosoftUnionMemberReference>;
1717 def err_union_member_of_reference_type : Error<
1718 "union member %0 has reference type %1">;
1719 def ext_anonymous_struct_union_qualified : Extension<
1720 "anonymous %select{struct|union}0 cannot be '%1'">;
1721 def err_different_return_type_for_overriding_virtual_function : Error<
1722 "virtual function %0 has a different return type "
1723 "%diff{($) than the function it overrides (which has return type $)|"
1724 "than the function it overrides}1,2">;
1725 def note_overridden_virtual_function : Note<
1726 "overridden virtual function is here">;
1727 def err_conflicting_overriding_cc_attributes : Error<
1728 "virtual function %0 has different calling convention attributes "
1729 "%diff{($) than the function it overrides (which has calling convention $)|"
1730 "than the function it overrides}1,2">;
1731 def warn_overriding_method_missing_noescape : Warning<
1732 "parameter of overriding method should be annotated with "
1733 "__attribute__((noescape))">, InGroup<MissingNoEscape>;
1734 def note_overridden_marked_noescape : Note<
1735 "parameter of overridden method is annotated with __attribute__((noescape))">;
1737 def err_covariant_return_inaccessible_base : Error<
1738 "invalid covariant return for virtual function: %1 is a "
1739 "%select{private|protected}2 base class of %0">, AccessControl;
1740 def err_covariant_return_ambiguous_derived_to_base_conv : Error<
1741 "return type of virtual function %3 is not covariant with the return type of "
1742 "the function it overrides (ambiguous conversion from derived class "
1743 "%0 to base class %1:%2)">;
1744 def err_covariant_return_not_derived : Error<
1745 "return type of virtual function %0 is not covariant with the return type of "
1746 "the function it overrides (%1 is not derived from %2)">;
1747 def err_covariant_return_incomplete : Error<
1748 "return type of virtual function %0 is not covariant with the return type of "
1749 "the function it overrides (%1 is incomplete)">;
1750 def err_covariant_return_type_different_qualifications : Error<
1751 "return type of virtual function %0 is not covariant with the return type of "
1752 "the function it overrides (%1 has different qualifiers than %2)">;
1753 def err_covariant_return_type_class_type_more_qualified : Error<
1754 "return type of virtual function %0 is not covariant with the return type of "
1755 "the function it overrides (class type %1 is more qualified than class "
1758 // C++ implicit special member functions
1759 def note_in_declaration_of_implicit_special_member : Note<
1760 "while declaring the implicit %sub{select_special_member_kind}1"
1764 def err_constructor_cannot_be : Error<"constructor cannot be declared '%0'">;
1765 def err_invalid_qualified_constructor : Error<
1766 "'%0' qualifier is not allowed on a constructor">;
1767 def err_ref_qualifier_constructor : Error<
1768 "ref-qualifier '%select{&&|&}0' is not allowed on a constructor">;
1770 def err_constructor_return_type : Error<
1771 "constructor cannot have a return type">;
1772 def err_constructor_redeclared : Error<"constructor cannot be redeclared">;
1773 def err_constructor_byvalue_arg : Error<
1774 "copy constructor must pass its first argument by reference">;
1775 def warn_no_constructor_for_refconst : Warning<
1776 "%select{struct|interface|union|class|enum}0 %1 does not declare any "
1777 "constructor to initialize its non-modifiable members">;
1778 def note_refconst_member_not_initialized : Note<
1779 "%select{const|reference}0 member %1 will never be initialized">;
1780 def ext_ms_explicit_constructor_call : ExtWarn<
1781 "explicit constructor calls are a Microsoft extension">,
1782 InGroup<MicrosoftExplicitConstructorCall>;
1785 def err_destructor_not_member : Error<
1786 "destructor must be a non-static member function">;
1787 def err_destructor_cannot_be : Error<"destructor cannot be declared '%0'">;
1788 def err_invalid_qualified_destructor : Error<
1789 "'%0' qualifier is not allowed on a destructor">;
1790 def err_ref_qualifier_destructor : Error<
1791 "ref-qualifier '%select{&&|&}0' is not allowed on a destructor">;
1792 def err_destructor_return_type : Error<"destructor cannot have a return type">;
1793 def err_destructor_redeclared : Error<"destructor cannot be redeclared">;
1794 def err_destructor_with_params : Error<"destructor cannot have any parameters">;
1795 def err_destructor_variadic : Error<"destructor cannot be variadic">;
1796 def err_destructor_typedef_name : Error<
1797 "destructor cannot be declared using a %select{typedef|type alias}1 %0 of the class name">;
1798 def err_destructor_name : Error<
1799 "expected the class name after '~' to name the enclosing class">;
1800 def err_destructor_class_name : Error<
1801 "expected the class name after '~' to name a destructor">;
1802 def err_ident_in_dtor_not_a_type : Error<
1803 "identifier %0 in object destruction expression does not name a type">;
1804 def err_destructor_expr_type_mismatch : Error<
1805 "destructor type %0 in object destruction expression does not match the "
1806 "type %1 of the object being destroyed">;
1807 def note_destructor_type_here : Note<
1808 "type %0 is declared here">;
1810 def err_destructor_template : Error<
1811 "destructor cannot be declared as a template">;
1813 // C++ initialization
1814 def err_init_conversion_failed : Error<
1815 "cannot initialize %select{a variable|a parameter|return object|"
1816 "statement expression result|an "
1817 "exception object|a member subobject|an array element|a new value|a value|a "
1818 "base class|a constructor delegation|a vector element|a block element|a "
1819 "block element|a complex element|a lambda capture|a compound literal "
1820 "initializer|a related result|a parameter of CF audited function}0 "
1821 "%diff{of type $ with an %select{rvalue|lvalue}2 of type $|"
1822 "with an %select{rvalue|lvalue}2 of incompatible type}1,3"
1823 "%select{|: different classes%diff{ ($ vs $)|}5,6"
1824 "|: different number of parameters (%5 vs %6)"
1825 "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7"
1826 "|: different return type%diff{ ($ vs $)|}5,6"
1827 "|: different qualifiers ("
1828 "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
1829 "volatile and restrict|const, volatile, and restrict}5 vs "
1830 "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
1831 "volatile and restrict|const, volatile, and restrict}6)"
1832 "|: different exception specifications}4">;
1834 def err_lvalue_to_rvalue_ref : Error<"rvalue reference %diff{to type $ cannot "
1835 "bind to lvalue of type $|cannot bind to incompatible lvalue}0,1">;
1836 def err_lvalue_reference_bind_to_initlist : Error<
1837 "%select{non-const|volatile}0 lvalue reference to type %1 cannot bind to an "
1838 "initializer list temporary">;
1839 def err_lvalue_reference_bind_to_temporary : Error<
1840 "%select{non-const|volatile}0 lvalue reference %diff{to type $ cannot bind "
1841 "to a temporary of type $|cannot bind to incompatible temporary}1,2">;
1842 def err_lvalue_reference_bind_to_unrelated : Error<
1843 "%select{non-const|volatile}0 lvalue reference "
1844 "%diff{to type $ cannot bind to a value of unrelated type $|"
1845 "cannot bind to a value of unrelated type}1,2">;
1846 def err_reference_bind_drops_quals : Error<
1847 "binding value %diff{of type $ to reference to type $|to reference}0,1 "
1848 "drops %select{<<ERROR>>|'const'|'restrict'|'const' and 'restrict'|"
1849 "'volatile'|'const' and 'volatile'|'restrict' and 'volatile'|"
1850 "'const', 'restrict', and 'volatile'}2 qualifier%plural{1:|2:|4:|:s}2">;
1851 def err_reference_bind_failed : Error<
1852 "reference %diff{to type $ could not bind to an %select{rvalue|lvalue}1 of "
1853 "type $|could not bind to %select{rvalue|lvalue}1 of incompatible type}0,2">;
1854 def err_reference_bind_init_list : Error<
1855 "reference to type %0 cannot bind to an initializer list">;
1856 def err_init_list_bad_dest_type : Error<
1857 "%select{|non-aggregate }0type %1 cannot be initialized with an initializer "
1860 def err_reference_bind_to_bitfield : Error<
1861 "%select{non-const|volatile}0 reference cannot bind to "
1862 "bit-field%select{| %1}2">;
1863 def err_reference_bind_to_vector_element : Error<
1864 "%select{non-const|volatile}0 reference cannot bind to vector element">;
1865 def err_reference_var_requires_init : Error<
1866 "declaration of reference variable %0 requires an initializer">;
1867 def err_reference_without_init : Error<
1868 "reference to type %0 requires an initializer">;
1869 def note_value_initialization_here : Note<
1870 "in value-initialization of type %0 here">;
1871 def err_reference_has_multiple_inits : Error<
1872 "reference cannot be initialized with multiple values">;
1873 def err_init_non_aggr_init_list : Error<
1874 "initialization of non-aggregate type %0 with an initializer list">;
1875 def err_init_reference_member_uninitialized : Error<
1876 "reference member of type %0 uninitialized">;
1877 def note_uninit_reference_member : Note<
1878 "uninitialized reference member is here">;
1879 def warn_field_is_uninit : Warning<"field %0 is uninitialized when used here">,
1880 InGroup<Uninitialized>;
1881 def warn_base_class_is_uninit : Warning<
1882 "base class %0 is uninitialized when used here to access %q1">,
1883 InGroup<Uninitialized>;
1884 def warn_reference_field_is_uninit : Warning<
1885 "reference %0 is not yet bound to a value when used here">,
1886 InGroup<Uninitialized>;
1887 def note_uninit_in_this_constructor : Note<
1888 "during field initialization in %select{this|the implicit default}0 "
1890 def warn_static_self_reference_in_init : Warning<
1891 "static variable %0 is suspiciously used within its own initialization">,
1892 InGroup<UninitializedStaticSelfInit>;
1893 def warn_uninit_self_reference_in_init : Warning<
1894 "variable %0 is uninitialized when used within its own initialization">,
1895 InGroup<Uninitialized>;
1896 def warn_uninit_self_reference_in_reference_init : Warning<
1897 "reference %0 is not yet bound to a value when used within its own"
1899 InGroup<Uninitialized>;
1900 def warn_uninit_var : Warning<
1901 "variable %0 is uninitialized when %select{used here|captured by block}1">,
1902 InGroup<Uninitialized>, DefaultIgnore;
1903 def warn_sometimes_uninit_var : Warning<
1904 "variable %0 is %select{used|captured}1 uninitialized whenever "
1905 "%select{'%3' condition is %select{true|false}4|"
1906 "'%3' loop %select{is entered|exits because its condition is false}4|"
1907 "'%3' loop %select{condition is true|exits because its condition is false}4|"
1908 "switch %3 is taken|"
1909 "its declaration is reached|"
1911 InGroup<UninitializedSometimes>, DefaultIgnore;
1912 def warn_maybe_uninit_var : Warning<
1913 "variable %0 may be uninitialized when "
1914 "%select{used here|captured by block}1">,
1915 InGroup<UninitializedMaybe>, DefaultIgnore;
1916 def note_var_declared_here : Note<"variable %0 is declared here">;
1917 def note_uninit_var_use : Note<
1918 "%select{uninitialized use occurs|variable is captured by block}0 here">;
1919 def warn_uninit_byref_blockvar_captured_by_block : Warning<
1920 "block pointer variable %0 is uninitialized when captured by block">,
1921 InGroup<Uninitialized>, DefaultIgnore;
1922 def note_block_var_fixit_add_initialization : Note<
1923 "did you mean to use __block %0?">;
1924 def note_in_omitted_aggregate_initializer : Note<
1925 "in implicit initialization of %select{"
1926 "array element %1 with omitted initializer|"
1927 "field %1 with omitted initializer|"
1928 "trailing array elements in runtime-sized array new}0">;
1929 def note_in_reference_temporary_list_initializer : Note<
1930 "in initialization of temporary of type %0 created to "
1931 "list-initialize this reference">;
1932 def note_var_fixit_add_initialization : Note<
1933 "initialize the variable %0 to silence this warning">;
1934 def note_uninit_fixit_remove_cond : Note<
1935 "remove the %select{'%1' if its condition|condition if it}0 "
1936 "is always %select{false|true}2">;
1937 def err_init_incomplete_type : Error<"initialization of incomplete type %0">;
1938 def err_list_init_in_parens : Error<
1939 "cannot initialize %select{non-class|reference}0 type %1 with a "
1940 "parenthesized initializer list">;
1942 def warn_unsequenced_mod_mod : Warning<
1943 "multiple unsequenced modifications to %0">, InGroup<Unsequenced>;
1944 def warn_unsequenced_mod_use : Warning<
1945 "unsequenced modification and access to %0">, InGroup<Unsequenced>;
1947 def select_initialized_entity_kind : TextSubstitution<
1948 "%select{copying variable|copying parameter|"
1949 "returning object|initializing statement expression result|"
1950 "throwing object|copying member subobject|copying array element|"
1951 "allocating object|copying temporary|initializing base subobject|"
1952 "initializing vector element|capturing value}0">;
1954 def err_temp_copy_no_viable : Error<
1955 "no viable constructor %sub{select_initialized_entity_kind}0 of type %1">;
1956 def ext_rvalue_to_reference_temp_copy_no_viable : Extension<
1957 "no viable constructor %sub{select_initialized_entity_kind}0 of type %1; "
1958 "C++98 requires a copy constructor when binding a reference to a temporary">,
1959 InGroup<BindToTemporaryCopy>;
1960 def err_temp_copy_ambiguous : Error<
1961 "ambiguous constructor call when %sub{select_initialized_entity_kind}0 "
1963 def err_temp_copy_deleted : Error<
1964 "%sub{select_initialized_entity_kind}0 of type %1 "
1965 "invokes deleted constructor">;
1966 def err_temp_copy_incomplete : Error<
1967 "copying a temporary object of incomplete type %0">;
1968 def warn_cxx98_compat_temp_copy : Warning<
1969 "%sub{select_initialized_entity_kind}1 "
1970 "of type %2 when binding a reference to a temporary would %select{invoke "
1971 "an inaccessible constructor|find no viable constructor|find ambiguous "
1972 "constructors|invoke a deleted constructor}0 in C++98">,
1973 InGroup<CXX98CompatBindToTemporaryCopy>, DefaultIgnore;
1974 def err_selected_explicit_constructor : Error<
1975 "chosen constructor is explicit in copy-initialization">;
1976 def note_explicit_ctor_deduction_guide_here : Note<
1977 "explicit %select{constructor|deduction guide}0 declared here">;
1980 def err_decltype_in_declarator : Error<
1981 "'decltype' cannot be used to name a declaration">;
1984 def warn_cxx98_compat_auto_type_specifier : Warning<
1985 "'auto' type specifier is incompatible with C++98">,
1986 InGroup<CXX98Compat>, DefaultIgnore;
1987 def err_auto_variable_cannot_appear_in_own_initializer : Error<
1988 "variable %0 declared with deduced type %1 "
1989 "cannot appear in its own initializer">;
1990 def err_binding_cannot_appear_in_own_initializer : Error<
1991 "binding %0 cannot appear in the initializer of its own "
1992 "decomposition declaration">;
1993 def err_illegal_decl_array_of_auto : Error<
1994 "'%0' declared as array of %1">;
1995 def err_new_array_of_auto : Error<
1996 "cannot allocate array of 'auto'">;
1997 def err_auto_not_allowed : Error<
1998 "%select{'auto'|'decltype(auto)'|'__auto_type'|"
2000 "%select{class template|function template|variable template|alias template|"
2001 "template template parameter|template}2 %3 requires template arguments; "
2002 "argument deduction}0 not allowed "
2003 "%select{in function prototype"
2004 "|in non-static struct member|in struct member"
2005 "|in non-static union member|in union member"
2006 "|in non-static class member|in interface member"
2007 "|in exception declaration|in template parameter until C++17|in block literal"
2008 "|in template argument|in typedef|in type alias|in function return type"
2009 "|in conversion function type|here|in lambda parameter"
2010 "|in type allocated by 'new'|in K&R-style function parameter"
2011 "|in template parameter|in friend declaration}1">;
2012 def err_dependent_deduced_tst : Error<
2013 "typename specifier refers to "
2014 "%select{class template|function template|variable template|alias template|"
2015 "template template parameter|template}0 member in %1; "
2016 "argument deduction not allowed here">;
2017 def err_auto_not_allowed_var_inst : Error<
2018 "'auto' variable template instantiation is not allowed">;
2019 def err_auto_var_requires_init : Error<
2020 "declaration of variable %0 with deduced type %1 requires an initializer">;
2021 def err_auto_new_requires_ctor_arg : Error<
2022 "new expression for type %0 requires a constructor argument">;
2023 def ext_auto_new_list_init : Extension<
2024 "ISO C++ standards before C++17 do not allow new expression for "
2025 "type %0 to use list-initialization">, InGroup<CXX17>;
2026 def err_auto_var_init_no_expression : Error<
2027 "initializer for variable %0 with type %1 is empty">;
2028 def err_auto_var_init_multiple_expressions : Error<
2029 "initializer for variable %0 with type %1 contains multiple expressions">;
2030 def err_auto_var_init_paren_braces : Error<
2031 "cannot deduce type for variable %1 with type %2 from "
2032 "%select{parenthesized|nested}0 initializer list">;
2033 def err_auto_new_ctor_multiple_expressions : Error<
2034 "new expression for type %0 contains multiple constructor arguments">;
2035 def err_auto_missing_trailing_return : Error<
2036 "'auto' return without trailing return type; deduced return types are a "
2038 def err_deduced_return_type : Error<
2039 "deduced return types are a C++14 extension">;
2040 def err_trailing_return_without_auto : Error<
2041 "function with trailing return type must specify return type 'auto', not %0">;
2042 def err_trailing_return_in_parens : Error<
2043 "trailing return type may not be nested within parentheses">;
2044 def err_auto_var_deduction_failure : Error<
2045 "variable %0 with type %1 has incompatible initializer of type %2">;
2046 def err_auto_var_deduction_failure_from_init_list : Error<
2047 "cannot deduce actual type for variable %0 with type %1 from initializer list">;
2048 def err_auto_new_deduction_failure : Error<
2049 "new expression for type %0 has incompatible constructor argument of type %1">;
2050 def err_auto_inconsistent_deduction : Error<
2051 "deduced conflicting types %diff{($ vs $) |}0,1"
2052 "for initializer list element type">;
2053 def err_auto_different_deductions : Error<
2054 "%select{'auto'|'decltype(auto)'|'__auto_type'|template arguments}0 "
2055 "deduced as %1 in declaration of %2 and "
2056 "deduced as %3 in declaration of %4">;
2057 def err_auto_non_deduced_not_alone : Error<
2058 "%select{function with deduced return type|"
2059 "declaration with trailing return type}0 "
2060 "must be the only declaration in its group">;
2061 def err_implied_std_initializer_list_not_found : Error<
2062 "cannot deduce type of initializer list because std::initializer_list was "
2063 "not found; include <initializer_list>">;
2064 def err_malformed_std_initializer_list : Error<
2065 "std::initializer_list must be a class template with a single type parameter">;
2066 def err_auto_init_list_from_c : Error<
2067 "cannot use __auto_type with initializer list in C">;
2068 def err_auto_bitfield : Error<
2069 "cannot pass bit-field as __auto_type initializer in C">;
2071 // C++1y decltype(auto) type
2072 def err_decltype_auto_invalid : Error<
2073 "'decltype(auto)' not allowed here">;
2074 def err_decltype_auto_cannot_be_combined : Error<
2075 "'decltype(auto)' cannot be combined with other type specifiers">;
2076 def err_decltype_auto_function_declarator_not_declaration : Error<
2077 "'decltype(auto)' can only be used as a return type "
2078 "in a function declaration">;
2079 def err_decltype_auto_compound_type : Error<
2080 "cannot form %select{pointer to|reference to|array of}0 'decltype(auto)'">;
2081 def err_decltype_auto_initializer_list : Error<
2082 "cannot deduce 'decltype(auto)' from initializer list">;
2084 // C++17 deduced class template specialization types
2085 def err_deduced_class_template_compound_type : Error<
2086 "cannot %select{form pointer to|form reference to|form array of|"
2087 "form function returning|use parentheses when declaring variable with}0 "
2088 "deduced class template specialization type">;
2089 def err_deduced_non_class_template_specialization_type : Error<
2090 "%select{<error>|function template|variable template|alias template|"
2091 "template template parameter|template}0 %1 requires template arguments; "
2092 "argument deduction only allowed for class templates">;
2093 def err_deduced_class_template_ctor_ambiguous : Error<
2094 "ambiguous deduction for template arguments of %0">;
2095 def err_deduced_class_template_ctor_no_viable : Error<
2096 "no viable constructor or deduction guide for deduction of "
2097 "template arguments of %0">;
2098 def err_deduced_class_template_incomplete : Error<
2099 "template %0 has no definition and no %select{|viable }1deduction guides "
2100 "for deduction of template arguments">;
2101 def err_deduced_class_template_deleted : Error<
2102 "class template argument deduction for %0 selected a deleted constructor">;
2103 def err_deduced_class_template_explicit : Error<
2104 "class template argument deduction for %0 selected an explicit "
2105 "%select{constructor|deduction guide}1 for copy-list-initialization">;
2106 def err_deduction_guide_no_trailing_return_type : Error<
2107 "deduction guide declaration without trailing return type">;
2108 def err_deduction_guide_bad_trailing_return_type : Error<
2109 "deduced type %1 of deduction guide is not %select{|written as }2"
2110 "a specialization of template %0">;
2111 def err_deduction_guide_with_complex_decl : Error<
2112 "cannot specify any part of a return type in the "
2113 "declaration of a deduction guide">;
2114 def err_deduction_guide_invalid_specifier : Error<
2115 "deduction guide cannot be declared '%0'">;
2116 def err_deduction_guide_name_not_class_template : Error<
2117 "cannot specify deduction guide for "
2118 "%select{<error>|function template|variable template|alias template|"
2119 "template template parameter|dependent template name}0 %1">;
2120 def err_deduction_guide_wrong_scope : Error<
2121 "deduction guide must be declared in the same scope as template %q0">;
2122 def err_deduction_guide_defines_function : Error<
2123 "deduction guide cannot have a function definition">;
2124 def err_deduction_guide_explicit_mismatch : Error<
2125 "deduction guide is %select{not |}0declared 'explicit' but "
2126 "previous declaration was%select{ not|}0">;
2127 def err_deduction_guide_specialized : Error<"deduction guide cannot be "
2128 "%select{explicitly instantiated|explicitly specialized}0">;
2129 def err_deduction_guide_template_not_deducible : Error<
2130 "deduction guide template contains "
2131 "%select{a template parameter|template parameters}0 that cannot be "
2133 def err_deduction_guide_wrong_access : Error<
2134 "deduction guide has different access from the corresponding "
2136 def note_deduction_guide_template_access : Note<
2137 "member template declared %0 here">;
2138 def note_deduction_guide_access : Note<
2139 "deduction guide declared %0 by intervening access specifier">;
2141 // C++1y deduced return types
2142 def err_auto_fn_deduction_failure : Error<
2143 "cannot deduce return type %0 from returned value of type %1">;
2144 def err_auto_fn_different_deductions : Error<
2145 "'%select{auto|decltype(auto)}0' in return type deduced as %1 here but "
2146 "deduced as %2 in earlier return statement">;
2147 def err_auto_fn_used_before_defined : Error<
2148 "function %0 with deduced return type cannot be used before it is defined">;
2149 def err_auto_fn_no_return_but_not_auto : Error<
2150 "cannot deduce return type %0 for function with no return statements">;
2151 def err_auto_fn_return_void_but_not_auto : Error<
2152 "cannot deduce return type %0 from omitted return expression">;
2153 def err_auto_fn_return_init_list : Error<
2154 "cannot deduce return type from initializer list">;
2155 def err_auto_fn_virtual : Error<
2156 "function with deduced return type cannot be virtual">;
2158 // C++11 override control
2159 def override_keyword_only_allowed_on_virtual_member_functions : Error<
2160 "only virtual member functions can be marked '%0'">;
2161 def override_keyword_hides_virtual_member_function : Error<
2162 "non-virtual member function marked '%0' hides virtual member "
2163 "%select{function|functions}1">;
2164 def err_function_marked_override_not_overriding : Error<
2165 "%0 marked 'override' but does not override any member functions">;
2166 def warn_destructor_marked_not_override_overriding : Warning <
2167 "%0 overrides a destructor but is not marked 'override'">,
2168 InGroup<CXX11WarnOverrideDestructor>, DefaultIgnore;
2169 def warn_function_marked_not_override_overriding : Warning <
2170 "%0 overrides a member function but is not marked 'override'">,
2171 InGroup<CXX11WarnOverrideMethod>;
2172 def err_class_marked_final_used_as_base : Error<
2173 "base %0 is marked '%select{final|sealed}1'">;
2174 def warn_abstract_final_class : Warning<
2175 "abstract class is marked '%select{final|sealed}0'">, InGroup<AbstractFinalClass>;
2178 def err_repeat_attribute : Error<"%0 attribute cannot be repeated">;
2181 def err_final_function_overridden : Error<
2182 "declaration of %0 overrides a '%select{final|sealed}1' function">;
2184 // C++11 scoped enumerations
2185 def err_enum_invalid_underlying : Error<
2186 "non-integral type %0 is an invalid underlying type">;
2187 def err_enumerator_too_large : Error<
2188 "enumerator value is not representable in the underlying type %0">;
2189 def ext_enumerator_too_large : Extension<
2190 "enumerator value is not representable in the underlying type %0">,
2191 InGroup<MicrosoftEnumValue>;
2192 def err_enumerator_wrapped : Error<
2193 "enumerator value %0 is not representable in the underlying type %1">;
2194 def err_enum_redeclare_type_mismatch : Error<
2195 "enumeration redeclared with different underlying type %0 (was %1)">;
2196 def err_enum_redeclare_fixed_mismatch : Error<
2197 "enumeration previously declared with %select{non|}0fixed underlying type">;
2198 def err_enum_redeclare_scoped_mismatch : Error<
2199 "enumeration previously declared as %select{un|}0scoped">;
2200 def err_enum_class_reference : Error<
2201 "reference to %select{|scoped }0enumeration must use 'enum' "
2202 "not 'enum class'">;
2203 def err_only_enums_have_underlying_types : Error<
2204 "only enumeration types have underlying types">;
2205 def err_underlying_type_of_incomplete_enum : Error<
2206 "cannot determine underlying type of incomplete enumeration type %0">;
2208 // C++11 delegating constructors
2209 def err_delegating_ctor : Error<
2210 "delegating constructors are permitted only in C++11">;
2211 def warn_cxx98_compat_delegating_ctor : Warning<
2212 "delegating constructors are incompatible with C++98">,
2213 InGroup<CXX98Compat>, DefaultIgnore;
2214 def err_delegating_initializer_alone : Error<
2215 "an initializer for a delegating constructor must appear alone">;
2216 def warn_delegating_ctor_cycle : Warning<
2217 "constructor for %0 creates a delegation cycle">, DefaultError,
2218 InGroup<DelegatingCtorCycles>;
2219 def note_it_delegates_to : Note<"it delegates to">;
2220 def note_which_delegates_to : Note<"which delegates to">;
2222 // C++11 range-based for loop
2223 def err_for_range_decl_must_be_var : Error<
2224 "for range declaration must declare a variable">;
2225 def err_for_range_storage_class : Error<
2226 "loop variable %0 may not be declared %select{'extern'|'static'|"
2227 "'__private_extern__'|'auto'|'register'|'constexpr'}1">;
2228 def err_type_defined_in_for_range : Error<
2229 "types may not be defined in a for range declaration">;
2230 def err_for_range_deduction_failure : Error<
2231 "cannot use type %0 as a range">;
2232 def err_for_range_incomplete_type : Error<
2233 "cannot use incomplete type %0 as a range">;
2234 def err_for_range_iter_deduction_failure : Error<
2235 "cannot use type %0 as an iterator">;
2236 def err_for_range_member_begin_end_mismatch : Error<
2237 "range type %0 has '%select{begin|end}1' member but no '%select{end|begin}1' member">;
2238 def ext_for_range_begin_end_types_differ : ExtWarn<
2239 "'begin' and 'end' returning different types (%0 and %1) is a C++17 extension">,
2241 def warn_for_range_begin_end_types_differ : Warning<
2242 "'begin' and 'end' returning different types (%0 and %1) is incompatible "
2243 "with C++ standards before C++17">, InGroup<CXXPre17Compat>, DefaultIgnore;
2244 def note_in_for_range: Note<
2245 "when looking up '%select{begin|end}0' function for range expression "
2247 def err_for_range_invalid: Error<
2248 "invalid range expression of type %0; no viable '%select{begin|end}1' "
2249 "function available">;
2250 def err_range_on_array_parameter : Error<
2251 "cannot build range expression with array function parameter %0 since "
2252 "parameter with array type %1 is treated as pointer type %2">;
2253 def err_for_range_dereference : Error<
2254 "invalid range expression of type %0; did you mean to dereference it "
2256 def note_for_range_invalid_iterator : Note <
2257 "in implicit call to 'operator%select{!=|*|++}0' for iterator of type %1">;
2258 def note_for_range_begin_end : Note<
2259 "selected '%select{begin|end}0' %select{function|template }1%2 with iterator type %3">;
2260 def warn_for_range_const_reference_copy : Warning<
2262 "%diff{has type $ but is initialized with type $"
2263 "| is initialized with a value of a different type}1,2 resulting in a copy">,
2264 InGroup<RangeLoopAnalysis>, DefaultIgnore;
2265 def note_use_type_or_non_reference : Note<
2266 "use non-reference type %0 to keep the copy or type %1 to prevent copying">;
2267 def warn_for_range_variable_always_copy : Warning<
2268 "loop variable %0 is always a copy because the range of type %1 does not "
2269 "return a reference">,
2270 InGroup<RangeLoopAnalysis>, DefaultIgnore;
2271 def note_use_non_reference_type : Note<"use non-reference type %0">;
2272 def warn_for_range_copy : Warning<
2273 "loop variable %0 of type %1 creates a copy from type %2">,
2274 InGroup<RangeLoopAnalysis>, DefaultIgnore;
2275 def note_use_reference_type : Note<"use reference type %0 to prevent copying">;
2278 def warn_cxx98_compat_constexpr : Warning<
2279 "'constexpr' specifier is incompatible with C++98">,
2280 InGroup<CXX98Compat>, DefaultIgnore;
2281 // FIXME: Maybe this should also go in -Wc++14-compat?
2282 def warn_cxx14_compat_constexpr_not_const : Warning<
2283 "'constexpr' non-static member function will not be implicitly 'const' "
2284 "in C++14; add 'const' to avoid a change in behavior">,
2285 InGroup<DiagGroup<"constexpr-not-const">>;
2286 def err_invalid_constexpr : Error<
2287 "%select{function parameter|typedef|non-static data member}0 "
2288 "cannot be constexpr">;
2289 def err_invalid_constexpr_member : Error<"non-static data member cannot be "
2290 "constexpr%select{; did you intend to make it %select{const|static}0?|}1">;
2291 def err_constexpr_tag : Error<
2292 "%select{class|struct|interface|union|enum}0 cannot be marked constexpr">;
2293 def err_constexpr_dtor : Error<"destructor cannot be marked constexpr">;
2294 def err_constexpr_no_declarators : Error<
2295 "constexpr can only be used in variable and function declarations">;
2296 def err_invalid_constexpr_var_decl : Error<
2297 "constexpr variable declaration must be a definition">;
2298 def err_constexpr_static_mem_var_requires_init : Error<
2299 "declaration of constexpr static data member %0 requires an initializer">;
2300 def err_constexpr_var_non_literal : Error<
2301 "constexpr variable cannot have non-literal type %0">;
2302 def err_constexpr_var_requires_const_init : Error<
2303 "constexpr variable %0 must be initialized by a constant expression">;
2304 def err_constexpr_redecl_mismatch : Error<
2305 "%select{non-constexpr declaration of %0 follows constexpr declaration"
2306 "|constexpr declaration of %0 follows non-constexpr declaration}1">;
2307 def err_constexpr_virtual : Error<"virtual function cannot be constexpr">;
2308 def err_constexpr_virtual_base : Error<
2309 "constexpr %select{member function|constructor}0 not allowed in "
2310 "%select{struct|interface|class}1 with virtual base "
2311 "%plural{1:class|:classes}2">;
2312 def note_non_literal_incomplete : Note<
2313 "incomplete type %0 is not a literal type">;
2314 def note_non_literal_virtual_base : Note<"%select{struct|interface|class}0 "
2315 "with virtual base %plural{1:class|:classes}1 is not a literal type">;
2316 def note_constexpr_virtual_base_here : Note<"virtual base class declared here">;
2317 def err_constexpr_non_literal_return : Error<
2318 "constexpr function's return type %0 is not a literal type">;
2319 def err_constexpr_non_literal_param : Error<
2320 "constexpr %select{function|constructor}1's %ordinal0 parameter type %2 is "
2321 "not a literal type">;
2322 def err_constexpr_body_invalid_stmt : Error<
2323 "statement not allowed in constexpr %select{function|constructor}0">;
2324 def ext_constexpr_body_invalid_stmt : ExtWarn<
2325 "use of this statement in a constexpr %select{function|constructor}0 "
2326 "is a C++14 extension">, InGroup<CXX14>;
2327 def warn_cxx11_compat_constexpr_body_invalid_stmt : Warning<
2328 "use of this statement in a constexpr %select{function|constructor}0 "
2329 "is incompatible with C++ standards before C++14">,
2330 InGroup<CXXPre14Compat>, DefaultIgnore;
2331 def ext_constexpr_type_definition : ExtWarn<
2332 "type definition in a constexpr %select{function|constructor}0 "
2333 "is a C++14 extension">, InGroup<CXX14>;
2334 def warn_cxx11_compat_constexpr_type_definition : Warning<
2335 "type definition in a constexpr %select{function|constructor}0 "
2336 "is incompatible with C++ standards before C++14">,
2337 InGroup<CXXPre14Compat>, DefaultIgnore;
2338 def err_constexpr_vla : Error<
2339 "variably-modified type %0 cannot be used in a constexpr "
2340 "%select{function|constructor}1">;
2341 def ext_constexpr_local_var : ExtWarn<
2342 "variable declaration in a constexpr %select{function|constructor}0 "
2343 "is a C++14 extension">, InGroup<CXX14>;
2344 def warn_cxx11_compat_constexpr_local_var : Warning<
2345 "variable declaration in a constexpr %select{function|constructor}0 "
2346 "is incompatible with C++ standards before C++14">,
2347 InGroup<CXXPre14Compat>, DefaultIgnore;
2348 def err_constexpr_local_var_static : Error<
2349 "%select{static|thread_local}1 variable not permitted in a constexpr "
2350 "%select{function|constructor}0">;
2351 def err_constexpr_local_var_non_literal_type : Error<
2352 "variable of non-literal type %1 cannot be defined in a constexpr "
2353 "%select{function|constructor}0">;
2354 def err_constexpr_local_var_no_init : Error<
2355 "variables defined in a constexpr %select{function|constructor}0 must be "
2357 def ext_constexpr_function_never_constant_expr : ExtWarn<
2358 "constexpr %select{function|constructor}0 never produces a "
2359 "constant expression">, InGroup<DiagGroup<"invalid-constexpr">>, DefaultError;
2360 def err_attr_cond_never_constant_expr : Error<
2361 "%0 attribute expression never produces a constant expression">;
2362 def err_diagnose_if_invalid_diagnostic_type : Error<
2363 "invalid diagnostic type for 'diagnose_if'; use \"error\" or \"warning\" "
2365 def err_constexpr_body_no_return : Error<
2366 "no return statement in constexpr function">;
2367 def err_constexpr_return_missing_expr : Error<
2368 "non-void constexpr function %0 should return a value">;
2369 def warn_cxx11_compat_constexpr_body_no_return : Warning<
2370 "constexpr function with no return statements is incompatible with C++ "
2371 "standards before C++14">, InGroup<CXXPre14Compat>, DefaultIgnore;
2372 def ext_constexpr_body_multiple_return : ExtWarn<
2373 "multiple return statements in constexpr function is a C++14 extension">,
2375 def warn_cxx11_compat_constexpr_body_multiple_return : Warning<
2376 "multiple return statements in constexpr function "
2377 "is incompatible with C++ standards before C++14">,
2378 InGroup<CXXPre14Compat>, DefaultIgnore;
2379 def note_constexpr_body_previous_return : Note<
2380 "previous return statement is here">;
2381 def err_constexpr_function_try_block : Error<
2382 "function try block not allowed in constexpr %select{function|constructor}0">;
2383 def err_constexpr_union_ctor_no_init : Error<
2384 "constexpr union constructor does not initialize any member">;
2385 def err_constexpr_ctor_missing_init : Error<
2386 "constexpr constructor must initialize all members">;
2387 def note_constexpr_ctor_missing_init : Note<
2388 "member not initialized by constructor">;
2389 def note_non_literal_no_constexpr_ctors : Note<
2390 "%0 is not literal because it is not an aggregate and has no constexpr "
2391 "constructors other than copy or move constructors">;
2392 def note_non_literal_base_class : Note<
2393 "%0 is not literal because it has base class %1 of non-literal type">;
2394 def note_non_literal_field : Note<
2395 "%0 is not literal because it has data member %1 of "
2396 "%select{non-literal|volatile}3 type %2">;
2397 def note_non_literal_user_provided_dtor : Note<
2398 "%0 is not literal because it has a user-provided destructor">;
2399 def note_non_literal_nontrivial_dtor : Note<
2400 "%0 is not literal because it has a non-trivial destructor">;
2401 def note_non_literal_lambda : Note<
2402 "lambda closure types are non-literal types before C++17">;
2403 def warn_private_extern : Warning<
2404 "use of __private_extern__ on a declaration may not produce external symbol "
2405 "private to the linkage unit and is deprecated">, InGroup<PrivateExtern>;
2406 def note_private_extern : Note<
2407 "use __attribute__((visibility(\"hidden\"))) attribute instead">;
2410 def err_concept_wrong_decl_kind : Error<
2411 "'concept' can only appear on the definition of a function template or variable template">;
2412 def err_concept_decls_may_only_appear_in_namespace_scope : Error<
2413 "concept declarations may only appear in namespace scope">;
2414 def err_function_concept_not_defined : Error<
2415 "function concept declaration must be a definition">;
2416 def err_var_concept_not_initialized : Error<
2417 "variable concept declaration must be initialized">;
2418 def err_function_concept_exception_spec : Error<
2419 "function concept cannot have exception specification">;
2420 def err_concept_decl_invalid_specifiers : Error<
2421 "%select{variable|function}0 concept cannot be declared "
2422 "'%select{thread_local|inline|friend|constexpr}1'">;
2423 def err_function_concept_with_params : Error<
2424 "function concept cannot have any parameters">;
2425 def err_function_concept_bool_ret : Error<
2426 "declared return type of function concept must be 'bool'">;
2427 def err_variable_concept_bool_decl : Error<
2428 "declared type of variable concept must be 'bool'">;
2429 def err_concept_specified_specialization : Error<
2430 "'concept' cannot be applied on an "
2431 "%select{explicit instantiation|explicit specialization|partial specialization}0">;
2432 def err_concept_specialized : Error<
2433 "%select{function|variable}0 concept cannot be "
2434 "%select{explicitly instantiated|explicitly specialized|partially specialized}1">;
2436 def err_template_different_associated_constraints : Error<
2437 "associated constraints differ in template redeclaration">;
2439 // C++11 char16_t/char32_t
2440 def warn_cxx98_compat_unicode_type : Warning<
2441 "'%0' type specifier is incompatible with C++98">,
2442 InGroup<CXX98Compat>, DefaultIgnore;
2443 def warn_cxx17_compat_unicode_type : Warning<
2444 "'char8_t' type specifier is incompatible with C++ standards before C++20">,
2445 InGroup<CXXPre2aCompat>, DefaultIgnore;
2447 // __make_integer_seq
2448 def err_integer_sequence_negative_length : Error<
2449 "integer sequences must have non-negative sequence length">;
2450 def err_integer_sequence_integral_element_type : Error<
2451 "integer sequences must have integral element type">;
2453 // __type_pack_element
2454 def err_type_pack_element_out_of_bounds : Error<
2455 "a parameter pack may not be accessed at an out of bounds index">;
2458 def err_objc_decls_may_only_appear_in_global_scope : Error<
2459 "Objective-C declarations may only appear in global scope">;
2460 def warn_auto_var_is_id : Warning<
2461 "'auto' deduced as 'id' in declaration of %0">,
2462 InGroup<DiagGroup<"auto-var-id">>;
2465 def err_nsobject_attribute : Error<
2466 "'NSObject' attribute is for pointer types only">;
2467 def err_attributes_are_not_compatible : Error<
2468 "%0 and %1 attributes are not compatible">;
2469 def err_attribute_wrong_number_arguments : Error<
2470 "%0 attribute %plural{0:takes no arguments|1:takes one argument|"
2471 ":requires exactly %1 arguments}1">;
2472 def err_attribute_too_many_arguments : Error<
2473 "%0 attribute takes no more than %1 argument%s1">;
2474 def err_attribute_too_few_arguments : Error<
2475 "%0 attribute takes at least %1 argument%s1">;
2476 def err_attribute_invalid_vector_type : Error<"invalid vector element type %0">;
2477 def err_attribute_bad_neon_vector_size : Error<
2478 "Neon vector size must be 64 or 128 bits">;
2479 def err_attribute_requires_positive_integer : Error<
2480 "%0 attribute requires a positive integral compile time constant expression">;
2481 def err_attribute_requires_opencl_version : Error<
2482 "%0 attribute requires OpenCL version %1%select{| or above}2">;
2483 def warn_unsupported_target_attribute
2484 : Warning<"%select{unsupported|duplicate}0%select{| architecture}1 '%2' in"
2485 " the 'target' attribute string; 'target' attribute ignored">,
2486 InGroup<IgnoredAttributes>;
2487 def err_attribute_unsupported
2488 : Error<"%0 attribute is not supported for this target">;
2489 // The err_*_attribute_argument_not_int are separate because they're used by
2490 // VerifyIntegerConstantExpression.
2491 def err_aligned_attribute_argument_not_int : Error<
2492 "'aligned' attribute requires integer constant">;
2493 def err_align_value_attribute_argument_not_int : Error<
2494 "'align_value' attribute requires integer constant">;
2495 def err_alignas_attribute_wrong_decl_type : Error<
2496 "%0 attribute cannot be applied to a %select{function parameter|"
2497 "variable with 'register' storage class|'catch' variable|bit-field}1">;
2498 def err_alignas_missing_on_definition : Error<
2499 "%0 must be specified on definition if it is specified on any declaration">;
2500 def note_alignas_on_declaration : Note<"declared with %0 attribute here">;
2501 def err_alignas_mismatch : Error<
2502 "redeclaration has different alignment requirement (%1 vs %0)">;
2503 def err_alignas_underaligned : Error<
2504 "requested alignment is less than minimum alignment of %1 for type %0">;
2505 def err_attribute_argument_n_type : Error<
2506 "%0 attribute requires parameter %1 to be %select{int or bool|an integer "
2507 "constant|a string|an identifier}2">;
2508 def err_attribute_argument_type : Error<
2509 "%0 attribute requires %select{int or bool|an integer "
2510 "constant|a string|an identifier}1">;
2511 def err_attribute_argument_outof_range : Error<
2512 "%0 attribute requires integer constant between %1 and %2 inclusive">;
2513 def err_init_priority_object_attr : Error<
2514 "can only use 'init_priority' attribute on file-scope definitions "
2515 "of objects of class type">;
2516 def err_attribute_argument_vec_type_hint : Error<
2517 "invalid attribute argument %0 - expecting a vector or vectorizable scalar type">;
2518 def err_attribute_argument_out_of_bounds : Error<
2519 "%0 attribute parameter %1 is out of bounds">;
2520 def err_attribute_only_once_per_parameter : Error<
2521 "%0 attribute can only be applied once per parameter">;
2522 def err_attribute_uuid_malformed_guid : Error<
2523 "uuid attribute contains a malformed GUID">;
2524 def err_mismatched_uuid : Error<"uuid does not match previous declaration">;
2525 def note_previous_uuid : Note<"previous uuid specified here">;
2526 def warn_attribute_pointers_only : Warning<
2527 "%0 attribute only applies to%select{| constant}1 pointer arguments">,
2528 InGroup<IgnoredAttributes>;
2529 def err_attribute_pointers_only : Error<warn_attribute_pointers_only.Text>;
2530 def err_attribute_integers_only : Error<
2531 "%0 attribute argument may only refer to a function parameter of integer "
2533 def warn_attribute_return_pointers_only : Warning<
2534 "%0 attribute only applies to return values that are pointers">,
2535 InGroup<IgnoredAttributes>;
2536 def warn_attribute_return_pointers_refs_only : Warning<
2537 "%0 attribute only applies to return values that are pointers or references">,
2538 InGroup<IgnoredAttributes>;
2539 def warn_attribute_pointer_or_reference_only : Warning<
2540 "%0 attribute only applies to a pointer or reference (%1 is invalid)">,
2541 InGroup<IgnoredAttributes>;
2542 def err_attribute_no_member_pointers : Error<
2543 "%0 attribute cannot be used with pointers to members">;
2544 def err_attribute_invalid_implicit_this_argument : Error<
2545 "%0 attribute is invalid for the implicit this argument">;
2546 def err_ownership_type : Error<
2547 "%0 attribute only applies to %select{pointer|integer}1 arguments">;
2548 def err_ownership_returns_index_mismatch : Error<
2549 "'ownership_returns' attribute index does not match; here it is %0">;
2550 def note_ownership_returns_index_mismatch : Note<
2551 "declared with index %0 here">;
2552 def err_format_strftime_third_parameter : Error<
2553 "strftime format attribute requires 3rd parameter to be 0">;
2554 def err_format_attribute_requires_variadic : Error<
2555 "format attribute requires variadic function">;
2556 def err_format_attribute_not : Error<"format argument not %0">;
2557 def err_format_attribute_result_not : Error<"function does not return %0">;
2558 def err_format_attribute_implicit_this_format_string : Error<
2559 "format attribute cannot specify the implicit this argument as the format "
2561 def err_init_method_bad_return_type : Error<
2562 "init methods must return an object pointer type, not %0">;
2563 def err_attribute_invalid_size : Error<
2564 "vector size not an integral multiple of component size">;
2565 def err_attribute_zero_size : Error<"zero vector size">;
2566 def err_attribute_size_too_large : Error<"vector size too large">;
2567 def err_typecheck_vector_not_convertable_implict_truncation : Error<
2568 "cannot convert between %select{scalar|vector}0 type %1 and vector type"
2569 " %2 as implicit conversion would cause truncation">;
2570 def err_typecheck_vector_not_convertable : Error<
2571 "cannot convert between vector values of different size (%0 and %1)">;
2572 def err_typecheck_vector_not_convertable_non_scalar : Error<
2573 "cannot convert between vector and non-scalar values (%0 and %1)">;
2574 def err_typecheck_vector_lengths_not_equal : Error<
2575 "vector operands do not have the same number of elements (%0 and %1)">;
2576 def warn_typecheck_vector_element_sizes_not_equal : Warning<
2577 "vector operands do not have the same elements sizes (%0 and %1)">,
2578 InGroup<DiagGroup<"vec-elem-size">>, DefaultError;
2579 def err_ext_vector_component_exceeds_length : Error<
2580 "vector component access exceeds type %0">;
2581 def err_ext_vector_component_name_illegal : Error<
2582 "illegal vector component name '%0'">;
2583 def err_attribute_address_space_negative : Error<
2584 "address space is negative">;
2585 def err_attribute_address_space_too_high : Error<
2586 "address space is larger than the maximum supported (%0)">;
2587 def err_attribute_address_multiple_qualifiers : Error<
2588 "multiple address spaces specified for type">;
2589 def warn_attribute_address_multiple_identical_qualifiers : Warning<
2590 "multiple identical address spaces specified for type">,
2591 InGroup<DuplicateDeclSpecifier>;
2592 def err_attribute_address_function_type : Error<
2593 "function type may not be qualified with an address space">;
2594 def err_as_qualified_auto_decl : Error<
2595 "automatic variable qualified with an%select{| invalid}0 address space">;
2596 def err_arg_with_address_space : Error<
2597 "parameter may not be qualified with an address space">;
2598 def err_field_with_address_space : Error<
2599 "field may not be qualified with an address space">;
2600 def err_attr_objc_ownership_redundant : Error<
2601 "the type %0 is already explicitly ownership-qualified">;
2602 def err_invalid_nsnumber_type : Error<
2603 "%0 is not a valid literal type for NSNumber">;
2604 def err_objc_illegal_boxed_expression_type : Error<
2605 "illegal type %0 used in a boxed expression">;
2606 def err_objc_non_trivially_copyable_boxed_expression_type : Error<
2607 "non-trivially copyable type %0 cannot be used in a boxed expression">;
2608 def err_objc_incomplete_boxed_expression_type : Error<
2609 "incomplete type %0 used in a boxed expression">;
2610 def err_undeclared_objc_literal_class : Error<
2611 "definition of class %0 must be available to use Objective-C "
2612 "%select{array literals|dictionary literals|numeric literals|boxed expressions|"
2613 "string literals}1">;
2614 def err_undeclared_boxing_method : Error<
2615 "declaration of %0 is missing in %1 class">;
2616 def err_objc_literal_method_sig : Error<
2617 "literal construction method %0 has incompatible signature">;
2618 def note_objc_literal_method_param : Note<
2619 "%select{first|second|third}0 parameter has unexpected type %1 "
2621 def note_objc_literal_method_return : Note<
2622 "method returns unexpected type %0 (should be an object type)">;
2623 def err_invalid_collection_element : Error<
2624 "collection element of type %0 is not an Objective-C object">;
2625 def err_box_literal_collection : Error<
2626 "%select{string|character|boolean|numeric}0 literal must be prefixed by '@' "
2628 def warn_objc_literal_comparison : Warning<
2629 "direct comparison of %select{an array literal|a dictionary literal|"
2630 "a numeric literal|a boxed expression|}0 has undefined behavior">,
2631 InGroup<ObjCLiteralComparison>;
2632 def err_missing_atsign_prefix : Error<
2633 "string literal must be prefixed by '@' ">;
2634 def warn_objc_string_literal_comparison : Warning<
2635 "direct comparison of a string literal has undefined behavior">,
2636 InGroup<ObjCStringComparison>;
2637 def warn_concatenated_nsarray_literal : Warning<
2638 "concatenated NSString literal for an NSArray expression - "
2639 "possibly missing a comma">,
2640 InGroup<ObjCStringConcatenation>;
2641 def note_objc_literal_comparison_isequal : Note<
2642 "use 'isEqual:' instead">;
2643 def warn_objc_collection_literal_element : Warning<
2644 "object of type %0 is not compatible with "
2645 "%select{array element type|dictionary key type|dictionary value type}1 %2">,
2646 InGroup<ObjCLiteralConversion>;
2647 def err_swift_param_attr_not_swiftcall : Error<
2648 "'%0' parameter can only be used with swiftcall calling convention">;
2649 def err_swift_indirect_result_not_first : Error<
2650 "'swift_indirect_result' parameters must be first parameters of function">;
2651 def err_swift_error_result_not_after_swift_context : Error<
2652 "'swift_error_result' parameter must follow 'swift_context' parameter">;
2653 def err_swift_abi_parameter_wrong_type : Error<
2654 "'%0' parameter must have pointer%select{| to unqualified pointer}1 type; "
2657 def err_attribute_argument_invalid : Error<
2658 "%0 attribute argument is invalid: %select{max must be 0 since min is 0|"
2659 "min must not be greater than max}1">;
2660 def err_attribute_argument_is_zero : Error<
2661 "%0 attribute must be greater than 0">;
2662 def warn_attribute_argument_n_negative : Warning<
2663 "%0 attribute parameter %1 is negative and will be ignored">,
2664 InGroup<CudaCompat>;
2665 def err_property_function_in_objc_container : Error<
2666 "use of Objective-C property in function nested in Objective-C "
2667 "container not supported, move function outside its container">;
2669 let CategoryName = "Cocoa API Issue" in {
2670 def warn_objc_redundant_literal_use : Warning<
2671 "using %0 with a literal is redundant">, InGroup<ObjCRedundantLiteralUse>;
2674 def err_attr_tlsmodel_arg : Error<"tls_model must be \"global-dynamic\", "
2675 "\"local-dynamic\", \"initial-exec\" or \"local-exec\"">;
2677 def err_tls_var_aligned_over_maximum : Error<
2678 "alignment (%0) of thread-local variable %1 is greater than the maximum supported "
2679 "alignment (%2) for a thread-local variable on this target">;
2681 def err_only_annotate_after_access_spec : Error<
2682 "access specifier can only have annotation attributes">;
2684 def err_attribute_section_invalid_for_target : Error<
2685 "argument to %select{'code_seg'|'section'}1 attribute is not valid for this target: %0">;
2686 def warn_mismatched_section : Warning<
2687 "%select{codeseg|section}0 does not match previous declaration">, InGroup<Section>;
2688 def warn_attribute_section_on_redeclaration : Warning<
2689 "section attribute is specified on redeclared variable">, InGroup<Section>;
2690 def err_mismatched_code_seg_base : Error<
2691 "derived class must specify the same code segment as its base classes">;
2692 def err_mismatched_code_seg_override : Error<
2693 "overriding virtual function must specify the same code segment as its overridden function">;
2694 def err_conflicting_codeseg_attribute : Error<
2695 "conflicting code segment specifiers">;
2696 def warn_duplicate_codeseg_attribute : Warning<
2697 "duplicate code segment specifiers">, InGroup<Section>;
2699 def err_anonymous_property: Error<
2700 "anonymous property is not supported">;
2701 def err_property_is_variably_modified : Error<
2702 "property %0 has a variably modified type">;
2703 def err_no_accessor_for_property : Error<
2704 "no %select{getter|setter}0 defined for property %1">;
2705 def err_cannot_find_suitable_accessor : Error<
2706 "cannot find suitable %select{getter|setter}0 for property %1">;
2708 def warn_alloca_align_alignof : Warning<
2709 "second argument to __builtin_alloca_with_align is supposed to be in bits">,
2710 InGroup<DiagGroup<"alloca-with-align-alignof">>;
2712 def err_alignment_too_small : Error<
2713 "requested alignment must be %0 or greater">;
2714 def err_alignment_too_big : Error<
2715 "requested alignment must be %0 or smaller">;
2716 def err_alignment_not_power_of_two : Error<
2717 "requested alignment is not a power of 2">;
2718 def err_alignment_dependent_typedef_name : Error<
2719 "requested alignment is dependent but declaration is not dependent">;
2721 def err_attribute_aligned_too_great : Error<
2722 "requested alignment must be %0 bytes or smaller">;
2723 def warn_redeclaration_without_attribute_prev_attribute_ignored : Warning<
2724 "%q0 redeclared without %1 attribute: previous %1 ignored">,
2725 InGroup<MicrosoftInconsistentDllImport>;
2726 def warn_redeclaration_without_import_attribute : Warning<
2727 "%q0 redeclared without 'dllimport' attribute: 'dllexport' attribute added">,
2728 InGroup<MicrosoftInconsistentDllImport>;
2729 def warn_dllimport_dropped_from_inline_function : Warning<
2730 "%q0 redeclared inline; %1 attribute ignored">,
2731 InGroup<IgnoredAttributes>;
2732 def warn_attribute_ignored : Warning<"%0 attribute ignored">,
2733 InGroup<IgnoredAttributes>;
2734 def warn_attribute_ignored_on_inline :
2735 Warning<"%0 attribute ignored on inline function">,
2736 InGroup<IgnoredAttributes>;
2737 def warn_nocf_check_attribute_ignored :
2738 Warning<"'nocf_check' attribute ignored; use -fcf-protection to enable the attribute">,
2739 InGroup<IgnoredAttributes>;
2740 def warn_attribute_after_definition_ignored : Warning<
2741 "attribute %0 after definition is ignored">,
2742 InGroup<IgnoredAttributes>;
2743 def warn_unknown_attribute_ignored : Warning<
2744 "unknown attribute %0 ignored">, InGroup<UnknownAttributes>;
2745 def warn_cxx11_gnu_attribute_on_type : Warning<
2746 "attribute %0 ignored, because it cannot be applied to a type">,
2747 InGroup<IgnoredAttributes>;
2748 def warn_unhandled_ms_attribute_ignored : Warning<
2749 "__declspec attribute %0 is not supported">,
2750 InGroup<IgnoredAttributes>;
2751 def err_decl_attribute_invalid_on_stmt : Error<
2752 "%0 attribute cannot be applied to a statement">;
2753 def err_stmt_attribute_invalid_on_decl : Error<
2754 "%0 attribute cannot be applied to a declaration">;
2755 def warn_declspec_attribute_ignored : Warning<
2756 "attribute %0 is ignored, place it after "
2757 "\"%select{class|struct|interface|union|enum}1\" to apply attribute to "
2758 "type declaration">, InGroup<IgnoredAttributes>;
2759 def warn_attribute_precede_definition : Warning<
2760 "attribute declaration must precede definition">,
2761 InGroup<IgnoredAttributes>;
2762 def warn_attribute_void_function_method : Warning<
2763 "attribute %0 cannot be applied to "
2764 "%select{functions|Objective-C method}1 without return value">,
2765 InGroup<IgnoredAttributes>;
2766 def warn_attribute_weak_on_field : Warning<
2767 "__weak attribute cannot be specified on a field declaration">,
2768 InGroup<IgnoredAttributes>;
2769 def warn_gc_attribute_weak_on_local : Warning<
2770 "Objective-C GC does not allow weak variables on the stack">,
2771 InGroup<IgnoredAttributes>;
2772 def warn_nsobject_attribute : Warning<
2773 "'NSObject' attribute may be put on a typedef only; attribute is ignored">,
2774 InGroup<NSobjectAttribute>;
2775 def warn_independentclass_attribute : Warning<
2776 "'objc_independent_class' attribute may be put on a typedef only; "
2777 "attribute is ignored">,
2778 InGroup<IndependentClassAttribute>;
2779 def warn_ptr_independentclass_attribute : Warning<
2780 "'objc_independent_class' attribute may be put on Objective-C object "
2781 "pointer type only; attribute is ignored">,
2782 InGroup<IndependentClassAttribute>;
2783 def warn_attribute_weak_on_local : Warning<
2784 "__weak attribute cannot be specified on an automatic variable when ARC "
2786 InGroup<IgnoredAttributes>;
2787 def warn_weak_identifier_undeclared : Warning<
2788 "weak identifier %0 never declared">;
2789 def err_attribute_weak_static : Error<
2790 "weak declaration cannot have internal linkage">;
2791 def err_attribute_selectany_non_extern_data : Error<
2792 "'selectany' can only be applied to data items with external linkage">;
2793 def err_declspec_thread_on_thread_variable : Error<
2794 "'__declspec(thread)' applied to variable that already has a "
2795 "thread-local storage specifier">;
2796 def err_attribute_dll_not_extern : Error<
2797 "%q0 must have external linkage when declared %q1">;
2798 def err_attribute_dll_thread_local : Error<
2799 "%q0 cannot be thread local when declared %q1">;
2800 def err_attribute_dll_lambda : Error<
2801 "lambda cannot be declared %0">;
2802 def warn_attribute_invalid_on_definition : Warning<
2803 "'%0' attribute cannot be specified on a definition">,
2804 InGroup<IgnoredAttributes>;
2805 def err_attribute_dll_redeclaration : Error<
2806 "redeclaration of %q0 cannot add %q1 attribute">;
2807 def warn_attribute_dll_redeclaration : Warning<
2808 "redeclaration of %q0 should not add %q1 attribute">,
2809 InGroup<DiagGroup<"dll-attribute-on-redeclaration">>;
2810 def err_attribute_dllimport_function_definition : Error<
2811 "dllimport cannot be applied to non-inline function definition">;
2812 def err_attribute_dll_deleted : Error<
2813 "attribute %q0 cannot be applied to a deleted function">;
2814 def err_attribute_dllimport_data_definition : Error<
2815 "definition of dllimport data">;
2816 def err_attribute_dllimport_static_field_definition : Error<
2817 "definition of dllimport static field not allowed">;
2818 def warn_attribute_dllimport_static_field_definition : Warning<
2819 "definition of dllimport static field">,
2820 InGroup<DiagGroup<"dllimport-static-field-def">>;
2821 def warn_attribute_dllexport_explicit_instantiation_decl : Warning<
2822 "explicit instantiation declaration should not be 'dllexport'">,
2823 InGroup<DiagGroup<"dllexport-explicit-instantiation-decl">>;
2824 def warn_invalid_initializer_from_system_header : Warning<
2825 "invalid constructor form class in system header, should not be explicit">,
2826 InGroup<DiagGroup<"invalid-initializer-from-system-header">>;
2827 def note_used_in_initialization_here : Note<"used in initialization here">;
2828 def err_attribute_dll_member_of_dll_class : Error<
2829 "attribute %q0 cannot be applied to member of %q1 class">;
2830 def warn_attribute_dll_instantiated_base_class : Warning<
2831 "propagating dll attribute to %select{already instantiated|explicitly specialized}0 "
2832 "base class template without dll attribute is not supported">,
2833 InGroup<DiagGroup<"unsupported-dll-base-class-template">>, DefaultIgnore;
2834 def err_attribute_dll_ambiguous_default_ctor : Error<
2835 "'__declspec(dllexport)' cannot be applied to more than one default constructor in %0">;
2836 def err_attribute_weakref_not_static : Error<
2837 "weakref declaration must have internal linkage">;
2838 def err_attribute_weakref_not_global_context : Error<
2839 "weakref declaration of %0 must be in a global context">;
2840 def err_attribute_weakref_without_alias : Error<
2841 "weakref declaration of %0 must also have an alias attribute">;
2842 def err_alias_not_supported_on_darwin : Error <
2843 "aliases are not supported on darwin">;
2844 def err_alias_to_undefined : Error<
2845 "%select{alias|ifunc}0 must point to a defined %select{variable or |}1function">;
2846 def warn_alias_to_weak_alias : Warning<
2847 "%select{alias|ifunc}2 will always resolve to %0 even if weak definition of %1 is overridden">,
2848 InGroup<IgnoredAttributes>;
2849 def warn_alias_with_section : Warning<
2850 "%select{alias|ifunc}1 will not be in section '%0' but in the same section as the %select{aliasee|resolver}2">,
2851 InGroup<IgnoredAttributes>;
2852 def err_duplicate_mangled_name : Error<
2853 "definition with same mangled name '%0' as another definition">;
2854 def err_cyclic_alias : Error<
2855 "%select{alias|ifunc}0 definition is part of a cycle">;
2856 def err_ifunc_resolver_return : Error<
2857 "ifunc resolver function must return a pointer">;
2858 def err_ifunc_resolver_params : Error<
2859 "ifunc resolver function must have no parameters">;
2860 def warn_attribute_wrong_decl_type_str : Warning<
2861 "%0 attribute only applies to %1">, InGroup<IgnoredAttributes>;
2862 def err_attribute_wrong_decl_type_str : Error<
2863 warn_attribute_wrong_decl_type_str.Text>;
2864 def warn_attribute_wrong_decl_type : Warning<
2865 "%0 attribute only applies to %select{"
2868 "|variables and functions"
2869 "|functions and methods"
2870 "|functions, methods and blocks"
2871 "|functions, methods, and parameters"
2873 "|variables and fields"
2874 "|variables, data members and tag types"
2875 "|types and namespaces"
2876 "|variables, functions and classes"
2878 "|non-K&R-style functions}1">,
2879 InGroup<IgnoredAttributes>;
2880 def err_attribute_wrong_decl_type : Error<warn_attribute_wrong_decl_type.Text>;
2881 def warn_type_attribute_wrong_type : Warning<
2882 "'%0' only applies to %select{function|pointer|"
2883 "Objective-C object or block pointer}1 types; type here is %2">,
2884 InGroup<IgnoredAttributes>;
2885 def warn_incomplete_encoded_type : Warning<
2886 "encoding of %0 type is incomplete because %1 component has unknown encoding">,
2887 InGroup<DiagGroup<"encode-type">>;
2888 def warn_gnu_inline_attribute_requires_inline : Warning<
2889 "'gnu_inline' attribute requires function to be marked 'inline',"
2890 " attribute ignored">,
2891 InGroup<IgnoredAttributes>;
2892 def err_attribute_vecreturn_only_vector_member : Error<
2893 "the vecreturn attribute can only be used on a class or structure with one member, which must be a vector">;
2894 def err_attribute_vecreturn_only_pod_record : Error<
2895 "the vecreturn attribute can only be used on a POD (plain old data) class or structure (i.e. no virtual functions)">;
2896 def err_cconv_change : Error<
2897 "function declared '%0' here was previously declared "
2898 "%select{'%2'|without calling convention}1">;
2899 def warn_cconv_ignored : Warning<
2900 "calling convention %0 ignored for this target">, InGroup<IgnoredAttributes>;
2901 def err_cconv_knr : Error<
2902 "function with no prototype cannot use the %0 calling convention">;
2903 def warn_cconv_knr : Warning<
2904 err_cconv_knr.Text>,
2905 InGroup<DiagGroup<"missing-prototype-for-cc">>;
2906 def err_cconv_varargs : Error<
2907 "variadic function cannot use %0 calling convention">;
2908 def warn_cconv_varargs : Warning<
2909 "%0 calling convention ignored on variadic function">,
2910 InGroup<IgnoredAttributes>;
2911 def warn_cconv_structors : Warning<
2912 "%0 calling convention ignored on constructor/destructor">,
2913 InGroup<IgnoredAttributes>;
2914 def err_regparm_mismatch : Error<"function declared with regparm(%0) "
2915 "attribute was previously declared "
2916 "%plural{0:without the regparm|:with the regparm(%1)}1 attribute">;
2917 def err_function_attribute_mismatch : Error<
2918 "function declared with %0 attribute "
2919 "was previously declared without the %0 attribute">;
2920 def err_objc_precise_lifetime_bad_type : Error<
2921 "objc_precise_lifetime only applies to retainable types; type here is %0">;
2922 def warn_objc_precise_lifetime_meaningless : Error<
2923 "objc_precise_lifetime is not meaningful for "
2924 "%select{__unsafe_unretained|__autoreleasing}0 objects">;
2925 def err_invalid_pcs : Error<"invalid PCS type">;
2926 def warn_attribute_not_on_decl : Warning<
2927 "%0 attribute ignored when parsing type">, InGroup<IgnoredAttributes>;
2928 def err_base_specifier_attribute : Error<
2929 "%0 attribute cannot be applied to a base specifier">;
2930 def err_invalid_attribute_on_virtual_function : Error<
2931 "%0 attribute cannot be applied to virtual functions">;
2933 def ext_cannot_use_trivial_abi : ExtWarn<
2934 "'trivial_abi' cannot be applied to %0">, InGroup<IgnoredAttributes>;
2936 // Availability attribute
2937 def warn_availability_unknown_platform : Warning<
2938 "unknown platform %0 in availability macro">, InGroup<Availability>;
2939 def warn_availability_version_ordering : Warning<
2940 "feature cannot be %select{introduced|deprecated|obsoleted}0 in %1 version "
2941 "%2 before it was %select{introduced|deprecated|obsoleted}3 in version %4; "
2942 "attribute ignored">, InGroup<Availability>;
2943 def warn_mismatched_availability: Warning<
2944 "availability does not match previous declaration">, InGroup<Availability>;
2945 def warn_mismatched_availability_override : Warning<
2946 "%select{|overriding }4method %select{introduced after|"
2947 "deprecated before|obsoleted before}0 "
2948 "%select{the protocol method it implements|overridden method}4 "
2949 "on %1 (%2 vs. %3)">, InGroup<Availability>;
2950 def warn_mismatched_availability_override_unavail : Warning<
2951 "%select{|overriding }1method cannot be unavailable on %0 when "
2952 "%select{the protocol method it implements|its overridden method}1 is "
2954 InGroup<Availability>;
2955 def warn_availability_on_static_initializer : Warning<
2956 "ignoring availability attribute %select{on '+load' method|"
2957 "with constructor attribute|with destructor attribute}0">,
2958 InGroup<Availability>;
2959 def note_overridden_method : Note<
2960 "overridden method is here">;
2961 def note_protocol_method : Note<
2962 "protocol method is here">;
2964 def warn_unguarded_availability :
2965 Warning<"%0 is only available on %1 %2 or newer">,
2966 InGroup<UnguardedAvailability>, DefaultIgnore;
2967 def warn_unguarded_availability_new :
2968 Warning<warn_unguarded_availability.Text>,
2969 InGroup<UnguardedAvailabilityNew>;
2970 def note_decl_unguarded_availability_silence : Note<
2971 "annotate %select{%1|anonymous %1}0 with an availability attribute to silence this warning">;
2972 def note_unguarded_available_silence : Note<
2973 "enclose %0 in %select{an @available|a __builtin_available}1 check to silence"
2975 def warn_at_available_unchecked_use : Warning<
2976 "%select{@available|__builtin_available}0 does not guard availability here; "
2977 "use if (%select{@available|__builtin_available}0) instead">,
2978 InGroup<DiagGroup<"unsupported-availability-guard">>;
2980 // Thread Safety Attributes
2981 def warn_invalid_capability_name : Warning<
2982 "invalid capability name '%0'; capability name must be 'mutex' or 'role'">,
2983 InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2984 def warn_thread_attribute_ignored : Warning<
2985 "ignoring %0 attribute because its argument is invalid">,
2986 InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2987 def warn_thread_attribute_argument_not_lockable : Warning<
2988 "%0 attribute requires arguments whose type is annotated "
2989 "with 'capability' attribute; type here is %1">,
2990 InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2991 def warn_thread_attribute_decl_not_lockable : Warning<
2992 "%0 attribute can only be applied in a context annotated "
2993 "with 'capability(\"mutex\")' attribute">,
2994 InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2995 def warn_thread_attribute_decl_not_pointer : Warning<
2996 "%0 only applies to pointer types; type here is %1">,
2997 InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2998 def err_attribute_argument_out_of_range : Error<
2999 "%0 attribute parameter %1 is out of bounds: "
3000 "%plural{0:no parameters to index into|"
3001 "1:can only be 1, since there is one parameter|"
3002 ":must be between 1 and %2}2">;
3004 // Thread Safety Analysis
3005 def warn_unlock_but_no_lock : Warning<"releasing %0 '%1' that was not held">,
3006 InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3007 def warn_unlock_kind_mismatch : Warning<
3008 "releasing %0 '%1' using %select{shared|exclusive}2 access, expected "
3009 "%select{shared|exclusive}3 access">,
3010 InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3011 def warn_double_lock : Warning<"acquiring %0 '%1' that is already held">,
3012 InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3013 def warn_no_unlock : Warning<
3014 "%0 '%1' is still held at the end of function">,
3015 InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3016 def warn_expecting_locked : Warning<
3017 "expecting %0 '%1' to be held at the end of function">,
3018 InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3019 // FIXME: improve the error message about locks not in scope
3020 def warn_lock_some_predecessors : Warning<
3021 "%0 '%1' is not held on every path through here">,
3022 InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3023 def warn_expecting_lock_held_on_loop : Warning<
3024 "expecting %0 '%1' to be held at start of each loop">,
3025 InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3026 def note_locked_here : Note<"%0 acquired here">;
3027 def warn_lock_exclusive_and_shared : Warning<
3028 "%0 '%1' is acquired exclusively and shared in the same scope">,
3029 InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3030 def note_lock_exclusive_and_shared : Note<
3031 "the other acquisition of %0 '%1' is here">;
3032 def warn_variable_requires_any_lock : Warning<
3033 "%select{reading|writing}1 variable %0 requires holding "
3034 "%select{any mutex|any mutex exclusively}1">,
3035 InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3036 def warn_var_deref_requires_any_lock : Warning<
3037 "%select{reading|writing}1 the value pointed to by %0 requires holding "
3038 "%select{any mutex|any mutex exclusively}1">,
3039 InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3040 def warn_fun_excludes_mutex : Warning<
3041 "cannot call function '%1' while %0 '%2' is held">,
3042 InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3043 def warn_cannot_resolve_lock : Warning<
3044 "cannot resolve lock expression">,
3045 InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3046 def warn_acquired_before : Warning<
3047 "%0 '%1' must be acquired before '%2'">,
3048 InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3049 def warn_acquired_before_after_cycle : Warning<
3050 "Cycle in acquired_before/after dependencies, starting with '%0'">,
3051 InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3054 // Thread safety warnings negative capabilities
3055 def warn_acquire_requires_negative_cap : Warning<
3056 "acquiring %0 '%1' requires negative capability '%2'">,
3057 InGroup<ThreadSafetyNegative>, DefaultIgnore;
3059 // Thread safety warnings on pass by reference
3060 def warn_guarded_pass_by_reference : Warning<
3061 "passing variable %1 by reference requires holding %0 "
3062 "%select{'%2'|'%2' exclusively}3">,
3063 InGroup<ThreadSafetyReference>, DefaultIgnore;
3064 def warn_pt_guarded_pass_by_reference : Warning<
3065 "passing the value that %1 points to by reference requires holding %0 "
3066 "%select{'%2'|'%2' exclusively}3">,
3067 InGroup<ThreadSafetyReference>, DefaultIgnore;
3069 // Imprecise thread safety warnings
3070 def warn_variable_requires_lock : Warning<
3071 "%select{reading|writing}3 variable %1 requires holding %0 "
3072 "%select{'%2'|'%2' exclusively}3">,
3073 InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3074 def warn_var_deref_requires_lock : Warning<
3075 "%select{reading|writing}3 the value pointed to by %1 requires "
3076 "holding %0 %select{'%2'|'%2' exclusively}3">,
3077 InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3078 def warn_fun_requires_lock : Warning<
3079 "calling function %1 requires holding %0 %select{'%2'|'%2' exclusively}3">,
3080 InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3082 // Precise thread safety warnings
3083 def warn_variable_requires_lock_precise :
3084 Warning<warn_variable_requires_lock.Text>,
3085 InGroup<ThreadSafetyPrecise>, DefaultIgnore;
3086 def warn_var_deref_requires_lock_precise :
3087 Warning<warn_var_deref_requires_lock.Text>,
3088 InGroup<ThreadSafetyPrecise>, DefaultIgnore;
3089 def warn_fun_requires_lock_precise :
3090 Warning<warn_fun_requires_lock.Text>,
3091 InGroup<ThreadSafetyPrecise>, DefaultIgnore;
3092 def note_found_mutex_near_match : Note<"found near match '%0'">;
3094 // Verbose thread safety warnings
3095 def warn_thread_safety_verbose : Warning<"Thread safety verbose warning.">,
3096 InGroup<ThreadSafetyVerbose>, DefaultIgnore;
3097 def note_thread_warning_in_fun : Note<"Thread warning in function %0">;
3098 def note_guarded_by_declared_here : Note<"Guarded_by declared here.">;
3100 // Dummy warning that will trigger "beta" warnings from the analysis if enabled.
3101 def warn_thread_safety_beta : Warning<"Thread safety beta warning.">,
3102 InGroup<ThreadSafetyBeta>, DefaultIgnore;
3104 // Consumed warnings
3105 def warn_use_in_invalid_state : Warning<
3106 "invalid invocation of method '%0' on object '%1' while it is in the '%2' "
3107 "state">, InGroup<Consumed>, DefaultIgnore;
3108 def warn_use_of_temp_in_invalid_state : Warning<
3109 "invalid invocation of method '%0' on a temporary object while it is in the "
3110 "'%1' state">, InGroup<Consumed>, DefaultIgnore;
3111 def warn_attr_on_unconsumable_class : Warning<
3112 "consumed analysis attribute is attached to member of class '%0' which isn't "
3113 "marked as consumable">, InGroup<Consumed>, DefaultIgnore;
3114 def warn_return_typestate_for_unconsumable_type : Warning<
3115 "return state set for an unconsumable type '%0'">, InGroup<Consumed>,
3117 def warn_return_typestate_mismatch : Warning<
3118 "return value not in expected state; expected '%0', observed '%1'">,
3119 InGroup<Consumed>, DefaultIgnore;
3120 def warn_loop_state_mismatch : Warning<
3121 "state of variable '%0' must match at the entry and exit of loop">,
3122 InGroup<Consumed>, DefaultIgnore;
3123 def warn_param_return_typestate_mismatch : Warning<
3124 "parameter '%0' not in expected state when the function returns: expected "
3125 "'%1', observed '%2'">, InGroup<Consumed>, DefaultIgnore;
3126 def warn_param_typestate_mismatch : Warning<
3127 "argument not in expected state; expected '%0', observed '%1'">,
3128 InGroup<Consumed>, DefaultIgnore;
3130 // no_sanitize attribute
3131 def warn_unknown_sanitizer_ignored : Warning<
3132 "unknown sanitizer '%0' ignored">, InGroup<UnknownSanitizers>;
3134 def warn_impcast_vector_scalar : Warning<
3135 "implicit conversion turns vector to scalar: %0 to %1">,
3136 InGroup<Conversion>, DefaultIgnore;
3137 def warn_impcast_complex_scalar : Warning<
3138 "implicit conversion discards imaginary component: %0 to %1">,
3139 InGroup<Conversion>, DefaultIgnore;
3140 def err_impcast_complex_scalar : Error<
3141 "implicit conversion from %0 to %1 is not permitted in C++">;
3142 def warn_impcast_float_precision : Warning<
3143 "implicit conversion loses floating-point precision: %0 to %1">,
3144 InGroup<Conversion>, DefaultIgnore;
3145 def warn_impcast_float_result_precision : Warning<
3146 "implicit conversion when assigning computation result loses floating-point precision: %0 to %1">,
3147 InGroup<Conversion>, DefaultIgnore;
3148 def warn_impcast_double_promotion : Warning<
3149 "implicit conversion increases floating-point precision: %0 to %1">,
3150 InGroup<DoublePromotion>, DefaultIgnore;
3151 def warn_impcast_integer_sign : Warning<
3152 "implicit conversion changes signedness: %0 to %1">,
3153 InGroup<SignConversion>, DefaultIgnore;
3154 def warn_impcast_integer_sign_conditional : Warning<
3155 "operand of ? changes signedness: %0 to %1">,
3156 InGroup<SignConversion>, DefaultIgnore;
3157 def warn_impcast_integer_precision : Warning<
3158 "implicit conversion loses integer precision: %0 to %1">,
3159 InGroup<Conversion>, DefaultIgnore;
3160 def warn_impcast_integer_64_32 : Warning<
3161 "implicit conversion loses integer precision: %0 to %1">,
3162 InGroup<Shorten64To32>, DefaultIgnore;
3163 def warn_impcast_integer_precision_constant : Warning<
3164 "implicit conversion from %2 to %3 changes value from %0 to %1">,
3165 InGroup<ConstantConversion>;
3166 def warn_impcast_bitfield_precision_constant : Warning<
3167 "implicit truncation from %2 to bit-field changes value from %0 to %1">,
3168 InGroup<BitFieldConstantConversion>;
3170 def warn_impcast_literal_float_to_integer : Warning<
3171 "implicit conversion from %0 to %1 changes value from %2 to %3">,
3172 InGroup<LiteralConversion>;
3173 def warn_impcast_literal_float_to_integer_out_of_range : Warning<
3174 "implicit conversion of out of range value from %0 to %1 is undefined">,
3175 InGroup<LiteralConversion>;
3176 def warn_impcast_float_integer : Warning<
3177 "implicit conversion turns floating-point number into integer: %0 to %1">,
3178 InGroup<FloatConversion>, DefaultIgnore;
3180 def warn_impcast_float_to_integer : Warning<
3181 "implicit conversion from %0 to %1 changes value from %2 to %3">,
3182 InGroup<FloatOverflowConversion>, DefaultIgnore;
3183 def warn_impcast_float_to_integer_out_of_range : Warning<
3184 "implicit conversion of out of range value from %0 to %1 is undefined">,
3185 InGroup<FloatOverflowConversion>, DefaultIgnore;
3186 def warn_impcast_float_to_integer_zero : Warning<
3187 "implicit conversion from %0 to %1 changes non-zero value from %2 to %3">,
3188 InGroup<FloatZeroConversion>, DefaultIgnore;
3190 def warn_impcast_string_literal_to_bool : Warning<
3191 "implicit conversion turns string literal into bool: %0 to %1">,
3192 InGroup<StringConversion>, DefaultIgnore;
3193 def warn_impcast_different_enum_types : Warning<
3194 "implicit conversion from enumeration type %0 to different enumeration type "
3195 "%1">, InGroup<EnumConversion>;
3196 def warn_impcast_bool_to_null_pointer : Warning<
3197 "initialization of pointer of type %0 to null from a constant boolean "
3198 "expression">, InGroup<BoolConversion>;
3199 def warn_non_literal_null_pointer : Warning<
3200 "expression which evaluates to zero treated as a null pointer constant of "
3201 "type %0">, InGroup<NonLiteralNullConversion>;
3202 def warn_impcast_null_pointer_to_integer : Warning<
3203 "implicit conversion of %select{NULL|nullptr}0 constant to %1">,
3204 InGroup<NullConversion>;
3205 def warn_impcast_floating_point_to_bool : Warning<
3206 "implicit conversion turns floating-point number into bool: %0 to %1">,
3207 InGroup<ImplicitConversionFloatingPointToBool>;
3208 def ext_ms_impcast_fn_obj : ExtWarn<
3209 "implicit conversion between pointer-to-function and pointer-to-object is a "
3210 "Microsoft extension">, InGroup<MicrosoftCast>;
3212 def warn_impcast_pointer_to_bool : Warning<
3213 "address of%select{| function| array}0 '%1' will always evaluate to "
3215 InGroup<PointerBoolConversion>;
3216 def warn_cast_nonnull_to_bool : Warning<
3217 "nonnull %select{function call|parameter}0 '%1' will evaluate to "
3218 "'true' on first encounter">,
3219 InGroup<PointerBoolConversion>;
3220 def warn_this_bool_conversion : Warning<
3221 "'this' pointer cannot be null in well-defined C++ code; pointer may be "
3222 "assumed to always convert to true">, InGroup<UndefinedBoolConversion>;
3223 def warn_address_of_reference_bool_conversion : Warning<
3224 "reference cannot be bound to dereferenced null pointer in well-defined C++ "
3225 "code; pointer may be assumed to always convert to true">,
3226 InGroup<UndefinedBoolConversion>;
3228 def warn_null_pointer_compare : Warning<
3229 "comparison of %select{address of|function|array}0 '%1' %select{not |}2"
3230 "equal to a null pointer is always %select{true|false}2">,
3231 InGroup<TautologicalPointerCompare>;
3232 def warn_nonnull_expr_compare : Warning<
3233 "comparison of nonnull %select{function call|parameter}0 '%1' "
3234 "%select{not |}2equal to a null pointer is '%select{true|false}2' on first "
3236 InGroup<TautologicalPointerCompare>;
3237 def warn_this_null_compare : Warning<
3238 "'this' pointer cannot be null in well-defined C++ code; comparison may be "
3239 "assumed to always evaluate to %select{true|false}0">,
3240 InGroup<TautologicalUndefinedCompare>;
3241 def warn_address_of_reference_null_compare : Warning<
3242 "reference cannot be bound to dereferenced null pointer in well-defined C++ "
3243 "code; comparison may be assumed to always evaluate to "
3244 "%select{true|false}0">,
3245 InGroup<TautologicalUndefinedCompare>;
3246 def note_reference_is_return_value : Note<"%0 returns a reference">;
3248 def note_function_warning_silence : Note<
3249 "prefix with the address-of operator to silence this warning">;
3250 def note_function_to_function_call : Note<
3251 "suffix with parentheses to turn this into a function call">;
3252 def warn_impcast_objective_c_literal_to_bool : Warning<
3253 "implicit boolean conversion of Objective-C object literal always "
3254 "evaluates to true">,
3255 InGroup<ObjCLiteralConversion>;
3257 def warn_cast_align : Warning<
3258 "cast from %0 to %1 increases required alignment from %2 to %3">,
3259 InGroup<CastAlign>, DefaultIgnore;
3260 def warn_old_style_cast : Warning<
3261 "use of old-style cast">, InGroup<OldStyleCast>, DefaultIgnore;
3263 // Separate between casts to void* and non-void* pointers.
3264 // Some APIs use (abuse) void* for something like a user context,
3265 // and often that value is an integer even if it isn't a pointer itself.
3266 // Having a separate warning flag allows users to control the warning
3267 // for their workflow.
3268 def warn_int_to_pointer_cast : Warning<
3269 "cast to %1 from smaller integer type %0">,
3270 InGroup<IntToPointerCast>;
3271 def warn_int_to_void_pointer_cast : Warning<
3272 "cast to %1 from smaller integer type %0">,
3273 InGroup<IntToVoidPointerCast>;
3275 def warn_attribute_ignored_for_field_of_type : Warning<
3276 "%0 attribute ignored for field of type %1">,
3277 InGroup<IgnoredAttributes>;
3278 def warn_no_underlying_type_specified_for_enum_bitfield : Warning<
3279 "enums in the Microsoft ABI are signed integers by default; consider giving "
3280 "the enum %0 an unsigned underlying type to make this code portable">,
3281 InGroup<SignedEnumBitfield>, DefaultIgnore;
3282 def warn_attribute_packed_for_bitfield : Warning<
3283 "'packed' attribute was ignored on bit-fields with single-byte alignment "
3284 "in older versions of GCC and Clang">,
3285 InGroup<DiagGroup<"attribute-packed-for-bitfield">>;
3286 def warn_transparent_union_attribute_field_size_align : Warning<
3287 "%select{alignment|size}0 of field %1 (%2 bits) does not match the "
3288 "%select{alignment|size}0 of the first field in transparent union; "
3289 "transparent_union attribute ignored">,
3290 InGroup<IgnoredAttributes>;
3291 def note_transparent_union_first_field_size_align : Note<
3292 "%select{alignment|size}0 of first field is %1 bits">;
3293 def warn_transparent_union_attribute_not_definition : Warning<
3294 "transparent_union attribute can only be applied to a union definition; "
3295 "attribute ignored">,
3296 InGroup<IgnoredAttributes>;
3297 def warn_transparent_union_attribute_floating : Warning<
3298 "first field of a transparent union cannot have %select{floating point|"
3299 "vector}0 type %1; transparent_union attribute ignored">,
3300 InGroup<IgnoredAttributes>;
3301 def warn_transparent_union_attribute_zero_fields : Warning<
3302 "transparent union definition must contain at least one field; "
3303 "transparent_union attribute ignored">,
3304 InGroup<IgnoredAttributes>;
3305 def warn_attribute_type_not_supported : Warning<
3306 "%0 attribute argument not supported: %1">,
3307 InGroup<IgnoredAttributes>;
3308 def warn_attribute_unknown_visibility : Warning<"unknown visibility %0">,
3309 InGroup<IgnoredAttributes>;
3310 def warn_attribute_protected_visibility :
3311 Warning<"target does not support 'protected' visibility; using 'default'">,
3312 InGroup<DiagGroup<"unsupported-visibility">>;
3313 def err_mismatched_visibility: Error<"visibility does not match previous declaration">;
3314 def note_previous_attribute : Note<"previous attribute is here">;
3315 def note_conflicting_attribute : Note<"conflicting attribute is here">;
3316 def note_attribute : Note<"attribute is here">;
3317 def err_mismatched_ms_inheritance : Error<
3318 "inheritance model does not match %select{definition|previous declaration}0">;
3319 def warn_ignored_ms_inheritance : Warning<
3320 "inheritance model ignored on %select{primary template|partial specialization}0">,
3321 InGroup<IgnoredAttributes>;
3322 def note_previous_ms_inheritance : Note<
3323 "previous inheritance model specified here">;
3324 def err_machine_mode : Error<"%select{unknown|unsupported}0 machine mode %1">;
3325 def err_mode_not_primitive : Error<
3326 "mode attribute only supported for integer and floating-point types">;
3327 def err_mode_wrong_type : Error<
3328 "type of machine mode does not match type of base type">;
3329 def warn_vector_mode_deprecated : Warning<
3330 "specifying vector types with the 'mode' attribute is deprecated; "
3331 "use the 'vector_size' attribute instead">,
3332 InGroup<DeprecatedAttributes>;
3333 def err_complex_mode_vector_type : Error<
3334 "type of machine mode does not support base vector types">;
3335 def err_enum_mode_vector_type : Error<
3336 "mode %0 is not supported for enumeration types">;
3337 def warn_attribute_nonnull_no_pointers : Warning<
3338 "'nonnull' attribute applied to function with no pointer arguments">,
3339 InGroup<IgnoredAttributes>;
3340 def warn_attribute_nonnull_parm_no_args : Warning<
3341 "'nonnull' attribute when used on parameters takes no arguments">,
3342 InGroup<IgnoredAttributes>;
3343 def note_declared_nonnull : Note<
3344 "declared %select{'returns_nonnull'|'nonnull'}0 here">;
3345 def warn_attribute_sentinel_named_arguments : Warning<
3346 "'sentinel' attribute requires named arguments">,
3347 InGroup<IgnoredAttributes>;
3348 def warn_attribute_sentinel_not_variadic : Warning<
3349 "'sentinel' attribute only supported for variadic %select{functions|blocks}0">,
3350 InGroup<IgnoredAttributes>;
3351 def err_attribute_sentinel_less_than_zero : Error<
3352 "'sentinel' parameter 1 less than zero">;
3353 def err_attribute_sentinel_not_zero_or_one : Error<
3354 "'sentinel' parameter 2 not 0 or 1">;
3355 def warn_cleanup_ext : Warning<
3356 "GCC does not allow the 'cleanup' attribute argument to be anything other "
3357 "than a simple identifier">,
3359 def err_attribute_cleanup_arg_not_function : Error<
3360 "'cleanup' argument %select{|%1 |%1 }0is not a %select{||single }0function">;
3361 def err_attribute_cleanup_func_must_take_one_arg : Error<
3362 "'cleanup' function %0 must take 1 parameter">;
3363 def err_attribute_cleanup_func_arg_incompatible_type : Error<
3364 "'cleanup' function %0 parameter has "
3365 "%diff{type $ which is incompatible with type $|incompatible type}1,2">;
3366 def err_attribute_regparm_wrong_platform : Error<
3367 "'regparm' is not valid on this platform">;
3368 def err_attribute_regparm_invalid_number : Error<
3369 "'regparm' parameter must be between 0 and %0 inclusive">;
3370 def err_attribute_not_supported_in_lang : Error<
3371 "%0 attribute is not supported in %select{C|C++|Objective-C}1">;
3372 def err_attribute_not_supported_on_arch
3373 : Error<"%0 attribute is not supported on '%1'">;
3374 def warn_gcc_ignores_type_attr : Warning<
3375 "GCC does not allow the %0 attribute to be written on a type">,
3378 // Clang-Specific Attributes
3379 def warn_attribute_iboutlet : Warning<
3380 "%0 attribute can only be applied to instance variables or properties">,
3381 InGroup<IgnoredAttributes>;
3382 def err_iboutletcollection_type : Error<
3383 "invalid type %0 as argument of iboutletcollection attribute">;
3384 def err_iboutletcollection_builtintype : Error<
3385 "type argument of iboutletcollection attribute cannot be a builtin type">;
3386 def warn_iboutlet_object_type : Warning<
3387 "%select{instance variable|property}2 with %0 attribute must "
3388 "be an object type (invalid %1)">, InGroup<ObjCInvalidIBOutletProperty>;
3389 def warn_iboutletcollection_property_assign : Warning<
3390 "IBOutletCollection properties should be copy/strong and not assign">,
3391 InGroup<ObjCInvalidIBOutletProperty>;
3393 def err_attribute_overloadable_mismatch : Error<
3394 "redeclaration of %0 must %select{not |}1have the 'overloadable' attribute">;
3395 def note_attribute_overloadable_prev_overload : Note<
3396 "previous %select{unmarked |}0overload of function is here">;
3397 def err_attribute_overloadable_no_prototype : Error<
3398 "'overloadable' function %0 must have a prototype">;
3399 def err_attribute_overloadable_multiple_unmarked_overloads : Error<
3400 "at most one overload for a given name may lack the 'overloadable' "
3402 def warn_ns_attribute_wrong_return_type : Warning<
3403 "%0 attribute only applies to %select{functions|methods|properties}1 that "
3404 "return %select{an Objective-C object|a pointer|a non-retainable pointer}2">,
3405 InGroup<IgnoredAttributes>;
3406 def err_ns_attribute_wrong_parameter_type : Error<
3407 "%0 attribute only applies to "
3408 "%select{Objective-C object|pointer|pointer-to-CF-pointer}1 parameters">;
3409 def warn_ns_attribute_wrong_parameter_type : Warning<
3410 "%0 attribute only applies to "
3411 "%select{Objective-C object|pointer|pointer-to-CF-pointer}1 parameters">,
3412 InGroup<IgnoredAttributes>;
3413 def warn_objc_requires_super_protocol : Warning<
3414 "%0 attribute cannot be applied to %select{methods in protocols|dealloc}1">,
3415 InGroup<DiagGroup<"requires-super-attribute">>;
3416 def note_protocol_decl : Note<
3417 "protocol is declared here">;
3418 def note_protocol_decl_undefined : Note<
3419 "protocol %0 has no definition">;
3421 // objc_designated_initializer attribute diagnostics.
3422 def warn_objc_designated_init_missing_super_call : Warning<
3423 "designated initializer missing a 'super' call to a designated initializer of the super class">,
3424 InGroup<ObjCDesignatedInit>;
3425 def note_objc_designated_init_marked_here : Note<
3426 "method marked as designated initializer of the class here">;
3427 def warn_objc_designated_init_non_super_designated_init_call : Warning<
3428 "designated initializer should only invoke a designated initializer on 'super'">,
3429 InGroup<ObjCDesignatedInit>;
3430 def warn_objc_designated_init_non_designated_init_call : Warning<
3431 "designated initializer invoked a non-designated initializer">,
3432 InGroup<ObjCDesignatedInit>;
3433 def warn_objc_secondary_init_super_init_call : Warning<
3434 "convenience initializer should not invoke an initializer on 'super'">,
3435 InGroup<ObjCDesignatedInit>;
3436 def warn_objc_secondary_init_missing_init_call : Warning<
3437 "convenience initializer missing a 'self' call to another initializer">,
3438 InGroup<ObjCDesignatedInit>;
3439 def warn_objc_implementation_missing_designated_init_override : Warning<
3440 "method override for the designated initializer of the superclass %objcinstance0 not found">,
3441 InGroup<ObjCDesignatedInit>;
3443 // objc_bridge attribute diagnostics.
3444 def err_objc_attr_not_id : Error<
3445 "parameter of %0 attribute must be a single name of an Objective-C %select{class|protocol}1">;
3446 def err_objc_attr_typedef_not_id : Error<
3447 "parameter of %0 attribute must be 'id' when used on a typedef">;
3448 def err_objc_attr_typedef_not_void_pointer : Error<
3449 "'objc_bridge(id)' is only allowed on structs and typedefs of void pointers">;
3450 def err_objc_cf_bridged_not_interface : Error<
3451 "CF object of type %0 is bridged to %1, which is not an Objective-C class">;
3452 def err_objc_ns_bridged_invalid_cfobject : Error<
3453 "ObjectiveC object of type %0 is bridged to %1, which is not valid CF object">;
3454 def warn_objc_invalid_bridge : Warning<
3455 "%0 bridges to %1, not %2">, InGroup<ObjCBridge>;
3456 def warn_objc_invalid_bridge_to_cf : Warning<
3457 "%0 cannot bridge to %1">, InGroup<ObjCBridge>;
3459 // objc_bridge_related attribute diagnostics.
3460 def err_objc_bridged_related_invalid_class : Error<
3461 "could not find Objective-C class %0 to convert %1 to %2">;
3462 def err_objc_bridged_related_invalid_class_name : Error<
3463 "%0 must be name of an Objective-C class to be able to convert %1 to %2">;
3464 def err_objc_bridged_related_known_method : Error<
3465 "%0 must be explicitly converted to %1; use %select{%objcclass2|%objcinstance2}3 "
3466 "method for this conversion">;
3468 def err_objc_attr_protocol_requires_definition : Error<
3469 "attribute %0 can only be applied to @protocol definitions, not forward declarations">;
3471 // Function Parameter Semantic Analysis.
3472 def err_param_with_void_type : Error<"argument may not have 'void' type">;
3473 def err_void_only_param : Error<
3474 "'void' must be the first and only parameter if specified">;
3475 def err_void_param_qualified : Error<
3476 "'void' as parameter must not have type qualifiers">;
3477 def err_ident_list_in_fn_declaration : Error<
3478 "a parameter list without types is only allowed in a function definition">;
3479 def ext_param_not_declared : Extension<
3480 "parameter %0 was not declared, defaulting to type 'int'">;
3481 def err_param_default_argument : Error<
3482 "C does not support default arguments">;
3483 def err_param_default_argument_redefinition : Error<
3484 "redefinition of default argument">;
3485 def ext_param_default_argument_redefinition : ExtWarn<
3486 err_param_default_argument_redefinition.Text>,
3487 InGroup<MicrosoftDefaultArgRedefinition>;
3488 def err_param_default_argument_missing : Error<
3489 "missing default argument on parameter">;
3490 def err_param_default_argument_missing_name : Error<
3491 "missing default argument on parameter %0">;
3492 def err_param_default_argument_references_param : Error<
3493 "default argument references parameter %0">;
3494 def err_param_default_argument_references_local : Error<
3495 "default argument references local variable %0 of enclosing function">;
3496 def err_param_default_argument_references_this : Error<
3497 "default argument references 'this'">;
3498 def err_param_default_argument_nonfunc : Error<
3499 "default arguments can only be specified for parameters in a function "
3501 def err_param_default_argument_template_redecl : Error<
3502 "default arguments cannot be added to a function template that has already "
3504 def err_param_default_argument_member_template_redecl : Error<
3505 "default arguments cannot be added to an out-of-line definition of a member "
3506 "of a %select{class template|class template partial specialization|nested "
3507 "class in a template}0">;
3508 def err_param_default_argument_on_parameter_pack : Error<
3509 "parameter pack cannot have a default argument">;
3510 def err_uninitialized_member_for_assign : Error<
3511 "cannot define the implicit copy assignment operator for %0, because "
3512 "non-static %select{reference|const}1 member %2 cannot use copy "
3513 "assignment operator">;
3514 def err_uninitialized_member_in_ctor : Error<
3515 "%select{constructor for %1|"
3516 "implicit default constructor for %1|"
3517 "cannot use constructor inherited from %1:}0 must explicitly "
3518 "initialize the %select{reference|const}2 member %3">;
3519 def err_default_arg_makes_ctor_special : Error<
3520 "addition of default argument on redeclaration makes this constructor a "
3521 "%select{default|copy|move}0 constructor">;
3523 def err_use_of_default_argument_to_function_declared_later : Error<
3524 "use of default argument to function %0 that is declared later in class %1">;
3525 def note_default_argument_declared_here : Note<
3526 "default argument declared here">;
3527 def err_recursive_default_argument : Error<"recursive evaluation of default argument">;
3529 def ext_param_promoted_not_compatible_with_prototype : ExtWarn<
3530 "%diff{promoted type $ of K&R function parameter is not compatible with the "
3531 "parameter type $|promoted type of K&R function parameter is not compatible "
3532 "with parameter type}0,1 declared in a previous prototype">,
3533 InGroup<KNRPromotedParameter>;
3536 // C++ Overloading Semantic Analysis.
3537 def err_ovl_diff_return_type : Error<
3538 "functions that differ only in their return type cannot be overloaded">;
3539 def err_ovl_static_nonstatic_member : Error<
3540 "static and non-static member functions with the same parameter types "
3541 "cannot be overloaded">;
3543 def err_ovl_no_viable_function_in_call : Error<
3544 "no matching function for call to %0">;
3545 def err_ovl_no_viable_member_function_in_call : Error<
3546 "no matching member function for call to %0">;
3547 def err_ovl_ambiguous_call : Error<
3548 "call to %0 is ambiguous">;
3549 def err_ovl_deleted_call : Error<
3550 "call to %select{unavailable|deleted}0 function %1%2">;
3551 def err_ovl_ambiguous_member_call : Error<
3552 "call to member function %0 is ambiguous">;
3553 def err_ovl_deleted_member_call : Error<
3554 "call to %select{unavailable|deleted}0 member function %1%2">;
3555 def note_ovl_too_many_candidates : Note<
3556 "remaining %0 candidate%s0 omitted; "
3557 "pass -fshow-overloads=all to show them">;
3559 def select_ovl_candidate_kind : TextSubstitution<
3560 "%select{function|function|constructor|"
3561 "constructor (the implicit default constructor)|"
3562 "constructor (the implicit copy constructor)|"
3563 "constructor (the implicit move constructor)|"
3564 "function (the implicit copy assignment operator)|"
3565 "function (the implicit move assignment operator)|"
3566 "inherited constructor}0%select{| template| %2}1">;
3568 def note_ovl_candidate : Note<
3569 "candidate %sub{select_ovl_candidate_kind}0,1,3"
3570 "%select{| has different class%diff{ (expected $ but has $)|}5,6"
3571 "| has different number of parameters (expected %5 but has %6)"
3572 "| has type mismatch at %ordinal5 parameter"
3573 "%diff{ (expected $ but has $)|}6,7"
3574 "| has different return type%diff{ ($ expected but has $)|}5,6"
3575 "| has different qualifiers (expected "
3576 "%select{none|const|restrict|const and restrict|volatile|const and volatile"
3577 "|volatile and restrict|const, volatile, and restrict}5 but found "
3578 "%select{none|const|restrict|const and restrict|volatile|const and volatile"
3579 "|volatile and restrict|const, volatile, and restrict}6)"
3580 "| has different exception specification}4">;
3582 def note_ovl_candidate_inherited_constructor : Note<
3583 "constructor from base class %0 inherited here">;
3584 def note_ovl_candidate_inherited_constructor_slice : Note<
3585 "candidate %select{constructor|template}0 ignored: "
3586 "inherited constructor cannot be used to %select{copy|move}1 object">;
3587 def note_ovl_candidate_illegal_constructor : Note<
3588 "candidate %select{constructor|template}0 ignored: "
3589 "instantiation %select{takes|would take}0 its own class type by value">;
3590 def note_ovl_candidate_bad_deduction : Note<
3591 "candidate template ignored: failed template argument deduction">;
3592 def note_ovl_candidate_incomplete_deduction : Note<"candidate template ignored: "
3593 "couldn't infer template argument %0">;
3594 def note_ovl_candidate_incomplete_deduction_pack : Note<"candidate template ignored: "
3595 "deduced too few arguments for expanded pack %0; no argument for %ordinal1 "
3596 "expanded parameter in deduced argument pack %2">;
3597 def note_ovl_candidate_inconsistent_deduction : Note<
3598 "candidate template ignored: deduced conflicting %select{types|values|"
3599 "templates}0 for parameter %1%diff{ ($ vs. $)|}2,3">;
3600 def note_ovl_candidate_inconsistent_deduction_types : Note<
3601 "candidate template ignored: deduced values %diff{"
3602 "of conflicting types for parameter %0 (%1 of type $ vs. %3 of type $)|"
3603 "%1 and %3 of conflicting types for parameter %0}2,4">;
3604 def note_ovl_candidate_explicit_arg_mismatch_named : Note<
3605 "candidate template ignored: invalid explicitly-specified argument "
3606 "for template parameter %0">;
3607 def note_ovl_candidate_explicit_arg_mismatch_unnamed : Note<
3608 "candidate template ignored: invalid explicitly-specified argument "
3609 "for %ordinal0 template parameter">;
3610 def note_ovl_candidate_instantiation_depth : Note<
3611 "candidate template ignored: substitution exceeded maximum template "
3612 "instantiation depth">;
3613 def note_ovl_candidate_underqualified : Note<
3614 "candidate template ignored: cannot deduce a type for %0 that would "
3615 "make %2 equal %1">;
3616 def note_ovl_candidate_substitution_failure : Note<
3617 "candidate template ignored: substitution failure%0%1">;
3618 def note_ovl_candidate_disabled_by_enable_if : Note<
3619 "candidate template ignored: disabled by %0%1">;
3620 def note_ovl_candidate_disabled_by_requirement : Note<
3621 "candidate template ignored: requirement '%0' was not satisfied%1">;
3622 def note_ovl_candidate_has_pass_object_size_params: Note<
3623 "candidate address cannot be taken because parameter %0 has "
3624 "pass_object_size attribute">;
3625 def err_diagnose_if_succeeded : Error<"%0">;
3626 def warn_diagnose_if_succeeded : Warning<"%0">, InGroup<UserDefinedWarnings>,
3628 def note_ovl_candidate_disabled_by_function_cond_attr : Note<
3629 "candidate disabled: %0">;
3630 def note_ovl_candidate_disabled_by_extension : Note<
3631 "candidate disabled due to OpenCL extension">;
3632 def err_addrof_function_disabled_by_enable_if_attr : Error<
3633 "cannot take address of function %0 because it has one or more "
3634 "non-tautological enable_if conditions">;
3635 def note_addrof_ovl_candidate_disabled_by_enable_if_attr : Note<
3636 "candidate function made ineligible by enable_if">;
3637 def note_ovl_candidate_deduced_mismatch : Note<
3638 "candidate template ignored: deduced type "
3639 "%diff{$ of %select{|element of }4%ordinal0 parameter does not match "
3640 "adjusted type $ of %select{|element of }4argument"
3641 "|of %select{|element of }4%ordinal0 parameter does not match "
3642 "adjusted type of %select{|element of }4argument}1,2%3">;
3643 def note_ovl_candidate_non_deduced_mismatch : Note<
3644 "candidate template ignored: could not match %diff{$ against $|types}0,1">;
3645 // This note is needed because the above note would sometimes print two
3646 // different types with the same name. Remove this note when the above note
3647 // can handle that case properly.
3648 def note_ovl_candidate_non_deduced_mismatch_qualified : Note<
3649 "candidate template ignored: could not match %q0 against %q1">;
3651 // Note that we don't treat templates differently for this diagnostic.
3652 def note_ovl_candidate_arity : Note<"candidate "
3653 "%sub{select_ovl_candidate_kind}0,1,2 not viable: "
3654 "requires%select{ at least| at most|}3 %4 argument%s4, but %5 "
3655 "%plural{1:was|:were}5 provided">;
3657 def note_ovl_candidate_arity_one : Note<"candidate "
3658 "%sub{select_ovl_candidate_kind}0,1,2 not viable: "
3659 "%select{requires at least|allows at most single|requires single}3 "
3660 "argument %4, but %plural{0:no|:%5}5 arguments were provided">;
3662 def note_ovl_candidate_deleted : Note<
3663 "candidate %sub{select_ovl_candidate_kind}0,1,2 has been "
3664 "%select{explicitly made unavailable|explicitly deleted|"
3665 "implicitly deleted}3">;
3667 // Giving the index of the bad argument really clutters this message, and
3668 // it's relatively unimportant because 1) it's generally obvious which
3669 // argument(s) are of the given object type and 2) the fix is usually
3670 // to complete the type, which doesn't involve changes to the call line
3671 // anyway. If people complain, we can change it.
3672 def note_ovl_candidate_bad_conv_incomplete : Note<
3673 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
3674 "cannot convert argument of incomplete type "
3675 "%diff{$ to $|to parameter type}3,4 for "
3676 "%select{%ordinal6 argument|object argument}5"
3677 "%select{|; dereference the argument with *|"
3678 "; take the address of the argument with &|"
3681 def note_ovl_candidate_bad_list_argument : Note<
3682 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
3683 "cannot convert initializer list argument to %4">;
3684 def note_ovl_candidate_bad_overload : Note<
3685 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
3686 "no overload of %4 matching %3 for %ordinal5 argument">;
3687 def note_ovl_candidate_bad_conv : Note<
3688 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
3689 "no known conversion "
3690 "%diff{from $ to $|from argument type to parameter type}3,4 for "
3691 "%select{%ordinal6 argument|object argument}5"
3692 "%select{|; dereference the argument with *|"
3693 "; take the address of the argument with &|"
3696 def note_ovl_candidate_bad_arc_conv : Note<
3697 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
3698 "cannot implicitly convert argument "
3699 "%diff{of type $ to $|type to parameter type}3,4 for "
3700 "%select{%ordinal6 argument|object argument}5 under ARC">;
3701 def note_ovl_candidate_bad_lvalue : Note<
3702 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
3703 "expects an l-value for "
3704 "%select{%ordinal4 argument|object argument}3">;
3705 def note_ovl_candidate_bad_addrspace : Note<
3706 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
3707 "address space mismatch in %select{%ordinal6|'this'}5 argument (%3), "
3708 "parameter type must be %4">;
3709 def note_ovl_candidate_bad_gc : Note<
3710 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
3711 "%select{%ordinal7|'this'}6 argument (%3) has %select{no|__weak|__strong}4 "
3712 "ownership, but parameter has %select{no|__weak|__strong}5 ownership">;
3713 def note_ovl_candidate_bad_ownership : Note<
3714 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
3715 "%select{%ordinal7|'this'}6 argument (%3) has "
3716 "%select{no|__unsafe_unretained|__strong|__weak|__autoreleasing}4 ownership,"
3717 " but parameter has %select{no|__unsafe_unretained|__strong|__weak|"
3718 "__autoreleasing}5 ownership">;
3719 def note_ovl_candidate_bad_cvr_this : Note<
3720 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
3721 "'this' argument has type %3, but method is not marked "
3722 "%select{const|restrict|const or restrict|volatile|const or volatile|"
3723 "volatile or restrict|const, volatile, or restrict}4">;
3724 def note_ovl_candidate_bad_cvr : Note<
3725 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
3726 "%ordinal5 argument (%3) would lose "
3727 "%select{const|restrict|const and restrict|volatile|const and volatile|"
3728 "volatile and restrict|const, volatile, and restrict}4 qualifier"
3729 "%select{||s||s|s|s}4">;
3730 def note_ovl_candidate_bad_unaligned : Note<
3731 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
3732 "%ordinal5 argument (%3) would lose __unaligned qualifier">;
3733 def note_ovl_candidate_bad_base_to_derived_conv : Note<
3734 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
3735 "cannot %select{convert from|convert from|bind}3 "
3736 "%select{base class pointer|superclass|base class object of type}3 %4 to "
3737 "%select{derived class pointer|subclass|derived class reference}3 %5 for "
3738 "%ordinal6 argument">;
3739 def note_ovl_candidate_bad_target : Note<
3740 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
3742 "%select{__device__|__global__|__host__|__host__ __device__|invalid}3 function from"
3743 " %select{__device__|__global__|__host__|__host__ __device__|invalid}4 function">;
3744 def note_implicit_member_target_infer_collision : Note<
3745 "implicit %sub{select_special_member_kind}0 inferred target collision: call to both "
3746 "%select{__device__|__global__|__host__|__host__ __device__}1 and "
3747 "%select{__device__|__global__|__host__|__host__ __device__}2 members">;
3749 def note_ambiguous_type_conversion: Note<
3750 "because of ambiguity in conversion %diff{of $ to $|between types}0,1">;
3751 def note_ovl_builtin_binary_candidate : Note<
3752 "built-in candidate %0">;
3753 def note_ovl_builtin_unary_candidate : Note<
3754 "built-in candidate %0">;
3755 def err_ovl_no_viable_function_in_init : Error<
3756 "no matching constructor for initialization of %0">;
3757 def err_ovl_no_conversion_in_cast : Error<
3758 "cannot convert %1 to %2 without a conversion operator">;
3759 def err_ovl_no_viable_conversion_in_cast : Error<
3760 "no matching conversion for %select{|static_cast|reinterpret_cast|"
3761 "dynamic_cast|C-style cast|functional-style cast}0 from %1 to %2">;
3762 def err_ovl_ambiguous_conversion_in_cast : Error<
3763 "ambiguous conversion for %select{|static_cast|reinterpret_cast|"
3764 "dynamic_cast|C-style cast|functional-style cast}0 from %1 to %2">;
3765 def err_ovl_deleted_conversion_in_cast : Error<
3766 "%select{|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
3767 "functional-style cast}0 from %1 to %2 uses deleted function">;
3768 def err_ovl_ambiguous_init : Error<"call to constructor of %0 is ambiguous">;
3769 def err_ref_init_ambiguous : Error<
3770 "reference initialization of type %0 with initializer of type %1 is ambiguous">;
3771 def err_ovl_deleted_init : Error<
3772 "call to %select{unavailable|deleted}0 constructor of %1">;
3773 def err_ovl_deleted_special_init : Error<
3774 "call to implicitly-deleted %select{default constructor|copy constructor|"
3775 "move constructor|copy assignment operator|move assignment operator|"
3776 "destructor|function}0 of %1">;
3777 def err_ovl_ambiguous_oper_unary : Error<
3778 "use of overloaded operator '%0' is ambiguous (operand type %1)">;
3779 def err_ovl_ambiguous_oper_binary : Error<
3780 "use of overloaded operator '%0' is ambiguous (with operand types %1 and %2)">;
3781 def err_ovl_no_viable_oper : Error<"no viable overloaded '%0'">;
3782 def note_assign_lhs_incomplete : Note<"type %0 is incomplete">;
3783 def err_ovl_deleted_oper : Error<
3784 "overload resolution selected %select{unavailable|deleted}0 operator '%1'%2">;
3785 def err_ovl_deleted_special_oper : Error<
3786 "object of type %0 cannot be %select{constructed|copied|moved|assigned|"
3787 "assigned|destroyed}1 because its %sub{select_special_member_kind}1 is implicitly deleted">;
3788 def err_ovl_no_viable_subscript :
3789 Error<"no viable overloaded operator[] for type %0">;
3790 def err_ovl_no_oper :
3791 Error<"type %0 does not provide a %select{subscript|call}1 operator">;
3792 def err_ovl_unresolvable : Error<
3793 "reference to %select{overloaded|multiversioned}1 function could not be "
3794 "resolved; did you mean to call it%select{| with no arguments}0?">;
3795 def err_bound_member_function : Error<
3796 "reference to non-static member function must be called"
3797 "%select{|; did you mean to call it with no arguments?}0">;
3798 def note_possible_target_of_call : Note<"possible target for call">;
3800 def err_ovl_no_viable_object_call : Error<
3801 "no matching function for call to object of type %0">;
3802 def err_ovl_ambiguous_object_call : Error<
3803 "call to object of type %0 is ambiguous">;
3804 def err_ovl_deleted_object_call : Error<
3805 "call to %select{unavailable|deleted}0 function call operator in type %1%2">;
3806 def note_ovl_surrogate_cand : Note<"conversion candidate of type %0">;
3807 def err_member_call_without_object : Error<
3808 "call to non-static member function without an object argument">;
3810 // C++ Address of Overloaded Function
3811 def err_addr_ovl_no_viable : Error<
3812 "address of overloaded function %0 does not match required type %1">;
3813 def err_addr_ovl_ambiguous : Error<
3814 "address of overloaded function %0 is ambiguous">;
3815 def err_addr_ovl_not_func_ptrref : Error<
3816 "address of overloaded function %0 cannot be converted to type %1">;
3817 def err_addr_ovl_no_qualifier : Error<
3818 "cannot form member pointer of type %0 without '&' and class name">;
3820 // C++11 Literal Operators
3821 def err_ovl_no_viable_literal_operator : Error<
3822 "no matching literal operator for call to %0"
3823 "%select{| with argument of type %2| with arguments of types %2 and %3}1"
3824 "%select{| or 'const char *'}4"
3825 "%select{|, and no matching literal operator template}5">;
3827 // C++ Template Declarations
3828 def err_template_param_shadow : Error<
3829 "declaration of %0 shadows template parameter">;
3830 def note_template_param_here : Note<"template parameter is declared here">;
3831 def warn_template_export_unsupported : Warning<
3832 "exported templates are unsupported">;
3833 def err_template_outside_namespace_or_class_scope : Error<
3834 "templates can only be declared in namespace or class scope">;
3835 def err_template_inside_local_class : Error<
3836 "templates cannot be declared inside of a local class">;
3837 def err_template_linkage : Error<"templates must have C++ linkage">;
3838 def err_template_typedef : Error<"a typedef cannot be a template">;
3839 def err_template_unnamed_class : Error<
3840 "cannot declare a class template with no name">;
3841 def err_template_param_list_different_arity : Error<
3842 "%select{too few|too many}0 template parameters in template "
3843 "%select{|template parameter }1redeclaration">;
3844 def note_template_param_list_different_arity : Note<
3845 "%select{too few|too many}0 template parameters in template template "
3847 def note_template_prev_declaration : Note<
3848 "previous template %select{declaration|template parameter}0 is here">;
3849 def err_template_param_different_kind : Error<
3850 "template parameter has a different kind in template "
3851 "%select{|template parameter }0redeclaration">;
3852 def note_template_param_different_kind : Note<
3853 "template parameter has a different kind in template argument">;
3855 def err_invalid_decl_specifier_in_nontype_parm : Error<
3856 "invalid declaration specifier in template non-type parameter">;
3858 def err_template_nontype_parm_different_type : Error<
3859 "template non-type parameter has a different type %0 in template "
3860 "%select{|template parameter }1redeclaration">;
3862 def note_template_nontype_parm_different_type : Note<
3863 "template non-type parameter has a different type %0 in template argument">;
3864 def note_template_nontype_parm_prev_declaration : Note<
3865 "previous non-type template parameter with type %0 is here">;
3866 def err_template_nontype_parm_bad_type : Error<
3867 "a non-type template parameter cannot have type %0">;
3868 def warn_cxx14_compat_template_nontype_parm_auto_type : Warning<
3869 "non-type template parameters declared with %0 are incompatible with C++ "
3870 "standards before C++17">,
3871 DefaultIgnore, InGroup<CXXPre17Compat>;
3872 def err_template_param_default_arg_redefinition : Error<
3873 "template parameter redefines default argument">;
3874 def note_template_param_prev_default_arg : Note<
3875 "previous default template argument defined here">;
3876 def err_template_param_default_arg_missing : Error<
3877 "template parameter missing a default argument">;
3878 def ext_template_parameter_default_in_function_template : ExtWarn<
3879 "default template arguments for a function template are a C++11 extension">,
3881 def warn_cxx98_compat_template_parameter_default_in_function_template : Warning<
3882 "default template arguments for a function template are incompatible with C++98">,
3883 InGroup<CXX98Compat>, DefaultIgnore;
3884 def err_template_parameter_default_template_member : Error<
3885 "cannot add a default template argument to the definition of a member of a "
3887 def err_template_parameter_default_friend_template : Error<
3888 "default template argument not permitted on a friend template">;
3889 def err_template_template_parm_no_parms : Error<
3890 "template template parameter must have its own template parameters">;
3892 def ext_variable_template : ExtWarn<"variable templates are a C++14 extension">,
3894 def warn_cxx11_compat_variable_template : Warning<
3895 "variable templates are incompatible with C++ standards before C++14">,
3896 InGroup<CXXPre14Compat>, DefaultIgnore;
3897 def err_template_variable_noparams : Error<
3898 "extraneous 'template<>' in declaration of variable %0">;
3899 def err_template_member : Error<"member %0 declared as a template">;
3900 def err_template_member_noparams : Error<
3901 "extraneous 'template<>' in declaration of member %0">;
3902 def err_template_tag_noparams : Error<
3903 "extraneous 'template<>' in declaration of %0 %1">;
3905 // C++ Template Argument Lists
3906 def err_template_missing_args : Error<
3908 "%select{class template|function template|variable template|alias template|"
3909 "template template parameter|template}0 %1 requires template arguments">;
3910 def err_template_arg_list_different_arity : Error<
3911 "%select{too few|too many}0 template arguments for "
3912 "%select{class template|function template|variable template|alias template|"
3913 "template template parameter|template}1 %2">;
3914 def note_template_decl_here : Note<"template is declared here">;
3915 def err_template_arg_must_be_type : Error<
3916 "template argument for template type parameter must be a type">;
3917 def err_template_arg_must_be_type_suggest : Error<
3918 "template argument for template type parameter must be a type; "
3919 "did you forget 'typename'?">;
3920 def ext_ms_template_type_arg_missing_typename : ExtWarn<
3921 "template argument for template type parameter must be a type; "
3922 "omitted 'typename' is a Microsoft extension">,
3923 InGroup<MicrosoftTemplate>;
3924 def err_template_arg_must_be_expr : Error<
3925 "template argument for non-type template parameter must be an expression">;
3926 def err_template_arg_nontype_ambig : Error<
3927 "template argument for non-type template parameter is treated as function type %0">;
3928 def err_template_arg_must_be_template : Error<
3929 "template argument for template template parameter must be a class template%select{| or type alias template}0">;
3930 def ext_template_arg_local_type : ExtWarn<
3931 "template argument uses local type %0">, InGroup<LocalTypeTemplateArgs>;
3932 def ext_template_arg_unnamed_type : ExtWarn<
3933 "template argument uses unnamed type">, InGroup<UnnamedTypeTemplateArgs>;
3934 def warn_cxx98_compat_template_arg_local_type : Warning<
3935 "local type %0 as template argument is incompatible with C++98">,
3936 InGroup<CXX98CompatLocalTypeTemplateArgs>, DefaultIgnore;
3937 def warn_cxx98_compat_template_arg_unnamed_type : Warning<
3938 "unnamed type as template argument is incompatible with C++98">,
3939 InGroup<CXX98CompatUnnamedTypeTemplateArgs>, DefaultIgnore;
3940 def note_template_unnamed_type_here : Note<
3941 "unnamed type used in template argument was declared here">;
3942 def err_template_arg_overload_type : Error<
3943 "template argument is the type of an unresolved overloaded function">;
3944 def err_template_arg_not_valid_template : Error<
3945 "template argument does not refer to a class or alias template, or template "
3946 "template parameter">;
3947 def note_template_arg_refers_here_func : Note<
3948 "template argument refers to function template %0, here">;
3949 def err_template_arg_template_params_mismatch : Error<
3950 "template template argument has different template parameters than its "
3951 "corresponding template template parameter">;
3952 def err_template_arg_not_integral_or_enumeral : Error<
3953 "non-type template argument of type %0 must have an integral or enumeration"
3955 def err_template_arg_not_ice : Error<
3956 "non-type template argument of type %0 is not an integral constant "
3958 def err_template_arg_not_address_constant : Error<
3959 "non-type template argument of type %0 is not a constant expression">;
3960 def warn_cxx98_compat_template_arg_null : Warning<
3961 "use of null pointer as non-type template argument is incompatible with "
3962 "C++98">, InGroup<CXX98Compat>, DefaultIgnore;
3963 def err_template_arg_untyped_null_constant : Error<
3964 "null non-type template argument must be cast to template parameter type %0">;
3965 def err_template_arg_wrongtype_null_constant : Error<
3966 "null non-type template argument of type %0 does not match template parameter "
3968 def err_non_type_template_parm_type_deduction_failure : Error<
3969 "non-type template parameter %0 with type %1 has incompatible initializer of type %2">;
3970 def err_deduced_non_type_template_arg_type_mismatch : Error<
3971 "deduced non-type template argument does not have the same type as the "
3972 "corresponding template parameter%diff{ ($ vs $)|}0,1">;
3973 def err_non_type_template_arg_subobject : Error<
3974 "non-type template argument refers to subobject '%0'">;
3975 def err_non_type_template_arg_addr_label_diff : Error<
3976 "template argument / label address difference / what did you expect?">;
3977 def err_template_arg_not_convertible : Error<
3978 "non-type template argument of type %0 cannot be converted to a value "
3980 def warn_template_arg_negative : Warning<
3981 "non-type template argument with value '%0' converted to '%1' for unsigned "
3982 "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
3983 def warn_template_arg_too_large : Warning<
3984 "non-type template argument value '%0' truncated to '%1' for "
3985 "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
3986 def err_template_arg_no_ref_bind : Error<
3987 "non-type template parameter of reference type "
3988 "%diff{$ cannot bind to template argument of type $"
3989 "|cannot bind to template of incompatible argument type}0,1">;
3990 def err_template_arg_ref_bind_ignores_quals : Error<
3991 "reference binding of non-type template parameter "
3992 "%diff{of type $ to template argument of type $|to template argument}0,1 "
3993 "ignores qualifiers">;
3994 def err_template_arg_not_decl_ref : Error<
3995 "non-type template argument does not refer to any declaration">;
3996 def err_template_arg_not_address_of : Error<
3997 "non-type template argument for template parameter of pointer type %0 must "
3998 "have its address taken">;
3999 def err_template_arg_address_of_non_pointer : Error<
4000 "address taken in non-type template argument for template parameter of "
4001 "reference type %0">;
4002 def err_template_arg_reference_var : Error<
4003 "non-type template argument of reference type %0 is not an object">;
4004 def err_template_arg_field : Error<
4005 "non-type template argument refers to non-static data member %0">;
4006 def err_template_arg_method : Error<
4007 "non-type template argument refers to non-static member function %0">;
4008 def err_template_arg_object_no_linkage : Error<
4009 "non-type template argument refers to %select{function|object}0 %1 that "
4010 "does not have linkage">;
4011 def warn_cxx98_compat_template_arg_object_internal : Warning<
4012 "non-type template argument referring to %select{function|object}0 %1 with "
4013 "internal linkage is incompatible with C++98">,
4014 InGroup<CXX98Compat>, DefaultIgnore;
4015 def ext_template_arg_object_internal : ExtWarn<
4016 "non-type template argument referring to %select{function|object}0 %1 with "
4017 "internal linkage is a C++11 extension">, InGroup<CXX11>;
4018 def err_template_arg_thread_local : Error<
4019 "non-type template argument refers to thread-local object">;
4020 def note_template_arg_internal_object : Note<
4021 "non-type template argument refers to %select{function|object}0 here">;
4022 def note_template_arg_refers_here : Note<
4023 "non-type template argument refers here">;
4024 def err_template_arg_not_object_or_func : Error<
4025 "non-type template argument does not refer to an object or function">;
4026 def err_template_arg_not_pointer_to_member_form : Error<
4027 "non-type template argument is not a pointer to member constant">;
4028 def err_template_arg_member_ptr_base_derived_not_supported : Error<
4029 "sorry, non-type template argument of pointer-to-member type %1 that refers "
4030 "to member %q0 of a different class is not supported yet">;
4031 def ext_template_arg_extra_parens : ExtWarn<
4032 "address non-type template argument cannot be surrounded by parentheses">;
4033 def warn_cxx98_compat_template_arg_extra_parens : Warning<
4034 "redundant parentheses surrounding address non-type template argument are "
4035 "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
4036 def err_pointer_to_member_type : Error<
4037 "invalid use of pointer to member type after %select{.*|->*}0">;
4038 def err_pointer_to_member_call_drops_quals : Error<
4039 "call to pointer to member function of type %0 drops '%1' qualifier%s2">;
4040 def err_pointer_to_member_oper_value_classify: Error<
4041 "pointer-to-member function type %0 can only be called on an "
4042 "%select{rvalue|lvalue}1">;
4043 def ext_pointer_to_const_ref_member_on_rvalue : Extension<
4044 "invoking a pointer to a 'const &' member function on an rvalue is a C++2a extension">,
4045 InGroup<CXX2a>, SFINAEFailure;
4046 def warn_cxx17_compat_pointer_to_const_ref_member_on_rvalue : Warning<
4047 "invoking a pointer to a 'const &' member function on an rvalue is "
4048 "incompatible with C++ standards before C++2a">,
4049 InGroup<CXXPre2aCompatPedantic>, DefaultIgnore;
4050 def ext_ms_deref_template_argument: ExtWarn<
4051 "non-type template argument containing a dereference operation is a "
4052 "Microsoft extension">, InGroup<MicrosoftTemplate>;
4053 def ext_ms_delayed_template_argument: ExtWarn<
4054 "using the undeclared type %0 as a default template argument is a "
4055 "Microsoft extension">, InGroup<MicrosoftTemplate>;
4056 def err_template_arg_deduced_incomplete_pack : Error<
4057 "deduced incomplete pack %0 for template parameter %1">;
4059 // C++ template specialization
4060 def err_template_spec_unknown_kind : Error<
4061 "can only provide an explicit specialization for a class template, function "
4062 "template, variable template, or a member function, static data member, "
4063 "%select{or member class|member class, or member enumeration}0 of a "
4065 def note_specialized_entity : Note<
4066 "explicitly specialized declaration is here">;
4067 def note_explicit_specialization_declared_here : Note<
4068 "explicit specialization declared here">;
4069 def err_template_spec_decl_function_scope : Error<
4070 "explicit specialization of %0 in function scope">;
4071 def err_template_spec_decl_friend : Error<
4072 "cannot declare an explicit specialization in a friend">;
4073 def err_template_spec_redecl_out_of_scope : Error<
4074 "%select{class template|class template partial|variable template|"
4075 "variable template partial|function template|member "
4076 "function|static data member|member class|member enumeration}0 "
4077 "specialization of %1 not in %select{a namespace enclosing %2|"
4078 "class %2 or an enclosing namespace}3">;
4079 def ext_ms_template_spec_redecl_out_of_scope: ExtWarn<
4080 "%select{class template|class template partial|variable template|"
4081 "variable template partial|function template|member "
4082 "function|static data member|member class|member enumeration}0 "
4083 "specialization of %1 not in %select{a namespace enclosing %2|"
4084 "class %2 or an enclosing namespace}3 "
4085 "is a Microsoft extension">, InGroup<MicrosoftTemplate>;
4086 def err_template_spec_redecl_global_scope : Error<
4087 "%select{class template|class template partial|variable template|"
4088 "variable template partial|function template|member "
4089 "function|static data member|member class|member enumeration}0 "
4090 "specialization of %1 must occur at global scope">;
4091 def err_spec_member_not_instantiated : Error<
4092 "specialization of member %q0 does not specialize an instantiated member">;
4093 def note_specialized_decl : Note<"attempt to specialize declaration here">;
4094 def err_specialization_after_instantiation : Error<
4095 "explicit specialization of %0 after instantiation">;
4096 def note_instantiation_required_here : Note<
4097 "%select{implicit|explicit}0 instantiation first required here">;
4098 def err_template_spec_friend : Error<
4099 "template specialization declaration cannot be a friend">;
4100 def err_template_spec_default_arg : Error<
4101 "default argument not permitted on an explicit "
4102 "%select{instantiation|specialization}0 of function %1">;
4103 def err_not_class_template_specialization : Error<
4104 "cannot specialize a %select{dependent template|template template "
4106 def ext_explicit_specialization_storage_class : ExtWarn<
4107 "explicit specialization cannot have a storage class">;
4108 def err_explicit_specialization_inconsistent_storage_class : Error<
4109 "explicit specialization has extraneous, inconsistent storage class "
4110 "'%select{none|extern|static|__private_extern__|auto|register}0'">;
4111 def err_dependent_function_template_spec_no_match : Error<
4112 "no candidate function template was found for dependent"
4113 " friend function template specialization">;
4114 def note_dependent_function_template_spec_discard_reason : Note<
4115 "candidate ignored: %select{not a function template"
4116 "|not a member of the enclosing namespace;"
4117 " did you mean to explicitly qualify the specialization?}0">;
4119 // C++ class template specializations and out-of-line definitions
4120 def err_template_spec_needs_header : Error<
4121 "template specialization requires 'template<>'">;
4122 def err_template_spec_needs_template_parameters : Error<
4123 "template specialization or definition requires a template parameter list "
4124 "corresponding to the nested type %0">;
4125 def err_template_param_list_matches_nontemplate : Error<
4126 "template parameter list matching the non-templated nested type %0 should "
4127 "be empty ('template<>')">;
4128 def err_alias_template_extra_headers : Error<
4129 "extraneous template parameter list in alias template declaration">;
4130 def err_template_spec_extra_headers : Error<
4131 "extraneous template parameter list in template specialization or "
4132 "out-of-line template definition">;
4133 def warn_template_spec_extra_headers : Warning<
4134 "extraneous template parameter list in template specialization">;
4135 def note_explicit_template_spec_does_not_need_header : Note<
4136 "'template<>' header not required for explicitly-specialized class %0 "
4138 def err_template_qualified_declarator_no_match : Error<
4139 "nested name specifier '%0' for declaration does not refer into a class, "
4140 "class template or class template partial specialization">;
4141 def err_specialize_member_of_template : Error<
4142 "cannot specialize %select{|(with 'template<>') }0a member of an "
4143 "unspecialized template">;
4145 // C++ Class Template Partial Specialization
4146 def err_default_arg_in_partial_spec : Error<
4147 "default template argument in a class template partial specialization">;
4148 def err_dependent_non_type_arg_in_partial_spec : Error<
4149 "type of specialized non-type template argument depends on a template "
4150 "parameter of the partial specialization">;
4151 def note_dependent_non_type_default_arg_in_partial_spec : Note<
4152 "template parameter is used in default argument declared here">;
4153 def err_dependent_typed_non_type_arg_in_partial_spec : Error<
4154 "non-type template argument specializes a template parameter with "
4155 "dependent type %0">;
4156 def err_partial_spec_args_match_primary_template : Error<
4157 "%select{class|variable}0 template partial specialization does not "
4158 "specialize any template argument; to %select{declare|define}1 the "
4159 "primary template, remove the template argument list">;
4160 def ext_partial_spec_not_more_specialized_than_primary : ExtWarn<
4161 "%select{class|variable}0 template partial specialization is not "
4162 "more specialized than the primary template">, DefaultError,
4163 InGroup<DiagGroup<"invalid-partial-specialization">>;
4164 def note_partial_spec_not_more_specialized_than_primary : Note<"%0">;
4165 def ext_partial_specs_not_deducible : ExtWarn<
4166 "%select{class|variable}0 template partial specialization contains "
4167 "%select{a template parameter|template parameters}1 that cannot be "
4168 "deduced; this partial specialization will never be used">,
4169 DefaultError, InGroup<DiagGroup<"unusable-partial-specialization">>;
4170 def note_non_deducible_parameter : Note<
4171 "non-deducible template parameter %0">;
4172 def err_partial_spec_ordering_ambiguous : Error<
4173 "ambiguous partial specializations of %0">;
4174 def note_partial_spec_match : Note<"partial specialization matches %0">;
4175 def err_partial_spec_redeclared : Error<
4176 "class template partial specialization %0 cannot be redeclared">;
4177 def note_partial_specialization_declared_here : Note<
4178 "explicit specialization declared here">;
4179 def note_prev_partial_spec_here : Note<
4180 "previous declaration of class template partial specialization %0 is here">;
4181 def err_partial_spec_fully_specialized : Error<
4182 "partial specialization of %0 does not use any of its template parameters">;
4184 // C++ Variable Template Partial Specialization
4185 def err_var_partial_spec_redeclared : Error<
4186 "variable template partial specialization %0 cannot be redefined">;
4187 def note_var_prev_partial_spec_here : Note<
4188 "previous declaration of variable template partial specialization is here">;
4189 def err_var_spec_no_template : Error<
4190 "no variable template matches%select{| partial}0 specialization">;
4191 def err_var_spec_no_template_but_method : Error<
4192 "no variable template matches specialization; "
4193 "did you mean to use %0 as function template instead?">;
4195 // C++ Function template specializations
4196 def err_function_template_spec_no_match : Error<
4197 "no function template matches function template specialization %0">;
4198 def err_function_template_spec_ambiguous : Error<
4199 "function template specialization %0 ambiguously refers to more than one "
4200 "function template; explicitly specify%select{| additional}1 template "
4201 "arguments to identify a particular function template">;
4202 def note_function_template_spec_matched : Note<
4203 "function template %q0 matches specialization %1">;
4204 def err_function_template_partial_spec : Error<
4205 "function template partial specialization is not allowed">;
4207 // C++ Template Instantiation
4208 def err_template_recursion_depth_exceeded : Error<
4209 "recursive template instantiation exceeded maximum depth of %0">,
4210 DefaultFatal, NoSFINAE;
4211 def note_template_recursion_depth : Note<
4212 "use -ftemplate-depth=N to increase recursive template instantiation depth">;
4214 def err_template_instantiate_within_definition : Error<
4215 "%select{implicit|explicit}0 instantiation of template %1 within its"
4217 def err_template_instantiate_undefined : Error<
4218 "%select{implicit|explicit}0 instantiation of undefined template %1">;
4219 def err_implicit_instantiate_member_undefined : Error<
4220 "implicit instantiation of undefined member %0">;
4221 def note_template_class_instantiation_was_here : Note<
4222 "class template %0 was instantiated here">;
4223 def note_template_class_explicit_specialization_was_here : Note<
4224 "class template %0 was explicitly specialized here">;
4225 def note_template_class_instantiation_here : Note<
4226 "in instantiation of template class %q0 requested here">;
4227 def note_template_member_class_here : Note<
4228 "in instantiation of member class %q0 requested here">;
4229 def note_template_member_function_here : Note<
4230 "in instantiation of member function %q0 requested here">;
4231 def note_function_template_spec_here : Note<
4232 "in instantiation of function template specialization %q0 requested here">;
4233 def note_template_static_data_member_def_here : Note<
4234 "in instantiation of static data member %q0 requested here">;
4235 def note_template_variable_def_here : Note<
4236 "in instantiation of variable template specialization %q0 requested here">;
4237 def note_template_enum_def_here : Note<
4238 "in instantiation of enumeration %q0 requested here">;
4239 def note_template_nsdmi_here : Note<
4240 "in instantiation of default member initializer %q0 requested here">;
4241 def note_template_type_alias_instantiation_here : Note<
4242 "in instantiation of template type alias %0 requested here">;
4243 def note_template_exception_spec_instantiation_here : Note<
4244 "in instantiation of exception specification for %0 requested here">;
4245 def warn_var_template_missing : Warning<"instantiation of variable %q0 "
4246 "required here, but no definition is available">,
4247 InGroup<UndefinedVarTemplate>;
4248 def warn_func_template_missing : Warning<"instantiation of function %q0 "
4249 "required here, but no definition is available">,
4250 InGroup<UndefinedFuncTemplate>, DefaultIgnore;
4251 def note_forward_template_decl : Note<
4252 "forward declaration of template entity is here">;
4253 def note_inst_declaration_hint : Note<"add an explicit instantiation "
4254 "declaration to suppress this warning if %q0 is explicitly instantiated in "
4255 "another translation unit">;
4257 def note_default_arg_instantiation_here : Note<
4258 "in instantiation of default argument for '%0' required here">;
4259 def note_default_function_arg_instantiation_here : Note<
4260 "in instantiation of default function argument expression "
4261 "for '%0' required here">;
4262 def note_explicit_template_arg_substitution_here : Note<
4263 "while substituting explicitly-specified template arguments into function "
4265 def note_function_template_deduction_instantiation_here : Note<
4266 "while substituting deduced template arguments into function template %0 "
4268 def note_deduced_template_arg_substitution_here : Note<
4269 "during template argument deduction for %select{class|variable}0 template "
4270 "%select{partial specialization |}1%2 %3">;
4271 def note_prior_template_arg_substitution : Note<
4272 "while substituting prior template arguments into %select{non-type|template}0"
4273 " template parameter%1 %2">;
4274 def note_template_default_arg_checking : Note<
4275 "while checking a default template argument used here">;
4276 def note_instantiation_contexts_suppressed : Note<
4277 "(skipping %0 context%s0 in backtrace; use -ftemplate-backtrace-limit=0 to "
4280 def err_field_instantiates_to_function : Error<
4281 "data member instantiated with function type %0">;
4282 def err_variable_instantiates_to_function : Error<
4283 "%select{variable|static data member}0 instantiated with function type %1">;
4284 def err_nested_name_spec_non_tag : Error<
4285 "type %0 cannot be used prior to '::' because it has no members">;
4287 def err_using_pack_expansion_empty : Error<
4288 "%select{|member}0 using declaration %1 instantiates to an empty pack">;
4290 // C++ Explicit Instantiation
4291 def err_explicit_instantiation_duplicate : Error<
4292 "duplicate explicit instantiation of %0">;
4293 def ext_explicit_instantiation_duplicate : ExtWarn<
4294 "duplicate explicit instantiation of %0 ignored as a Microsoft extension">,
4295 InGroup<MicrosoftTemplate>;
4296 def note_previous_explicit_instantiation : Note<
4297 "previous explicit instantiation is here">;
4298 def warn_explicit_instantiation_after_specialization : Warning<
4299 "explicit instantiation of %0 that occurs after an explicit "
4300 "specialization has no effect">,
4301 InGroup<DiagGroup<"instantiation-after-specialization">>;
4302 def note_previous_template_specialization : Note<
4303 "previous template specialization is here">;
4304 def err_explicit_instantiation_nontemplate_type : Error<
4305 "explicit instantiation of non-templated type %0">;
4306 def note_nontemplate_decl_here : Note<
4307 "non-templated declaration is here">;
4308 def err_explicit_instantiation_in_class : Error<
4309 "explicit instantiation of %0 in class scope">;
4310 def err_explicit_instantiation_out_of_scope : Error<
4311 "explicit instantiation of %0 not in a namespace enclosing %1">;
4312 def err_explicit_instantiation_must_be_global : Error<
4313 "explicit instantiation of %0 must occur at global scope">;
4314 def warn_explicit_instantiation_out_of_scope_0x : Warning<
4315 "explicit instantiation of %0 not in a namespace enclosing %1">,
4316 InGroup<CXX11Compat>, DefaultIgnore;
4317 def warn_explicit_instantiation_must_be_global_0x : Warning<
4318 "explicit instantiation of %0 must occur at global scope">,
4319 InGroup<CXX11Compat>, DefaultIgnore;
4321 def err_explicit_instantiation_requires_name : Error<
4322 "explicit instantiation declaration requires a name">;
4323 def err_explicit_instantiation_of_typedef : Error<
4324 "explicit instantiation of typedef %0">;
4325 def err_explicit_instantiation_storage_class : Error<
4326 "explicit instantiation cannot have a storage class">;
4327 def err_explicit_instantiation_not_known : Error<
4328 "explicit instantiation of %0 does not refer to a function template, "
4329 "variable template, member function, member class, or static data member">;
4330 def note_explicit_instantiation_here : Note<
4331 "explicit instantiation refers here">;
4332 def err_explicit_instantiation_data_member_not_instantiated : Error<
4333 "explicit instantiation refers to static data member %q0 that is not an "
4335 def err_explicit_instantiation_member_function_not_instantiated : Error<
4336 "explicit instantiation refers to member function %q0 that is not an "
4338 def err_explicit_instantiation_ambiguous : Error<
4339 "partial ordering for explicit instantiation of %0 is ambiguous">;
4340 def note_explicit_instantiation_candidate : Note<
4341 "explicit instantiation candidate function %q0 template here %1">;
4342 def err_explicit_instantiation_inline : Error<
4343 "explicit instantiation cannot be 'inline'">;
4344 def warn_explicit_instantiation_inline_0x : Warning<
4345 "explicit instantiation cannot be 'inline'">, InGroup<CXX11Compat>,
4347 def err_explicit_instantiation_constexpr : Error<
4348 "explicit instantiation cannot be 'constexpr'">;
4349 def ext_explicit_instantiation_without_qualified_id : Extension<
4350 "qualifier in explicit instantiation of %q0 requires a template-id "
4351 "(a typedef is not permitted)">;
4352 def err_explicit_instantiation_without_template_id : Error<
4353 "explicit instantiation of %q0 must specify a template argument list">;
4354 def err_explicit_instantiation_unqualified_wrong_namespace : Error<
4355 "explicit instantiation of %q0 must occur in namespace %1">;
4356 def warn_explicit_instantiation_unqualified_wrong_namespace_0x : Warning<
4357 "explicit instantiation of %q0 must occur in namespace %1">,
4358 InGroup<CXX11Compat>, DefaultIgnore;
4359 def err_explicit_instantiation_undefined_member : Error<
4360 "explicit instantiation of undefined %select{member class|member function|"
4361 "static data member}0 %1 of class template %2">;
4362 def err_explicit_instantiation_undefined_func_template : Error<
4363 "explicit instantiation of undefined function template %0">;
4364 def err_explicit_instantiation_undefined_var_template : Error<
4365 "explicit instantiation of undefined variable template %q0">;
4366 def err_explicit_instantiation_declaration_after_definition : Error<
4367 "explicit instantiation declaration (with 'extern') follows explicit "
4368 "instantiation definition (without 'extern')">;
4369 def note_explicit_instantiation_definition_here : Note<
4370 "explicit instantiation definition is here">;
4371 def err_invalid_var_template_spec_type : Error<"type %2 "
4372 "of %select{explicit instantiation|explicit specialization|"
4373 "partial specialization|redeclaration}0 of %1 does not match"
4374 " expected type %3">;
4375 def err_mismatched_exception_spec_explicit_instantiation : Error<
4376 "exception specification in explicit instantiation does not match "
4377 "instantiated one">;
4378 def ext_mismatched_exception_spec_explicit_instantiation : ExtWarn<
4379 err_mismatched_exception_spec_explicit_instantiation.Text>,
4380 InGroup<MicrosoftExceptionSpec>;
4382 // C++ typename-specifiers
4383 def err_typename_nested_not_found : Error<"no type named %0 in %1">;
4384 def err_typename_nested_not_found_enable_if : Error<
4385 "no type named 'type' in %0; 'enable_if' cannot be used to disable "
4386 "this declaration">;
4387 def err_typename_nested_not_found_requirement : Error<
4388 "failed requirement '%0'; 'enable_if' cannot be used to disable this "
4390 def err_typename_nested_not_type : Error<
4391 "typename specifier refers to non-type member %0 in %1">;
4392 def note_typename_refers_here : Note<
4393 "referenced member %0 is declared here">;
4394 def err_typename_missing : Error<
4395 "missing 'typename' prior to dependent type name '%0%1'">;
4396 def err_typename_missing_template : Error<
4397 "missing 'typename' prior to dependent type template name '%0%1'">;
4398 def ext_typename_missing : ExtWarn<
4399 "missing 'typename' prior to dependent type name '%0%1'">,
4400 InGroup<DiagGroup<"typename-missing">>;
4401 def ext_typename_outside_of_template : ExtWarn<
4402 "'typename' occurs outside of a template">, InGroup<CXX11>;
4403 def warn_cxx98_compat_typename_outside_of_template : Warning<
4404 "use of 'typename' outside of a template is incompatible with C++98">,
4405 InGroup<CXX98Compat>, DefaultIgnore;
4406 def err_typename_refers_to_using_value_decl : Error<
4407 "typename specifier refers to a dependent using declaration for a value "
4409 def note_using_value_decl_missing_typename : Note<
4410 "add 'typename' to treat this using declaration as a type">;
4412 def err_template_kw_refers_to_non_template : Error<
4413 "%0 following the 'template' keyword does not refer to a template">;
4414 def note_template_kw_refers_to_non_template : Note<
4415 "declared as a non-template here">;
4416 def err_template_kw_refers_to_class_template : Error<
4417 "'%0%1' instantiated to a class template, not a function template">;
4418 def note_referenced_class_template : Note<
4419 "class template declared here">;
4420 def err_template_kw_missing : Error<
4421 "missing 'template' keyword prior to dependent template name '%0%1'">;
4422 def ext_template_outside_of_template : ExtWarn<
4423 "'template' keyword outside of a template">, InGroup<CXX11>;
4424 def warn_cxx98_compat_template_outside_of_template : Warning<
4425 "use of 'template' keyword outside of a template is incompatible with C++98">,
4426 InGroup<CXX98Compat>, DefaultIgnore;
4428 def err_non_type_template_in_nested_name_specifier : Error<
4429 "qualified name refers into a specialization of %select{function|variable}0 "
4431 def err_template_id_not_a_type : Error<
4432 "template name refers to non-type template %0">;
4433 def note_template_declared_here : Note<
4434 "%select{function template|class template|variable template"
4435 "|type alias template|template template parameter}0 "
4436 "%1 declared here">;
4437 def err_alias_template_expansion_into_fixed_list : Error<
4438 "pack expansion used as argument for non-pack parameter of alias template">;
4439 def note_parameter_type : Note<
4440 "parameter of type %0 is declared here">;
4442 // C++11 Variadic Templates
4443 def err_template_param_pack_default_arg : Error<
4444 "template parameter pack cannot have a default argument">;
4445 def err_template_param_pack_must_be_last_template_parameter : Error<
4446 "template parameter pack must be the last template parameter">;
4448 def err_template_parameter_pack_non_pack : Error<
4449 "%select{template type|non-type template|template template}0 parameter"
4450 "%select{| pack}1 conflicts with previous %select{template type|"
4451 "non-type template|template template}0 parameter%select{ pack|}1">;
4452 def note_template_parameter_pack_non_pack : Note<
4453 "%select{template type|non-type template|template template}0 parameter"
4454 "%select{| pack}1 does not match %select{template type|non-type template"
4455 "|template template}0 parameter%select{ pack|}1 in template argument">;
4456 def note_template_parameter_pack_here : Note<
4457 "previous %select{template type|non-type template|template template}0 "
4458 "parameter%select{| pack}1 declared here">;
4460 def err_unexpanded_parameter_pack : Error<
4461 "%select{expression|base type|declaration type|data member type|bit-field "
4462 "size|static assertion|fixed underlying type|enumerator value|"
4463 "using declaration|friend declaration|qualifier|initializer|default argument|"
4464 "non-type template parameter type|exception type|partial specialization|"
4465 "__if_exists name|__if_not_exists name|lambda|block}0 contains"
4466 "%plural{0: an|:}1 unexpanded parameter pack"
4467 "%plural{0:|1: %2|2:s %2 and %3|:s %2, %3, ...}1">;
4469 def err_pack_expansion_without_parameter_packs : Error<
4470 "pack expansion does not contain any unexpanded parameter packs">;
4471 def err_pack_expansion_length_conflict : Error<
4472 "pack expansion contains parameter packs %0 and %1 that have different "
4473 "lengths (%2 vs. %3)">;
4474 def err_pack_expansion_length_conflict_multilevel : Error<
4475 "pack expansion contains parameter pack %0 that has a different "
4476 "length (%1 vs. %2) from outer parameter packs">;
4477 def err_pack_expansion_length_conflict_partial : Error<
4478 "pack expansion contains parameter pack %0 that has a different "
4479 "length (at least %1 vs. %2) from outer parameter packs">;
4480 def err_pack_expansion_member_init : Error<
4481 "pack expansion for initialization of member %0">;
4483 def err_function_parameter_pack_without_parameter_packs : Error<
4484 "type %0 of function parameter pack does not contain any unexpanded "
4486 def err_ellipsis_in_declarator_not_parameter : Error<
4487 "only function and template parameters can be parameter packs">;
4489 def err_sizeof_pack_no_pack_name : Error<
4490 "%0 does not refer to the name of a parameter pack">;
4492 def err_fold_expression_packs_both_sides : Error<
4493 "binary fold expression has unexpanded parameter packs in both operands">;
4494 def err_fold_expression_empty : Error<
4495 "unary fold expression has empty expansion for operator '%0' "
4496 "with no fallback value">;
4497 def err_fold_expression_bad_operand : Error<
4498 "expression not permitted as operand of fold expression">;
4500 def err_unexpected_typedef : Error<
4501 "unexpected type name %0: expected expression">;
4502 def err_unexpected_namespace : Error<
4503 "unexpected namespace name %0: expected expression">;
4504 def err_undeclared_var_use : Error<"use of undeclared identifier %0">;
4505 def ext_undeclared_unqual_id_with_dependent_base : ExtWarn<
4506 "use of undeclared identifier %0; "
4507 "unqualified lookup into dependent bases of class template %1 is a Microsoft extension">,
4508 InGroup<MicrosoftTemplate>;
4509 def ext_found_via_dependent_bases_lookup : ExtWarn<"use of identifier %0 "
4510 "found via unqualified lookup into dependent bases of class templates is a "
4511 "Microsoft extension">, InGroup<MicrosoftTemplate>;
4512 def note_dependent_var_use : Note<"must qualify identifier to find this "
4513 "declaration in dependent base class">;
4514 def err_not_found_by_two_phase_lookup : Error<"call to function %0 that is neither "
4515 "visible in the template definition nor found by argument-dependent lookup">;
4516 def note_not_found_by_two_phase_lookup : Note<"%0 should be declared prior to the "
4517 "call site%select{| or in %2| or in an associated namespace of one of its arguments}1">;
4518 def err_undeclared_use : Error<"use of undeclared %0">;
4519 def warn_deprecated : Warning<"%0 is deprecated">,
4520 InGroup<DeprecatedDeclarations>;
4521 def note_from_diagnose_if : Note<"from 'diagnose_if' attribute on %0:">;
4522 def warn_property_method_deprecated :
4523 Warning<"property access is using %0 method which is deprecated">,
4524 InGroup<DeprecatedDeclarations>;
4525 def warn_deprecated_message : Warning<"%0 is deprecated: %1">,
4526 InGroup<DeprecatedDeclarations>;
4527 def warn_deprecated_anonymous_namespace : Warning<
4528 "'deprecated' attribute on anonymous namespace ignored">,
4529 InGroup<IgnoredAttributes>;
4530 def warn_deprecated_fwdclass_message : Warning<
4531 "%0 may be deprecated because the receiver type is unknown">,
4532 InGroup<DeprecatedDeclarations>;
4533 def warn_deprecated_def : Warning<
4534 "implementing deprecated %select{method|class|category}0">,
4535 InGroup<DeprecatedImplementations>, DefaultIgnore;
4536 def warn_unavailable_def : Warning<
4537 "implementing unavailable method">,
4538 InGroup<DeprecatedImplementations>, DefaultIgnore;
4539 def err_unavailable : Error<"%0 is unavailable">;
4540 def err_property_method_unavailable :
4541 Error<"property access is using %0 method which is unavailable">;
4542 def err_unavailable_message : Error<"%0 is unavailable: %1">;
4543 def warn_unavailable_fwdclass_message : Warning<
4544 "%0 may be unavailable because the receiver type is unknown">,
4545 InGroup<UnavailableDeclarations>;
4546 def note_availability_specified_here : Note<
4547 "%0 has been explicitly marked "
4548 "%select{unavailable|deleted|deprecated|partial}1 here">;
4549 def note_implicitly_deleted : Note<
4550 "explicitly defaulted function was implicitly deleted here">;
4551 def warn_not_enough_argument : Warning<
4552 "not enough variable arguments in %0 declaration to fit a sentinel">,
4554 def warn_missing_sentinel : Warning <
4555 "missing sentinel in %select{function call|method dispatch|block call}0">,
4557 def note_sentinel_here : Note<
4558 "%select{function|method|block}0 has been explicitly marked sentinel here">;
4559 def warn_missing_prototype : Warning<
4560 "no previous prototype for function %0">,
4561 InGroup<DiagGroup<"missing-prototypes">>, DefaultIgnore;
4562 def note_declaration_not_a_prototype : Note<
4563 "this declaration is not a prototype; add 'void' to make it a prototype for a zero-parameter function">;
4564 def warn_strict_prototypes : Warning<
4565 "this %select{function declaration is not|block declaration is not|"
4566 "old-style function definition is not preceded by}0 a prototype">,
4567 InGroup<DiagGroup<"strict-prototypes">>, DefaultIgnore;
4568 def warn_missing_variable_declarations : Warning<
4569 "no previous extern declaration for non-static variable %0">,
4570 InGroup<DiagGroup<"missing-variable-declarations">>, DefaultIgnore;
4571 def err_static_data_member_reinitialization :
4572 Error<"static data member %0 already has an initializer">;
4573 def err_redefinition : Error<"redefinition of %0">;
4574 def err_alias_after_tentative :
4575 Error<"alias definition of %0 after tentative definition">;
4576 def err_alias_is_definition :
4577 Error<"definition %0 cannot also be an %select{alias|ifunc}1">;
4578 def err_definition_of_implicitly_declared_member : Error<
4579 "definition of implicitly declared %select{default constructor|copy "
4580 "constructor|move constructor|copy assignment operator|move assignment "
4581 "operator|destructor|function}1">;
4582 def err_definition_of_explicitly_defaulted_member : Error<
4583 "definition of explicitly defaulted %select{default constructor|copy "
4584 "constructor|move constructor|copy assignment operator|move assignment "
4585 "operator|destructor|function}0">;
4586 def err_redefinition_extern_inline : Error<
4587 "redefinition of a 'extern inline' function %0 is not supported in "
4588 "%select{C99 mode|C++}1">;
4589 def warn_attr_abi_tag_namespace : Warning<
4590 "'abi_tag' attribute on %select{non-inline|anonymous}0 namespace ignored">,
4591 InGroup<IgnoredAttributes>;
4592 def err_abi_tag_on_redeclaration : Error<
4593 "cannot add 'abi_tag' attribute in a redeclaration">;
4594 def err_new_abi_tag_on_redeclaration : Error<
4595 "'abi_tag' %0 missing in original declaration">;
4596 def note_use_ifdef_guards : Note<
4597 "unguarded header; consider using #ifdef guards or #pragma once">;
4599 def note_deleted_dtor_no_operator_delete : Note<
4600 "virtual destructor requires an unambiguous, accessible 'operator delete'">;
4601 def note_deleted_special_member_class_subobject : Note<
4602 "%select{default constructor of|copy constructor of|move constructor of|"
4603 "copy assignment operator of|move assignment operator of|destructor of|"
4604 "constructor inherited by}0 "
4605 "%1 is implicitly deleted because "
4606 "%select{base class %3|%select{||||variant }4field %3}2 has "
4607 "%select{no|a deleted|multiple|an inaccessible|a non-trivial}4 "
4608 "%select{%select{default constructor|copy constructor|move constructor|copy "
4609 "assignment operator|move assignment operator|destructor|"
4610 "%select{default|corresponding|default|default|default}4 constructor}0|"
4613 def note_deleted_default_ctor_uninit_field : Note<
4614 "%select{default constructor of|constructor inherited by}0 "
4615 "%1 is implicitly deleted because field %2 of "
4616 "%select{reference|const-qualified}4 type %3 would not be initialized">;
4617 def note_deleted_default_ctor_all_const : Note<
4618 "%select{default constructor of|constructor inherited by}0 "
4619 "%1 is implicitly deleted because all "
4620 "%select{data members|data members of an anonymous union member}2"
4621 " are const-qualified">;
4622 def note_deleted_copy_ctor_rvalue_reference : Note<
4623 "copy constructor of %0 is implicitly deleted because field %1 is of "
4624 "rvalue reference type %2">;
4625 def note_deleted_copy_user_declared_move : Note<
4626 "copy %select{constructor|assignment operator}0 is implicitly deleted because"
4627 " %1 has a user-declared move %select{constructor|assignment operator}2">;
4628 def note_deleted_assign_field : Note<
4629 "%select{copy|move}0 assignment operator of %1 is implicitly deleted "
4630 "because field %2 is of %select{reference|const-qualified}4 type %3">;
4632 // These should be errors.
4633 def warn_undefined_internal : Warning<
4634 "%select{function|variable}0 %q1 has internal linkage but is not defined">,
4635 InGroup<DiagGroup<"undefined-internal">>;
4636 def err_undefined_internal_type : Error<
4637 "%select{function|variable}0 %q1 is used but not defined in this "
4638 "translation unit, and cannot be defined in any other translation unit "
4639 "because its type does not have linkage">;
4640 def ext_undefined_internal_type : Extension<
4641 "ISO C++ requires a definition in this translation unit for "
4642 "%select{function|variable}0 %q1 because its type does not have linkage">,
4643 InGroup<DiagGroup<"undefined-internal-type">>;
4644 def warn_undefined_inline : Warning<"inline function %q0 is not defined">,
4645 InGroup<DiagGroup<"undefined-inline">>;
4646 def err_undefined_inline_var : Error<"inline variable %q0 is not defined">;
4647 def note_used_here : Note<"used here">;
4649 def err_internal_linkage_redeclaration : Error<
4650 "'internal_linkage' attribute does not appear on the first declaration of %0">;
4651 def warn_internal_linkage_local_storage : Warning<
4652 "'internal_linkage' attribute on a non-static local variable is ignored">,
4653 InGroup<IgnoredAttributes>;
4655 def ext_internal_in_extern_inline : ExtWarn<
4656 "static %select{function|variable}0 %1 is used in an inline function with "
4657 "external linkage">, InGroup<StaticInInline>;
4658 def ext_internal_in_extern_inline_quiet : Extension<
4659 "static %select{function|variable}0 %1 is used in an inline function with "
4660 "external linkage">, InGroup<StaticInInline>;
4661 def warn_static_local_in_extern_inline : Warning<
4662 "non-constant static local variable in inline function may be different "
4663 "in different files">, InGroup<StaticLocalInInline>;
4664 def note_convert_inline_to_static : Note<
4665 "use 'static' to give inline function %0 internal linkage">;
4667 def ext_redefinition_of_typedef : ExtWarn<
4668 "redefinition of typedef %0 is a C11 feature">,
4669 InGroup<DiagGroup<"typedef-redefinition"> >;
4670 def err_redefinition_variably_modified_typedef : Error<
4671 "redefinition of %select{typedef|type alias}0 for variably-modified type %1">;
4673 def err_inline_decl_follows_def : Error<
4674 "inline declaration of %0 follows non-inline definition">;
4675 def err_inline_declaration_block_scope : Error<
4676 "inline declaration of %0 not allowed in block scope">;
4677 def err_static_non_static : Error<
4678 "static declaration of %0 follows non-static declaration">;
4679 def err_different_language_linkage : Error<
4680 "declaration of %0 has a different language linkage">;
4681 def ext_retained_language_linkage : Extension<
4682 "friend function %0 retaining previous language linkage is an extension">,
4683 InGroup<DiagGroup<"retained-language-linkage">>;
4684 def err_extern_c_global_conflict : Error<
4685 "declaration of %1 %select{with C language linkage|in global scope}0 "
4686 "conflicts with declaration %select{in global scope|with C language linkage}0">;
4687 def note_extern_c_global_conflict : Note<
4688 "declared %select{in global scope|with C language linkage}0 here">;
4689 def note_extern_c_begins_here : Note<
4690 "extern \"C\" language linkage specification begins here">;
4691 def warn_weak_import : Warning <
4692 "an already-declared variable is made a weak_import declaration %0">;
4693 def ext_static_non_static : Extension<
4694 "redeclaring non-static %0 as static is a Microsoft extension">,
4695 InGroup<MicrosoftRedeclareStatic>;
4696 def err_non_static_static : Error<
4697 "non-static declaration of %0 follows static declaration">;
4698 def err_extern_non_extern : Error<
4699 "extern declaration of %0 follows non-extern declaration">;
4700 def err_non_extern_extern : Error<
4701 "non-extern declaration of %0 follows extern declaration">;
4702 def err_non_thread_thread : Error<
4703 "non-thread-local declaration of %0 follows thread-local declaration">;
4704 def err_thread_non_thread : Error<
4705 "thread-local declaration of %0 follows non-thread-local declaration">;
4706 def err_thread_thread_different_kind : Error<
4707 "thread-local declaration of %0 with %select{static|dynamic}1 initialization "
4708 "follows declaration with %select{dynamic|static}1 initialization">;
4709 def err_mismatched_owning_module : Error<
4710 "declaration of %0 in %select{the global module|module %2}1 follows "
4711 "declaration in %select{the global module|module %4}3">;
4712 def err_redefinition_different_type : Error<
4713 "redefinition of %0 with a different type%diff{: $ vs $|}1,2">;
4714 def err_redefinition_different_kind : Error<
4715 "redefinition of %0 as different kind of symbol">;
4716 def err_redefinition_different_namespace_alias : Error<
4717 "redefinition of %0 as an alias for a different namespace">;
4718 def note_previous_namespace_alias : Note<
4719 "previously defined as an alias for %0">;
4720 def warn_forward_class_redefinition : Warning<
4721 "redefinition of forward class %0 of a typedef name of an object type is ignored">,
4722 InGroup<DiagGroup<"objc-forward-class-redefinition">>;
4723 def err_redefinition_different_typedef : Error<
4724 "%select{typedef|type alias|type alias template}0 "
4725 "redefinition with different types%diff{ ($ vs $)|}1,2">;
4726 def err_tag_reference_non_tag : Error<
4727 "%select{non-struct type|non-class type|non-union type|non-enum "
4728 "type|typedef|type alias|template|type alias template|template "
4729 "template argument}1 %0 cannot be referenced with a "
4730 "%select{struct|interface|union|class|enum}2 specifier">;
4731 def err_tag_reference_conflict : Error<
4732 "implicit declaration introduced by elaborated type conflicts with a "
4733 "%select{non-struct type|non-class type|non-union type|non-enum "
4734 "type|typedef|type alias|template|type alias template|template "
4735 "template argument}0 of the same name">;
4736 def err_dependent_tag_decl : Error<
4737 "%select{declaration|definition}0 of "
4738 "%select{struct|interface|union|class|enum}1 in a dependent scope">;
4739 def err_tag_definition_of_typedef : Error<
4740 "definition of type %0 conflicts with %select{typedef|type alias}1 of the same name">;
4741 def err_conflicting_types : Error<"conflicting types for %0">;
4742 def err_different_pass_object_size_params : Error<
4743 "conflicting pass_object_size attributes on parameters">;
4744 def err_late_asm_label_name : Error<
4745 "cannot apply asm label to %select{variable|function}0 after its first use">;
4746 def err_different_asm_label : Error<"conflicting asm label">;
4747 def err_nested_redefinition : Error<"nested redefinition of %0">;
4748 def err_use_with_wrong_tag : Error<
4749 "use of %0 with tag type that does not match previous declaration">;
4750 def warn_struct_class_tag_mismatch : Warning<
4751 "%select{struct|interface|class}0%select{| template}1 %2 was previously "
4752 "declared as a %select{struct|interface|class}3%select{| template}1">,
4753 InGroup<MismatchedTags>, DefaultIgnore;
4754 def warn_struct_class_previous_tag_mismatch : Warning<
4755 "%2 defined as %select{a struct|an interface|a class}0%select{| template}1 "
4756 "here but previously declared as "
4757 "%select{a struct|an interface|a class}3%select{| template}1">,
4758 InGroup<MismatchedTags>, DefaultIgnore;
4759 def note_struct_class_suggestion : Note<
4760 "did you mean %select{struct|interface|class}0 here?">;
4761 def ext_forward_ref_enum : Extension<
4762 "ISO C forbids forward references to 'enum' types">;
4763 def err_forward_ref_enum : Error<
4764 "ISO C++ forbids forward references to 'enum' types">;
4765 def ext_ms_forward_ref_enum : ExtWarn<
4766 "forward references to 'enum' types are a Microsoft extension">,
4767 InGroup<MicrosoftEnumForwardReference>;
4768 def ext_forward_ref_enum_def : Extension<
4769 "redeclaration of already-defined enum %0 is a GNU extension">,
4770 InGroup<GNURedeclaredEnum>;
4772 def err_redefinition_of_enumerator : Error<"redefinition of enumerator %0">;
4773 def err_duplicate_member : Error<"duplicate member %0">;
4774 def err_misplaced_ivar : Error<
4775 "instance variables may not be placed in %select{categories|class extension}0">;
4776 def warn_ivars_in_interface : Warning<
4777 "declaration of instance variables in the interface is deprecated">,
4778 InGroup<DiagGroup<"objc-interface-ivars">>, DefaultIgnore;
4779 def ext_enum_value_not_int : Extension<
4780 "ISO C restricts enumerator values to range of 'int' (%0 is too "
4781 "%select{small|large}1)">;
4782 def ext_enum_too_large : ExtWarn<
4783 "enumeration values exceed range of largest integer">, InGroup<EnumTooLarge>;
4784 def ext_enumerator_increment_too_large : ExtWarn<
4785 "incremented enumerator value %0 is not representable in the "
4786 "largest integer type">, InGroup<EnumTooLarge>;
4787 def warn_flag_enum_constant_out_of_range : Warning<
4788 "enumeration value %0 is out of range of flags in enumeration type %1">,
4791 def warn_illegal_constant_array_size : Extension<
4792 "size of static array must be an integer constant expression">;
4793 def err_vm_decl_in_file_scope : Error<
4794 "variably modified type declaration not allowed at file scope">;
4795 def err_vm_decl_has_extern_linkage : Error<
4796 "variably modified type declaration cannot have 'extern' linkage">;
4797 def err_typecheck_field_variable_size : Error<
4798 "fields must have a constant size: 'variable length array in structure' "
4799 "extension will never be supported">;
4800 def err_vm_func_decl : Error<
4801 "function declaration cannot have variably modified type">;
4802 def err_array_too_large : Error<
4803 "array is too large (%0 elements)">;
4805 // -Wpadded, -Wpacked
4806 def warn_padded_struct_field : Warning<
4807 "padding %select{struct|interface|class}0 %1 with %2 "
4808 "%select{byte|bit}3%s2 to align %4">,
4809 InGroup<Padded>, DefaultIgnore;
4810 def warn_padded_struct_anon_field : Warning<
4811 "padding %select{struct|interface|class}0 %1 with %2 "
4812 "%select{byte|bit}3%s2 to align anonymous bit-field">,
4813 InGroup<Padded>, DefaultIgnore;
4814 def warn_padded_struct_size : Warning<
4815 "padding size of %0 with %1 %select{byte|bit}2%s1 to alignment boundary">,
4816 InGroup<Padded>, DefaultIgnore;
4817 def warn_unnecessary_packed : Warning<
4818 "packed attribute is unnecessary for %0">, InGroup<Packed>, DefaultIgnore;
4820 def err_typecheck_negative_array_size : Error<"array size is negative">;
4821 def warn_typecheck_function_qualifiers_ignored : Warning<
4822 "'%0' qualifier on function type %1 has no effect">,
4823 InGroup<IgnoredQualifiers>;
4824 def warn_typecheck_function_qualifiers_unspecified : Warning<
4825 "'%0' qualifier on function type %1 has unspecified behavior">;
4826 def warn_typecheck_reference_qualifiers : Warning<
4827 "'%0' qualifier on reference type %1 has no effect">,
4828 InGroup<IgnoredQualifiers>;
4829 def err_typecheck_invalid_restrict_not_pointer : Error<
4830 "restrict requires a pointer or reference (%0 is invalid)">;
4831 def err_typecheck_invalid_restrict_not_pointer_noarg : Error<
4832 "restrict requires a pointer or reference">;
4833 def err_typecheck_invalid_restrict_invalid_pointee : Error<
4834 "pointer to function type %0 may not be 'restrict' qualified">;
4835 def ext_typecheck_zero_array_size : Extension<
4836 "zero size arrays are an extension">, InGroup<ZeroLengthArray>;
4837 def err_typecheck_zero_array_size : Error<
4838 "zero-length arrays are not permitted in C++">;
4839 def warn_typecheck_zero_static_array_size : Warning<
4840 "'static' has no effect on zero-length arrays">,
4841 InGroup<ArrayBounds>;
4842 def err_array_size_non_int : Error<"size of array has non-integer type %0">;
4843 def err_init_element_not_constant : Error<
4844 "initializer element is not a compile-time constant">;
4845 def ext_aggregate_init_not_constant : Extension<
4846 "initializer for aggregate is not a compile-time constant">, InGroup<C99>;
4847 def err_local_cant_init : Error<
4848 "'__local' variable cannot have an initializer">;
4849 def err_block_extern_cant_init : Error<
4850 "'extern' variable cannot have an initializer">;
4851 def warn_extern_init : Warning<"'extern' variable has an initializer">,
4852 InGroup<DiagGroup<"extern-initializer">>;
4853 def err_variable_object_no_init : Error<
4854 "variable-sized object may not be initialized">;
4855 def err_excess_initializers : Error<
4856 "excess elements in %select{array|vector|scalar|union|struct}0 initializer">;
4857 def ext_excess_initializers : ExtWarn<
4858 "excess elements in %select{array|vector|scalar|union|struct}0 initializer">;
4859 def err_excess_initializers_in_char_array_initializer : Error<
4860 "excess elements in char array initializer">;
4861 def ext_excess_initializers_in_char_array_initializer : ExtWarn<
4862 "excess elements in char array initializer">;
4863 def err_initializer_string_for_char_array_too_long : Error<
4864 "initializer-string for char array is too long">;
4865 def ext_initializer_string_for_char_array_too_long : ExtWarn<
4866 "initializer-string for char array is too long">;
4867 def warn_missing_field_initializers : Warning<
4868 "missing field %0 initializer">,
4869 InGroup<MissingFieldInitializers>, DefaultIgnore;
4870 def warn_braces_around_scalar_init : Warning<
4871 "braces around scalar initializer">, InGroup<DiagGroup<"braced-scalar-init">>;
4872 def ext_many_braces_around_scalar_init : ExtWarn<
4873 "too many braces around scalar initializer">,
4874 InGroup<DiagGroup<"many-braces-around-scalar-init">>;
4875 def ext_complex_component_init : Extension<
4876 "complex initialization specifying real and imaginary components "
4877 "is an extension">, InGroup<DiagGroup<"complex-component-init">>;
4878 def err_empty_scalar_initializer : Error<"scalar initializer cannot be empty">;
4879 def warn_cxx98_compat_empty_scalar_initializer : Warning<
4880 "scalar initialized from empty initializer list is incompatible with C++98">,
4881 InGroup<CXX98Compat>, DefaultIgnore;
4882 def warn_cxx98_compat_reference_list_init : Warning<
4883 "reference initialized from initializer list is incompatible with C++98">,
4884 InGroup<CXX98Compat>, DefaultIgnore;
4885 def warn_cxx98_compat_initializer_list_init : Warning<
4886 "initialization of initializer_list object is incompatible with C++98">,
4887 InGroup<CXX98Compat>, DefaultIgnore;
4888 def warn_cxx98_compat_ctor_list_init : Warning<
4889 "constructor call from initializer list is incompatible with C++98">,
4890 InGroup<CXX98Compat>, DefaultIgnore;
4891 def err_illegal_initializer : Error<
4892 "illegal initializer (only variables can be initialized)">;
4893 def err_illegal_initializer_type : Error<"illegal initializer type %0">;
4894 def ext_init_list_type_narrowing : ExtWarn<
4895 "type %0 cannot be narrowed to %1 in initializer list">,
4896 InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
4897 def ext_init_list_variable_narrowing : ExtWarn<
4898 "non-constant-expression cannot be narrowed from type %0 to %1 in "
4899 "initializer list">, InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
4900 def ext_init_list_constant_narrowing : ExtWarn<
4901 "constant expression evaluates to %0 which cannot be narrowed to type %1">,
4902 InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
4903 def warn_init_list_type_narrowing : Warning<
4904 "type %0 cannot be narrowed to %1 in initializer list in C++11">,
4905 InGroup<CXX11Narrowing>, DefaultIgnore;
4906 def warn_init_list_variable_narrowing : Warning<
4907 "non-constant-expression cannot be narrowed from type %0 to %1 in "
4908 "initializer list in C++11">,
4909 InGroup<CXX11Narrowing>, DefaultIgnore;
4910 def warn_init_list_constant_narrowing : Warning<
4911 "constant expression evaluates to %0 which cannot be narrowed to type %1 in "
4913 InGroup<CXX11Narrowing>, DefaultIgnore;
4914 def note_init_list_narrowing_silence : Note<
4915 "insert an explicit cast to silence this issue">;
4916 def err_init_objc_class : Error<
4917 "cannot initialize Objective-C class type %0">;
4918 def err_implicit_empty_initializer : Error<
4919 "initializer for aggregate with no elements requires explicit braces">;
4920 def err_bitfield_has_negative_width : Error<
4921 "bit-field %0 has negative width (%1)">;
4922 def err_anon_bitfield_has_negative_width : Error<
4923 "anonymous bit-field has negative width (%0)">;
4924 def err_bitfield_has_zero_width : Error<"named bit-field %0 has zero width">;
4925 def err_bitfield_width_exceeds_type_width : Error<
4926 "width of bit-field %0 (%1 bits) exceeds %select{width|size}2 "
4927 "of its type (%3 bit%s3)">;
4928 def err_anon_bitfield_width_exceeds_type_width : Error<
4929 "width of anonymous bit-field (%0 bits) exceeds %select{width|size}1 "
4930 "of its type (%2 bit%s2)">;
4931 def err_incorrect_number_of_vector_initializers : Error<
4932 "number of elements must be either one or match the size of the vector">;
4934 // Used by C++ which allows bit-fields that are wider than the type.
4935 def warn_bitfield_width_exceeds_type_width: Warning<
4936 "width of bit-field %0 (%1 bits) exceeds the width of its type; value will "
4937 "be truncated to %2 bit%s2">, InGroup<BitFieldWidth>;
4938 def warn_anon_bitfield_width_exceeds_type_width : Warning<
4939 "width of anonymous bit-field (%0 bits) exceeds width of its type; value "
4940 "will be truncated to %1 bit%s1">, InGroup<BitFieldWidth>;
4941 def warn_bitfield_too_small_for_enum : Warning<
4942 "bit-field %0 is not wide enough to store all enumerators of %1">,
4943 InGroup<BitFieldEnumConversion>, DefaultIgnore;
4944 def note_widen_bitfield : Note<
4945 "widen this field to %0 bits to store all values of %1">;
4946 def warn_unsigned_bitfield_assigned_signed_enum : Warning<
4947 "assigning value of signed enum type %1 to unsigned bit-field %0; "
4948 "negative enumerators of enum %1 will be converted to positive values">,
4949 InGroup<BitFieldEnumConversion>, DefaultIgnore;
4950 def warn_signed_bitfield_enum_conversion : Warning<
4951 "signed bit-field %0 needs an extra bit to represent the largest positive "
4952 "enumerators of %1">,
4953 InGroup<BitFieldEnumConversion>, DefaultIgnore;
4954 def note_change_bitfield_sign : Note<
4955 "consider making the bitfield type %select{unsigned|signed}0">;
4957 def warn_missing_braces : Warning<
4958 "suggest braces around initialization of subobject">,
4959 InGroup<MissingBraces>, DefaultIgnore;
4961 def err_redefinition_of_label : Error<"redefinition of label %0">;
4962 def err_undeclared_label_use : Error<"use of undeclared label %0">;
4963 def err_goto_ms_asm_label : Error<
4964 "cannot jump from this goto statement to label %0 inside an inline assembly block">;
4965 def note_goto_ms_asm_label : Note<
4966 "inline assembly label %0 declared here">;
4967 def warn_unused_label : Warning<"unused label %0">,
4968 InGroup<UnusedLabel>, DefaultIgnore;
4970 def err_goto_into_protected_scope : Error<
4971 "cannot jump from this goto statement to its label">;
4972 def ext_goto_into_protected_scope : ExtWarn<
4973 "jump from this goto statement to its label is a Microsoft extension">,
4974 InGroup<MicrosoftGoto>;
4975 def warn_cxx98_compat_goto_into_protected_scope : Warning<
4976 "jump from this goto statement to its label is incompatible with C++98">,
4977 InGroup<CXX98Compat>, DefaultIgnore;
4978 def err_switch_into_protected_scope : Error<
4979 "cannot jump from switch statement to this case label">;
4980 def warn_cxx98_compat_switch_into_protected_scope : Warning<
4981 "jump from switch statement to this case label is incompatible with C++98">,
4982 InGroup<CXX98Compat>, DefaultIgnore;
4983 def err_indirect_goto_without_addrlabel : Error<
4984 "indirect goto in function with no address-of-label expressions">;
4985 def err_indirect_goto_in_protected_scope : Error<
4986 "cannot jump from this indirect goto statement to one of its possible targets">;
4987 def warn_cxx98_compat_indirect_goto_in_protected_scope : Warning<
4988 "jump from this indirect goto statement to one of its possible targets "
4989 "is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
4990 def note_indirect_goto_target : Note<
4991 "possible target of indirect goto statement">;
4992 def note_protected_by_variable_init : Note<
4993 "jump bypasses variable initialization">;
4994 def note_protected_by_variable_nontriv_destructor : Note<
4995 "jump bypasses variable with a non-trivial destructor">;
4996 def note_protected_by_variable_non_pod : Note<
4997 "jump bypasses initialization of non-POD variable">;
4998 def note_protected_by_cleanup : Note<
4999 "jump bypasses initialization of variable with __attribute__((cleanup))">;
5000 def note_protected_by_vla_typedef : Note<
5001 "jump bypasses initialization of VLA typedef">;
5002 def note_protected_by_vla_type_alias : Note<
5003 "jump bypasses initialization of VLA type alias">;
5004 def note_protected_by_constexpr_if : Note<
5005 "jump enters controlled statement of constexpr if">;
5006 def note_protected_by_if_available : Note<
5007 "jump enters controlled statement of if available">;
5008 def note_protected_by_vla : Note<
5009 "jump bypasses initialization of variable length array">;
5010 def note_protected_by_objc_fast_enumeration : Note<
5011 "jump enters Objective-C fast enumeration loop">;
5012 def note_protected_by_objc_try : Note<
5013 "jump bypasses initialization of @try block">;
5014 def note_protected_by_objc_catch : Note<
5015 "jump bypasses initialization of @catch block">;
5016 def note_protected_by_objc_finally : Note<
5017 "jump bypasses initialization of @finally block">;
5018 def note_protected_by_objc_synchronized : Note<
5019 "jump bypasses initialization of @synchronized block">;
5020 def note_protected_by_objc_autoreleasepool : Note<
5021 "jump bypasses auto release push of @autoreleasepool block">;
5022 def note_protected_by_cxx_try : Note<
5023 "jump bypasses initialization of try block">;
5024 def note_protected_by_cxx_catch : Note<
5025 "jump bypasses initialization of catch block">;
5026 def note_protected_by_seh_try : Note<
5027 "jump bypasses initialization of __try block">;
5028 def note_protected_by_seh_except : Note<
5029 "jump bypasses initialization of __except block">;
5030 def note_protected_by_seh_finally : Note<
5031 "jump bypasses initialization of __finally block">;
5032 def note_protected_by___block : Note<
5033 "jump bypasses setup of __block variable">;
5034 def note_protected_by_objc_strong_init : Note<
5035 "jump bypasses initialization of __strong variable">;
5036 def note_protected_by_objc_weak_init : Note<
5037 "jump bypasses initialization of __weak variable">;
5038 def note_protected_by_non_trivial_c_struct_init : Note<
5039 "jump bypasses initialization of variable of non-trivial C struct type">;
5040 def note_enters_block_captures_cxx_obj : Note<
5041 "jump enters lifetime of block which captures a destructible C++ object">;
5042 def note_enters_block_captures_strong : Note<
5043 "jump enters lifetime of block which strongly captures a variable">;
5044 def note_enters_block_captures_weak : Note<
5045 "jump enters lifetime of block which weakly captures a variable">;
5046 def note_enters_block_captures_non_trivial_c_struct : Note<
5047 "jump enters lifetime of block which captures a C struct that is non-trivial "
5050 def note_exits_cleanup : Note<
5051 "jump exits scope of variable with __attribute__((cleanup))">;
5052 def note_exits_dtor : Note<
5053 "jump exits scope of variable with non-trivial destructor">;
5054 def note_exits_temporary_dtor : Note<
5055 "jump exits scope of lifetime-extended temporary with non-trivial "
5057 def note_exits___block : Note<
5058 "jump exits scope of __block variable">;
5059 def note_exits_objc_try : Note<
5060 "jump exits @try block">;
5061 def note_exits_objc_catch : Note<
5062 "jump exits @catch block">;
5063 def note_exits_objc_finally : Note<
5064 "jump exits @finally block">;
5065 def note_exits_objc_synchronized : Note<
5066 "jump exits @synchronized block">;
5067 def note_exits_cxx_try : Note<
5068 "jump exits try block">;
5069 def note_exits_cxx_catch : Note<
5070 "jump exits catch block">;
5071 def note_exits_seh_try : Note<
5072 "jump exits __try block">;
5073 def note_exits_seh_except : Note<
5074 "jump exits __except block">;
5075 def note_exits_seh_finally : Note<
5076 "jump exits __finally block">;
5077 def note_exits_objc_autoreleasepool : Note<
5078 "jump exits autoreleasepool block">;
5079 def note_exits_objc_strong : Note<
5080 "jump exits scope of __strong variable">;
5081 def note_exits_objc_weak : Note<
5082 "jump exits scope of __weak variable">;
5083 def note_exits_block_captures_cxx_obj : Note<
5084 "jump exits lifetime of block which captures a destructible C++ object">;
5085 def note_exits_block_captures_strong : Note<
5086 "jump exits lifetime of block which strongly captures a variable">;
5087 def note_exits_block_captures_weak : Note<
5088 "jump exits lifetime of block which weakly captures a variable">;
5089 def note_exits_block_captures_non_trivial_c_struct : Note<
5090 "jump exits lifetime of block which captures a C struct that is non-trivial "
5093 def err_func_returning_qualified_void : ExtWarn<
5094 "function cannot return qualified void type %0">,
5095 InGroup<DiagGroup<"qualified-void-return-type">>;
5096 def err_func_returning_array_function : Error<
5097 "function cannot return %select{array|function}0 type %1">;
5098 def err_field_declared_as_function : Error<"field %0 declared as a function">;
5099 def err_field_incomplete : Error<"field has incomplete type %0">;
5100 def ext_variable_sized_type_in_struct : ExtWarn<
5101 "field %0 with variable sized type %1 not at the end of a struct or class is"
5102 " a GNU extension">, InGroup<GNUVariableSizedTypeNotAtEnd>;
5104 def ext_c99_flexible_array_member : Extension<
5105 "flexible array members are a C99 feature">, InGroup<C99>;
5106 def err_flexible_array_virtual_base : Error<
5107 "flexible array member %0 not allowed in "
5108 "%select{struct|interface|union|class|enum}1 which has a virtual base class">;
5109 def err_flexible_array_empty_aggregate : Error<
5110 "flexible array member %0 not allowed in otherwise empty "
5111 "%select{struct|interface|union|class|enum}1">;
5112 def err_flexible_array_has_nontrivial_dtor : Error<
5113 "flexible array member %0 of type %1 with non-trivial destruction">;
5114 def ext_flexible_array_in_struct : Extension<
5115 "%0 may not be nested in a struct due to flexible array member">,
5116 InGroup<FlexibleArrayExtensions>;
5117 def ext_flexible_array_in_array : Extension<
5118 "%0 may not be used as an array element due to flexible array member">,
5119 InGroup<FlexibleArrayExtensions>;
5120 def err_flexible_array_init : Error<
5121 "initialization of flexible array member is not allowed">;
5122 def ext_flexible_array_empty_aggregate_ms : Extension<
5123 "flexible array member %0 in otherwise empty "
5124 "%select{struct|interface|union|class|enum}1 is a Microsoft extension">,
5125 InGroup<MicrosoftFlexibleArray>;
5126 def err_flexible_array_union : Error<
5127 "flexible array member %0 in a union is not allowed">;
5128 def ext_flexible_array_union_ms : Extension<
5129 "flexible array member %0 in a union is a Microsoft extension">,
5130 InGroup<MicrosoftFlexibleArray>;
5131 def ext_flexible_array_empty_aggregate_gnu : Extension<
5132 "flexible array member %0 in otherwise empty "
5133 "%select{struct|interface|union|class|enum}1 is a GNU extension">,
5134 InGroup<GNUEmptyStruct>;
5135 def ext_flexible_array_union_gnu : Extension<
5136 "flexible array member %0 in a union is a GNU extension">, InGroup<GNUFlexibleArrayUnionMember>;
5138 def err_flexible_array_not_at_end : Error<
5139 "flexible array member %0 with type %1 is not at the end of"
5140 " %select{struct|interface|union|class|enum}2">;
5141 def err_objc_variable_sized_type_not_at_end : Error<
5142 "field %0 with variable sized type %1 is not at the end of class">;
5143 def note_next_field_declaration : Note<
5144 "next field declaration is here">;
5145 def note_next_ivar_declaration : Note<
5146 "next %select{instance variable declaration|synthesized instance variable}0"
5148 def err_synthesize_variable_sized_ivar : Error<
5149 "synthesized property with variable size type %0"
5150 " requires an existing instance variable">;
5151 def err_flexible_array_arc_retainable : Error<
5152 "ARC forbids flexible array members with retainable object type">;
5153 def warn_variable_sized_ivar_visibility : Warning<
5154 "field %0 with variable sized type %1 is not visible to subclasses and"
5155 " can conflict with their instance variables">, InGroup<ObjCFlexibleArray>;
5156 def warn_superclass_variable_sized_type_not_at_end : Warning<
5157 "field %0 can overwrite instance variable %1 with variable sized type %2"
5158 " in superclass %3">, InGroup<ObjCFlexibleArray>;
5160 let CategoryName = "ARC Semantic Issue" in {
5162 // ARC-mode diagnostics.
5164 let CategoryName = "ARC Weak References" in {
5166 def err_arc_weak_no_runtime : Error<
5167 "cannot create __weak reference because the current deployment target "
5168 "does not support weak references">;
5169 def err_arc_weak_disabled : Error<
5170 "cannot create __weak reference in file using manual reference counting">;
5171 def err_synthesizing_arc_weak_property_disabled : Error<
5172 "cannot synthesize weak property in file using manual reference counting">;
5173 def err_synthesizing_arc_weak_property_no_runtime : Error<
5174 "cannot synthesize weak property because the current deployment target "
5175 "does not support weak references">;
5176 def err_arc_unsupported_weak_class : Error<
5177 "class is incompatible with __weak references">;
5178 def err_arc_weak_unavailable_assign : Error<
5179 "assignment of a weak-unavailable object to a __weak object">;
5180 def err_arc_weak_unavailable_property : Error<
5181 "synthesizing __weak instance variable of type %0, which does not "
5182 "support weak references">;
5183 def note_implemented_by_class : Note<
5184 "when implemented by class %0">;
5185 def err_arc_convesion_of_weak_unavailable : Error<
5186 "%select{implicit conversion|cast}0 of weak-unavailable object of type %1 to"
5187 " a __weak object of type %2">;
5189 } // end "ARC Weak References" category
5191 let CategoryName = "ARC Restrictions" in {
5193 def err_unavailable_in_arc : Error<
5194 "%0 is unavailable in ARC">;
5195 def note_arc_forbidden_type : Note<
5196 "declaration uses type that is ill-formed in ARC">;
5197 def note_performs_forbidden_arc_conversion : Note<
5198 "inline function performs a conversion which is forbidden in ARC">;
5199 def note_arc_init_returns_unrelated : Note<
5200 "init method must return a type related to its receiver type">;
5201 def note_arc_weak_disabled : Note<
5202 "declaration uses __weak, but ARC is disabled">;
5203 def note_arc_weak_no_runtime : Note<"declaration uses __weak, which "
5204 "the current deployment target does not support">;
5205 def note_arc_field_with_ownership : Note<
5206 "field has non-trivial ownership qualification">;
5208 def err_arc_illegal_explicit_message : Error<
5209 "ARC forbids explicit message send of %0">;
5210 def err_arc_unused_init_message : Error<
5211 "the result of a delegate init call must be immediately returned "
5212 "or assigned to 'self'">;
5213 def err_arc_mismatched_cast : Error<
5214 "%select{implicit conversion|cast}0 of "
5215 "%select{%2|a non-Objective-C pointer type %2|a block pointer|"
5216 "an Objective-C pointer|an indirect pointer to an Objective-C pointer}1"
5217 " to %3 is disallowed with ARC">;
5218 def err_arc_nolifetime_behavior : Error<
5219 "explicit ownership qualifier on cast result has no effect">;
5220 def err_arc_objc_object_in_tag : Error<
5221 "ARC forbids %select{Objective-C objects|blocks}0 in "
5222 "%select{struct|interface|union|<<ERROR>>|enum}1">;
5223 def err_arc_objc_property_default_assign_on_object : Error<
5224 "ARC forbids synthesizing a property of an Objective-C object "
5225 "with unspecified ownership or storage attribute">;
5226 def err_arc_illegal_selector : Error<
5227 "ARC forbids use of %0 in a @selector">;
5228 def err_arc_illegal_method_def : Error<
5229 "ARC forbids %select{implementation|synthesis}0 of %1">;
5230 def warn_arc_strong_pointer_objc_pointer : Warning<
5231 "method parameter of type %0 with no explicit ownership">,
5232 InGroup<DiagGroup<"explicit-ownership-type">>, DefaultIgnore;
5234 } // end "ARC Restrictions" category
5236 def err_arc_lost_method_convention : Error<
5237 "method was declared as %select{an 'alloc'|a 'copy'|an 'init'|a 'new'}0 "
5238 "method, but its implementation doesn't match because %select{"
5239 "its result type is not an object pointer|"
5240 "its result type is unrelated to its receiver type}1">;
5241 def note_arc_lost_method_convention : Note<"declaration in interface">;
5242 def err_arc_gained_method_convention : Error<
5243 "method implementation does not match its declaration">;
5244 def note_arc_gained_method_convention : Note<
5245 "declaration in interface is not in the '%select{alloc|copy|init|new}0' "
5246 "family because %select{its result type is not an object pointer|"
5247 "its result type is unrelated to its receiver type}1">;
5248 def err_typecheck_arc_assign_self : Error<
5249 "cannot assign to 'self' outside of a method in the init family">;
5250 def err_typecheck_arc_assign_self_class_method : Error<
5251 "cannot assign to 'self' in a class method">;
5252 def err_typecheck_arr_assign_enumeration : Error<
5253 "fast enumeration variables cannot be modified in ARC by default; "
5254 "declare the variable __strong to allow this">;
5255 def warn_arc_retained_assign : Warning<
5256 "assigning retained object to %select{weak|unsafe_unretained}0 "
5257 "%select{property|variable}1"
5258 "; object will be released after assignment">,
5259 InGroup<ARCUnsafeRetainedAssign>;
5260 def warn_arc_retained_property_assign : Warning<
5261 "assigning retained object to unsafe property"
5262 "; object will be released after assignment">,
5263 InGroup<ARCUnsafeRetainedAssign>;
5264 def warn_arc_literal_assign : Warning<
5265 "assigning %select{array literal|dictionary literal|numeric literal|boxed expression|<should not happen>|block literal}0"
5266 " to a weak %select{property|variable}1"
5267 "; object will be released after assignment">,
5268 InGroup<ARCUnsafeRetainedAssign>;
5269 def err_arc_new_array_without_ownership : Error<
5270 "'new' cannot allocate an array of %0 with no explicit ownership">;
5271 def err_arc_autoreleasing_var : Error<
5272 "%select{__block variables|global variables|fields|instance variables}0 cannot have "
5273 "__autoreleasing ownership">;
5274 def err_arc_autoreleasing_capture : Error<
5275 "cannot capture __autoreleasing variable in a "
5276 "%select{block|lambda by copy}0">;
5277 def err_arc_thread_ownership : Error<
5278 "thread-local variable has non-trivial ownership: type is %0">;
5279 def err_arc_indirect_no_ownership : Error<
5280 "%select{pointer|reference}1 to non-const type %0 with no explicit ownership">;
5281 def err_arc_array_param_no_ownership : Error<
5282 "must explicitly describe intended ownership of an object array parameter">;
5283 def err_arc_pseudo_dtor_inconstant_quals : Error<
5284 "pseudo-destructor destroys object of type %0 with inconsistently-qualified "
5286 def err_arc_init_method_unrelated_result_type : Error<
5287 "init methods must return a type related to the receiver type">;
5288 def err_arc_nonlocal_writeback : Error<
5289 "passing address of %select{non-local|non-scalar}0 object to "
5290 "__autoreleasing parameter for write-back">;
5291 def err_arc_method_not_found : Error<
5292 "no known %select{instance|class}1 method for selector %0">;
5293 def err_arc_receiver_forward_class : Error<
5294 "receiver %0 for class message is a forward declaration">;
5295 def err_arc_may_not_respond : Error<
5296 "no visible @interface for %0 declares the selector %1">;
5297 def err_arc_receiver_forward_instance : Error<
5298 "receiver type %0 for instance message is a forward declaration">;
5299 def warn_receiver_forward_instance : Warning<
5300 "receiver type %0 for instance message is a forward declaration">,
5301 InGroup<ForwardClassReceiver>, DefaultIgnore;
5302 def err_arc_collection_forward : Error<
5303 "collection expression type %0 is a forward declaration">;
5304 def err_arc_multiple_method_decl : Error<
5305 "multiple methods named %0 found with mismatched result, "
5306 "parameter type or attributes">;
5307 def warn_arc_lifetime_result_type : Warning<
5308 "ARC %select{unused|__unsafe_unretained|__strong|__weak|__autoreleasing}0 "
5309 "lifetime qualifier on return type is ignored">,
5310 InGroup<IgnoredQualifiers>;
5312 let CategoryName = "ARC Retain Cycle" in {
5314 def warn_arc_retain_cycle : Warning<
5315 "capturing %0 strongly in this block is likely to lead to a retain cycle">,
5316 InGroup<ARCRetainCycles>;
5317 def note_arc_retain_cycle_owner : Note<
5318 "block will be retained by %select{the captured object|an object strongly "
5319 "retained by the captured object}0">;
5321 } // end "ARC Retain Cycle" category
5323 def warn_arc_object_memaccess : Warning<
5324 "%select{destination for|source of}0 this %1 call is a pointer to "
5325 "ownership-qualified type %2">, InGroup<ARCNonPodMemAccess>;
5327 let CategoryName = "ARC and @properties" in {
5329 def err_arc_strong_property_ownership : Error<
5330 "existing instance variable %1 for strong property %0 may not be "
5331 "%select{|__unsafe_unretained||__weak}2">;
5332 def err_arc_assign_property_ownership : Error<
5333 "existing instance variable %1 for property %0 with %select{unsafe_unretained|assign}2 "
5334 "attribute must be __unsafe_unretained">;
5335 def err_arc_inconsistent_property_ownership : Error<
5336 "%select{|unsafe_unretained|strong|weak}1 property %0 may not also be "
5337 "declared %select{|__unsafe_unretained|__strong|__weak|__autoreleasing}2">;
5339 } // end "ARC and @properties" category
5341 def warn_block_capture_autoreleasing : Warning<
5342 "block captures an autoreleasing out-parameter, which may result in "
5343 "use-after-free bugs">,
5344 InGroup<BlockCaptureAutoReleasing>;
5345 def note_declare_parameter_strong : Note<
5346 "declare the parameter __strong or capture a __block __strong variable to "
5347 "keep values alive across autorelease pools">;
5349 def err_arc_atomic_ownership : Error<
5350 "cannot perform atomic operation on a pointer to type %0: type has "
5351 "non-trivial ownership">;
5353 let CategoryName = "ARC Casting Rules" in {
5355 def err_arc_bridge_cast_incompatible : Error<
5356 "incompatible types casting %0 to %1 with a %select{__bridge|"
5357 "__bridge_transfer|__bridge_retained}2 cast">;
5358 def err_arc_bridge_cast_wrong_kind : Error<
5359 "cast of %select{Objective-C|block|C}0 pointer type %1 to "
5360 "%select{Objective-C|block|C}2 pointer type %3 cannot use %select{__bridge|"
5361 "__bridge_transfer|__bridge_retained}4">;
5362 def err_arc_cast_requires_bridge : Error<
5363 "%select{cast|implicit conversion}0 of %select{Objective-C|block|C}1 "
5364 "pointer type %2 to %select{Objective-C|block|C}3 pointer type %4 "
5365 "requires a bridged cast">;
5366 def note_arc_bridge : Note<
5367 "use __bridge to convert directly (no change in ownership)">;
5368 def note_arc_cstyle_bridge : Note<
5369 "use __bridge with C-style cast to convert directly (no change in ownership)">;
5370 def note_arc_bridge_transfer : Note<
5371 "use %select{__bridge_transfer|CFBridgingRelease call}1 to transfer "
5372 "ownership of a +1 %0 into ARC">;
5373 def note_arc_cstyle_bridge_transfer : Note<
5374 "use __bridge_transfer with C-style cast to transfer "
5375 "ownership of a +1 %0 into ARC">;
5376 def note_arc_bridge_retained : Note<
5377 "use %select{__bridge_retained|CFBridgingRetain call}1 to make an "
5378 "ARC object available as a +1 %0">;
5379 def note_arc_cstyle_bridge_retained : Note<
5380 "use __bridge_retained with C-style cast to make an "
5381 "ARC object available as a +1 %0">;
5383 } // ARC Casting category
5385 } // ARC category name
5387 def err_flexible_array_init_needs_braces : Error<
5388 "flexible array requires brace-enclosed initializer">;
5389 def err_illegal_decl_array_of_functions : Error<
5390 "'%0' declared as array of functions of type %1">;
5391 def err_illegal_decl_array_incomplete_type : Error<
5392 "array has incomplete element type %0">;
5393 def err_illegal_message_expr_incomplete_type : Error<
5394 "Objective-C message has incomplete result type %0">;
5395 def err_illegal_decl_array_of_references : Error<
5396 "'%0' declared as array of references of type %1">;
5397 def err_decl_negative_array_size : Error<
5398 "'%0' declared as an array with a negative size">;
5399 def err_array_static_outside_prototype : Error<
5400 "%0 used in array declarator outside of function prototype">;
5401 def err_array_static_not_outermost : Error<
5402 "%0 used in non-outermost array type derivation">;
5403 def err_array_star_outside_prototype : Error<
5404 "star modifier used outside of function prototype">;
5405 def err_illegal_decl_pointer_to_reference : Error<
5406 "'%0' declared as a pointer to a reference of type %1">;
5407 def err_illegal_decl_mempointer_to_reference : Error<
5408 "'%0' declared as a member pointer to a reference of type %1">;
5409 def err_illegal_decl_mempointer_to_void : Error<
5410 "'%0' declared as a member pointer to void">;
5411 def err_illegal_decl_mempointer_in_nonclass : Error<
5412 "'%0' does not point into a class">;
5413 def err_mempointer_in_nonclass_type : Error<
5414 "member pointer refers into non-class type %0">;
5415 def err_reference_to_void : Error<"cannot form a reference to 'void'">;
5416 def err_nonfunction_block_type : Error<
5417 "block pointer to non-function type is invalid">;
5418 def err_return_block_has_expr : Error<"void block should not return a value">;
5419 def err_block_return_missing_expr : Error<
5420 "non-void block should return a value">;
5421 def err_func_def_incomplete_result : Error<
5422 "incomplete result type %0 in function definition">;
5423 def err_atomic_specifier_bad_type : Error<
5424 "_Atomic cannot be applied to "
5425 "%select{incomplete |array |function |reference |atomic |qualified |}0type "
5426 "%1 %select{||||||which is not trivially copyable}0">;
5429 def ext_sizeof_alignof_function_type : Extension<
5430 "invalid application of '%select{sizeof|alignof|vec_step}0' to a "
5431 "function type">, InGroup<PointerArith>;
5432 def ext_sizeof_alignof_void_type : Extension<
5433 "invalid application of '%select{sizeof|alignof|vec_step}0' to a void "
5434 "type">, InGroup<PointerArith>;
5435 def err_opencl_sizeof_alignof_type : Error<
5436 "invalid application of '%select{sizeof|alignof|vec_step|__builtin_omp_required_simd_align}0' to a void type">;
5437 def err_sizeof_alignof_incomplete_type : Error<
5438 "invalid application of '%select{sizeof|alignof|vec_step|__builtin_omp_required_simd_align}0' to an "
5439 "incomplete type %1">;
5440 def err_sizeof_alignof_function_type : Error<
5441 "invalid application of '%select{sizeof|alignof|vec_step|__builtin_omp_required_simd_align}0' to a "
5443 def err_openmp_default_simd_align_expr : Error<
5444 "invalid application of '__builtin_omp_required_simd_align' to an expression, only type is allowed">;
5445 def err_sizeof_alignof_typeof_bitfield : Error<
5446 "invalid application of '%select{sizeof|alignof|typeof}0' to bit-field">;
5447 def err_alignof_member_of_incomplete_type : Error<
5448 "invalid application of 'alignof' to a field of a class still being defined">;
5449 def err_vecstep_non_scalar_vector_type : Error<
5450 "'vec_step' requires built-in scalar or vector type, %0 invalid">;
5451 def err_offsetof_incomplete_type : Error<
5452 "offsetof of incomplete type %0">;
5453 def err_offsetof_record_type : Error<
5454 "offsetof requires struct, union, or class type, %0 invalid">;
5455 def err_offsetof_array_type : Error<"offsetof requires array type, %0 invalid">;
5456 def ext_offsetof_non_pod_type : ExtWarn<"offset of on non-POD type %0">,
5457 InGroup<InvalidOffsetof>;
5458 def ext_offsetof_non_standardlayout_type : ExtWarn<
5459 "offset of on non-standard-layout type %0">, InGroup<InvalidOffsetof>;
5460 def err_offsetof_bitfield : Error<"cannot compute offset of bit-field %0">;
5461 def err_offsetof_field_of_virtual_base : Error<
5462 "invalid application of 'offsetof' to a field of a virtual base">;
5463 def warn_sub_ptr_zero_size_types : Warning<
5464 "subtraction of pointers to type %0 of zero size has undefined behavior">,
5465 InGroup<PointerArith>;
5466 def warn_pointer_arith_null_ptr : Warning<
5467 "performing pointer arithmetic on a null pointer has undefined behavior%select{| if the offset is nonzero}0">,
5468 InGroup<NullPointerArithmetic>, DefaultIgnore;
5469 def warn_gnu_null_ptr_arith : Warning<
5470 "arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension">,
5471 InGroup<NullPointerArithmetic>, DefaultIgnore;
5473 def warn_floatingpoint_eq : Warning<
5474 "comparing floating point with == or != is unsafe">,
5475 InGroup<DiagGroup<"float-equal">>, DefaultIgnore;
5477 def warn_remainder_division_by_zero : Warning<
5478 "%select{remainder|division}0 by zero is undefined">,
5480 def warn_shift_lhs_negative : Warning<"shifting a negative signed value is undefined">,
5481 InGroup<DiagGroup<"shift-negative-value">>;
5482 def warn_shift_negative : Warning<"shift count is negative">,
5483 InGroup<DiagGroup<"shift-count-negative">>;
5484 def warn_shift_gt_typewidth : Warning<"shift count >= width of type">,
5485 InGroup<DiagGroup<"shift-count-overflow">>;
5486 def warn_shift_result_gt_typewidth : Warning<
5487 "signed shift result (%0) requires %1 bits to represent, but %2 only has "
5488 "%3 bits">, InGroup<DiagGroup<"shift-overflow">>;
5489 def warn_shift_result_sets_sign_bit : Warning<
5490 "signed shift result (%0) sets the sign bit of the shift expression's "
5491 "type (%1) and becomes negative">,
5492 InGroup<DiagGroup<"shift-sign-overflow">>, DefaultIgnore;
5494 def warn_precedence_bitwise_rel : Warning<
5495 "%0 has lower precedence than %1; %1 will be evaluated first">,
5496 InGroup<Parentheses>;
5497 def note_precedence_bitwise_first : Note<
5498 "place parentheses around the %0 expression to evaluate it first">;
5499 def note_precedence_silence : Note<
5500 "place parentheses around the '%0' expression to silence this warning">;
5502 def warn_precedence_conditional : Warning<
5503 "operator '?:' has lower precedence than '%0'; '%0' will be evaluated first">,
5504 InGroup<Parentheses>;
5505 def note_precedence_conditional_first : Note<
5506 "place parentheses around the '?:' expression to evaluate it first">;
5508 def warn_logical_instead_of_bitwise : Warning<
5509 "use of logical '%0' with constant operand">,
5510 InGroup<DiagGroup<"constant-logical-operand">>;
5511 def note_logical_instead_of_bitwise_change_operator : Note<
5512 "use '%0' for a bitwise operation">;
5513 def note_logical_instead_of_bitwise_remove_constant : Note<
5514 "remove constant to silence this warning">;
5516 def warn_bitwise_op_in_bitwise_op : Warning<
5517 "'%0' within '%1'">, InGroup<BitwiseOpParentheses>;
5519 def warn_logical_and_in_logical_or : Warning<
5520 "'&&' within '||'">, InGroup<LogicalOpParentheses>;
5522 def warn_overloaded_shift_in_comparison :Warning<
5523 "overloaded operator %select{>>|<<}0 has higher precedence than "
5524 "comparison operator">,
5525 InGroup<OverloadedShiftOpParentheses>;
5526 def note_evaluate_comparison_first :Note<
5527 "place parentheses around comparison expression to evaluate it first">;
5529 def warn_addition_in_bitshift : Warning<
5530 "operator '%0' has lower precedence than '%1'; "
5531 "'%1' will be evaluated first">, InGroup<ShiftOpParentheses>;
5533 def warn_self_assignment_builtin : Warning<
5534 "explicitly assigning value of variable of type %0 to itself">,
5535 InGroup<SelfAssignment>, DefaultIgnore;
5536 def warn_self_assignment_overloaded : Warning<
5537 "explicitly assigning value of variable of type %0 to itself">,
5538 InGroup<SelfAssignmentOverloaded>, DefaultIgnore;
5539 def warn_self_move : Warning<
5540 "explicitly moving variable of type %0 to itself">,
5541 InGroup<SelfMove>, DefaultIgnore;
5543 def warn_redundant_move_on_return : Warning<
5544 "redundant move in return statement">,
5545 InGroup<RedundantMove>, DefaultIgnore;
5546 def warn_pessimizing_move_on_return : Warning<
5547 "moving a local object in a return statement prevents copy elision">,
5548 InGroup<PessimizingMove>, DefaultIgnore;
5549 def warn_pessimizing_move_on_initialization : Warning<
5550 "moving a temporary object prevents copy elision">,
5551 InGroup<PessimizingMove>, DefaultIgnore;
5552 def note_remove_move : Note<"remove std::move call here">;
5554 def warn_return_std_move : Warning<
5555 "local variable %0 will be copied despite being %select{returned|thrown}1 by name">,
5556 InGroup<ReturnStdMove>, DefaultIgnore;
5557 def note_add_std_move : Note<
5558 "call 'std::move' explicitly to avoid copying">;
5559 def warn_return_std_move_in_cxx11 : Warning<
5560 "prior to the resolution of a defect report against ISO C++11, "
5561 "local variable %0 would have been copied despite being returned by name, "
5562 "due to its not matching the function return type%diff{ ($ vs $)|}1,2">,
5563 InGroup<ReturnStdMoveInCXX11>, DefaultIgnore;
5564 def note_add_std_move_in_cxx11 : Note<
5565 "call 'std::move' explicitly to avoid copying on older compilers">;
5567 def warn_string_plus_int : Warning<
5568 "adding %0 to a string does not append to the string">,
5569 InGroup<StringPlusInt>;
5570 def warn_string_plus_char : Warning<
5571 "adding %0 to a string pointer does not append to the string">,
5572 InGroup<StringPlusChar>;
5573 def note_string_plus_scalar_silence : Note<
5574 "use array indexing to silence this warning">;
5576 def warn_sizeof_array_param : Warning<
5577 "sizeof on array function parameter will return size of %0 instead of %1">,
5578 InGroup<SizeofArrayArgument>;
5580 def warn_sizeof_array_decay : Warning<
5581 "sizeof on pointer operation will return size of %0 instead of %1">,
5582 InGroup<SizeofArrayDecay>;
5584 def err_sizeof_nonfragile_interface : Error<
5585 "application of '%select{alignof|sizeof}1' to interface %0 is "
5586 "not supported on this architecture and platform">;
5587 def err_atdef_nonfragile_interface : Error<
5588 "use of @defs is not supported on this architecture and platform">;
5589 def err_subscript_nonfragile_interface : Error<
5590 "subscript requires size of interface %0, which is not constant for "
5591 "this architecture and platform">;
5593 def err_arithmetic_nonfragile_interface : Error<
5594 "arithmetic on pointer to interface %0, which is not a constant size for "
5595 "this architecture and platform">;
5598 def ext_subscript_non_lvalue : Extension<
5599 "ISO C90 does not allow subscripting non-lvalue array">;
5600 def err_typecheck_subscript_value : Error<
5601 "subscripted value is not an array, pointer, or vector">;
5602 def err_typecheck_subscript_not_integer : Error<
5603 "array subscript is not an integer">;
5604 def err_subscript_function_type : Error<
5605 "subscript of pointer to function type %0">;
5606 def err_subscript_incomplete_type : Error<
5607 "subscript of pointer to incomplete type %0">;
5608 def err_dereference_incomplete_type : Error<
5609 "dereference of pointer to incomplete type %0">;
5610 def ext_gnu_subscript_void_type : Extension<
5611 "subscript of a pointer to void is a GNU extension">, InGroup<PointerArith>;
5612 def err_typecheck_member_reference_struct_union : Error<
5613 "member reference base type %0 is not a structure or union">;
5614 def err_typecheck_member_reference_ivar : Error<
5615 "%0 does not have a member named %1">;
5616 def err_arc_weak_ivar_access : Error<
5617 "dereferencing a __weak pointer is not allowed due to possible "
5618 "null value caused by race condition, assign it to strong variable first">;
5619 def err_typecheck_member_reference_arrow : Error<
5620 "member reference type %0 is not a pointer">;
5621 def err_typecheck_member_reference_suggestion : Error<
5622 "member reference type %0 is %select{a|not a}1 pointer; did you mean to use '%select{->|.}1'?">;
5623 def note_typecheck_member_reference_suggestion : Note<
5624 "did you mean to use '.' instead?">;
5625 def note_member_reference_arrow_from_operator_arrow : Note<
5626 "'->' applied to return value of the operator->() declared here">;
5627 def err_typecheck_member_reference_type : Error<
5628 "cannot refer to type member %0 in %1 with '%select{.|->}2'">;
5629 def err_typecheck_member_reference_unknown : Error<
5630 "cannot refer to member %0 in %1 with '%select{.|->}2'">;
5631 def err_member_reference_needs_call : Error<
5632 "base of member reference is a function; perhaps you meant to call "
5633 "it%select{| with no arguments}0?">;
5634 def warn_subscript_is_char : Warning<"array subscript is of type 'char'">,
5635 InGroup<CharSubscript>, DefaultIgnore;
5637 def err_typecheck_incomplete_tag : Error<"incomplete definition of type %0">;
5638 def err_no_member : Error<"no member named %0 in %1">;
5639 def err_no_member_overloaded_arrow : Error<
5640 "no member named %0 in %1; did you mean to use '->' instead of '.'?">;
5642 def err_member_not_yet_instantiated : Error<
5643 "no member %0 in %1; it has not yet been instantiated">;
5644 def note_non_instantiated_member_here : Note<
5645 "not-yet-instantiated member is declared here">;
5647 def err_enumerator_does_not_exist : Error<
5648 "enumerator %0 does not exist in instantiation of %1">;
5649 def note_enum_specialized_here : Note<
5650 "enum %0 was explicitly specialized here">;
5652 def err_specialization_not_primary_template : Error<
5653 "cannot reference member of primary template because deduced class "
5654 "template specialization %0 is %select{instantiated from a partial|"
5655 "an explicit}1 specialization">;
5657 def err_member_redeclared : Error<"class member cannot be redeclared">;
5658 def ext_member_redeclared : ExtWarn<"class member cannot be redeclared">,
5659 InGroup<RedeclaredClassMember>;
5660 def err_member_redeclared_in_instantiation : Error<
5661 "multiple overloads of %0 instantiate to the same signature %1">;
5662 def err_member_name_of_class : Error<"member %0 has the same name as its class">;
5663 def err_member_def_undefined_record : Error<
5664 "out-of-line definition of %0 from class %1 without definition">;
5665 def err_member_decl_does_not_match : Error<
5666 "out-of-line %select{declaration|definition}2 of %0 "
5667 "does not match any declaration in %1">;
5668 def err_friend_decl_with_def_arg_must_be_def : Error<
5669 "friend declaration specifying a default argument must be a definition">;
5670 def err_friend_decl_with_def_arg_redeclared : Error<
5671 "friend declaration specifying a default argument must be the only declaration">;
5672 def err_friend_decl_does_not_match : Error<
5673 "friend declaration of %0 does not match any declaration in %1">;
5674 def err_member_decl_does_not_match_suggest : Error<
5675 "out-of-line %select{declaration|definition}2 of %0 "
5676 "does not match any declaration in %1; did you mean %3?">;
5677 def err_member_def_does_not_match_ret_type : Error<
5678 "return type of out-of-line definition of %q0 differs from "
5679 "that in the declaration">;
5680 def err_nonstatic_member_out_of_line : Error<
5681 "non-static data member defined out-of-line">;
5682 def err_qualified_typedef_declarator : Error<
5683 "typedef declarator cannot be qualified">;
5684 def err_qualified_param_declarator : Error<
5685 "parameter declarator cannot be qualified">;
5686 def ext_out_of_line_declaration : ExtWarn<
5687 "out-of-line declaration of a member must be a definition">,
5688 InGroup<OutOfLineDeclaration>, DefaultError;
5689 def err_member_extra_qualification : Error<
5690 "extra qualification on member %0">;
5691 def warn_member_extra_qualification : Warning<
5692 err_member_extra_qualification.Text>, InGroup<MicrosoftExtraQualification>;
5693 def warn_namespace_member_extra_qualification : Warning<
5694 "extra qualification on member %0">,
5695 InGroup<DiagGroup<"extra-qualification">>;
5696 def err_member_qualification : Error<
5697 "non-friend class member %0 cannot have a qualified name">;
5698 def note_member_def_close_match : Note<"member declaration nearly matches">;
5699 def note_member_def_close_const_match : Note<
5700 "member declaration does not match because "
5701 "it %select{is|is not}0 const qualified">;
5702 def note_member_def_close_param_match : Note<
5703 "type of %ordinal0 parameter of member declaration does not match definition"
5704 "%diff{ ($ vs $)|}1,2">;
5705 def note_local_decl_close_match : Note<"local declaration nearly matches">;
5706 def note_local_decl_close_param_match : Note<
5707 "type of %ordinal0 parameter of local declaration does not match definition"
5708 "%diff{ ($ vs $)|}1,2">;
5709 def err_typecheck_ivar_variable_size : Error<
5710 "instance variables must have a constant size">;
5711 def err_ivar_reference_type : Error<
5712 "instance variables cannot be of reference type">;
5713 def err_typecheck_illegal_increment_decrement : Error<
5714 "cannot %select{decrement|increment}1 value of type %0">;
5715 def err_typecheck_expect_int : Error<
5716 "used type %0 where integer is required">;
5717 def err_typecheck_arithmetic_incomplete_type : Error<
5718 "arithmetic on a pointer to an incomplete type %0">;
5719 def err_typecheck_pointer_arith_function_type : Error<
5720 "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 "
5721 "function type%select{|s}2 %1%select{| and %3}2">;
5722 def err_typecheck_pointer_arith_void_type : Error<
5723 "arithmetic on%select{ a|}0 pointer%select{|s}0 to void">;
5724 def err_typecheck_decl_incomplete_type : Error<
5725 "variable has incomplete type %0">;
5726 def ext_typecheck_decl_incomplete_type : ExtWarn<
5727 "tentative definition of variable with internal linkage has incomplete non-array type %0">,
5728 InGroup<DiagGroup<"tentative-definition-incomplete-type">>;
5729 def err_tentative_def_incomplete_type : Error<
5730 "tentative definition has type %0 that is never completed">;
5731 def warn_tentative_incomplete_array : Warning<
5732 "tentative array definition assumed to have one element">;
5733 def err_typecheck_incomplete_array_needs_initializer : Error<
5734 "definition of variable with array type needs an explicit size "
5735 "or an initializer">;
5736 def err_array_init_not_init_list : Error<
5737 "array initializer must be an initializer "
5738 "list%select{| or string literal| or wide string literal}0">;
5739 def err_array_init_narrow_string_into_wchar : Error<
5740 "initializing wide char array with non-wide string literal">;
5741 def err_array_init_wide_string_into_char : Error<
5742 "initializing char array with wide string literal">;
5743 def err_array_init_incompat_wide_string_into_wchar : Error<
5744 "initializing wide char array with incompatible wide string literal">;
5745 def err_array_init_plain_string_into_char8_t : Error<
5746 "initializing 'char8_t' array with plain string literal">;
5747 def note_array_init_plain_string_into_char8_t : Note<
5748 "add 'u8' prefix to form a 'char8_t' string literal">;
5749 def err_array_init_utf8_string_into_char : Error<
5750 "initialization of char array with UTF-8 string literal is not permitted "
5752 def err_array_init_different_type : Error<
5753 "cannot initialize array %diff{of type $ with array of type $|"
5754 "with different type of array}0,1">;
5755 def err_array_init_non_constant_array : Error<
5756 "cannot initialize array %diff{of type $ with non-constant array of type $|"
5757 "with different type of array}0,1">;
5758 def ext_array_init_copy : Extension<
5759 "initialization of an array "
5760 "%diff{of type $ from a compound literal of type $|"
5761 "from a compound literal}0,1 is a GNU extension">, InGroup<GNUCompoundLiteralInitializer>;
5762 // This is intentionally not disabled by -Wno-gnu.
5763 def ext_array_init_parens : ExtWarn<
5764 "parenthesized initialization of a member array is a GNU extension">,
5765 InGroup<DiagGroup<"gnu-array-member-paren-init">>, DefaultError;
5766 def warn_deprecated_string_literal_conversion : Warning<
5767 "conversion from string literal to %0 is deprecated">,
5768 InGroup<CXX11CompatDeprecatedWritableStr>;
5769 def ext_deprecated_string_literal_conversion : ExtWarn<
5770 "ISO C++11 does not allow conversion from string literal to %0">,
5771 InGroup<WritableStrings>, SFINAEFailure;
5772 def err_realimag_invalid_type : Error<"invalid type %0 to %1 operator">;
5773 def err_typecheck_sclass_fscope : Error<
5774 "illegal storage class on file-scoped variable">;
5775 def warn_standalone_specifier : Warning<"'%0' ignored on this declaration">,
5776 InGroup<MissingDeclarations>;
5777 def ext_standalone_specifier : ExtWarn<"'%0' is not permitted on a declaration "
5778 "of a type">, InGroup<MissingDeclarations>;
5779 def err_standalone_class_nested_name_specifier : Error<
5780 "forward declaration of %select{class|struct|interface|union|enum}0 cannot "
5781 "have a nested name specifier">;
5782 def err_typecheck_sclass_func : Error<"illegal storage class on function">;
5783 def err_static_block_func : Error<
5784 "function declared in block scope cannot have 'static' storage class">;
5785 def err_typecheck_address_of : Error<"address of %select{bit-field"
5786 "|vector element|property expression|register variable}0 requested">;
5787 def ext_typecheck_addrof_void : Extension<
5788 "ISO C forbids taking the address of an expression of type 'void'">;
5789 def err_unqualified_pointer_member_function : Error<
5790 "must explicitly qualify name of member function when taking its address">;
5791 def err_invalid_form_pointer_member_function : Error<
5792 "cannot create a non-constant pointer to member function">;
5793 def err_address_of_function_with_pass_object_size_params: Error<
5794 "cannot take address of function %0 because parameter %1 has "
5795 "pass_object_size attribute">;
5796 def err_parens_pointer_member_function : Error<
5797 "cannot parenthesize the name of a method when forming a member pointer">;
5798 def err_typecheck_invalid_lvalue_addrof_addrof_function : Error<
5799 "extra '&' taking address of overloaded function">;
5800 def err_typecheck_invalid_lvalue_addrof : Error<
5801 "cannot take the address of an rvalue of type %0">;
5802 def ext_typecheck_addrof_temporary : ExtWarn<
5803 "taking the address of a temporary object of type %0">,
5804 InGroup<AddressOfTemporary>, DefaultError;
5805 def err_typecheck_addrof_temporary : Error<
5806 "taking the address of a temporary object of type %0">;
5807 def err_typecheck_addrof_dtor : Error<
5808 "taking the address of a destructor">;
5809 def err_typecheck_unary_expr : Error<
5810 "invalid argument type %0 to unary expression">;
5811 def err_typecheck_indirection_requires_pointer : Error<
5812 "indirection requires pointer operand (%0 invalid)">;
5813 def ext_typecheck_indirection_through_void_pointer : ExtWarn<
5814 "ISO C++ does not allow indirection on operand of type %0">,
5815 InGroup<DiagGroup<"void-ptr-dereference">>;
5816 def warn_indirection_through_null : Warning<
5817 "indirection of non-volatile null pointer will be deleted, not trap">,
5818 InGroup<NullDereference>;
5819 def warn_binding_null_to_reference : Warning<
5820 "binding dereferenced null pointer to reference has undefined behavior">,
5821 InGroup<NullDereference>;
5822 def note_indirection_through_null : Note<
5823 "consider using __builtin_trap() or qualifying pointer with 'volatile'">;
5824 def warn_pointer_indirection_from_incompatible_type : Warning<
5825 "dereference of type %1 that was reinterpret_cast from type %0 has undefined "
5827 InGroup<UndefinedReinterpretCast>, DefaultIgnore;
5828 def warn_taking_address_of_packed_member : Warning<
5829 "taking address of packed member %0 of class or structure %q1 may result in an unaligned pointer value">,
5830 InGroup<DiagGroup<"address-of-packed-member">>;
5832 def err_objc_object_assignment : Error<
5833 "cannot assign to class object (%0 invalid)">;
5834 def err_typecheck_invalid_operands : Error<
5835 "invalid operands to binary expression (%0 and %1)">;
5836 def note_typecheck_invalid_operands_converted : Note<
5837 "%select{first|second}0 operand was implicitly converted to type %1">;
5838 def err_typecheck_logical_vector_expr_gnu_cpp_restrict : Error<
5839 "logical expression with vector %select{type %1 and non-vector type %2|types"
5840 " %1 and %2}0 is only supported in C++">;
5841 def err_typecheck_sub_ptr_compatible : Error<
5842 "%diff{$ and $ are not pointers to compatible types|"
5843 "pointers to incompatible types}0,1">;
5844 def ext_typecheck_ordered_comparison_of_pointer_integer : ExtWarn<
5845 "ordered comparison between pointer and integer (%0 and %1)">;
5846 def ext_typecheck_ordered_comparison_of_pointer_and_zero : Extension<
5847 "ordered comparison between pointer and zero (%0 and %1) is an extension">;
5848 def err_typecheck_ordered_comparison_of_pointer_and_zero : Error<
5849 "ordered comparison between pointer and zero (%0 and %1)">;
5850 def ext_typecheck_ordered_comparison_of_function_pointers : ExtWarn<
5851 "ordered comparison of function pointers (%0 and %1)">,
5852 InGroup<DiagGroup<"ordered-compare-function-pointers">>;
5853 def ext_typecheck_comparison_of_fptr_to_void : Extension<
5854 "equality comparison between function pointer and void pointer (%0 and %1)">;
5855 def err_typecheck_comparison_of_fptr_to_void : Error<
5856 "equality comparison between function pointer and void pointer (%0 and %1)">;
5857 def ext_typecheck_comparison_of_pointer_integer : ExtWarn<
5858 "comparison between pointer and integer (%0 and %1)">;
5859 def err_typecheck_comparison_of_pointer_integer : Error<
5860 "comparison between pointer and integer (%0 and %1)">;
5861 def ext_typecheck_comparison_of_distinct_pointers : ExtWarn<
5862 "comparison of distinct pointer types%diff{ ($ and $)|}0,1">,
5863 InGroup<CompareDistinctPointerType>;
5864 def ext_typecheck_cond_incompatible_operands : ExtWarn<
5865 "incompatible operand types (%0 and %1)">;
5866 def err_cond_voidptr_arc : Error <
5867 "operands to conditional of types%diff{ $ and $|}0,1 are incompatible "
5869 def err_typecheck_comparison_of_distinct_pointers : Error<
5870 "comparison of distinct pointer types%diff{ ($ and $)|}0,1">;
5871 def err_typecheck_op_on_nonoverlapping_address_space_pointers : Error<
5872 "%select{comparison between %diff{ ($ and $)|}0,1"
5873 "|arithmetic operation with operands of type %diff{ ($ and $)|}0,1"
5874 "|conditional operator with the second and third operands of type "
5875 "%diff{ ($ and $)|}0,1}2"
5876 " which are pointers to non-overlapping address spaces">;
5878 def err_typecheck_assign_const : Error<
5880 "cannot assign to return value because function %1 returns a const value|"
5881 "cannot assign to variable %1 with const-qualified type %2|"
5882 "cannot assign to %select{non-|}1static data member %2 "
5883 "with const-qualified type %3|"
5884 "cannot assign to non-static data member within const member function %1|"
5885 "cannot assign to %select{variable %2|non-static data member %2|lvalue}1 "
5886 "with %select{|nested }3const-qualified data member %4|"
5887 "read-only variable is not assignable}0">;
5889 def note_typecheck_assign_const : Note<
5891 "function %1 which returns const-qualified type %2 declared here|"
5892 "variable %1 declared const here|"
5893 "%select{non-|}1static data member %2 declared const here|"
5894 "member function %q1 is declared const here|"
5895 "%select{|nested }1data member %2 declared const here}0">;
5897 def warn_unsigned_always_true_comparison : Warning<
5898 "result of comparison of %select{%3|unsigned expression}0 %2 "
5899 "%select{unsigned expression|%3}0 is always %4">,
5900 InGroup<TautologicalUnsignedZeroCompare>, DefaultIgnore;
5901 def warn_unsigned_enum_always_true_comparison : Warning<
5902 "result of comparison of %select{%3|unsigned enum expression}0 %2 "
5903 "%select{unsigned enum expression|%3}0 is always %4">,
5904 InGroup<TautologicalUnsignedEnumZeroCompare>, DefaultIgnore;
5905 def warn_tautological_constant_compare : Warning<
5906 "result of comparison %select{%3|%1}0 %2 "
5907 "%select{%1|%3}0 is always %4">,
5908 InGroup<TautologicalTypeLimitCompare>, DefaultIgnore;
5910 def warn_mixed_sign_comparison : Warning<
5911 "comparison of integers of different signs: %0 and %1">,
5912 InGroup<SignCompare>, DefaultIgnore;
5913 def warn_out_of_range_compare : Warning<
5914 "result of comparison of %select{constant %0|true|false}1 with "
5915 "%select{expression of type %2|boolean expression}3 is always %4">,
5916 InGroup<TautologicalOutOfRangeCompare>;
5917 def warn_tautological_bool_compare : Warning<warn_out_of_range_compare.Text>,
5918 InGroup<TautologicalConstantCompare>;
5919 def warn_comparison_of_mixed_enum_types : Warning<
5920 "comparison of two values with different enumeration types"
5921 "%diff{ ($ and $)|}0,1">,
5922 InGroup<EnumCompare>;
5923 def warn_comparison_of_mixed_enum_types_switch : Warning<
5924 "comparison of two values with different enumeration types in switch statement"
5925 "%diff{ ($ and $)|}0,1">,
5926 InGroup<EnumCompareSwitch>;
5927 def warn_null_in_arithmetic_operation : Warning<
5928 "use of NULL in arithmetic operation">,
5929 InGroup<NullArithmetic>;
5930 def warn_null_in_comparison_operation : Warning<
5931 "comparison between NULL and non-pointer "
5932 "%select{(%1 and NULL)|(NULL and %1)}0">,
5933 InGroup<NullArithmetic>;
5934 def err_shift_rhs_only_vector : Error<
5935 "requested shift is a vector of type %0 but the first operand is not a "
5938 def warn_logical_not_on_lhs_of_check : Warning<
5939 "logical not is only applied to the left hand side of this "
5940 "%select{comparison|bitwise operator}0">,
5941 InGroup<LogicalNotParentheses>;
5942 def note_logical_not_fix : Note<
5943 "add parentheses after the '!' to evaluate the "
5944 "%select{comparison|bitwise operator}0 first">;
5945 def note_logical_not_silence_with_parens : Note<
5946 "add parentheses around left hand side expression to silence this warning">;
5948 def err_invalid_this_use : Error<
5949 "invalid use of 'this' outside of a non-static member function">;
5950 def err_this_static_member_func : Error<
5951 "'this' cannot be%select{| implicitly}0 used in a static member function "
5953 def err_invalid_member_use_in_static_method : Error<
5954 "invalid use of member %0 in static member function">;
5955 def err_invalid_qualified_function_type : Error<
5956 "%select{non-member function|static member function|deduction guide}0 "
5957 "%select{of type %2 |}1cannot have '%3' qualifier">;
5958 def err_compound_qualified_function_type : Error<
5959 "%select{block pointer|pointer|reference}0 to function type %select{%2 |}1"
5960 "cannot have '%3' qualifier">;
5962 def err_ref_qualifier_overload : Error<
5963 "cannot overload a member function %select{without a ref-qualifier|with "
5964 "ref-qualifier '&'|with ref-qualifier '&&'}0 with a member function %select{"
5965 "without a ref-qualifier|with ref-qualifier '&'|with ref-qualifier '&&'}1">;
5967 def err_invalid_non_static_member_use : Error<
5968 "invalid use of non-static data member %0">;
5969 def err_nested_non_static_member_use : Error<
5970 "%select{call to non-static member function|use of non-static data member}0 "
5971 "%2 of %1 from nested type %3">;
5972 def warn_cxx98_compat_non_static_member_use : Warning<
5973 "use of non-static data member %0 in an unevaluated context is "
5974 "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
5975 def err_invalid_incomplete_type_use : Error<
5976 "invalid use of incomplete type %0">;
5977 def err_builtin_func_cast_more_than_one_arg : Error<
5978 "function-style cast to a builtin type can only take one argument">;
5979 def err_value_init_for_array_type : Error<
5980 "array types cannot be value-initialized">;
5981 def err_init_for_function_type : Error<
5982 "cannot create object of function type %0">;
5983 def warn_format_nonliteral_noargs : Warning<
5984 "format string is not a string literal (potentially insecure)">,
5985 InGroup<FormatSecurity>;
5986 def warn_format_nonliteral : Warning<
5987 "format string is not a string literal">,
5988 InGroup<FormatNonLiteral>, DefaultIgnore;
5990 def err_unexpected_interface : Error<
5991 "unexpected interface name %0: expected expression">;
5992 def err_ref_non_value : Error<"%0 does not refer to a value">;
5993 def err_ref_vm_type : Error<
5994 "cannot refer to declaration with a variably modified type inside block">;
5995 def err_ref_flexarray_type : Error<
5996 "cannot refer to declaration of structure variable with flexible array member "
5998 def err_ref_array_type : Error<
5999 "cannot refer to declaration with an array type inside block">;
6000 def err_property_not_found : Error<
6001 "property %0 not found on object of type %1">;
6002 def err_invalid_property_name : Error<
6003 "%0 is not a valid property name (accessing an object of type %1)">;
6004 def err_getter_not_found : Error<
6005 "no getter method for read from property">;
6006 def err_objc_subscript_method_not_found : Error<
6007 "expected method to %select{read|write}1 %select{dictionary|array}2 element not "
6008 "found on object of type %0">;
6009 def err_objc_subscript_index_type : Error<
6010 "method index parameter type %0 is not integral type">;
6011 def err_objc_subscript_key_type : Error<
6012 "method key parameter type %0 is not object type">;
6013 def err_objc_subscript_dic_object_type : Error<
6014 "method object parameter type %0 is not object type">;
6015 def err_objc_subscript_object_type : Error<
6016 "cannot assign to this %select{dictionary|array}1 because assigning method's "
6017 "2nd parameter of type %0 is not an Objective-C pointer type">;
6018 def err_objc_subscript_base_type : Error<
6019 "%select{dictionary|array}1 subscript base type %0 is not an Objective-C object">;
6020 def err_objc_multiple_subscript_type_conversion : Error<
6021 "indexing expression is invalid because subscript type %0 has "
6022 "multiple type conversion functions">;
6023 def err_objc_subscript_type_conversion : Error<
6024 "indexing expression is invalid because subscript type %0 is not an integral"
6025 " or Objective-C pointer type">;
6026 def err_objc_subscript_pointer : Error<
6027 "indexing expression is invalid because subscript type %0 is not an"
6028 " Objective-C pointer">;
6029 def err_objc_indexing_method_result_type : Error<
6030 "method for accessing %select{dictionary|array}1 element must have Objective-C"
6031 " object return type instead of %0">;
6032 def err_objc_index_incomplete_class_type : Error<
6033 "Objective-C index expression has incomplete class type %0">;
6034 def err_illegal_container_subscripting_op : Error<
6035 "illegal operation on Objective-C container subscripting">;
6036 def err_property_not_found_forward_class : Error<
6037 "property %0 cannot be found in forward class object %1">;
6038 def err_property_not_as_forward_class : Error<
6039 "property %0 refers to an incomplete Objective-C class %1 "
6040 "(with no @interface available)">;
6041 def note_forward_class : Note<
6042 "forward declaration of class here">;
6043 def err_duplicate_property : Error<
6044 "property has a previous declaration">;
6045 def ext_gnu_void_ptr : Extension<
6046 "arithmetic on%select{ a|}0 pointer%select{|s}0 to void is a GNU extension">,
6047 InGroup<PointerArith>;
6048 def ext_gnu_ptr_func_arith : Extension<
6049 "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 function "
6050 "type%select{|s}2 %1%select{| and %3}2 is a GNU extension">,
6051 InGroup<PointerArith>;
6052 def err_readonly_message_assignment : Error<
6053 "assigning to 'readonly' return result of an Objective-C message not allowed">;
6054 def ext_integer_increment_complex : Extension<
6055 "ISO C does not support '++'/'--' on complex integer type %0">;
6056 def ext_integer_complement_complex : Extension<
6057 "ISO C does not support '~' for complex conjugation of %0">;
6058 def err_nosetter_property_assignment : Error<
6059 "%select{assignment to readonly property|"
6060 "no setter method %1 for assignment to property}0">;
6061 def err_nosetter_property_incdec : Error<
6062 "%select{%select{increment|decrement}1 of readonly property|"
6063 "no setter method %2 for %select{increment|decrement}1 of property}0">;
6064 def err_nogetter_property_compound_assignment : Error<
6065 "a getter method is needed to perform a compound assignment on a property">;
6066 def err_nogetter_property_incdec : Error<
6067 "no getter method %1 for %select{increment|decrement}0 of property">;
6068 def err_no_subobject_property_setting : Error<
6069 "expression is not assignable">;
6070 def err_qualified_objc_access : Error<
6071 "%select{property|instance variable}0 access cannot be qualified with '%1'">;
6073 def ext_freestanding_complex : Extension<
6074 "complex numbers are an extension in a freestanding C99 implementation">;
6076 // FIXME: Remove when we support imaginary.
6077 def err_imaginary_not_supported : Error<"imaginary types are not supported">;
6079 // Obj-c expressions
6080 def warn_root_inst_method_not_found : Warning<
6081 "instance method %0 is being used on 'Class' which is not in the root class">,
6082 InGroup<MethodAccess>;
6083 def warn_class_method_not_found : Warning<
6084 "class method %objcclass0 not found (return type defaults to 'id')">,
6085 InGroup<MethodAccess>;
6086 def warn_instance_method_on_class_found : Warning<
6087 "instance method %0 found instead of class method %1">,
6088 InGroup<MethodAccess>;
6089 def warn_inst_method_not_found : Warning<
6090 "instance method %objcinstance0 not found (return type defaults to 'id')">,
6091 InGroup<MethodAccess>;
6092 def warn_instance_method_not_found_with_typo : Warning<
6093 "instance method %objcinstance0 not found (return type defaults to 'id')"
6094 "; did you mean %objcinstance2?">, InGroup<MethodAccess>;
6095 def warn_class_method_not_found_with_typo : Warning<
6096 "class method %objcclass0 not found (return type defaults to 'id')"
6097 "; did you mean %objcclass2?">, InGroup<MethodAccess>;
6098 def err_method_not_found_with_typo : Error<
6099 "%select{instance|class}1 method %0 not found "
6100 "; did you mean %2?">;
6101 def err_no_super_class_message : Error<
6102 "no @interface declaration found in class messaging of %0">;
6103 def err_root_class_cannot_use_super : Error<
6104 "%0 cannot use 'super' because it is a root class">;
6105 def err_invalid_receiver_to_message_super : Error<
6106 "'super' is only valid in a method body">;
6107 def err_invalid_receiver_class_message : Error<
6108 "receiver type %0 is not an Objective-C class">;
6109 def err_missing_open_square_message_send : Error<
6110 "missing '[' at start of message send expression">;
6111 def warn_bad_receiver_type : Warning<
6112 "receiver type %0 is not 'id' or interface pointer, consider "
6113 "casting it to 'id'">,InGroup<ObjCReceiver>;
6114 def err_bad_receiver_type : Error<"bad receiver type %0">;
6115 def err_incomplete_receiver_type : Error<"incomplete receiver type %0">;
6116 def err_unknown_receiver_suggest : Error<
6117 "unknown receiver %0; did you mean %1?">;
6118 def err_objc_throw_expects_object : Error<
6119 "@throw requires an Objective-C object type (%0 invalid)">;
6120 def err_objc_synchronized_expects_object : Error<
6121 "@synchronized requires an Objective-C object type (%0 invalid)">;
6122 def err_rethrow_used_outside_catch : Error<
6123 "@throw (rethrow) used outside of a @catch block">;
6124 def err_attribute_multiple_objc_gc : Error<
6125 "multiple garbage collection attributes specified for type">;
6126 def err_catch_param_not_objc_type : Error<
6127 "@catch parameter is not a pointer to an interface type">;
6128 def err_illegal_qualifiers_on_catch_parm : Error<
6129 "illegal qualifiers on @catch parameter">;
6130 def err_storage_spec_on_catch_parm : Error<
6131 "@catch parameter cannot have storage specifier '%0'">;
6132 def warn_register_objc_catch_parm : Warning<
6133 "'register' storage specifier on @catch parameter will be ignored">;
6134 def err_qualified_objc_catch_parm : Error<
6135 "@catch parameter declarator cannot be qualified">;
6136 def warn_objc_pointer_cxx_catch_fragile : Warning<
6137 "cannot catch an exception thrown with @throw in C++ in the non-unified "
6138 "exception model">, InGroup<ObjCNonUnifiedException>;
6139 def err_objc_object_catch : Error<
6140 "cannot catch an Objective-C object by value">;
6141 def err_incomplete_type_objc_at_encode : Error<
6142 "'@encode' of incomplete type %0">;
6143 def warn_objc_circular_container : Warning<
6144 "adding %0 to %1 might cause circular dependency in container">,
6145 InGroup<DiagGroup<"objc-circular-container">>;
6146 def note_objc_circular_container_declared_here : Note<"%0 declared here">;
6147 def warn_objc_unsafe_perform_selector : Warning<
6148 "%0 is incompatible with selectors that return a "
6149 "%select{struct|union|vector}1 type">,
6150 InGroup<DiagGroup<"objc-unsafe-perform-selector">>;
6151 def note_objc_unsafe_perform_selector_method_declared_here : Note<
6152 "method %0 that returns %1 declared here">;
6154 def warn_setter_getter_impl_required : Warning<
6155 "property %0 requires method %1 to be defined - "
6156 "use @synthesize, @dynamic or provide a method implementation "
6157 "in this class implementation">,
6158 InGroup<ObjCPropertyImpl>;
6159 def warn_setter_getter_impl_required_in_category : Warning<
6160 "property %0 requires method %1 to be defined - "
6161 "use @dynamic or provide a method implementation in this category">,
6162 InGroup<ObjCPropertyImpl>;
6163 def note_parameter_named_here : Note<
6164 "passing argument to parameter %0 here">;
6165 def note_parameter_here : Note<
6166 "passing argument to parameter here">;
6167 def note_method_return_type_change : Note<
6168 "compiler has implicitly changed method %0 return type">;
6170 def warn_impl_required_for_class_property : Warning<
6171 "class property %0 requires method %1 to be defined - "
6172 "use @dynamic or provide a method implementation "
6173 "in this class implementation">,
6174 InGroup<ObjCPropertyImpl>;
6175 def warn_impl_required_in_category_for_class_property : Warning<
6176 "class property %0 requires method %1 to be defined - "
6177 "use @dynamic or provide a method implementation in this category">,
6178 InGroup<ObjCPropertyImpl>;
6181 // These messages adhere to the TryCast pattern: %0 is an int specifying the
6182 // cast type, %1 is the source type, %2 is the destination type.
6183 def err_bad_reinterpret_cast_overload : Error<
6184 "reinterpret_cast cannot resolve overloaded function %0 to type %1">;
6186 def warn_reinterpret_different_from_static : Warning<
6187 "'reinterpret_cast' %select{from|to}3 class %0 %select{to|from}3 its "
6188 "%select{virtual base|base at non-zero offset}2 %1 behaves differently from "
6189 "'static_cast'">, InGroup<ReinterpretBaseClass>;
6190 def note_reinterpret_updowncast_use_static: Note<
6191 "use 'static_cast' to adjust the pointer correctly while "
6192 "%select{upcasting|downcasting}0">;
6194 def err_bad_static_cast_overload : Error<
6195 "address of overloaded function %0 cannot be static_cast to type %1">;
6197 def err_bad_cstyle_cast_overload : Error<
6198 "address of overloaded function %0 cannot be cast to type %1">;
6201 def err_bad_cxx_cast_generic : Error<
6202 "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
6203 "functional-style cast}0 from %1 to %2 is not allowed">;
6204 def err_bad_cxx_cast_unrelated_class : Error<
6205 "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
6206 "functional-style cast}0 from %1 to %2, which are not related by "
6207 "inheritance, is not allowed">;
6208 def note_type_incomplete : Note<"%0 is incomplete">;
6209 def err_bad_cxx_cast_rvalue : Error<
6210 "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
6211 "functional-style cast}0 from rvalue to reference type %2">;
6212 def err_bad_cxx_cast_bitfield : Error<
6213 "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
6214 "functional-style cast}0 from bit-field lvalue to reference type %2">;
6215 def err_bad_cxx_cast_qualifiers_away : Error<
6216 "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
6217 "functional-style cast}0 from %1 to %2 casts away qualifiers">;
6218 def ext_bad_cxx_cast_qualifiers_away_incoherent : ExtWarn<
6219 "ISO C++ does not allow "
6220 "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
6221 "functional-style cast}0 from %1 to %2 because it casts away qualifiers, "
6222 "even though the source and destination types are unrelated">,
6223 SFINAEFailure, InGroup<DiagGroup<"cast-qual-unrelated">>;
6224 def err_bad_const_cast_dest : Error<
6225 "%select{const_cast||||C-style cast|functional-style cast}0 to %2, "
6226 "which is not a reference, pointer-to-object, or pointer-to-data-member">;
6227 def ext_cast_fn_obj : Extension<
6228 "cast between pointer-to-function and pointer-to-object is an extension">;
6229 def ext_ms_cast_fn_obj : ExtWarn<
6230 "static_cast between pointer-to-function and pointer-to-object is a "
6231 "Microsoft extension">, InGroup<MicrosoftCast>;
6232 def warn_cxx98_compat_cast_fn_obj : Warning<
6233 "cast between pointer-to-function and pointer-to-object is incompatible with C++98">,
6234 InGroup<CXX98CompatPedantic>, DefaultIgnore;
6235 def err_bad_reinterpret_cast_small_int : Error<
6236 "cast from pointer to smaller type %2 loses information">;
6237 def err_bad_cxx_cast_vector_to_scalar_different_size : Error<
6238 "%select{||reinterpret_cast||C-style cast|}0 from vector %1 "
6239 "to scalar %2 of different size">;
6240 def err_bad_cxx_cast_scalar_to_vector_different_size : Error<
6241 "%select{||reinterpret_cast||C-style cast|}0 from scalar %1 "
6242 "to vector %2 of different size">;
6243 def err_bad_cxx_cast_vector_to_vector_different_size : Error<
6244 "%select{||reinterpret_cast||C-style cast|}0 from vector %1 "
6245 "to vector %2 of different size">;
6246 def err_bad_lvalue_to_rvalue_cast : Error<
6247 "cannot cast from lvalue of type %1 to rvalue reference type %2; types are "
6249 def err_bad_rvalue_to_rvalue_cast : Error<
6250 "cannot cast from rvalue of type %1 to rvalue reference type %2; types are "
6252 def err_bad_static_cast_pointer_nonpointer : Error<
6253 "cannot cast from type %1 to pointer type %2">;
6254 def err_bad_static_cast_member_pointer_nonmp : Error<
6255 "cannot cast from type %1 to member pointer type %2">;
6256 def err_bad_cxx_cast_member_pointer_size : Error<
6257 "cannot %select{||reinterpret_cast||C-style cast|}0 from member pointer "
6258 "type %1 to member pointer type %2 of different size">;
6259 def err_bad_reinterpret_cast_reference : Error<
6260 "reinterpret_cast of a %0 to %1 needs its address, which is not allowed">;
6261 def warn_undefined_reinterpret_cast : Warning<
6262 "reinterpret_cast from %0 to %1 has undefined behavior">,
6263 InGroup<UndefinedReinterpretCast>, DefaultIgnore;
6265 // These messages don't adhere to the pattern.
6266 // FIXME: Display the path somehow better.
6267 def err_ambiguous_base_to_derived_cast : Error<
6268 "ambiguous cast from base %0 to derived %1:%2">;
6269 def err_static_downcast_via_virtual : Error<
6270 "cannot cast %0 to %1 via virtual base %2">;
6271 def err_downcast_from_inaccessible_base : Error<
6272 "cannot cast %select{private|protected}2 base class %1 to %0">;
6273 def err_upcast_to_inaccessible_base : Error<
6274 "cannot cast %0 to its %select{private|protected}2 base class %1">;
6275 def err_bad_dynamic_cast_not_ref_or_ptr : Error<
6276 "%0 is not a reference or pointer">;
6277 def err_bad_dynamic_cast_not_class : Error<"%0 is not a class">;
6278 def err_bad_dynamic_cast_incomplete : Error<"%0 is an incomplete type">;
6279 def err_bad_dynamic_cast_not_ptr : Error<"%0 is not a pointer">;
6280 def err_bad_dynamic_cast_not_polymorphic : Error<"%0 is not polymorphic">;
6282 // Other C++ expressions
6283 def err_need_header_before_typeid : Error<
6284 "you need to include <typeinfo> before using the 'typeid' operator">;
6285 def err_need_header_before_ms_uuidof : Error<
6286 "you need to include <guiddef.h> before using the '__uuidof' operator">;
6287 def err_ms___leave_not_in___try : Error<
6288 "'__leave' statement not in __try block">;
6289 def err_uuidof_without_guid : Error<
6290 "cannot call operator __uuidof on a type with no GUID">;
6291 def err_uuidof_with_multiple_guids : Error<
6292 "cannot call operator __uuidof on a type with multiple GUIDs">;
6293 def err_incomplete_typeid : Error<"'typeid' of incomplete type %0">;
6294 def err_variably_modified_typeid : Error<"'typeid' of variably modified type %0">;
6295 def err_static_illegal_in_new : Error<
6296 "the 'static' modifier for the array size is not legal in new expressions">;
6297 def err_array_new_needs_size : Error<
6298 "array size must be specified in new expressions">;
6299 def err_bad_new_type : Error<
6300 "cannot allocate %select{function|reference}1 type %0 with new">;
6301 def err_new_incomplete_type : Error<
6302 "allocation of incomplete type %0">;
6303 def err_new_array_nonconst : Error<
6304 "only the first dimension of an allocated array may have dynamic size">;
6305 def err_new_array_init_args : Error<
6306 "array 'new' cannot have initialization arguments">;
6307 def ext_new_paren_array_nonconst : ExtWarn<
6308 "when type is in parentheses, array cannot have dynamic size">;
6309 def err_placement_new_non_placement_delete : Error<
6310 "'new' expression with placement arguments refers to non-placement "
6311 "'operator delete'">;
6312 def err_array_size_not_integral : Error<
6313 "array size expression must have integral or %select{|unscoped }0"
6314 "enumeration type, not %1">;
6315 def err_array_size_incomplete_type : Error<
6316 "array size expression has incomplete class type %0">;
6317 def err_array_size_explicit_conversion : Error<
6318 "array size expression of type %0 requires explicit conversion to type %1">;
6319 def note_array_size_conversion : Note<
6320 "conversion to %select{integral|enumeration}0 type %1 declared here">;
6321 def err_array_size_ambiguous_conversion : Error<
6322 "ambiguous conversion of array size expression of type %0 to an integral or "
6323 "enumeration type">;
6324 def ext_array_size_conversion : Extension<
6325 "implicit conversion from array size expression of type %0 to "
6326 "%select{integral|enumeration}1 type %2 is a C++11 extension">,
6328 def warn_cxx98_compat_array_size_conversion : Warning<
6329 "implicit conversion from array size expression of type %0 to "
6330 "%select{integral|enumeration}1 type %2 is incompatible with C++98">,
6331 InGroup<CXX98CompatPedantic>, DefaultIgnore;
6332 def err_address_space_qualified_new : Error<
6333 "'new' cannot allocate objects of type %0 in address space '%1'">;
6334 def err_address_space_qualified_delete : Error<
6335 "'delete' cannot delete objects of type %0 in address space '%1'">;
6337 def err_default_init_const : Error<
6338 "default initialization of an object of const type %0"
6339 "%select{| without a user-provided default constructor}1">;
6340 def ext_default_init_const : ExtWarn<
6341 "default initialization of an object of const type %0"
6342 "%select{| without a user-provided default constructor}1 "
6343 "is a Microsoft extension">,
6344 InGroup<MicrosoftConstInit>;
6345 def err_delete_operand : Error<"cannot delete expression of type %0">;
6346 def ext_delete_void_ptr_operand : ExtWarn<
6347 "cannot delete expression with pointer-to-'void' type %0">,
6348 InGroup<DeleteIncomplete>;
6349 def err_ambiguous_delete_operand : Error<
6350 "ambiguous conversion of delete expression of type %0 to a pointer">;
6351 def warn_delete_incomplete : Warning<
6352 "deleting pointer to incomplete type %0 may cause undefined behavior">,
6353 InGroup<DeleteIncomplete>;
6354 def err_delete_incomplete_class_type : Error<
6355 "deleting incomplete class type %0; no conversions to pointer type">;
6356 def err_delete_explicit_conversion : Error<
6357 "converting delete expression from type %0 to type %1 invokes an explicit "
6358 "conversion function">;
6359 def note_delete_conversion : Note<"conversion to pointer type %0">;
6360 def warn_delete_array_type : Warning<
6361 "'delete' applied to a pointer-to-array type %0 treated as 'delete[]'">;
6362 def warn_mismatched_delete_new : Warning<
6363 "'delete%select{|[]}0' applied to a pointer that was allocated with "
6364 "'new%select{[]|}0'; did you mean 'delete%select{[]|}0'?">,
6365 InGroup<DiagGroup<"mismatched-new-delete">>;
6366 def note_allocated_here : Note<"allocated with 'new%select{[]|}0' here">;
6367 def err_no_suitable_delete_member_function_found : Error<
6368 "no suitable member %0 in %1">;
6369 def err_ambiguous_suitable_delete_member_function_found : Error<
6370 "multiple suitable %0 functions in %1">;
6371 def warn_ambiguous_suitable_delete_function_found : Warning<
6372 "multiple suitable %0 functions for %1; no 'operator delete' function "
6373 "will be invoked if initialization throws an exception">,
6374 InGroup<DiagGroup<"ambiguous-delete">>;
6375 def note_member_declared_here : Note<
6376 "member %0 declared here">;
6377 def note_member_first_declared_here : Note<
6378 "member %0 first declared here">;
6379 def err_decrement_bool : Error<"cannot decrement expression of type bool">;
6380 def warn_increment_bool : Warning<
6381 "incrementing expression of type bool is deprecated and "
6382 "incompatible with C++17">, InGroup<DeprecatedIncrementBool>;
6383 def ext_increment_bool : ExtWarn<
6384 "ISO C++17 does not allow incrementing expression of type bool">,
6385 DefaultError, InGroup<IncrementBool>;
6386 def err_increment_decrement_enum : Error<
6387 "cannot %select{decrement|increment}0 expression of enum type %1">;
6388 def err_catch_incomplete_ptr : Error<
6389 "cannot catch pointer to incomplete type %0">;
6390 def err_catch_incomplete_ref : Error<
6391 "cannot catch reference to incomplete type %0">;
6392 def err_catch_incomplete : Error<"cannot catch incomplete type %0">;
6393 def err_catch_rvalue_ref : Error<"cannot catch exceptions by rvalue reference">;
6394 def err_catch_variably_modified : Error<
6395 "cannot catch variably modified type %0">;
6396 def err_qualified_catch_declarator : Error<
6397 "exception declarator cannot be qualified">;
6398 def err_early_catch_all : Error<"catch-all handler must come last">;
6399 def err_bad_memptr_rhs : Error<
6400 "right hand operand to %0 has non-pointer-to-member type %1">;
6401 def err_bad_memptr_lhs : Error<
6402 "left hand operand to %0 must be a %select{|pointer to }1class "
6403 "compatible with the right hand operand, but is %2">;
6404 def err_memptr_incomplete : Error<
6405 "member pointer has incomplete base type %0">;
6406 def warn_exception_caught_by_earlier_handler : Warning<
6407 "exception of type %0 will be caught by earlier handler">,
6408 InGroup<Exceptions>;
6409 def note_previous_exception_handler : Note<"for type %0">;
6410 def err_exceptions_disabled : Error<
6411 "cannot use '%0' with exceptions disabled">;
6412 def err_objc_exceptions_disabled : Error<
6413 "cannot use '%0' with Objective-C exceptions disabled">;
6414 def warn_throw_in_noexcept_func : Warning<
6415 "%0 has a non-throwing exception specification but can still throw">,
6416 InGroup<Exceptions>;
6417 def note_throw_in_dtor : Note<
6418 "%select{destructor|deallocator}0 has a %select{non-throwing|implicit "
6419 "non-throwing}1 exception specification">;
6420 def note_throw_in_function : Note<"function declared non-throwing here">;
6421 def err_seh_try_outside_functions : Error<
6422 "cannot use SEH '__try' in blocks, captured regions, or Obj-C method decls">;
6423 def err_mixing_cxx_try_seh_try : Error<
6424 "cannot use C++ 'try' in the same function as SEH '__try'">;
6425 def err_seh_try_unsupported : Error<
6426 "SEH '__try' is not supported on this target">;
6427 def note_conflicting_try_here : Note<
6428 "conflicting %0 here">;
6429 def warn_jump_out_of_seh_finally : Warning<
6430 "jump out of __finally block has undefined behavior">,
6431 InGroup<DiagGroup<"jump-seh-finally">>;
6432 def warn_non_virtual_dtor : Warning<
6433 "%0 has virtual functions but non-virtual destructor">,
6434 InGroup<NonVirtualDtor>, DefaultIgnore;
6435 def warn_delete_non_virtual_dtor : Warning<
6436 "%select{delete|destructor}0 called on non-final %1 that has "
6437 "virtual functions but non-virtual destructor">,
6438 InGroup<DeleteNonVirtualDtor>, DefaultIgnore, ShowInSystemHeader;
6439 def note_delete_non_virtual : Note<
6440 "qualify call to silence this warning">;
6441 def warn_delete_abstract_non_virtual_dtor : Warning<
6442 "%select{delete|destructor}0 called on %1 that is abstract but has "
6443 "non-virtual destructor">, InGroup<DeleteNonVirtualDtor>, ShowInSystemHeader;
6444 def warn_overloaded_virtual : Warning<
6445 "%q0 hides overloaded virtual %select{function|functions}1">,
6446 InGroup<OverloadedVirtual>, DefaultIgnore;
6447 def note_hidden_overloaded_virtual_declared_here : Note<
6448 "hidden overloaded virtual function %q0 declared here"
6449 "%select{|: different classes%diff{ ($ vs $)|}2,3"
6450 "|: different number of parameters (%2 vs %3)"
6451 "|: type mismatch at %ordinal2 parameter%diff{ ($ vs $)|}3,4"
6452 "|: different return type%diff{ ($ vs $)|}2,3"
6453 "|: different qualifiers ("
6454 "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
6455 "volatile and restrict|const, volatile, and restrict}2 vs "
6456 "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
6457 "volatile and restrict|const, volatile, and restrict}3)"
6458 "|: different exception specifications}1">;
6459 def warn_using_directive_in_header : Warning<
6460 "using namespace directive in global context in header">,
6461 InGroup<HeaderHygiene>, DefaultIgnore;
6462 def warn_overaligned_type : Warning<
6463 "type %0 requires %1 bytes of alignment and the default allocator only "
6464 "guarantees %2 bytes">,
6465 InGroup<OveralignedType>, DefaultIgnore;
6466 def warn_aligned_allocation_unavailable :Warning<
6467 "aligned %select{allocation|deallocation}0 function of type '%1' is only "
6468 "available on %2 %3 or newer">, InGroup<AlignedAllocationUnavailable>, DefaultError;
6469 def note_silence_unligned_allocation_unavailable : Note<
6470 "if you supply your own aligned allocation functions, use "
6471 "-Wno-aligned-allocation-unavailable to silence this diagnostic">;
6473 def err_conditional_void_nonvoid : Error<
6474 "%select{left|right}1 operand to ? is void, but %select{right|left}1 operand "
6476 def err_conditional_ambiguous : Error<
6477 "conditional expression is ambiguous; "
6478 "%diff{$ can be converted to $ and vice versa|"
6479 "types can be convert to each other}0,1">;
6480 def err_conditional_ambiguous_ovl : Error<
6481 "conditional expression is ambiguous; %diff{$ and $|types}0,1 "
6482 "can be converted to several common types">;
6483 def err_conditional_vector_size : Error<
6484 "vector condition type %0 and result type %1 do not have the same number "
6486 def err_conditional_vector_element_size : Error<
6487 "vector condition type %0 and result type %1 do not have elements of the "
6490 def err_throw_incomplete : Error<
6491 "cannot throw object of incomplete type %0">;
6492 def err_throw_incomplete_ptr : Error<
6493 "cannot throw pointer to object of incomplete type %0">;
6494 def err_return_in_constructor_handler : Error<
6495 "return in the catch of a function try block of a constructor is illegal">;
6496 def warn_cdtor_function_try_handler_mem_expr : Warning<
6497 "cannot refer to a non-static member from the handler of a "
6498 "%select{constructor|destructor}0 function try block">, InGroup<Exceptions>;
6500 let CategoryName = "Lambda Issue" in {
6501 def err_capture_more_than_once : Error<
6502 "%0 can appear only once in a capture list">;
6503 def err_reference_capture_with_reference_default : Error<
6504 "'&' cannot precede a capture when the capture default is '&'">;
6505 def err_copy_capture_with_copy_default : Error<
6506 "'&' must precede a capture when the capture default is '='">;
6507 def err_capture_does_not_name_variable : Error<
6508 "%0 in capture list does not name a variable">;
6509 def err_capture_non_automatic_variable : Error<
6510 "%0 cannot be captured because it does not have automatic storage "
6512 def err_this_capture : Error<
6513 "'this' cannot be %select{implicitly |}0captured in this context">;
6514 def err_lambda_capture_anonymous_var : Error<
6515 "unnamed variable cannot be implicitly captured in a lambda expression">;
6516 def err_lambda_capture_flexarray_type : Error<
6517 "variable %0 with flexible array member cannot be captured in "
6518 "a lambda expression">;
6519 def err_lambda_impcap : Error<
6520 "variable %0 cannot be implicitly captured in a lambda with no "
6521 "capture-default specified">;
6522 def note_lambda_decl : Note<"lambda expression begins here">;
6523 def err_lambda_unevaluated_operand : Error<
6524 "lambda expression in an unevaluated operand">;
6525 def err_lambda_in_constant_expression : Error<
6526 "a lambda expression may not appear inside of a constant expression">;
6527 def err_lambda_in_invalid_context : Error<
6528 "a lambda expression cannot appear in this context">;
6529 def err_lambda_return_init_list : Error<
6530 "cannot deduce lambda return type from initializer list">;
6531 def err_lambda_capture_default_arg : Error<
6532 "lambda expression in default argument cannot capture any entity">;
6533 def err_lambda_incomplete_result : Error<
6534 "incomplete result type %0 in lambda expression">;
6535 def err_noreturn_lambda_has_return_expr : Error<
6536 "lambda declared 'noreturn' should not return">;
6537 def warn_maybe_falloff_nonvoid_lambda : Warning<
6538 "control may reach end of non-void lambda">,
6539 InGroup<ReturnType>;
6540 def warn_falloff_nonvoid_lambda : Warning<
6541 "control reaches end of non-void lambda">,
6542 InGroup<ReturnType>;
6543 def err_access_lambda_capture : Error<
6544 // The ERRORs represent other special members that aren't constructors, in
6545 // hopes that someone will bother noticing and reporting if they appear
6546 "capture of variable '%0' as type %1 calls %select{private|protected}3 "
6547 "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}2constructor">,
6549 def note_lambda_to_block_conv : Note<
6550 "implicit capture of lambda object due to conversion to block pointer "
6552 def note_var_explicitly_captured_here : Note<"variable %0 is"
6553 "%select{| explicitly}1 captured here">;
6555 // C++14 lambda init-captures.
6556 def warn_cxx11_compat_init_capture : Warning<
6557 "initialized lambda captures are incompatible with C++ standards "
6558 "before C++14">, InGroup<CXXPre14Compat>, DefaultIgnore;
6559 def ext_init_capture : ExtWarn<
6560 "initialized lambda captures are a C++14 extension">, InGroup<CXX14>;
6561 def err_init_capture_no_expression : Error<
6562 "initializer missing for lambda capture %0">;
6563 def err_init_capture_multiple_expressions : Error<
6564 "initializer for lambda capture %0 contains multiple expressions">;
6565 def err_init_capture_paren_braces : Error<
6566 "cannot deduce type for lambda capture %1 from "
6567 "%select{parenthesized|nested}0 initializer list">;
6568 def err_init_capture_deduction_failure : Error<
6569 "cannot deduce type for lambda capture %0 from initializer of type %2">;
6570 def err_init_capture_deduction_failure_from_init_list : Error<
6571 "cannot deduce type for lambda capture %0 from initializer list">;
6573 // C++17 '*this' captures.
6574 def warn_cxx14_compat_star_this_lambda_capture : Warning<
6575 "by value capture of '*this' is incompatible with C++ standards before C++17">,
6576 InGroup<CXXPre17Compat>, DefaultIgnore;
6577 def ext_star_this_lambda_capture_cxx17 : ExtWarn<
6578 "capture of '*this' by copy is a C++17 extension">, InGroup<CXX17>;
6580 // C++2a [=, this] captures.
6581 def warn_cxx17_compat_equals_this_lambda_capture : Warning<
6582 "explicit capture of 'this' with a capture default of '=' is incompatible "
6583 "with C++ standards before C++2a">, InGroup<CXXPre2aCompat>, DefaultIgnore;
6584 def ext_equals_this_lambda_capture_cxx2a : ExtWarn<
6585 "explicit capture of 'this' with a capture default of '=' "
6586 "is a C++2a extension">, InGroup<CXX2a>;
6587 def warn_deprecated_this_capture : Warning<
6588 "implicit capture of 'this' with a capture default of '=' is deprecated">,
6589 InGroup<DeprecatedThisCapture>, DefaultIgnore;
6590 def note_deprecated_this_capture : Note<
6591 "add an explicit capture of 'this' to capture '*this' by reference">;
6594 def err_return_in_captured_stmt : Error<
6595 "cannot return from %0">;
6596 def err_capture_block_variable : Error<
6597 "__block variable %0 cannot be captured in a "
6598 "%select{lambda expression|captured statement}1">;
6600 def err_operator_arrow_circular : Error<
6601 "circular pointer delegation detected">;
6602 def err_operator_arrow_depth_exceeded : Error<
6603 "use of 'operator->' on type %0 would invoke a sequence of more than %1 "
6604 "'operator->' calls">;
6605 def note_operator_arrow_here : Note<
6606 "'operator->' declared here produces an object of type %0">;
6607 def note_operator_arrows_suppressed : Note<
6608 "(skipping %0 'operator->'%s0 in backtrace)">;
6609 def note_operator_arrow_depth : Note<
6610 "use -foperator-arrow-depth=N to increase 'operator->' limit">;
6612 def err_pseudo_dtor_base_not_scalar : Error<
6613 "object expression of non-scalar type %0 cannot be used in a "
6614 "pseudo-destructor expression">;
6615 def ext_pseudo_dtor_on_void : ExtWarn<
6616 "pseudo-destructors on type void are a Microsoft extension">,
6617 InGroup<MicrosoftVoidPseudoDtor>;
6618 def err_pseudo_dtor_type_mismatch : Error<
6619 "the type of object expression "
6620 "%diff{($) does not match the type being destroyed ($)|"
6621 "does not match the type being destroyed}0,1 "
6622 "in pseudo-destructor expression">;
6623 def err_pseudo_dtor_call_with_args : Error<
6624 "call to pseudo-destructor cannot have any arguments">;
6625 def err_dtor_expr_without_call : Error<
6626 "reference to %select{destructor|pseudo-destructor}0 must be called"
6627 "%select{|; did you mean to call it with no arguments?}1">;
6628 def err_pseudo_dtor_destructor_non_type : Error<
6629 "%0 does not refer to a type name in pseudo-destructor expression; expected "
6630 "the name of type %1">;
6631 def err_invalid_use_of_function_type : Error<
6632 "a function type is not allowed here">;
6633 def err_invalid_use_of_array_type : Error<"an array type is not allowed here">;
6634 def err_typecheck_bool_condition : Error<
6635 "value of type %0 is not contextually convertible to 'bool'">;
6636 def err_typecheck_ambiguous_condition : Error<
6637 "conversion %diff{from $ to $|between types}0,1 is ambiguous">;
6638 def err_typecheck_nonviable_condition : Error<
6639 "no viable conversion%select{%diff{ from $ to $|}1,2|"
6640 "%diff{ from returned value of type $ to function return type $|}1,2}0">;
6641 def err_typecheck_nonviable_condition_incomplete : Error<
6642 "no viable conversion%diff{ from $ to incomplete type $|}0,1">;
6643 def err_typecheck_deleted_function : Error<
6644 "conversion function %diff{from $ to $|between types}0,1 "
6645 "invokes a deleted function">;
6647 def err_expected_class_or_namespace : Error<"%0 is not a class"
6648 "%select{ or namespace|, namespace, or enumeration}1">;
6649 def err_invalid_declarator_scope : Error<"cannot define or redeclare %0 here "
6650 "because namespace %1 does not enclose namespace %2">;
6651 def err_invalid_declarator_global_scope : Error<
6652 "definition or redeclaration of %0 cannot name the global scope">;
6653 def err_invalid_declarator_in_function : Error<
6654 "definition or redeclaration of %0 not allowed inside a function">;
6655 def err_invalid_declarator_in_block : Error<
6656 "definition or redeclaration of %0 not allowed inside a block">;
6657 def err_not_tag_in_scope : Error<
6658 "no %select{struct|interface|union|class|enum}0 named %1 in %2">;
6660 def err_no_typeid_with_fno_rtti : Error<
6661 "use of typeid requires -frtti">;
6662 def err_no_dynamic_cast_with_fno_rtti : Error<
6663 "use of dynamic_cast requires -frtti">;
6665 def err_cannot_form_pointer_to_member_of_reference_type : Error<
6666 "cannot form a pointer-to-member to member %0 of reference type %1">;
6667 def err_incomplete_object_call : Error<
6668 "incomplete type in call to object of type %0">;
6670 def warn_condition_is_assignment : Warning<"using the result of an "
6671 "assignment as a condition without parentheses">,
6672 InGroup<Parentheses>;
6673 // Completely identical except off by default.
6674 def warn_condition_is_idiomatic_assignment : Warning<"using the result "
6675 "of an assignment as a condition without parentheses">,
6676 InGroup<DiagGroup<"idiomatic-parentheses">>, DefaultIgnore;
6677 def note_condition_assign_to_comparison : Note<
6678 "use '==' to turn this assignment into an equality comparison">;
6679 def note_condition_or_assign_to_comparison : Note<
6680 "use '!=' to turn this compound assignment into an inequality comparison">;
6681 def note_condition_assign_silence : Note<
6682 "place parentheses around the assignment to silence this warning">;
6684 def warn_equality_with_extra_parens : Warning<"equality comparison with "
6685 "extraneous parentheses">, InGroup<ParenthesesOnEquality>;
6686 def note_equality_comparison_to_assign : Note<
6687 "use '=' to turn this equality comparison into an assignment">;
6688 def note_equality_comparison_silence : Note<
6689 "remove extraneous parentheses around the comparison to silence this warning">;
6691 // assignment related diagnostics (also for argument passing, returning, etc).
6692 // In most of these diagnostics the %2 is a value from the
6693 // Sema::AssignmentAction enumeration
6694 def err_typecheck_convert_incompatible : Error<
6695 "%select{%diff{assigning to $ from incompatible type $|"
6696 "assigning to type from incompatible type}0,1"
6697 "|%diff{passing $ to parameter of incompatible type $|"
6698 "passing type to parameter of incompatible type}0,1"
6699 "|%diff{returning $ from a function with incompatible result type $|"
6700 "returning type from a function with incompatible result type}0,1"
6701 "|%diff{converting $ to incompatible type $|"
6702 "converting type to incompatible type}0,1"
6703 "|%diff{initializing $ with an expression of incompatible type $|"
6704 "initializing type with an expression of incompatible type}0,1"
6705 "|%diff{sending $ to parameter of incompatible type $|"
6706 "sending type to parameter of incompatible type}0,1"
6707 "|%diff{casting $ to incompatible type $|"
6708 "casting type to incompatible type}0,1}2"
6709 "%select{|; dereference with *|"
6710 "; take the address with &|"
6713 "%select{|: different classes%diff{ ($ vs $)|}5,6"
6714 "|: different number of parameters (%5 vs %6)"
6715 "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7"
6716 "|: different return type%diff{ ($ vs $)|}5,6"
6717 "|: different qualifiers ("
6718 "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
6719 "volatile and restrict|const, volatile, and restrict}5 vs "
6720 "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
6721 "volatile and restrict|const, volatile, and restrict}6)"
6722 "|: different exception specifications}4">;
6723 def err_typecheck_missing_return_type_incompatible : Error<
6724 "%diff{return type $ must match previous return type $|"
6725 "return type must match previous return type}0,1 when %select{block "
6726 "literal|lambda expression}2 has unspecified explicit return type">;
6728 def note_incomplete_class_and_qualified_id : Note<
6729 "conformance of forward class %0 to protocol %1 can not be confirmed">;
6730 def warn_incompatible_qualified_id : Warning<
6731 "%select{%diff{assigning to $ from incompatible type $|"
6732 "assigning to type from incompatible type}0,1"
6733 "|%diff{passing $ to parameter of incompatible type $|"
6734 "passing type to parameter of incompatible type}0,1"
6735 "|%diff{returning $ from a function with incompatible result type $|"
6736 "returning type from a function with incompatible result type}0,1"
6737 "|%diff{converting $ to incompatible type $|"
6738 "converting type to incompatible type}0,1"
6739 "|%diff{initializing $ with an expression of incompatible type $|"
6740 "initializing type with an expression of incompatible type}0,1"
6741 "|%diff{sending $ to parameter of incompatible type $|"
6742 "sending type to parameter of incompatible type}0,1"
6743 "|%diff{casting $ to incompatible type $|"
6744 "casting type to incompatible type}0,1}2">;
6745 def ext_typecheck_convert_pointer_int : ExtWarn<
6746 "incompatible pointer to integer conversion "
6747 "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6748 "|%diff{passing $ to parameter of type $|"
6749 "passing to parameter of different type}0,1"
6750 "|%diff{returning $ from a function with result type $|"
6751 "returning from function with different return type}0,1"
6752 "|%diff{converting $ to type $|converting between types}0,1"
6753 "|%diff{initializing $ with an expression of type $|"
6754 "initializing with expression of different type}0,1"
6755 "|%diff{sending $ to parameter of type $|"
6756 "sending to parameter of different type}0,1"
6757 "|%diff{casting $ to type $|casting between types}0,1}2"
6758 "%select{|; dereference with *|"
6759 "; take the address with &|"
6762 InGroup<IntConversion>;
6763 def ext_typecheck_convert_int_pointer : ExtWarn<
6764 "incompatible integer to pointer conversion "
6765 "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6766 "|%diff{passing $ to parameter of type $|"
6767 "passing to parameter of different type}0,1"
6768 "|%diff{returning $ from a function with result type $|"
6769 "returning from function with different return type}0,1"
6770 "|%diff{converting $ to type $|converting between types}0,1"
6771 "|%diff{initializing $ with an expression of type $|"
6772 "initializing with expression of different type}0,1"
6773 "|%diff{sending $ to parameter of type $|"
6774 "sending to parameter of different type}0,1"
6775 "|%diff{casting $ to type $|casting between types}0,1}2"
6776 "%select{|; dereference with *|"
6777 "; take the address with &|"
6780 InGroup<IntConversion>;
6781 def ext_typecheck_convert_pointer_void_func : Extension<
6782 "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6783 "|%diff{passing $ to parameter of type $|"
6784 "passing to parameter of different type}0,1"
6785 "|%diff{returning $ from a function with result type $|"
6786 "returning from function with different return type}0,1"
6787 "|%diff{converting $ to type $|converting between types}0,1"
6788 "|%diff{initializing $ with an expression of type $|"
6789 "initializing with expression of different type}0,1"
6790 "|%diff{sending $ to parameter of type $|"
6791 "sending to parameter of different type}0,1"
6792 "|%diff{casting $ to type $|casting between types}0,1}2"
6793 " converts between void pointer and function pointer">;
6794 def ext_typecheck_convert_incompatible_pointer_sign : ExtWarn<
6795 "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6796 "|%diff{passing $ to parameter of type $|"
6797 "passing to parameter of different type}0,1"
6798 "|%diff{returning $ from a function with result type $|"
6799 "returning from function with different return type}0,1"
6800 "|%diff{converting $ to type $|converting between types}0,1"
6801 "|%diff{initializing $ with an expression of type $|"
6802 "initializing with expression of different type}0,1"
6803 "|%diff{sending $ to parameter of type $|"
6804 "sending to parameter of different type}0,1"
6805 "|%diff{casting $ to type $|casting between types}0,1}2"
6806 " converts between pointers to integer types with different sign">,
6807 InGroup<DiagGroup<"pointer-sign">>;
6808 def ext_typecheck_convert_incompatible_pointer : ExtWarn<
6809 "incompatible pointer types "
6810 "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6811 "|%diff{passing $ to parameter of type $|"
6812 "passing to parameter of different type}0,1"
6813 "|%diff{returning $ from a function with result type $|"
6814 "returning from function with different return type}0,1"
6815 "|%diff{converting $ to type $|converting between types}0,1"
6816 "|%diff{initializing $ with an expression of type $|"
6817 "initializing with expression of different type}0,1"
6818 "|%diff{sending $ to parameter of type $|"
6819 "sending to parameter of different type}0,1"
6820 "|%diff{casting $ to type $|casting between types}0,1}2"
6821 "%select{|; dereference with *|"
6822 "; take the address with &|"
6825 InGroup<IncompatiblePointerTypes>;
6826 def ext_typecheck_convert_incompatible_function_pointer : ExtWarn<
6827 "incompatible function pointer types "
6828 "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6829 "|%diff{passing $ to parameter of type $|"
6830 "passing to parameter of different type}0,1"
6831 "|%diff{returning $ from a function with result type $|"
6832 "returning from function with different return type}0,1"
6833 "|%diff{converting $ to type $|converting between types}0,1"
6834 "|%diff{initializing $ with an expression of type $|"
6835 "initializing with expression of different type}0,1"
6836 "|%diff{sending $ to parameter of type $|"
6837 "sending to parameter of different type}0,1"
6838 "|%diff{casting $ to type $|casting between types}0,1}2"
6839 "%select{|; dereference with *|"
6840 "; take the address with &|"
6843 InGroup<IncompatibleFunctionPointerTypes>;
6844 def ext_typecheck_convert_discards_qualifiers : ExtWarn<
6845 "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6846 "|%diff{passing $ to parameter of type $|"
6847 "passing to parameter of different type}0,1"
6848 "|%diff{returning $ from a function with result type $|"
6849 "returning from function with different return type}0,1"
6850 "|%diff{converting $ to type $|converting between types}0,1"
6851 "|%diff{initializing $ with an expression of type $|"
6852 "initializing with expression of different type}0,1"
6853 "|%diff{sending $ to parameter of type $|"
6854 "sending to parameter of different type}0,1"
6855 "|%diff{casting $ to type $|casting between types}0,1}2"
6856 " discards qualifiers">,
6857 InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
6858 def ext_nested_pointer_qualifier_mismatch : ExtWarn<
6859 "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6860 "|%diff{passing $ to parameter of type $|"
6861 "passing to parameter of different type}0,1"
6862 "|%diff{returning $ from a function with result type $|"
6863 "returning from function with different return type}0,1"
6864 "|%diff{converting $ to type $|converting between types}0,1"
6865 "|%diff{initializing $ with an expression of type $|"
6866 "initializing with expression of different type}0,1"
6867 "|%diff{sending $ to parameter of type $|"
6868 "sending to parameter of different type}0,1"
6869 "|%diff{casting $ to type $|casting between types}0,1}2"
6870 " discards qualifiers in nested pointer types">,
6871 InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
6872 def warn_incompatible_vectors : Warning<
6873 "incompatible vector types "
6874 "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6875 "|%diff{passing $ to parameter of type $|"
6876 "passing to parameter of different type}0,1"
6877 "|%diff{returning $ from a function with result type $|"
6878 "returning from function with different return type}0,1"
6879 "|%diff{converting $ to type $|converting between types}0,1"
6880 "|%diff{initializing $ with an expression of type $|"
6881 "initializing with expression of different type}0,1"
6882 "|%diff{sending $ to parameter of type $|"
6883 "sending to parameter of different type}0,1"
6884 "|%diff{casting $ to type $|casting between types}0,1}2">,
6885 InGroup<VectorConversion>, DefaultIgnore;
6886 def err_int_to_block_pointer : Error<
6887 "invalid block pointer conversion "
6888 "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6889 "|%diff{passing $ to parameter of type $|"
6890 "passing to parameter of different type}0,1"
6891 "|%diff{returning $ from a function with result type $|"
6892 "returning from function with different return type}0,1"
6893 "|%diff{converting $ to type $|converting between types}0,1"
6894 "|%diff{initializing $ with an expression of type $|"
6895 "initializing with expression of different type}0,1"
6896 "|%diff{sending $ to parameter of type $|"
6897 "sending to parameter of different type}0,1"
6898 "|%diff{casting $ to type $|casting between types}0,1}2">;
6899 def err_typecheck_convert_incompatible_block_pointer : Error<
6900 "incompatible block pointer types "
6901 "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6902 "|%diff{passing $ to parameter of type $|"
6903 "passing to parameter of different type}0,1"
6904 "|%diff{returning $ from a function with result type $|"
6905 "returning from function with different return type}0,1"
6906 "|%diff{converting $ to type $|converting between types}0,1"
6907 "|%diff{initializing $ with an expression of type $|"
6908 "initializing with expression of different type}0,1"
6909 "|%diff{sending $ to parameter of type $|"
6910 "sending to parameter of different type}0,1"
6911 "|%diff{casting $ to type $|casting between types}0,1}2">;
6912 def err_typecheck_incompatible_address_space : Error<
6913 "%select{%diff{assigning $ to $|assigning to different types}1,0"
6914 "|%diff{passing $ to parameter of type $|"
6915 "passing to parameter of different type}0,1"
6916 "|%diff{returning $ from a function with result type $|"
6917 "returning from function with different return type}0,1"
6918 "|%diff{converting $ to type $|converting between types}0,1"
6919 "|%diff{initializing $ with an expression of type $|"
6920 "initializing with expression of different type}0,1"
6921 "|%diff{sending $ to parameter of type $|"
6922 "sending to parameter of different type}0,1"
6923 "|%diff{casting $ to type $|casting between types}0,1}2"
6924 " changes address space of pointer">;
6925 def err_typecheck_incompatible_ownership : Error<
6926 "%select{%diff{assigning $ to $|assigning to different types}1,0"
6927 "|%diff{passing $ to parameter of type $|"
6928 "passing to parameter of different type}0,1"
6929 "|%diff{returning $ from a function with result type $|"
6930 "returning from function with different return type}0,1"
6931 "|%diff{converting $ to type $|converting between types}0,1"
6932 "|%diff{initializing $ with an expression of type $|"
6933 "initializing with expression of different type}0,1"
6934 "|%diff{sending $ to parameter of type $|"
6935 "sending to parameter of different type}0,1"
6936 "|%diff{casting $ to type $|casting between types}0,1}2"
6937 " changes retain/release properties of pointer">;
6938 def err_typecheck_comparison_of_distinct_blocks : Error<
6939 "comparison of distinct block types%diff{ ($ and $)|}0,1">;
6941 def err_typecheck_array_not_modifiable_lvalue : Error<
6942 "array type %0 is not assignable">;
6943 def err_typecheck_non_object_not_modifiable_lvalue : Error<
6944 "non-object type %0 is not assignable">;
6945 def err_typecheck_expression_not_modifiable_lvalue : Error<
6946 "expression is not assignable">;
6947 def err_typecheck_incomplete_type_not_modifiable_lvalue : Error<
6948 "incomplete type %0 is not assignable">;
6949 def err_typecheck_lvalue_casts_not_supported : Error<
6950 "assignment to cast is illegal, lvalue casts are not supported">;
6952 def err_typecheck_duplicate_vector_components_not_mlvalue : Error<
6953 "vector is not assignable (contains duplicate components)">;
6954 def err_block_decl_ref_not_modifiable_lvalue : Error<
6955 "variable is not assignable (missing __block type specifier)">;
6956 def err_lambda_decl_ref_not_modifiable_lvalue : Error<
6957 "cannot assign to a variable captured by copy in a non-mutable lambda">;
6958 def err_typecheck_call_not_function : Error<
6959 "called object type %0 is not a function or function pointer">;
6960 def err_call_incomplete_return : Error<
6961 "calling function with incomplete return type %0">;
6962 def err_call_function_incomplete_return : Error<
6963 "calling %0 with incomplete return type %1">;
6964 def err_call_incomplete_argument : Error<
6965 "argument type %0 is incomplete">;
6966 def err_typecheck_call_too_few_args : Error<
6967 "too few %select{|||execution configuration }0arguments to "
6968 "%select{function|block|method|kernel function}0 call, "
6969 "expected %1, have %2">;
6970 def err_typecheck_call_too_few_args_one : Error<
6971 "too few %select{|||execution configuration }0arguments to "
6972 "%select{function|block|method|kernel function}0 call, "
6973 "single argument %1 was not specified">;
6974 def err_typecheck_call_too_few_args_at_least : Error<
6975 "too few %select{|||execution configuration }0arguments to "
6976 "%select{function|block|method|kernel function}0 call, "
6977 "expected at least %1, have %2">;
6978 def err_typecheck_call_too_few_args_at_least_one : Error<
6979 "too few %select{|||execution configuration }0arguments to "
6980 "%select{function|block|method|kernel function}0 call, "
6981 "at least argument %1 must be specified">;
6982 def err_typecheck_call_too_few_args_suggest : Error<
6983 "too few %select{|||execution configuration }0arguments to "
6984 "%select{function|block|method|kernel function}0 call, "
6985 "expected %1, have %2; did you mean %3?">;
6986 def err_typecheck_call_too_few_args_at_least_suggest : Error<
6987 "too few %select{|||execution configuration }0arguments to "
6988 "%select{function|block|method|kernel function}0 call, "
6989 "expected at least %1, have %2; did you mean %3?">;
6990 def err_typecheck_call_too_many_args : Error<
6991 "too many %select{|||execution configuration }0arguments to "
6992 "%select{function|block|method|kernel function}0 call, "
6993 "expected %1, have %2">;
6994 def err_typecheck_call_too_many_args_one : Error<
6995 "too many %select{|||execution configuration }0arguments to "
6996 "%select{function|block|method|kernel function}0 call, "
6997 "expected single argument %1, have %2 arguments">;
6998 def err_typecheck_call_too_many_args_at_most : Error<
6999 "too many %select{|||execution configuration }0arguments to "
7000 "%select{function|block|method|kernel function}0 call, "
7001 "expected at most %1, have %2">;
7002 def err_typecheck_call_too_many_args_at_most_one : Error<
7003 "too many %select{|||execution configuration }0arguments to "
7004 "%select{function|block|method|kernel function}0 call, "
7005 "expected at most single argument %1, have %2 arguments">;
7006 def err_typecheck_call_too_many_args_suggest : Error<
7007 "too many %select{|||execution configuration }0arguments to "
7008 "%select{function|block|method|kernel function}0 call, "
7009 "expected %1, have %2; did you mean %3?">;
7010 def err_typecheck_call_too_many_args_at_most_suggest : Error<
7011 "too many %select{|||execution configuration }0arguments to "
7012 "%select{function|block|method|kernel function}0 call, "
7013 "expected at most %1, have %2; did you mean %3?">;
7015 def err_arc_typecheck_convert_incompatible_pointer : Error<
7016 "incompatible pointer types passing retainable parameter of type %0"
7017 "to a CF function expecting %1 type">;
7019 def err_builtin_fn_use : Error<"builtin functions must be directly called">;
7021 def warn_call_wrong_number_of_arguments : Warning<
7022 "too %select{few|many}0 arguments in call to %1">;
7023 def err_atomic_builtin_must_be_pointer : Error<
7024 "address argument to atomic builtin must be a pointer (%0 invalid)">;
7025 def err_atomic_builtin_must_be_pointer_intptr : Error<
7026 "address argument to atomic builtin must be a pointer to integer or pointer"
7028 def err_atomic_builtin_cannot_be_const : Error<
7029 "address argument to atomic builtin cannot be const-qualified (%0 invalid)">;
7030 def err_atomic_builtin_must_be_pointer_intfltptr : Error<
7031 "address argument to atomic builtin must be a pointer to integer,"
7032 " floating-point or pointer (%0 invalid)">;
7033 def err_atomic_builtin_pointer_size : Error<
7034 "address argument to atomic builtin must be a pointer to 1,2,4,8 or 16 byte "
7035 "type (%0 invalid)">;
7036 def err_atomic_exclusive_builtin_pointer_size : Error<
7037 "address argument to load or store exclusive builtin must be a pointer to"
7038 " 1,2,4 or 8 byte type (%0 invalid)">;
7039 def err_atomic_op_needs_atomic : Error<
7040 "address argument to atomic operation must be a pointer to _Atomic "
7041 "type (%0 invalid)">;
7042 def err_atomic_op_needs_non_const_atomic : Error<
7043 "address argument to atomic operation must be a pointer to non-%select{const|constant}0 _Atomic "
7044 "type (%1 invalid)">;
7045 def err_atomic_op_needs_non_const_pointer : Error<
7046 "address argument to atomic operation must be a pointer to non-const "
7047 "type (%0 invalid)">;
7048 def err_atomic_op_needs_trivial_copy : Error<
7049 "address argument to atomic operation must be a pointer to a "
7050 "trivially-copyable type (%0 invalid)">;
7051 def err_atomic_op_needs_atomic_int_or_ptr : Error<
7052 "address argument to atomic operation must be a pointer to %select{|atomic }0"
7053 "integer or pointer (%1 invalid)">;
7054 def err_atomic_op_needs_int32_or_ptr : Error<
7055 "address argument to atomic operation must be a pointer to signed or unsigned 32-bit integer">;
7056 def err_atomic_op_bitwise_needs_atomic_int : Error<
7057 "address argument to bitwise atomic operation must be a pointer to "
7058 "%select{|atomic }0integer (%1 invalid)">;
7059 def warn_atomic_op_has_invalid_memory_order : Warning<
7060 "memory order argument to atomic operation is invalid">,
7061 InGroup<DiagGroup<"atomic-memory-ordering">>;
7062 def err_atomic_op_has_invalid_synch_scope : Error<
7063 "synchronization scope argument to atomic operation is invalid">;
7064 def warn_atomic_op_misaligned : Warning<
7065 "misaligned or large atomic operation may incur significant performance penalty">,
7066 InGroup<DiagGroup<"atomic-alignment">>;
7068 def err_overflow_builtin_must_be_int : Error<
7069 "operand argument to overflow builtin must be an integer (%0 invalid)">;
7070 def err_overflow_builtin_must_be_ptr_int : Error<
7071 "result argument to overflow builtin must be a pointer "
7072 "to a non-const integer (%0 invalid)">;
7074 def err_atomic_load_store_uses_lib : Error<
7075 "atomic %select{load|store}0 requires runtime support that is not "
7076 "available for this target">;
7078 def err_nontemporal_builtin_must_be_pointer : Error<
7079 "address argument to nontemporal builtin must be a pointer (%0 invalid)">;
7080 def err_nontemporal_builtin_must_be_pointer_intfltptr_or_vector : Error<
7081 "address argument to nontemporal builtin must be a pointer to integer, float, "
7082 "pointer, or a vector of such types (%0 invalid)">;
7084 def err_deleted_function_use : Error<"attempt to use a deleted function">;
7085 def err_deleted_inherited_ctor_use : Error<
7086 "constructor inherited by %0 from base class %1 is implicitly deleted">;
7088 def note_called_by : Note<"called by %0">;
7089 def err_kern_type_not_void_return : Error<
7090 "kernel function type %0 must have void return type">;
7091 def err_kern_is_nonstatic_method : Error<
7092 "kernel function %0 must be a free function or static member function">;
7093 def err_config_scalar_return : Error<
7094 "CUDA special function 'cudaConfigureCall' must have scalar return type">;
7095 def err_kern_call_not_global_function : Error<
7096 "kernel call to non-global function %0">;
7097 def err_global_call_not_config : Error<
7098 "call to global function %0 not configured">;
7099 def err_ref_bad_target : Error<
7100 "reference to %select{__device__|__global__|__host__|__host__ __device__}0 "
7101 "function %1 in %select{__device__|__global__|__host__|__host__ __device__}2 function">;
7102 def err_ref_bad_target_global_initializer : Error<
7103 "reference to %select{__device__|__global__|__host__|__host__ __device__}0 "
7104 "function %1 in global initializer">;
7105 def warn_kern_is_method : Extension<
7106 "kernel function %0 is a member function; this may not be accepted by nvcc">,
7107 InGroup<CudaCompat>;
7108 def warn_kern_is_inline : Warning<
7109 "ignored 'inline' attribute on kernel function %0">,
7110 InGroup<CudaCompat>;
7111 def err_variadic_device_fn : Error<
7112 "CUDA device code does not support variadic functions">;
7113 def err_va_arg_in_device : Error<
7114 "CUDA device code does not support va_arg">;
7115 def err_alias_not_supported_on_nvptx : Error<"CUDA does not support aliases">;
7116 def err_cuda_unattributed_constexpr_cannot_overload_device : Error<
7117 "constexpr function %0 without __host__ or __device__ attributes cannot "
7118 "overload __device__ function with same signature. Add a __host__ "
7119 "attribute, or build with -fno-cuda-host-device-constexpr.">;
7120 def note_cuda_conflicting_device_function_declared_here : Note<
7121 "conflicting __device__ function declared here">;
7122 def err_cuda_device_exceptions : Error<
7123 "cannot use '%0' in "
7124 "%select{__device__|__global__|__host__|__host__ __device__}1 function">;
7125 def err_dynamic_var_init : Error<
7126 "dynamic initialization is not supported for "
7127 "__device__, __constant__, and __shared__ variables.">;
7128 def err_shared_var_init : Error<
7129 "initialization is not supported for __shared__ variables.">;
7130 def err_device_static_local_var : Error<
7131 "within a %select{__device__|__global__|__host__|__host__ __device__}0 "
7132 "function, only __shared__ variables may be marked 'static'">;
7133 def err_cuda_vla : Error<
7134 "cannot use variable-length arrays in "
7135 "%select{__device__|__global__|__host__|__host__ __device__}0 functions">;
7136 def err_cuda_extern_shared : Error<"__shared__ variable %0 cannot be 'extern'">;
7137 def err_cuda_host_shared : Error<
7138 "__shared__ local variables not allowed in "
7139 "%select{__device__|__global__|__host__|__host__ __device__}0 functions">;
7140 def err_cuda_nonglobal_constant : Error<"__constant__ variables must be global">;
7141 def err_cuda_ovl_target : Error<
7142 "%select{__device__|__global__|__host__|__host__ __device__}0 function %1 "
7143 "cannot overload %select{__device__|__global__|__host__|__host__ __device__}2 function %3">;
7144 def note_cuda_ovl_candidate_target_mismatch : Note<
7145 "candidate template ignored: target attributes do not match">;
7147 def warn_non_pod_vararg_with_format_string : Warning<
7148 "cannot pass %select{non-POD|non-trivial}0 object of type %1 to variadic "
7149 "%select{function|block|method|constructor}2; expected type from format "
7150 "string was %3">, InGroup<NonPODVarargs>, DefaultError;
7151 // The arguments to this diagnostic should match the warning above.
7152 def err_cannot_pass_objc_interface_to_vararg_format : Error<
7153 "cannot pass object with interface type %1 by value to variadic "
7154 "%select{function|block|method|constructor}2; expected type from format "
7156 def err_cannot_pass_non_trivial_c_struct_to_vararg : Error<
7157 "cannot pass non-trivial C object of type %0 by value to variadic "
7158 "%select{function|block|method|constructor}1">;
7161 def err_cannot_pass_objc_interface_to_vararg : Error<
7162 "cannot pass object with interface type %0 by value through variadic "
7163 "%select{function|block|method|constructor}1">;
7164 def warn_cannot_pass_non_pod_arg_to_vararg : Warning<
7165 "cannot pass object of %select{non-POD|non-trivial}0 type %1 through variadic"
7166 " %select{function|block|method|constructor}2; call will abort at runtime">,
7167 InGroup<NonPODVarargs>, DefaultError;
7168 def warn_cxx98_compat_pass_non_pod_arg_to_vararg : Warning<
7169 "passing object of trivial but non-POD type %0 through variadic"
7170 " %select{function|block|method|constructor}1 is incompatible with C++98">,
7171 InGroup<CXX98Compat>, DefaultIgnore;
7172 def warn_pass_class_arg_to_vararg : Warning<
7173 "passing object of class type %0 through variadic "
7174 "%select{function|block|method|constructor}1"
7175 "%select{|; did you mean to call '%3'?}2">,
7176 InGroup<ClassVarargs>, DefaultIgnore;
7177 def err_cannot_pass_to_vararg : Error<
7178 "cannot pass %select{expression of type %1|initializer list}0 to variadic "
7179 "%select{function|block|method|constructor}2">;
7180 def err_cannot_pass_to_vararg_format : Error<
7181 "cannot pass %select{expression of type %1|initializer list}0 to variadic "
7182 "%select{function|block|method|constructor}2; expected type from format "
7185 def err_typecheck_call_invalid_ordered_compare : Error<
7186 "ordered compare requires two args of floating point type"
7187 "%diff{ ($ and $)|}0,1">;
7188 def err_typecheck_call_invalid_unary_fp : Error<
7189 "floating point classification requires argument of floating point type "
7191 def err_typecheck_cond_expect_int_float : Error<
7192 "used type %0 where integer or floating point type is required">;
7193 def err_typecheck_cond_expect_scalar : Error<
7194 "used type %0 where arithmetic or pointer type is required">;
7195 def err_typecheck_cond_expect_nonfloat : Error<
7196 "used type %0 where floating point type is not allowed">;
7197 def ext_typecheck_cond_one_void : Extension<
7198 "C99 forbids conditional expressions with only one void side">;
7199 def err_typecheck_cast_to_incomplete : Error<
7200 "cast to incomplete type %0">;
7201 def ext_typecheck_cast_nonscalar : Extension<
7202 "C99 forbids casting nonscalar type %0 to the same type">;
7203 def ext_typecheck_cast_to_union : Extension<
7204 "cast to union type is a GNU extension">,
7205 InGroup<GNUUnionCast>;
7206 def err_typecheck_cast_to_union_no_type : Error<
7207 "cast to union type from type %0 not present in union">;
7208 def err_cast_pointer_from_non_pointer_int : Error<
7209 "operand of type %0 cannot be cast to a pointer type">;
7210 def warn_cast_pointer_from_sel : Warning<
7211 "cast of type %0 to %1 is deprecated; use sel_getName instead">,
7212 InGroup<SelTypeCast>;
7213 def warn_function_def_in_objc_container : Warning<
7214 "function definition inside an Objective-C container is deprecated">,
7215 InGroup<FunctionDefInObjCContainer>;
7217 def warn_cast_calling_conv : Warning<
7218 "cast between incompatible calling conventions '%0' and '%1'; "
7219 "calls through this pointer may abort at runtime">,
7220 InGroup<DiagGroup<"cast-calling-convention">>;
7221 def note_change_calling_conv_fixit : Note<
7222 "consider defining %0 with the '%1' calling convention">;
7223 def warn_bad_function_cast : Warning<
7224 "cast from function call of type %0 to non-matching type %1">,
7225 InGroup<BadFunctionCast>, DefaultIgnore;
7226 def err_cast_pointer_to_non_pointer_int : Error<
7227 "pointer cannot be cast to type %0">;
7228 def err_typecheck_expect_scalar_operand : Error<
7229 "operand of type %0 where arithmetic or pointer type is required">;
7230 def err_typecheck_cond_incompatible_operands : Error<
7231 "incompatible operand types%diff{ ($ and $)|}0,1">;
7232 def err_cast_selector_expr : Error<
7233 "cannot type cast @selector expression">;
7234 def ext_typecheck_cond_incompatible_pointers : ExtWarn<
7235 "pointer type mismatch%diff{ ($ and $)|}0,1">,
7236 InGroup<DiagGroup<"pointer-type-mismatch">>;
7237 def ext_typecheck_cond_pointer_integer_mismatch : ExtWarn<
7238 "pointer/integer type mismatch in conditional expression"
7239 "%diff{ ($ and $)|}0,1">,
7240 InGroup<DiagGroup<"conditional-type-mismatch">>;
7241 def err_typecheck_choose_expr_requires_constant : Error<
7242 "'__builtin_choose_expr' requires a constant expression">;
7243 def warn_unused_expr : Warning<"expression result unused">,
7244 InGroup<UnusedValue>;
7245 def warn_unused_voidptr : Warning<
7246 "expression result unused; should this cast be to 'void'?">,
7247 InGroup<UnusedValue>;
7248 def warn_unused_property_expr : Warning<
7249 "property access result unused - getters should not be used for side effects">,
7250 InGroup<UnusedGetterReturnValue>;
7251 def warn_unused_container_subscript_expr : Warning<
7252 "container access result unused - container access should not be used for side effects">,
7253 InGroup<UnusedValue>;
7254 def warn_unused_call : Warning<
7255 "ignoring return value of function declared with %0 attribute">,
7256 InGroup<UnusedValue>;
7257 def warn_side_effects_unevaluated_context : Warning<
7258 "expression with side effects has no effect in an unevaluated context">,
7259 InGroup<UnevaluatedExpression>;
7260 def warn_side_effects_typeid : Warning<
7261 "expression with side effects will be evaluated despite being used as an "
7262 "operand to 'typeid'">, InGroup<PotentiallyEvaluatedExpression>;
7263 def warn_unused_result : Warning<
7264 "ignoring return value of function declared with %0 attribute">,
7265 InGroup<UnusedResult>;
7266 def warn_unused_volatile : Warning<
7267 "expression result unused; assign into a variable to force a volatile load">,
7268 InGroup<DiagGroup<"unused-volatile-lvalue">>;
7270 def ext_cxx14_attr : Extension<
7271 "use of the %0 attribute is a C++14 extension">, InGroup<CXX14>;
7272 def ext_cxx17_attr : Extension<
7273 "use of the %0 attribute is a C++17 extension">, InGroup<CXX17>;
7275 def warn_unused_comparison : Warning<
7276 "%select{equality|inequality|relational|three-way}0 comparison result unused">,
7277 InGroup<UnusedComparison>;
7278 def note_inequality_comparison_to_or_assign : Note<
7279 "use '|=' to turn this inequality comparison into an or-assignment">;
7281 def err_incomplete_type_used_in_type_trait_expr : Error<
7282 "incomplete type %0 used in type trait expression">;
7284 def err_require_constant_init_failed : Error<
7285 "variable does not have a constant initializer">;
7286 def note_declared_required_constant_init_here : Note<
7287 "required by 'require_constant_initialization' attribute here">;
7289 def err_dimension_expr_not_constant_integer : Error<
7290 "dimension expression does not evaluate to a constant unsigned int">;
7292 def err_typecheck_cond_incompatible_operands_null : Error<
7293 "non-pointer operand type %0 incompatible with %select{NULL|nullptr}1">;
7294 def ext_empty_struct_union : Extension<
7295 "empty %select{struct|union}0 is a GNU extension">, InGroup<GNUEmptyStruct>;
7296 def ext_no_named_members_in_struct_union : Extension<
7297 "%select{struct|union}0 without named members is a GNU extension">, InGroup<GNUEmptyStruct>;
7298 def warn_zero_size_struct_union_compat : Warning<"%select{|empty }0"
7299 "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">,
7300 InGroup<CXXCompat>, DefaultIgnore;
7301 def warn_zero_size_struct_union_in_extern_c : Warning<"%select{|empty }0"
7302 "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">,
7303 InGroup<ExternCCompat>;
7304 def warn_cast_qual : Warning<"cast from %0 to %1 drops %select{const and "
7305 "volatile qualifiers|const qualifier|volatile qualifier}2">,
7306 InGroup<CastQual>, DefaultIgnore;
7307 def warn_cast_qual2 : Warning<"cast from %0 to %1 must have all intermediate "
7308 "pointers const qualified to be safe">, InGroup<CastQual>, DefaultIgnore;
7309 def warn_redefine_extname_not_applied : Warning<
7310 "#pragma redefine_extname is applicable to external C declarations only; "
7311 "not applied to %select{function|variable}0 %1">,
7313 } // End of general sema category.
7316 let CategoryName = "Inline Assembly Issue" in {
7317 def err_asm_invalid_lvalue_in_output : Error<"invalid lvalue in asm output">;
7318 def err_asm_invalid_output_constraint : Error<
7319 "invalid output constraint '%0' in asm">;
7320 def err_asm_invalid_lvalue_in_input : Error<
7321 "invalid lvalue in asm input for constraint '%0'">;
7322 def err_asm_invalid_input_constraint : Error<
7323 "invalid input constraint '%0' in asm">;
7324 def err_asm_immediate_expected : Error<"constraint '%0' expects "
7325 "an integer constant expression">;
7326 def err_asm_invalid_type_in_input : Error<
7327 "invalid type %0 in asm input for constraint '%1'">;
7328 def err_asm_tying_incompatible_types : Error<
7329 "unsupported inline asm: input with type "
7330 "%diff{$ matching output with type $|}0,1">;
7331 def err_asm_unexpected_constraint_alternatives : Error<
7332 "asm constraint has an unexpected number of alternatives: %0 vs %1">;
7333 def err_asm_incomplete_type : Error<"asm operand has incomplete type %0">;
7334 def err_asm_unknown_register_name : Error<"unknown register name '%0' in asm">;
7335 def err_asm_invalid_global_var_reg : Error<"register '%0' unsuitable for "
7336 "global register variables on this target">;
7337 def err_asm_register_size_mismatch : Error<"size of register '%0' does not "
7338 "match variable size">;
7339 def err_asm_bad_register_type : Error<"bad type for named register variable">;
7340 def err_asm_invalid_input_size : Error<
7341 "invalid input size for constraint '%0'">;
7342 def err_asm_invalid_output_size : Error<
7343 "invalid output size for constraint '%0'">;
7344 def err_invalid_asm_cast_lvalue : Error<
7345 "invalid use of a cast in a inline asm context requiring an l-value: "
7346 "remove the cast or build with -fheinous-gnu-extensions">;
7347 def err_invalid_asm_value_for_constraint
7348 : Error <"value '%0' out of range for constraint '%1'">;
7349 def err_asm_non_addr_value_in_memory_constraint : Error <
7350 "reference to a %select{bit-field|vector element|global register variable}0"
7351 " in asm %select{input|output}1 with a memory constraint '%2'">;
7352 def err_asm_input_duplicate_match : Error<
7353 "more than one input constraint matches the same output '%0'">;
7355 def warn_asm_label_on_auto_decl : Warning<
7356 "ignored asm label '%0' on automatic variable">;
7357 def warn_invalid_asm_cast_lvalue : Warning<
7358 "invalid use of a cast in an inline asm context requiring an l-value: "
7359 "accepted due to -fheinous-gnu-extensions, but clang may remove support "
7360 "for this in the future">;
7361 def warn_asm_mismatched_size_modifier : Warning<
7362 "value size does not match register size specified by the constraint "
7364 InGroup<ASMOperandWidths>;
7366 def note_asm_missing_constraint_modifier : Note<
7367 "use constraint modifier \"%0\"">;
7368 def note_asm_input_duplicate_first : Note<
7369 "constraint '%0' is already present here">;
7372 def error_inoutput_conflict_with_clobber : Error<
7373 "asm-specifier for input or output variable conflicts with asm"
7376 let CategoryName = "Semantic Issue" in {
7378 def err_invalid_conversion_between_vectors : Error<
7379 "invalid conversion between vector type%diff{ $ and $|}0,1 of different "
7381 def err_invalid_conversion_between_vector_and_integer : Error<
7382 "invalid conversion between vector type %0 and integer type %1 "
7383 "of different size">;
7385 def err_opencl_function_pointer : Error<
7386 "pointers to functions are not allowed">;
7388 def err_opencl_taking_address_capture : Error<
7389 "taking address of a capture is not allowed">;
7391 def err_invalid_conversion_between_vector_and_scalar : Error<
7392 "invalid conversion between vector type %0 and scalar type %1">;
7394 // C++ member initializers.
7395 def err_only_constructors_take_base_inits : Error<
7396 "only constructors take base initializers">;
7398 def err_multiple_mem_initialization : Error <
7399 "multiple initializations given for non-static member %0">;
7400 def err_multiple_mem_union_initialization : Error <
7401 "initializing multiple members of union">;
7402 def err_multiple_base_initialization : Error <
7403 "multiple initializations given for base %0">;
7405 def err_mem_init_not_member_or_class : Error<
7406 "member initializer %0 does not name a non-static data member or base "
7409 def warn_initializer_out_of_order : Warning<
7410 "%select{field|base class}0 %1 will be initialized after "
7411 "%select{field|base}2 %3">,
7412 InGroup<Reorder>, DefaultIgnore;
7413 def warn_abstract_vbase_init_ignored : Warning<
7414 "initializer for virtual base class %0 of abstract class %1 "
7415 "will never be used">,
7416 InGroup<DiagGroup<"abstract-vbase-init">>, DefaultIgnore;
7418 def err_base_init_does_not_name_class : Error<
7419 "constructor initializer %0 does not name a class">;
7420 def err_base_init_direct_and_virtual : Error<
7421 "base class initializer %0 names both a direct base class and an "
7422 "inherited virtual base class">;
7423 def err_not_direct_base_or_virtual : Error<
7424 "type %0 is not a direct or virtual base of %1">;
7426 def err_in_class_initializer_non_const : Error<
7427 "non-const static data member must be initialized out of line">;
7428 def err_in_class_initializer_volatile : Error<
7429 "static const volatile data member must be initialized out of line">;
7430 def err_in_class_initializer_bad_type : Error<
7431 "static data member of type %0 must be initialized out of line">;
7432 def ext_in_class_initializer_float_type : ExtWarn<
7433 "in-class initializer for static data member of type %0 is a GNU extension">,
7434 InGroup<GNUStaticFloatInit>;
7435 def ext_in_class_initializer_float_type_cxx11 : ExtWarn<
7436 "in-class initializer for static data member of type %0 requires "
7437 "'constexpr' specifier">, InGroup<StaticFloatInit>, DefaultError;
7438 def note_in_class_initializer_float_type_cxx11 : Note<"add 'constexpr'">;
7439 def err_in_class_initializer_literal_type : Error<
7440 "in-class initializer for static data member of type %0 requires "
7441 "'constexpr' specifier">;
7442 def err_in_class_initializer_non_constant : Error<
7443 "in-class initializer for static data member is not a constant expression">;
7444 def err_in_class_initializer_not_yet_parsed : Error<
7445 "default member initializer for %1 needed within definition of enclosing "
7446 "class %0 outside of member functions">;
7447 def note_in_class_initializer_not_yet_parsed : Note<
7448 "default member initializer declared here">;
7449 def err_in_class_initializer_cycle
7450 : Error<"default member initializer for %0 uses itself">;
7451 def err_exception_spec_cycle
7452 : Error<"exception specification of %0 uses itself">;
7454 def ext_in_class_initializer_non_constant : Extension<
7455 "in-class initializer for static data member is not a constant expression; "
7456 "folding it to a constant is a GNU extension">, InGroup<GNUFoldingConstant>;
7458 def err_thread_dynamic_init : Error<
7459 "initializer for thread-local variable must be a constant expression">;
7460 def err_thread_nontrivial_dtor : Error<
7461 "type of thread-local variable has non-trivial destruction">;
7462 def note_use_thread_local : Note<
7463 "use 'thread_local' to allow this">;
7465 // C++ anonymous unions and GNU anonymous structs/unions
7466 def ext_anonymous_union : Extension<
7467 "anonymous unions are a C11 extension">, InGroup<C11>;
7468 def ext_gnu_anonymous_struct : Extension<
7469 "anonymous structs are a GNU extension">, InGroup<GNUAnonymousStruct>;
7470 def ext_c11_anonymous_struct : Extension<
7471 "anonymous structs are a C11 extension">, InGroup<C11>;
7472 def err_anonymous_union_not_static : Error<
7473 "anonymous unions at namespace or global scope must be declared 'static'">;
7474 def err_anonymous_union_with_storage_spec : Error<
7475 "anonymous union at class scope must not have a storage specifier">;
7476 def err_anonymous_struct_not_member : Error<
7477 "anonymous %select{structs|structs and classes}0 must be "
7478 "%select{struct or union|class}0 members">;
7479 def err_anonymous_record_member_redecl : Error<
7480 "member of anonymous %select{struct|union}0 redeclares %1">;
7481 def err_anonymous_record_with_type : Error<
7482 "types cannot be declared in an anonymous %select{struct|union}0">;
7483 def ext_anonymous_record_with_type : Extension<
7484 "types declared in an anonymous %select{struct|union}0 are a Microsoft "
7485 "extension">, InGroup<MicrosoftAnonTag>;
7486 def ext_anonymous_record_with_anonymous_type : Extension<
7487 "anonymous types declared in an anonymous %select{struct|union}0 "
7488 "are an extension">, InGroup<DiagGroup<"nested-anon-types">>;
7489 def err_anonymous_record_with_function : Error<
7490 "functions cannot be declared in an anonymous %select{struct|union}0">;
7491 def err_anonymous_record_with_static : Error<
7492 "static members cannot be declared in an anonymous %select{struct|union}0">;
7493 def err_anonymous_record_bad_member : Error<
7494 "anonymous %select{struct|union}0 can only contain non-static data members">;
7495 def err_anonymous_record_nonpublic_member : Error<
7496 "anonymous %select{struct|union}0 cannot contain a "
7497 "%select{private|protected}1 data member">;
7498 def ext_ms_anonymous_record : ExtWarn<
7499 "anonymous %select{structs|unions}0 are a Microsoft extension">,
7500 InGroup<MicrosoftAnonTag>;
7502 // C++ local classes
7503 def err_reference_to_local_in_enclosing_context : Error<
7504 "reference to local %select{variable|binding}1 %0 declared in enclosing "
7505 "%select{%3|block literal|lambda expression|context}2">;
7507 def err_static_data_member_not_allowed_in_local_class : Error<
7508 "static data member %0 not allowed in local class %1">;
7510 // C++ derived classes
7511 def err_base_clause_on_union : Error<"unions cannot have base classes">;
7512 def err_base_must_be_class : Error<"base specifier must name a class">;
7513 def err_union_as_base_class : Error<"unions cannot be base classes">;
7514 def err_circular_inheritance : Error<
7515 "circular inheritance between %0 and %1">;
7516 def err_base_class_has_flexible_array_member : Error<
7517 "base class %0 has a flexible array member">;
7518 def err_incomplete_base_class : Error<"base class has incomplete type">;
7519 def err_duplicate_base_class : Error<
7520 "base class %0 specified more than once as a direct base class">;
7521 def warn_inaccessible_base_class : Warning<
7522 "direct base %0 is inaccessible due to ambiguity:%1">,
7523 InGroup<DiagGroup<"inaccessible-base">>;
7524 // FIXME: better way to display derivation? Pass entire thing into diagclient?
7525 def err_ambiguous_derived_to_base_conv : Error<
7526 "ambiguous conversion from derived class %0 to base class %1:%2">;
7527 def err_ambiguous_memptr_conv : Error<
7528 "ambiguous conversion from pointer to member of %select{base|derived}0 "
7529 "class %1 to pointer to member of %select{derived|base}0 class %2:%3">;
7530 def ext_ms_ambiguous_direct_base : ExtWarn<
7531 "accessing inaccessible direct base %0 of %1 is a Microsoft extension">,
7532 InGroup<MicrosoftInaccessibleBase>;
7534 def err_memptr_conv_via_virtual : Error<
7535 "conversion from pointer to member of class %0 to pointer to member "
7536 "of class %1 via virtual base %2 is not allowed">;
7538 // C++ member name lookup
7539 def err_ambiguous_member_multiple_subobjects : Error<
7540 "non-static member %0 found in multiple base-class subobjects of type %1:%2">;
7541 def err_ambiguous_member_multiple_subobject_types : Error<
7542 "member %0 found in multiple base classes of different types">;
7543 def note_ambiguous_member_found : Note<"member found by ambiguous name lookup">;
7544 def err_ambiguous_reference : Error<"reference to %0 is ambiguous">;
7545 def note_ambiguous_candidate : Note<"candidate found by name lookup is %q0">;
7546 def err_ambiguous_tag_hiding : Error<"a type named %0 is hidden by a "
7547 "declaration in a different namespace">;
7548 def note_hidden_tag : Note<"type declaration hidden">;
7549 def note_hiding_object : Note<"declaration hides type">;
7551 // C++ operator overloading
7552 def err_operator_overload_needs_class_or_enum : Error<
7553 "overloaded %0 must have at least one parameter of class "
7554 "or enumeration type">;
7556 def err_operator_overload_variadic : Error<"overloaded %0 cannot be variadic">;
7557 def err_operator_overload_static : Error<
7558 "overloaded %0 cannot be a static member function">;
7559 def err_operator_overload_default_arg : Error<
7560 "parameter of overloaded %0 cannot have a default argument">;
7561 def err_operator_overload_must_be : Error<
7562 "overloaded %0 must be a %select{unary|binary|unary or binary}2 operator "
7563 "(has %1 parameter%s1)">;
7565 def err_operator_overload_must_be_member : Error<
7566 "overloaded %0 must be a non-static member function">;
7567 def err_operator_overload_post_incdec_must_be_int : Error<
7568 "parameter of overloaded post-%select{increment|decrement}1 operator must "
7569 "have type 'int' (not %0)">;
7571 // C++ allocation and deallocation functions.
7572 def err_operator_new_delete_declared_in_namespace : Error<
7573 "%0 cannot be declared inside a namespace">;
7574 def err_operator_new_delete_declared_static : Error<
7575 "%0 cannot be declared static in global scope">;
7576 def ext_operator_new_delete_declared_inline : ExtWarn<
7577 "replacement function %0 cannot be declared 'inline'">,
7578 InGroup<DiagGroup<"inline-new-delete">>;
7579 def err_operator_new_delete_invalid_result_type : Error<
7580 "%0 must return type %1">;
7581 def err_operator_new_delete_dependent_result_type : Error<
7582 "%0 cannot have a dependent return type; use %1 instead">;
7583 def err_operator_new_delete_too_few_parameters : Error<
7584 "%0 must have at least one parameter">;
7585 def err_operator_new_delete_template_too_few_parameters : Error<
7586 "%0 template must have at least two parameters">;
7587 def warn_operator_new_returns_null : Warning<
7588 "%0 should not return a null pointer unless it is declared 'throw()'"
7589 "%select{| or 'noexcept'}1">, InGroup<OperatorNewReturnsNull>;
7591 def err_operator_new_dependent_param_type : Error<
7592 "%0 cannot take a dependent type as first parameter; "
7593 "use size_t (%1) instead">;
7594 def err_operator_new_param_type : Error<
7595 "%0 takes type size_t (%1) as first parameter">;
7596 def err_operator_new_default_arg: Error<
7597 "parameter of %0 cannot have a default argument">;
7598 def err_operator_delete_dependent_param_type : Error<
7599 "%0 cannot take a dependent type as first parameter; use %1 instead">;
7600 def err_operator_delete_param_type : Error<
7601 "first parameter of %0 must have type %1">;
7602 def err_destroying_operator_delete_not_usual : Error<
7603 "destroying operator delete can have only an optional size and optional "
7604 "alignment parameter">;
7605 def note_implicit_delete_this_in_destructor_here : Note<
7606 "while checking implicit 'delete this' for virtual destructor">;
7607 def err_builtin_operator_new_delete_not_usual : Error<
7608 "call to '%select{__builtin_operator_new|__builtin_operator_delete}0' "
7609 "selects non-usual %select{allocation|deallocation}0 function">;
7610 def note_non_usual_function_declared_here : Note<
7611 "non-usual %0 declared here">;
7613 // C++ literal operators
7614 def err_literal_operator_outside_namespace : Error<
7615 "literal operator %0 must be in a namespace or global scope">;
7616 def err_literal_operator_id_outside_namespace : Error<
7617 "non-namespace scope '%0' cannot have a literal operator member">;
7618 def err_literal_operator_default_argument : Error<
7619 "literal operator cannot have a default argument">;
7620 def err_literal_operator_bad_param_count : Error<
7621 "non-template literal operator must have one or two parameters">;
7622 def err_literal_operator_invalid_param : Error<
7623 "parameter of literal operator must have type 'unsigned long long', 'long double', 'char', 'wchar_t', 'char16_t', 'char32_t', or 'const char *'">;
7624 def err_literal_operator_param : Error<
7625 "invalid literal operator parameter type %0, did you mean %1?">;
7626 def err_literal_operator_template_with_params : Error<
7627 "literal operator template cannot have any parameters">;
7628 def err_literal_operator_template : Error<
7629 "template parameter list for literal operator must be either 'char...' or 'typename T, T...'">;
7630 def err_literal_operator_extern_c : Error<
7631 "literal operator must have C++ linkage">;
7632 def ext_string_literal_operator_template : ExtWarn<
7633 "string literal operator templates are a GNU extension">,
7634 InGroup<GNUStringLiteralOperatorTemplate>;
7635 def warn_user_literal_reserved : Warning<
7636 "user-defined literal suffixes not starting with '_' are reserved"
7637 "%select{; no literal will invoke this operator|}0">,
7638 InGroup<UserDefinedLiterals>;
7640 // C++ conversion functions
7641 def err_conv_function_not_member : Error<
7642 "conversion function must be a non-static member function">;
7643 def err_conv_function_return_type : Error<
7644 "conversion function cannot have a return type">;
7645 def err_conv_function_with_params : Error<
7646 "conversion function cannot have any parameters">;
7647 def err_conv_function_variadic : Error<
7648 "conversion function cannot be variadic">;
7649 def err_conv_function_to_array : Error<
7650 "conversion function cannot convert to an array type">;
7651 def err_conv_function_to_function : Error<
7652 "conversion function cannot convert to a function type">;
7653 def err_conv_function_with_complex_decl : Error<
7654 "cannot specify any part of a return type in the "
7655 "declaration of a conversion function"
7657 "; put the complete type after 'operator'|"
7658 "; use a typedef to declare a conversion to %1|"
7659 "; use an alias template to declare a conversion to %1|"
7661 def err_conv_function_redeclared : Error<
7662 "conversion function cannot be redeclared">;
7663 def warn_conv_to_self_not_used : Warning<
7664 "conversion function converting %0 to itself will never be used">;
7665 def warn_conv_to_base_not_used : Warning<
7666 "conversion function converting %0 to its base class %1 will never be used">;
7667 def warn_conv_to_void_not_used : Warning<
7668 "conversion function converting %0 to %1 will never be used">;
7670 def warn_not_compound_assign : Warning<
7671 "use of unary operator that may be intended as compound assignment (%0=)">;
7673 // C++11 explicit conversion operators
7674 def ext_explicit_conversion_functions : ExtWarn<
7675 "explicit conversion functions are a C++11 extension">, InGroup<CXX11>;
7676 def warn_cxx98_compat_explicit_conversion_functions : Warning<
7677 "explicit conversion functions are incompatible with C++98">,
7678 InGroup<CXX98Compat>, DefaultIgnore;
7680 // C++11 defaulted functions
7681 def err_defaulted_special_member_params : Error<
7682 "an explicitly-defaulted %select{|copy |move }0constructor cannot "
7683 "have default arguments">;
7684 def err_defaulted_special_member_variadic : Error<
7685 "an explicitly-defaulted %select{|copy |move }0constructor cannot "
7687 def err_defaulted_special_member_return_type : Error<
7688 "explicitly-defaulted %select{copy|move}0 assignment operator must "
7690 def err_defaulted_special_member_quals : Error<
7691 "an explicitly-defaulted %select{copy|move}0 assignment operator may not "
7692 "have 'const'%select{, 'constexpr'|}1 or 'volatile' qualifiers">;
7693 def err_defaulted_special_member_volatile_param : Error<
7694 "the parameter for an explicitly-defaulted %sub{select_special_member_kind}0 "
7695 "may not be volatile">;
7696 def err_defaulted_special_member_move_const_param : Error<
7697 "the parameter for an explicitly-defaulted move "
7698 "%select{constructor|assignment operator}0 may not be const">;
7699 def err_defaulted_special_member_copy_const_param : Error<
7700 "the parameter for this explicitly-defaulted copy "
7701 "%select{constructor|assignment operator}0 is const, but a member or base "
7702 "requires it to be non-const">;
7703 def err_defaulted_copy_assign_not_ref : Error<
7704 "the parameter for an explicitly-defaulted copy assignment operator must be an "
7705 "lvalue reference type">;
7706 def err_incorrect_defaulted_exception_spec : Error<
7707 "exception specification of explicitly defaulted "
7708 "%sub{select_special_member_kind}0 does not match the calculated one">;
7709 def err_incorrect_defaulted_constexpr : Error<
7710 "defaulted definition of %sub{select_special_member_kind}0 "
7711 "is not constexpr">;
7712 def err_out_of_line_default_deletes : Error<
7713 "defaulting this %sub{select_special_member_kind}0 "
7714 "would delete it after its first declaration">;
7715 def warn_vbase_moved_multiple_times : Warning<
7716 "defaulted move assignment operator of %0 will move assign virtual base "
7717 "class %1 multiple times">, InGroup<DiagGroup<"multiple-move-vbase">>;
7718 def note_vbase_moved_here : Note<
7719 "%select{%1 is a virtual base class of base class %2 declared here|"
7720 "virtual base class %1 declared here}0">;
7722 def ext_implicit_exception_spec_mismatch : ExtWarn<
7723 "function previously declared with an %select{explicit|implicit}0 exception "
7724 "specification redeclared with an %select{implicit|explicit}0 exception "
7725 "specification">, InGroup<DiagGroup<"implicit-exception-spec-mismatch">>;
7727 def warn_ptr_arith_precedes_bounds : Warning<
7728 "the pointer decremented by %0 refers before the beginning of the array">,
7729 InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore;
7730 def warn_ptr_arith_exceeds_bounds : Warning<
7731 "the pointer incremented by %0 refers past the end of the array (that "
7732 "contains %1 element%s2)">,
7733 InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore;
7734 def warn_array_index_precedes_bounds : Warning<
7735 "array index %0 is before the beginning of the array">,
7736 InGroup<ArrayBounds>;
7737 def warn_array_index_exceeds_bounds : Warning<
7738 "array index %0 is past the end of the array (which contains %1 "
7739 "element%s2)">, InGroup<ArrayBounds>;
7740 def note_array_index_out_of_bounds : Note<
7741 "array %0 declared here">;
7743 def warn_printf_insufficient_data_args : Warning<
7744 "more '%%' conversions than data arguments">, InGroup<Format>;
7745 def warn_printf_data_arg_not_used : Warning<
7746 "data argument not used by format string">, InGroup<FormatExtraArgs>;
7747 def warn_format_invalid_conversion : Warning<
7748 "invalid conversion specifier '%0'">, InGroup<FormatInvalidSpecifier>;
7749 def warn_printf_incomplete_specifier : Warning<
7750 "incomplete format specifier">, InGroup<Format>;
7751 def warn_missing_format_string : Warning<
7752 "format string missing">, InGroup<Format>;
7753 def warn_scanf_nonzero_width : Warning<
7754 "zero field width in scanf format string is unused">,
7756 def warn_format_conversion_argument_type_mismatch : Warning<
7757 "format specifies type %0 but the argument has "
7758 "%select{type|underlying type}2 %1">,
7760 def warn_format_conversion_argument_type_mismatch_pedantic : Extension<
7761 "format specifies type %0 but the argument has "
7762 "%select{type|underlying type}2 %1">,
7763 InGroup<FormatPedantic>;
7764 def warn_format_argument_needs_cast : Warning<
7765 "%select{values of type|enum values with underlying type}2 '%0' should not "
7766 "be used as format arguments; add an explicit cast to %1 instead">,
7768 def warn_format_argument_needs_cast_pedantic : Warning<
7769 "%select{values of type|enum values with underlying type}2 '%0' should not "
7770 "be used as format arguments; add an explicit cast to %1 instead">,
7771 InGroup<FormatPedantic>, DefaultIgnore;
7772 def warn_printf_positional_arg_exceeds_data_args : Warning <
7773 "data argument position '%0' exceeds the number of data arguments (%1)">,
7775 def warn_format_zero_positional_specifier : Warning<
7776 "position arguments in format strings start counting at 1 (not 0)">,
7778 def warn_format_invalid_positional_specifier : Warning<
7779 "invalid position specified for %select{field width|field precision}0">,
7781 def warn_format_mix_positional_nonpositional_args : Warning<
7782 "cannot mix positional and non-positional arguments in format string">,
7784 def warn_static_array_too_small : Warning<
7785 "array argument is too small; contains %0 elements, callee requires at least %1">,
7786 InGroup<ArrayBounds>;
7787 def note_callee_static_array : Note<
7788 "callee declares array parameter as static here">;
7789 def warn_empty_format_string : Warning<
7790 "format string is empty">, InGroup<FormatZeroLength>;
7791 def warn_format_string_is_wide_literal : Warning<
7792 "format string should not be a wide string">, InGroup<Format>;
7793 def warn_printf_format_string_contains_null_char : Warning<
7794 "format string contains '\\0' within the string body">, InGroup<Format>;
7795 def warn_printf_format_string_not_null_terminated : Warning<
7796 "format string is not null-terminated">, InGroup<Format>;
7797 def warn_printf_asterisk_missing_arg : Warning<
7798 "'%select{*|.*}0' specified field %select{width|precision}0 is missing a matching 'int' argument">,
7800 def warn_printf_asterisk_wrong_type : Warning<
7801 "field %select{width|precision}0 should have type %1, but argument has type %2">,
7803 def warn_printf_nonsensical_optional_amount: Warning<
7804 "%select{field width|precision}0 used with '%1' conversion specifier, resulting in undefined behavior">,
7806 def warn_printf_nonsensical_flag: Warning<
7807 "flag '%0' results in undefined behavior with '%1' conversion specifier">,
7809 def warn_format_nonsensical_length: Warning<
7810 "length modifier '%0' results in undefined behavior or no effect with '%1' conversion specifier">,
7812 def warn_format_non_standard_positional_arg: Warning<
7813 "positional arguments are not supported by ISO C">, InGroup<FormatNonStandard>, DefaultIgnore;
7814 def warn_format_non_standard: Warning<
7815 "'%0' %select{length modifier|conversion specifier}1 is not supported by ISO C">,
7816 InGroup<FormatNonStandard>, DefaultIgnore;
7817 def warn_format_non_standard_conversion_spec: Warning<
7818 "using length modifier '%0' with conversion specifier '%1' is not supported by ISO C">,
7819 InGroup<FormatNonStandard>, DefaultIgnore;
7820 def warn_format_invalid_annotation : Warning<
7821 "using '%0' format specifier annotation outside of os_log()/os_trace()">,
7823 def warn_format_P_no_precision : Warning<
7824 "using '%%P' format specifier without precision">,
7826 def warn_printf_ignored_flag: Warning<
7827 "flag '%0' is ignored when flag '%1' is present">,
7829 def warn_printf_empty_objc_flag: Warning<
7830 "missing object format flag">,
7832 def warn_printf_ObjCflags_without_ObjCConversion: Warning<
7833 "object format flags cannot be used with '%0' conversion specifier">,
7835 def warn_printf_invalid_objc_flag: Warning<
7836 "'%0' is not a valid object format flag">,
7838 def warn_scanf_scanlist_incomplete : Warning<
7839 "no closing ']' for '%%[' in scanf format string">,
7841 def note_format_string_defined : Note<"format string is defined here">;
7842 def note_format_fix_specifier : Note<"did you mean to use '%0'?">;
7843 def note_printf_c_str: Note<"did you mean to call the %0 method?">;
7844 def note_format_security_fixit: Note<
7845 "treat the string as an argument to avoid this">;
7847 def warn_null_arg : Warning<
7848 "null passed to a callee that requires a non-null argument">,
7850 def warn_null_ret : Warning<
7851 "null returned from %select{function|method}0 that requires a non-null return value">,
7854 // CHECK: returning address/reference of stack memory
7855 def warn_ret_stack_addr_ref : Warning<
7856 "%select{address of|reference to}0 stack memory associated with "
7857 "%select{local variable|parameter}2 %1 returned">,
7858 InGroup<ReturnStackAddress>;
7859 def warn_ret_local_temp_addr_ref : Warning<
7860 "returning %select{address of|reference to}0 local temporary object">,
7861 InGroup<ReturnStackAddress>;
7862 def warn_ret_addr_label : Warning<
7863 "returning address of label, which is local">,
7864 InGroup<ReturnStackAddress>;
7865 def err_ret_local_block : Error<
7866 "returning block that lives on the local stack">;
7867 def note_local_var_initializer : Note<
7868 "%select{via initialization of|binding reference}0 variable %1 here">;
7869 def note_init_with_default_member_initalizer : Note<
7870 "initializing field %0 with default member initializer">;
7872 // Check for initializing a member variable with the address or a reference to
7873 // a constructor parameter.
7874 def warn_bind_ref_member_to_parameter : Warning<
7875 "binding reference member %0 to stack allocated "
7876 "%select{variable|parameter}2 %1">, InGroup<DanglingField>;
7877 def warn_init_ptr_member_to_parameter_addr : Warning<
7878 "initializing pointer member %0 with the stack address of "
7879 "%select{variable|parameter}2 %1">, InGroup<DanglingField>;
7880 def note_ref_or_ptr_member_declared_here : Note<
7881 "%select{reference|pointer}0 member declared here">;
7883 def err_dangling_member : Error<
7884 "%select{reference|backing array for 'std::initializer_list'}2 "
7885 "%select{|subobject of }1member %0 "
7886 "%select{binds to|is}2 a temporary object "
7887 "whose lifetime would be shorter than the lifetime of "
7888 "the constructed object">;
7889 def warn_dangling_member : Warning<
7890 "%select{reference|backing array for 'std::initializer_list'}2 "
7891 "%select{|subobject of }1member %0 "
7892 "%select{binds to|is}2 a temporary object "
7893 "whose lifetime is shorter than the lifetime of the constructed object">,
7894 InGroup<DanglingField>;
7895 def note_lifetime_extending_member_declared_here : Note<
7896 "%select{%select{reference|'std::initializer_list'}0 member|"
7897 "member with %select{reference|'std::initializer_list'}0 subobject}1 "
7899 def warn_dangling_variable : Warning<
7900 "%select{temporary %select{whose address is used as value of|bound to}3 "
7901 "%select{%select{|reference }3member of local variable|"
7902 "local %select{variable|reference}3}1|"
7904 "%select{initializer list subobject of local variable|"
7905 "local initializer list}1}0 "
7906 "%2 will be destroyed at the end of the full-expression">,
7908 def warn_new_dangling_reference : Warning<
7909 "temporary bound to reference member of allocated object "
7910 "will be destroyed at the end of the full-expression">,
7911 InGroup<DanglingField>;
7912 def warn_new_dangling_initializer_list : Warning<
7914 "%select{initializer list subobject of the allocated object|"
7915 "the allocated initializer list}0 "
7916 "will be destroyed at the end of the full-expression">,
7917 InGroup<DanglingInitializerList>;
7918 def warn_unsupported_lifetime_extension : Warning<
7919 "sorry, lifetime extension of "
7920 "%select{temporary|backing array of initializer list}0 created "
7921 "by aggregate initialization using default member initializer "
7922 "is not supported; lifetime of %select{temporary|backing array}0 "
7923 "will end at the end of the full-expression">, InGroup<Dangling>;
7925 // For non-floating point, expressions of the form x == x or x != x
7926 // should result in a warning, since these always evaluate to a constant.
7927 // Array comparisons have similar warnings
7928 def warn_comparison_always : Warning<
7929 "%select{self-|array }0comparison always evaluates to %select{a constant|%2}1">,
7930 InGroup<TautologicalCompare>;
7931 def warn_comparison_bitwise_always : Warning<
7932 "bitwise comparison always evaluates to %select{false|true}0">,
7933 InGroup<TautologicalCompare>;
7934 def warn_tautological_overlap_comparison : Warning<
7935 "overlapping comparisons always evaluate to %select{false|true}0">,
7936 InGroup<TautologicalOverlapCompare>, DefaultIgnore;
7938 def warn_stringcompare : Warning<
7939 "result of comparison against %select{a string literal|@encode}0 is "
7940 "unspecified (use strncmp instead)">,
7941 InGroup<StringCompare>;
7943 def warn_identity_field_assign : Warning<
7944 "assigning %select{field|instance variable}0 to itself">,
7945 InGroup<SelfAssignmentField>;
7947 // Type safety attributes
7948 def err_type_tag_for_datatype_not_ice : Error<
7949 "'type_tag_for_datatype' attribute requires the initializer to be "
7950 "an %select{integer|integral}0 constant expression">;
7951 def err_type_tag_for_datatype_too_large : Error<
7952 "'type_tag_for_datatype' attribute requires the initializer to be "
7953 "an %select{integer|integral}0 constant expression "
7954 "that can be represented by a 64 bit integer">;
7955 def err_tag_index_out_of_range : Error<
7956 "%select{type tag|argument}0 index %1 is greater than the number of arguments specified">;
7957 def warn_type_tag_for_datatype_wrong_kind : Warning<
7958 "this type tag was not designed to be used with this function">,
7959 InGroup<TypeSafety>;
7960 def warn_type_safety_type_mismatch : Warning<
7961 "argument type %0 doesn't match specified %1 type tag "
7962 "%select{that requires %3|}2">, InGroup<TypeSafety>;
7963 def warn_type_safety_null_pointer_required : Warning<
7964 "specified %0 type tag requires a null pointer">, InGroup<TypeSafety>;
7966 // Generic selections.
7967 def err_assoc_type_incomplete : Error<
7968 "type %0 in generic association incomplete">;
7969 def err_assoc_type_nonobject : Error<
7970 "type %0 in generic association not an object type">;
7971 def err_assoc_type_variably_modified : Error<
7972 "type %0 in generic association is a variably modified type">;
7973 def err_assoc_compatible_types : Error<
7974 "type %0 in generic association compatible with previously specified type %1">;
7975 def note_compat_assoc : Note<
7976 "compatible type %0 specified here">;
7977 def err_generic_sel_no_match : Error<
7978 "controlling expression type %0 not compatible with any generic association type">;
7979 def err_generic_sel_multi_match : Error<
7980 "controlling expression type %0 compatible with %1 generic association types">;
7984 def err_blocks_disable : Error<"blocks support disabled - compile with -fblocks"
7985 " or %select{pick a deployment target that supports them|for OpenCL 2.0}0">;
7986 def err_block_returning_array_function : Error<
7987 "block cannot return %select{array|function}0 type %1">;
7989 // Builtin annotation
7990 def err_builtin_annotation_first_arg : Error<
7991 "first argument to __builtin_annotation must be an integer">;
7992 def err_builtin_annotation_second_arg : Error<
7993 "second argument to __builtin_annotation must be a non-wide string constant">;
7994 def err_msvc_annotation_wide_str : Error<
7995 "arguments to __annotation must be wide string constants">;
7997 // CFString checking
7998 def err_cfstring_literal_not_string_constant : Error<
7999 "CFString literal is not a string constant">;
8000 def warn_cfstring_truncated : Warning<
8001 "input conversion stopped due to an input byte that does not "
8002 "belong to the input codeset UTF-8">,
8003 InGroup<DiagGroup<"CFString-literal">>;
8006 // TODO: separate diagnostic for os_trace()
8007 def err_os_log_format_not_string_constant : Error<
8008 "os_log() format argument is not a string constant">;
8009 def err_os_log_argument_too_big : Error<
8010 "os_log() argument %0 is too big (%1 bytes, max %2)">;
8011 def warn_os_log_format_narg : Error<
8012 "os_log() '%%n' format specifier is not allowed">, DefaultError;
8015 def err_continue_not_in_loop : Error<
8016 "'continue' statement not in loop statement">;
8017 def err_break_not_in_loop_or_switch : Error<
8018 "'break' statement not in loop or switch statement">;
8019 def warn_loop_ctrl_binds_to_inner : Warning<
8020 "'%0' is bound to current loop, GCC binds it to the enclosing loop">,
8022 def warn_break_binds_to_switch : Warning<
8023 "'break' is bound to loop, GCC binds it to switch">,
8025 def err_default_not_in_switch : Error<
8026 "'default' statement not in switch statement">;
8027 def err_case_not_in_switch : Error<"'case' statement not in switch statement">;
8028 def warn_bool_switch_condition : Warning<
8029 "switch condition has boolean value">, InGroup<SwitchBool>;
8030 def warn_case_value_overflow : Warning<
8031 "overflow converting case value to switch condition type (%0 to %1)">,
8033 def err_duplicate_case : Error<"duplicate case value '%0'">;
8034 def err_duplicate_case_differing_expr : Error<
8035 "duplicate case value: '%0' and '%1' both equal '%2'">;
8036 def warn_case_empty_range : Warning<"empty case range specified">;
8037 def warn_missing_case_for_condition :
8038 Warning<"no case matching constant switch condition '%0'">;
8040 def warn_def_missing_case : Warning<"%plural{"
8041 "1:enumeration value %1 not explicitly handled in switch|"
8042 "2:enumeration values %1 and %2 not explicitly handled in switch|"
8043 "3:enumeration values %1, %2, and %3 not explicitly handled in switch|"
8044 ":%0 enumeration values not explicitly handled in switch: %1, %2, %3...}0">,
8045 InGroup<SwitchEnum>, DefaultIgnore;
8047 def warn_missing_case : Warning<"%plural{"
8048 "1:enumeration value %1 not handled in switch|"
8049 "2:enumeration values %1 and %2 not handled in switch|"
8050 "3:enumeration values %1, %2, and %3 not handled in switch|"
8051 ":%0 enumeration values not handled in switch: %1, %2, %3...}0">,
8054 def warn_unannotated_fallthrough : Warning<
8055 "unannotated fall-through between switch labels">,
8056 InGroup<ImplicitFallthrough>, DefaultIgnore;
8057 def warn_unannotated_fallthrough_per_function : Warning<
8058 "unannotated fall-through between switch labels in partly-annotated "
8059 "function">, InGroup<ImplicitFallthroughPerFunction>, DefaultIgnore;
8060 def note_insert_fallthrough_fixit : Note<
8061 "insert '%0;' to silence this warning">;
8062 def note_insert_break_fixit : Note<
8063 "insert 'break;' to avoid fall-through">;
8064 def err_fallthrough_attr_wrong_target : Error<
8065 "%0 attribute is only allowed on empty statements">;
8066 def note_fallthrough_insert_semi_fixit : Note<"did you forget ';'?">;
8067 def err_fallthrough_attr_outside_switch : Error<
8068 "fallthrough annotation is outside switch statement">;
8069 def err_fallthrough_attr_invalid_placement : Error<
8070 "fallthrough annotation does not directly precede switch label">;
8071 def warn_fallthrough_attr_unreachable : Warning<
8072 "fallthrough annotation in unreachable code">,
8073 InGroup<ImplicitFallthrough>, DefaultIgnore;
8075 def warn_unreachable_default : Warning<
8076 "default label in switch which covers all enumeration values">,
8077 InGroup<CoveredSwitchDefault>, DefaultIgnore;
8078 def warn_not_in_enum : Warning<"case value not in enumerated type %0">,
8080 def warn_not_in_enum_assignment : Warning<"integer constant not in range "
8081 "of enumerated type %0">, InGroup<DiagGroup<"assign-enum">>, DefaultIgnore;
8082 def err_typecheck_statement_requires_scalar : Error<
8083 "statement requires expression of scalar type (%0 invalid)">;
8084 def err_typecheck_statement_requires_integer : Error<
8085 "statement requires expression of integer type (%0 invalid)">;
8086 def err_multiple_default_labels_defined : Error<
8087 "multiple default labels in one switch">;
8088 def err_switch_multiple_conversions : Error<
8089 "multiple conversions from switch condition type %0 to an integral or "
8090 "enumeration type">;
8091 def note_switch_conversion : Note<
8092 "conversion to %select{integral|enumeration}0 type %1">;
8093 def err_switch_explicit_conversion : Error<
8094 "switch condition type %0 requires explicit conversion to %1">;
8095 def err_switch_incomplete_class_type : Error<
8096 "switch condition has incomplete class type %0">;
8098 def warn_empty_if_body : Warning<
8099 "if statement has empty body">, InGroup<EmptyBody>;
8100 def warn_empty_for_body : Warning<
8101 "for loop has empty body">, InGroup<EmptyBody>;
8102 def warn_empty_range_based_for_body : Warning<
8103 "range-based for loop has empty body">, InGroup<EmptyBody>;
8104 def warn_empty_while_body : Warning<
8105 "while loop has empty body">, InGroup<EmptyBody>;
8106 def warn_empty_switch_body : Warning<
8107 "switch statement has empty body">, InGroup<EmptyBody>;
8108 def note_empty_body_on_separate_line : Note<
8109 "put the semicolon on a separate line to silence this warning">;
8111 def err_va_start_captured_stmt : Error<
8112 "'va_start' cannot be used in a captured statement">;
8113 def err_va_start_outside_function : Error<
8114 "'va_start' cannot be used outside a function">;
8115 def err_va_start_fixed_function : Error<
8116 "'va_start' used in function with fixed args">;
8117 def err_va_start_used_in_wrong_abi_function : Error<
8118 "'va_start' used in %select{System V|Win64}0 ABI function">;
8119 def err_ms_va_start_used_in_sysv_function : Error<
8120 "'__builtin_ms_va_start' used in System V ABI function">;
8121 def warn_second_arg_of_va_start_not_last_named_param : Warning<
8122 "second argument to 'va_start' is not the last named parameter">,
8124 def warn_va_start_type_is_undefined : Warning<
8125 "passing %select{an object that undergoes default argument promotion|"
8126 "an object of reference type|a parameter declared with the 'register' "
8127 "keyword}0 to 'va_start' has undefined behavior">, InGroup<Varargs>;
8128 def err_first_argument_to_va_arg_not_of_type_va_list : Error<
8129 "first argument to 'va_arg' is of type %0 and not 'va_list'">;
8130 def err_second_parameter_to_va_arg_incomplete: Error<
8131 "second argument to 'va_arg' is of incomplete type %0">;
8132 def err_second_parameter_to_va_arg_abstract: Error<
8133 "second argument to 'va_arg' is of abstract type %0">;
8134 def warn_second_parameter_to_va_arg_not_pod : Warning<
8135 "second argument to 'va_arg' is of non-POD type %0">,
8136 InGroup<NonPODVarargs>, DefaultError;
8137 def warn_second_parameter_to_va_arg_ownership_qualified : Warning<
8138 "second argument to 'va_arg' is of ARC ownership-qualified type %0">,
8139 InGroup<NonPODVarargs>, DefaultError;
8140 def warn_second_parameter_to_va_arg_never_compatible : Warning<
8141 "second argument to 'va_arg' is of promotable type %0; this va_arg has "
8142 "undefined behavior because arguments will be promoted to %1">, InGroup<Varargs>;
8144 def warn_return_missing_expr : Warning<
8145 "non-void %select{function|method}1 %0 should return a value">, DefaultError,
8146 InGroup<ReturnType>;
8147 def ext_return_missing_expr : ExtWarn<
8148 "non-void %select{function|method}1 %0 should return a value">, DefaultError,
8149 InGroup<ReturnType>;
8150 def ext_return_has_expr : ExtWarn<
8151 "%select{void function|void method|constructor|destructor}1 %0 "
8152 "should not return a value">,
8153 DefaultError, InGroup<ReturnType>;
8154 def ext_return_has_void_expr : Extension<
8155 "void %select{function|method|block}1 %0 should not return void expression">;
8156 def err_return_init_list : Error<
8157 "%select{void function|void method|constructor|destructor}1 %0 "
8158 "must not return a value">;
8159 def err_ctor_dtor_returns_void : Error<
8160 "%select{constructor|destructor}1 %0 must not return void expression">;
8161 def warn_noreturn_function_has_return_expr : Warning<
8162 "function %0 declared 'noreturn' should not return">,
8163 InGroup<InvalidNoreturn>;
8164 def warn_falloff_noreturn_function : Warning<
8165 "function declared 'noreturn' should not return">,
8166 InGroup<InvalidNoreturn>;
8167 def err_noreturn_block_has_return_expr : Error<
8168 "block declared 'noreturn' should not return">;
8169 def err_noreturn_missing_on_first_decl : Error<
8170 "function declared '[[noreturn]]' after its first declaration">;
8171 def note_noreturn_missing_first_decl : Note<
8172 "declaration missing '[[noreturn]]' attribute is here">;
8173 def err_carries_dependency_missing_on_first_decl : Error<
8174 "%select{function|parameter}0 declared '[[carries_dependency]]' "
8175 "after its first declaration">;
8176 def note_carries_dependency_missing_first_decl : Note<
8177 "declaration missing '[[carries_dependency]]' attribute is here">;
8178 def err_carries_dependency_param_not_function_decl : Error<
8179 "'[[carries_dependency]]' attribute only allowed on parameter in a function "
8180 "declaration or lambda">;
8181 def err_block_on_nonlocal : Error<
8182 "__block attribute not allowed, only allowed on local variables">;
8183 def err_block_on_vm : Error<
8184 "__block attribute not allowed on declaration with a variably modified type">;
8186 def err_vec_builtin_non_vector : Error<
8187 "first two arguments to %0 must be vectors">;
8188 def err_vec_builtin_incompatible_vector : Error<
8189 "first two arguments to %0 must have the same type">;
8190 def err_vsx_builtin_nonconstant_argument : Error<
8191 "argument %0 to %1 must be a 2-bit unsigned literal (i.e. 0, 1, 2 or 3)">;
8193 def err_shufflevector_nonconstant_argument : Error<
8194 "index for __builtin_shufflevector must be a constant integer">;
8195 def err_shufflevector_argument_too_large : Error<
8196 "index for __builtin_shufflevector must be less than the total number "
8197 "of vector elements">;
8199 def err_convertvector_non_vector : Error<
8200 "first argument to __builtin_convertvector must be a vector">;
8201 def err_convertvector_non_vector_type : Error<
8202 "second argument to __builtin_convertvector must be a vector type">;
8203 def err_convertvector_incompatible_vector : Error<
8204 "first two arguments to __builtin_convertvector must have the same number of elements">;
8206 def err_first_argument_to_cwsc_not_call : Error<
8207 "first argument to __builtin_call_with_static_chain must be a non-member call expression">;
8208 def err_first_argument_to_cwsc_block_call : Error<
8209 "first argument to __builtin_call_with_static_chain must not be a block call">;
8210 def err_first_argument_to_cwsc_builtin_call : Error<
8211 "first argument to __builtin_call_with_static_chain must not be a builtin call">;
8212 def err_first_argument_to_cwsc_pdtor_call : Error<
8213 "first argument to __builtin_call_with_static_chain must not be a pseudo-destructor call">;
8214 def err_second_argument_to_cwsc_not_pointer : Error<
8215 "second argument to __builtin_call_with_static_chain must be of pointer type">;
8217 def err_vector_incorrect_num_initializers : Error<
8218 "%select{too many|too few}0 elements in vector initialization (expected %1 elements, have %2)">;
8219 def err_altivec_empty_initializer : Error<"expected initializer">;
8221 def err_invalid_neon_type_code : Error<
8222 "incompatible constant for this __builtin_neon function">;
8223 def err_argument_invalid_range : Error<
8224 "argument value %0 is outside the valid range [%1, %2]">;
8225 def warn_argument_invalid_range : Warning<
8226 "argument value %0 is outside the valid range [%1, %2]">, DefaultError,
8227 InGroup<DiagGroup<"argument-outside-range">>;
8228 def err_argument_not_multiple : Error<
8229 "argument should be a multiple of %0">;
8230 def warn_neon_vector_initializer_non_portable : Warning<
8231 "vector initializers are not compatible with NEON intrinsics in big endian "
8232 "mode">, InGroup<DiagGroup<"nonportable-vector-initialization">>;
8233 def note_neon_vector_initializer_non_portable : Note<
8234 "consider using vld1_%0%1() to initialize a vector from memory, or "
8235 "vcreate_%0%1() to initialize from an integer constant">;
8236 def note_neon_vector_initializer_non_portable_q : Note<
8237 "consider using vld1q_%0%1() to initialize a vector from memory, or "
8238 "vcombine_%0%1(vcreate_%0%1(), vcreate_%0%1()) to initialize from integer "
8240 def err_systemz_invalid_tabort_code : Error<
8241 "invalid transaction abort code">;
8242 def err_64_bit_builtin_32_bit_tgt : Error<
8243 "this builtin is only available on 64-bit targets">;
8244 def err_32_bit_builtin_64_bit_tgt : Error<
8245 "this builtin is only available on 32-bit targets">;
8246 def err_builtin_x64_aarch64_only : Error<
8247 "this builtin is only available on x86-64 and aarch64 targets">;
8248 def err_ppc_builtin_only_on_pwr7 : Error<
8249 "this builtin is only valid on POWER7 or later CPUs">;
8250 def err_x86_builtin_invalid_rounding : Error<
8251 "invalid rounding argument">;
8252 def err_x86_builtin_invalid_scale : Error<
8253 "scale argument must be 1, 2, 4, or 8">;
8254 def err_hexagon_builtin_unsupported_cpu : Error<
8255 "builtin is not supported on this CPU">;
8256 def err_hexagon_builtin_requires_hvx : Error<
8257 "builtin requires HVX">;
8258 def err_hexagon_builtin_unsupported_hvx : Error<
8259 "builtin is not supported on this version of HVX">;
8261 def err_builtin_target_unsupported : Error<
8262 "builtin is not supported on this target">;
8263 def err_builtin_longjmp_unsupported : Error<
8264 "__builtin_longjmp is not supported for the current target">;
8265 def err_builtin_setjmp_unsupported : Error<
8266 "__builtin_setjmp is not supported for the current target">;
8268 def err_builtin_longjmp_invalid_val : Error<
8269 "argument to __builtin_longjmp must be a constant 1">;
8270 def err_builtin_requires_language : Error<"'%0' is only available in %1">;
8272 def err_constant_integer_arg_type : Error<
8273 "argument to %0 must be a constant integer">;
8275 def ext_mixed_decls_code : Extension<
8276 "ISO C90 forbids mixing declarations and code">,
8277 InGroup<DiagGroup<"declaration-after-statement">>;
8279 def err_non_local_variable_decl_in_for : Error<
8280 "declaration of non-local variable in 'for' loop">;
8281 def err_non_variable_decl_in_for : Error<
8282 "non-variable declaration in 'for' loop">;
8283 def err_toomany_element_decls : Error<
8284 "only one element declaration is allowed">;
8285 def err_selector_element_not_lvalue : Error<
8286 "selector element is not a valid lvalue">;
8287 def err_selector_element_type : Error<
8288 "selector element type %0 is not a valid object">;
8289 def err_selector_element_const_type : Error<
8290 "selector element of type %0 cannot be a constant l-value expression">;
8291 def err_collection_expr_type : Error<
8292 "the type %0 is not a pointer to a fast-enumerable object">;
8293 def warn_collection_expr_type : Warning<
8294 "collection expression type %0 may not respond to %1">;
8296 def err_invalid_conversion_between_ext_vectors : Error<
8297 "invalid conversion between ext-vector type %0 and %1">;
8299 def warn_duplicate_attribute_exact : Warning<
8300 "attribute %0 is already applied">, InGroup<IgnoredAttributes>;
8302 def warn_duplicate_attribute : Warning<
8303 "attribute %0 is already applied with different parameters">,
8304 InGroup<IgnoredAttributes>;
8306 def warn_sync_fetch_and_nand_semantics_change : Warning<
8307 "the semantics of this intrinsic changed with GCC "
8308 "version 4.4 - the newer semantics are provided here">,
8309 InGroup<DiagGroup<"sync-fetch-and-nand-semantics-changed">>;
8312 def ext_invalid_sign_spec : Extension<"'%0' cannot be signed or unsigned">;
8313 def warn_receiver_forward_class : Warning<
8314 "receiver %0 is a forward class and corresponding @interface may not exist">,
8315 InGroup<ForwardClassReceiver>;
8316 def note_method_sent_forward_class : Note<"method %0 is used for the forward class">;
8317 def ext_missing_declspec : ExtWarn<
8318 "declaration specifier missing, defaulting to 'int'">;
8319 def ext_missing_type_specifier : ExtWarn<
8320 "type specifier missing, defaults to 'int'">,
8321 InGroup<ImplicitInt>;
8322 def err_decimal_unsupported : Error<
8323 "GNU decimal type extension not supported">;
8324 def err_missing_type_specifier : Error<
8325 "C++ requires a type specifier for all declarations">;
8326 def err_objc_array_of_interfaces : Error<
8327 "array of interface %0 is invalid (probably should be an array of pointers)">;
8328 def ext_c99_array_usage : Extension<
8329 "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 "
8330 "feature">, InGroup<C99>;
8331 def err_c99_array_usage_cxx : Error<
8332 "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 "
8333 "feature, not permitted in C++">;
8334 def err_type_unsupported : Error<
8335 "%0 is not supported on this target">;
8336 def err_nsconsumed_attribute_mismatch : Error<
8337 "overriding method has mismatched ns_consumed attribute on its"
8339 def err_nsreturns_retained_attribute_mismatch : Error<
8340 "overriding method has mismatched ns_returns_%select{not_retained|retained}0"
8342 def warn_nsconsumed_attribute_mismatch : Warning<
8343 err_nsconsumed_attribute_mismatch.Text>, InGroup<NSConsumedMismatch>;
8344 def warn_nsreturns_retained_attribute_mismatch : Warning<
8345 err_nsreturns_retained_attribute_mismatch.Text>, InGroup<NSReturnsMismatch>;
8347 def note_getter_unavailable : Note<
8348 "or because setter is declared here, but no getter method %0 is found">;
8349 def err_invalid_protocol_qualifiers : Error<
8350 "invalid protocol qualifiers on non-ObjC type">;
8351 def warn_ivar_use_hidden : Warning<
8352 "local declaration of %0 hides instance variable">,
8353 InGroup<ShadowIvar>;
8354 def warn_direct_initialize_call : Warning<
8355 "explicit call to +initialize results in duplicate call to +initialize">,
8356 InGroup<ExplicitInitializeCall>;
8357 def warn_direct_super_initialize_call : Warning<
8358 "explicit call to [super initialize] should only be in implementation "
8360 InGroup<ExplicitInitializeCall>;
8361 def err_ivar_use_in_class_method : Error<
8362 "instance variable %0 accessed in class method">;
8363 def err_private_ivar_access : Error<"instance variable %0 is private">,
8365 def err_protected_ivar_access : Error<"instance variable %0 is protected">,
8367 def warn_maynot_respond : Warning<"%0 may not respond to %1">;
8368 def ext_typecheck_base_super : Warning<
8369 "method parameter type "
8370 "%diff{$ does not match super class method parameter type $|"
8371 "does not match super class method parameter type}0,1">,
8372 InGroup<SuperSubClassMismatch>, DefaultIgnore;
8373 def warn_missing_method_return_type : Warning<
8374 "method has no return type specified; defaults to 'id'">,
8375 InGroup<MissingMethodReturnType>, DefaultIgnore;
8376 def warn_direct_ivar_access : Warning<"instance variable %0 is being "
8377 "directly accessed">, InGroup<DiagGroup<"direct-ivar-access">>, DefaultIgnore;
8379 // Spell-checking diagnostics
8380 def err_unknown_typename : Error<
8381 "unknown type name %0">;
8382 def err_unknown_type_or_class_name_suggest : Error<
8383 "unknown %select{type|class}1 name %0; did you mean %2?">;
8384 def err_unknown_typename_suggest : Error<
8385 "unknown type name %0; did you mean %1?">;
8386 def err_unknown_nested_typename_suggest : Error<
8387 "no type named %0 in %1; did you mean %select{|simply }2%3?">;
8388 def err_no_member_suggest : Error<"no member named %0 in %1; did you mean %select{|simply }2%3?">;
8389 def err_undeclared_use_suggest : Error<
8390 "use of undeclared %0; did you mean %1?">;
8391 def err_undeclared_var_use_suggest : Error<
8392 "use of undeclared identifier %0; did you mean %1?">;
8393 def err_no_template : Error<"no template named %0">;
8394 def err_no_template_suggest : Error<"no template named %0; did you mean %1?">;
8395 def err_no_member_template : Error<"no template named %0 in %1">;
8396 def err_no_member_template_suggest : Error<
8397 "no template named %0 in %1; did you mean %select{|simply }2%3?">;
8398 def err_non_template_in_template_id : Error<
8399 "%0 does not name a template but is followed by template arguments">;
8400 def err_non_template_in_template_id_suggest : Error<
8401 "%0 does not name a template but is followed by template arguments; "
8402 "did you mean %1?">;
8403 def err_non_template_in_member_template_id_suggest : Error<
8404 "member %0 of %1 is not a template; did you mean %select{|simply }2%3?">;
8405 def note_non_template_in_template_id_found : Note<
8406 "non-template declaration found by name lookup">;
8407 def err_mem_init_not_member_or_class_suggest : Error<
8408 "initializer %0 does not name a non-static data member or base "
8409 "class; did you mean the %select{base class|member}1 %2?">;
8410 def err_field_designator_unknown_suggest : Error<
8411 "field designator %0 does not refer to any field in type %1; did you mean "
8413 def err_typecheck_member_reference_ivar_suggest : Error<
8414 "%0 does not have a member named %1; did you mean %2?">;
8415 def err_property_not_found_suggest : Error<
8416 "property %0 not found on object of type %1; did you mean %2?">;
8417 def err_class_property_found : Error<
8418 "property %0 is a class property; did you mean to access it with class '%1'?">;
8419 def err_ivar_access_using_property_syntax_suggest : Error<
8420 "property %0 not found on object of type %1; did you mean to access instance variable %2?">;
8421 def warn_property_access_suggest : Warning<
8422 "property %0 not found on object of type %1; did you mean to access property %2?">,
8423 InGroup<PropertyAccessDotSyntax>;
8424 def err_property_found_suggest : Error<
8425 "property %0 found on object of type %1; did you mean to access "
8426 "it with the \".\" operator?">;
8427 def err_undef_interface_suggest : Error<
8428 "cannot find interface declaration for %0; did you mean %1?">;
8429 def warn_undef_interface_suggest : Warning<
8430 "cannot find interface declaration for %0; did you mean %1?">;
8431 def err_undef_superclass_suggest : Error<
8432 "cannot find interface declaration for %0, superclass of %1; did you mean "
8434 def err_undeclared_protocol_suggest : Error<
8435 "cannot find protocol declaration for %0; did you mean %1?">;
8436 def note_base_class_specified_here : Note<
8437 "base class %0 specified here">;
8438 def err_using_directive_suggest : Error<
8439 "no namespace named %0; did you mean %1?">;
8440 def err_using_directive_member_suggest : Error<
8441 "no namespace named %0 in %1; did you mean %select{|simply }2%3?">;
8442 def note_namespace_defined_here : Note<"namespace %0 defined here">;
8443 def err_sizeof_pack_no_pack_name_suggest : Error<
8444 "%0 does not refer to the name of a parameter pack; did you mean %1?">;
8445 def note_parameter_pack_here : Note<"parameter pack %0 declared here">;
8447 def err_uncasted_use_of_unknown_any : Error<
8448 "%0 has unknown type; cast it to its declared type to use it">;
8449 def err_uncasted_call_of_unknown_any : Error<
8450 "%0 has unknown return type; cast the call to its declared return type">;
8451 def err_uncasted_send_to_unknown_any_method : Error<
8452 "no known method %select{%objcinstance1|%objcclass1}0; cast the "
8453 "message send to the method's return type">;
8454 def err_unsupported_unknown_any_decl : Error<
8455 "%0 has unknown type, which is not supported for this kind of declaration">;
8456 def err_unsupported_unknown_any_expr : Error<
8457 "unsupported expression with unknown type">;
8458 def err_unsupported_unknown_any_call : Error<
8459 "call to unsupported expression with unknown type">;
8460 def err_unknown_any_addrof : Error<
8461 "the address of a declaration with unknown type "
8462 "can only be cast to a pointer type">;
8463 def err_unknown_any_addrof_call : Error<
8464 "address-of operator cannot be applied to a call to a function with "
8465 "unknown return type">;
8466 def err_unknown_any_var_function_type : Error<
8467 "variable %0 with unknown type cannot be given a function type">;
8468 def err_unknown_any_function : Error<
8469 "function %0 with unknown type must be given a function type">;
8471 def err_filter_expression_integral : Error<
8472 "filter expression type should be an integral value not %0">;
8474 def err_non_asm_stmt_in_naked_function : Error<
8475 "non-ASM statement in naked function is not supported">;
8476 def err_asm_naked_this_ref : Error<
8477 "'this' pointer references not allowed in naked functions">;
8478 def err_asm_naked_parm_ref : Error<
8479 "parameter references not allowed in naked functions">;
8481 // OpenCL warnings and errors.
8482 def err_invalid_astype_of_different_size : Error<
8483 "invalid reinterpretation: sizes of %0 and %1 must match">;
8484 def err_static_kernel : Error<
8485 "kernel functions cannot be declared static">;
8486 def err_opencl_ptrptr_kernel_param : Error<
8487 "kernel parameter cannot be declared as a pointer to a pointer">;
8488 def err_kernel_arg_address_space : Error<
8489 "pointer arguments to kernel functions must reside in '__global', "
8490 "'__constant' or '__local' address space">;
8491 def err_opencl_ext_vector_component_invalid_length : Error<
8492 "vector component access has invalid length %0. Supported: 1,2,3,4,8,16.">;
8493 def err_opencl_function_variable : Error<
8494 "%select{non-kernel function|function scope}0 variable cannot be declared in %1 address space">;
8495 def err_opencl_addrspace_scope : Error<
8496 "variables in the %0 address space can only be declared in the outermost "
8497 "scope of a kernel function">;
8498 def err_static_function_scope : Error<
8499 "variables in function scope cannot be declared static">;
8500 def err_opencl_bitfields : Error<
8501 "bit-fields are not supported in OpenCL">;
8502 def err_opencl_vla : Error<
8503 "variable length arrays are not supported in OpenCL">;
8504 def err_opencl_scalar_type_rank_greater_than_vector_type : Error<
8505 "scalar operand type has greater rank than the type of the vector "
8506 "element. (%0 and %1)">;
8507 def err_bad_kernel_param_type : Error<
8508 "%0 cannot be used as the type of a kernel parameter">;
8509 def err_record_with_pointers_kernel_param : Error<
8510 "%select{struct|union}0 kernel parameters may not contain pointers">;
8511 def note_within_field_of_type : Note<
8512 "within field of type %0 declared here">;
8513 def note_illegal_field_declared_here : Note<
8514 "field of illegal %select{type|pointer type}0 %1 declared here">;
8515 def err_opencl_type_struct_or_union_field : Error<
8516 "the %0 type cannot be used to declare a structure or union field">;
8517 def err_event_t_addr_space_qual : Error<
8518 "the event_t type can only be used with __private address space qualifier">;
8519 def err_expected_kernel_void_return_type : Error<
8520 "kernel must have void return type">;
8521 def err_sampler_initializer_not_integer : Error<
8522 "sampler_t initialization requires 32-bit integer, not %0">;
8523 def warn_sampler_initializer_invalid_bits : Warning<
8524 "sampler initializer has invalid %0 bits">, InGroup<SpirCompat>, DefaultIgnore;
8525 def err_sampler_argument_required : Error<
8526 "sampler_t variable required - got %0">;
8527 def err_wrong_sampler_addressspace: Error<
8528 "sampler type cannot be used with the __local and __global address space qualifiers">;
8529 def err_opencl_nonconst_global_sampler : Error<
8530 "global sampler requires a const or constant address space qualifier">;
8531 def err_opencl_cast_non_zero_to_event_t : Error<
8532 "cannot cast non-zero value '%0' to 'event_t'">;
8533 def err_opencl_global_invalid_addr_space : Error<
8534 "%select{program scope|static local|extern}0 variable must reside in %1 address space">;
8535 def err_missing_actual_pipe_type : Error<
8536 "missing actual type specifier for pipe">;
8537 def err_reference_pipe_type : Error <
8538 "pipes packet types cannot be of reference type">;
8539 def err_opencl_no_main : Error<"%select{function|kernel}0 cannot be called 'main'">;
8540 def err_opencl_kernel_attr :
8541 Error<"attribute %0 can only be applied to an OpenCL kernel function">;
8542 def err_opencl_return_value_with_address_space : Error<
8543 "return value cannot be qualified with address space">;
8544 def err_opencl_constant_no_init : Error<
8545 "variable in constant address space must be initialized">;
8546 def err_opencl_atomic_init: Error<
8547 "atomic variable can be %select{assigned|initialized}0 to a variable only "
8548 "in global address space">;
8549 def err_opencl_implicit_vector_conversion : Error<
8550 "implicit conversions between vector types (%0 and %1) are not permitted">;
8551 def err_opencl_invalid_type_array : Error<
8552 "array of %0 type is invalid in OpenCL">;
8553 def err_opencl_ternary_with_block : Error<
8554 "block type cannot be used as expression in ternary expression in OpenCL">;
8555 def err_opencl_pointer_to_type : Error<
8556 "pointer to type %0 is invalid in OpenCL">;
8557 def err_opencl_type_can_only_be_used_as_function_parameter : Error <
8558 "type %0 can only be used as a function parameter in OpenCL">;
8559 def warn_opencl_attr_deprecated_ignored : Warning <
8560 "%0 attribute is deprecated and ignored in OpenCL version %1">,
8561 InGroup<IgnoredAttributes>;
8562 def err_opencl_variadic_function : Error<
8563 "invalid prototype, variadic arguments are not allowed in OpenCL">;
8564 def err_opencl_requires_extension : Error<
8565 "use of %select{type|declaration}0 %1 requires %2 extension to be enabled">;
8567 // OpenCL v2.0 s6.13.6 -- Builtin Pipe Functions
8568 def err_opencl_builtin_pipe_first_arg : Error<
8569 "first argument to %0 must be a pipe type">;
8570 def err_opencl_builtin_pipe_arg_num : Error<
8571 "invalid number of arguments to function: %0">;
8572 def err_opencl_builtin_pipe_invalid_arg : Error<
8573 "invalid argument type to function %0 (expecting %1 having %2)">;
8574 def err_opencl_builtin_pipe_invalid_access_modifier : Error<
8575 "invalid pipe access modifier (expecting %0)">;
8577 // OpenCL access qualifier
8578 def err_opencl_invalid_access_qualifier : Error<
8579 "access qualifier can only be used for pipe and image type">;
8580 def err_opencl_invalid_read_write : Error<
8581 "access qualifier %0 can not be used for %1 %select{|prior to OpenCL version 2.0}2">;
8582 def err_opencl_multiple_access_qualifiers : Error<
8583 "multiple access qualifiers">;
8584 def note_opencl_typedef_access_qualifier : Note<
8585 "previously declared '%0' here">;
8587 // OpenCL Section 6.8.g
8588 def err_opencl_unknown_type_specifier : Error<
8589 "OpenCL %select{C|C++}0 version %1 does not support the '%2' "
8590 "%select{type qualifier|storage class specifier}3">;
8592 // OpenCL v2.0 s6.12.5 Blocks restrictions
8593 def err_opencl_block_storage_type : Error<
8594 "the __block storage type is not permitted">;
8595 def err_opencl_invalid_block_declaration : Error<
8596 "invalid block variable declaration - must be %select{const qualified|initialized}0">;
8597 def err_opencl_extern_block_declaration : Error<
8598 "invalid block variable declaration - using 'extern' storage class is disallowed">;
8599 def err_opencl_block_ref_block : Error<
8600 "cannot refer to a block inside block">;
8602 // OpenCL v2.0 s6.13.9 - Address space qualifier functions.
8603 def err_opencl_builtin_to_addr_arg_num : Error<
8604 "invalid number of arguments to function: %0">;
8605 def err_opencl_builtin_to_addr_invalid_arg : Error<
8606 "invalid argument %0 to function: %1, expecting a generic pointer argument">;
8608 // OpenCL v2.0 s6.13.17 Enqueue kernel restrictions.
8609 def err_opencl_enqueue_kernel_incorrect_args : Error<
8610 "illegal call to enqueue_kernel, incorrect argument types">;
8611 def err_opencl_enqueue_kernel_local_size_args : Error<
8612 "mismatch in number of block parameters and local size arguments passed">;
8613 def err_opencl_enqueue_kernel_invalid_local_size_type : Error<
8614 "illegal call to enqueue_kernel, parameter needs to be specified as integer type">;
8615 def err_opencl_enqueue_kernel_blocks_non_local_void_args : Error<
8616 "blocks used in enqueue_kernel call are expected to have parameters of type 'local void*'">;
8617 def err_opencl_enqueue_kernel_blocks_no_args : Error<
8618 "blocks with parameters are not accepted in this prototype of enqueue_kernel call">;
8620 def err_opencl_builtin_expected_type : Error<
8621 "illegal call to %0, expected %1 argument type">;
8623 // OpenCL v2.2 s2.1.2.3 - Vector Component Access
8624 def ext_opencl_ext_vector_type_rgba_selector: ExtWarn<
8625 "vector component name '%0' is an OpenCL version 2.2 feature">,
8626 InGroup<OpenCLUnsupportedRGBA>;
8627 } // end of sema category
8629 let CategoryName = "OpenMP Issue" in {
8631 def err_omp_expected_var_arg : Error<
8632 "%0 is not a global variable, static local variable or static data member">;
8633 def err_omp_expected_var_arg_suggest : Error<
8634 "%0 is not a global variable, static local variable or static data member; "
8636 def err_omp_global_var_arg : Error<
8637 "arguments of '#pragma omp %0' must have %select{global storage|static storage duration}1">;
8638 def err_omp_ref_type_arg : Error<
8639 "arguments of '#pragma omp %0' cannot be of reference type %1">;
8640 def err_omp_region_not_file_context : Error<
8641 "directive must be at file or namespace scope">;
8642 def err_omp_var_scope : Error<
8643 "'#pragma omp %0' must appear in the scope of the %q1 variable declaration">;
8644 def err_omp_var_used : Error<
8645 "'#pragma omp %0' must precede all references to variable %q1">;
8646 def err_omp_var_thread_local : Error<
8647 "variable %0 cannot be threadprivate because it is %select{thread-local|a global named register variable}1">;
8648 def err_omp_private_incomplete_type : Error<
8649 "a private variable with incomplete type %0">;
8650 def err_omp_firstprivate_incomplete_type : Error<
8651 "a firstprivate variable with incomplete type %0">;
8652 def err_omp_lastprivate_incomplete_type : Error<
8653 "a lastprivate variable with incomplete type %0">;
8654 def err_omp_reduction_incomplete_type : Error<
8655 "a reduction list item with incomplete type %0">;
8656 def err_omp_unexpected_clause_value : Error<
8657 "expected %0 in OpenMP clause '%1'">;
8658 def err_omp_expected_var_name_member_expr : Error<
8659 "expected variable name%select{| or data member of current class}0">;
8660 def err_omp_expected_var_name_member_expr_or_array_item : Error<
8661 "expected variable name%select{|, data member of current class}0, array element or array section">;
8662 def err_omp_expected_addressable_lvalue_or_array_item : Error<
8663 "expected addressable lvalue expression, array element or array section">;
8664 def err_omp_expected_named_var_member_or_array_expression: Error<
8665 "expected expression containing only member accesses and/or array sections based on named variables">;
8666 def err_omp_bit_fields_forbidden_in_clause : Error<
8667 "bit fields cannot be used to specify storage in a '%0' clause">;
8668 def err_array_section_does_not_specify_contiguous_storage : Error<
8669 "array section does not specify contiguous storage">;
8670 def err_omp_union_type_not_allowed : Error<
8671 "mapping of union members is not allowed">;
8672 def err_omp_expected_access_to_data_field : Error<
8673 "expected access to data field">;
8674 def err_omp_multiple_array_items_in_map_clause : Error<
8675 "multiple array elements associated with the same variable are not allowed in map clauses of the same construct">;
8676 def err_omp_pointer_mapped_along_with_derived_section : Error<
8677 "pointer cannot be mapped along with a section derived from itself">;
8678 def err_omp_original_storage_is_shared_and_does_not_contain : Error<
8679 "original storage of expression in data environment is shared but data environment do not fully contain mapped expression storage">;
8680 def err_omp_same_pointer_dereferenced : Error<
8681 "same pointer dereferenced in multiple different ways in map clause expressions">;
8682 def note_omp_task_predetermined_firstprivate_here : Note<
8683 "predetermined as a firstprivate in a task construct here">;
8684 def err_omp_threadprivate_incomplete_type : Error<
8685 "threadprivate variable with incomplete type %0">;
8686 def err_omp_no_dsa_for_variable : Error<
8687 "variable %0 must have explicitly specified data sharing attributes">;
8688 def err_omp_wrong_dsa : Error<
8689 "%0 variable cannot be %1">;
8690 def err_omp_variably_modified_type_not_supported : Error<
8691 "arguments of OpenMP clause '%0' in '#pragma omp %2' directive cannot be of variably-modified type %1">;
8692 def note_omp_explicit_dsa : Note<
8694 def note_omp_predetermined_dsa : Note<
8695 "%select{static data member is predetermined as shared|"
8696 "variable with static storage duration is predetermined as shared|"
8697 "loop iteration variable is predetermined as private|"
8698 "loop iteration variable is predetermined as linear|"
8699 "loop iteration variable is predetermined as lastprivate|"
8700 "constant variable is predetermined as shared|"
8701 "global variable is predetermined as shared|"
8702 "non-shared variable in a task construct is predetermined as firstprivate|"
8703 "variable with automatic storage duration is predetermined as private}0"
8704 "%select{|; perhaps you forget to enclose 'omp %2' directive into a parallel or another task region?}1">;
8705 def note_omp_implicit_dsa : Note<
8706 "implicitly determined as %0">;
8707 def err_omp_loop_var_dsa : Error<
8708 "loop iteration variable in the associated loop of 'omp %1' directive may not be %0, predetermined as %2">;
8709 def err_omp_not_for : Error<
8710 "%select{statement after '#pragma omp %1' must be a for loop|"
8711 "expected %2 for loops after '#pragma omp %1'%select{|, but found only %4}3}0">;
8712 def note_omp_collapse_ordered_expr : Note<
8713 "as specified in %select{'collapse'|'ordered'|'collapse' and 'ordered'}0 clause%select{||s}0">;
8714 def err_omp_negative_expression_in_clause : Error<
8715 "argument to '%0' clause must be a %select{non-negative|strictly positive}1 integer value">;
8716 def err_omp_not_integral : Error<
8717 "expression must have integral or unscoped enumeration "
8719 def err_omp_threadprivate_in_target : Error<
8720 "threadprivate variables cannot be used in target constructs">;
8721 def err_omp_incomplete_type : Error<
8722 "expression has incomplete class type %0">;
8723 def err_omp_explicit_conversion : Error<
8724 "expression requires explicit conversion from %0 to %1">;
8725 def note_omp_conversion_here : Note<
8726 "conversion to %select{integral|enumeration}0 type %1 declared here">;
8727 def err_omp_ambiguous_conversion : Error<
8728 "ambiguous conversion from type %0 to an integral or unscoped "
8729 "enumeration type">;
8730 def err_omp_required_access : Error<
8731 "%0 variable must be %1">;
8732 def err_omp_const_variable : Error<
8733 "const-qualified variable cannot be %0">;
8734 def err_omp_const_reduction_list_item : Error<
8735 "const-qualified list item cannot be reduction">;
8736 def err_omp_linear_incomplete_type : Error<
8737 "a linear variable with incomplete type %0">;
8738 def err_omp_linear_expected_int_or_ptr : Error<
8739 "argument of a linear clause should be of integral or pointer "
8741 def warn_omp_linear_step_zero : Warning<
8742 "zero linear step (%0 %select{|and other variables in clause }1should probably be const)">,
8743 InGroup<OpenMPClauses>;
8744 def warn_omp_alignment_not_power_of_two : Warning<
8745 "aligned clause will be ignored because the requested alignment is not a power of 2">,
8746 InGroup<OpenMPClauses>;
8747 def err_omp_enclosed_declare_target : Error<
8748 "declare target region may not be enclosed within another declare target region">;
8749 def err_omp_invalid_target_decl : Error<
8750 "%0 used in declare target directive is not a variable or a function name">;
8751 def err_omp_declare_target_multiple : Error<
8752 "%0 appears multiple times in clauses on the same declare target directive">;
8753 def err_omp_declare_target_to_and_link : Error<
8754 "%0 must not appear in both clauses 'to' and 'link'">;
8755 def warn_omp_not_in_target_context : Warning<
8756 "declaration is not declared in any declare target region">,
8757 InGroup<OpenMPTarget>;
8758 def err_omp_function_in_link_clause : Error<
8759 "function name is not allowed in 'link' clause">;
8760 def err_omp_aligned_expected_array_or_ptr : Error<
8761 "argument of aligned clause should be array"
8762 "%select{ or pointer|, pointer, reference to array or reference to pointer}1"
8764 def err_omp_aligned_twice : Error<
8765 "%select{a variable|a parameter|'this'}0 cannot appear in more than one aligned clause">;
8766 def err_omp_local_var_in_threadprivate_init : Error<
8767 "variable with local storage in initial value of threadprivate variable">;
8768 def err_omp_loop_not_canonical_init : Error<
8769 "initialization clause of OpenMP for loop is not in canonical form "
8770 "('var = init' or 'T var = init')">;
8771 def ext_omp_loop_not_canonical_init : ExtWarn<
8772 "initialization clause of OpenMP for loop is not in canonical form "
8773 "('var = init' or 'T var = init')">, InGroup<OpenMPLoopForm>;
8774 def err_omp_loop_not_canonical_cond : Error<
8775 "condition of OpenMP for loop must be a relational comparison "
8776 "('<', '<=', '>', or '>=') of loop variable %0">;
8777 def err_omp_loop_not_canonical_incr : Error<
8778 "increment clause of OpenMP for loop must perform simple addition "
8779 "or subtraction on loop variable %0">;
8780 def err_omp_loop_variable_type : Error<
8781 "variable must be of integer or %select{pointer|random access iterator}0 type">;
8782 def err_omp_loop_incr_not_compatible : Error<
8783 "increment expression must cause %0 to %select{decrease|increase}1 "
8784 "on each iteration of OpenMP for loop">;
8785 def note_omp_loop_cond_requres_compatible_incr : Note<
8786 "loop step is expected to be %select{negative|positive}0 due to this condition">;
8787 def err_omp_loop_diff_cxx : Error<
8788 "could not calculate number of iterations calling 'operator-' with "
8789 "upper and lower loop bounds">;
8790 def err_omp_loop_cannot_use_stmt : Error<
8791 "'%0' statement cannot be used in OpenMP for loop">;
8792 def err_omp_simd_region_cannot_use_stmt : Error<
8793 "'%0' statement cannot be used in OpenMP simd region">;
8794 def warn_omp_loop_64_bit_var : Warning<
8795 "OpenMP loop iteration variable cannot have more than 64 bits size and will be narrowed">,
8796 InGroup<OpenMPLoopForm>;
8797 def err_omp_unknown_reduction_identifier : Error<
8798 "incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', "
8799 "'&&', '||', 'min' or 'max' or declare reduction for type %0">;
8800 def err_omp_not_resolved_reduction_identifier : Error<
8801 "unable to resolve declare reduction construct for type %0">;
8802 def err_omp_reduction_ref_type_arg : Error<
8803 "argument of OpenMP clause '%0' must reference the same object in all threads">;
8804 def err_omp_clause_not_arithmetic_type_arg : Error<
8805 "arguments of OpenMP clause '%0' for 'min' or 'max' must be of %select{scalar|arithmetic}1 type">;
8806 def err_omp_clause_floating_type_arg : Error<
8807 "arguments of OpenMP clause '%0' with bitwise operators cannot be of floating type">;
8808 def err_omp_once_referenced : Error<
8809 "variable can appear only once in OpenMP '%0' clause">;
8810 def err_omp_once_referenced_in_target_update : Error<
8811 "variable can appear only once in OpenMP 'target update' construct">;
8812 def note_omp_referenced : Note<
8813 "previously referenced here">;
8814 def err_omp_reduction_in_task : Error<
8815 "reduction variables may not be accessed in an explicit task">;
8816 def err_omp_reduction_id_not_compatible : Error<
8817 "list item of type %0 is not valid for specified reduction operation: unable to provide default initialization value">;
8818 def err_omp_in_reduction_not_task_reduction : Error<
8819 "in_reduction variable must appear in a task_reduction clause">;
8820 def err_omp_reduction_identifier_mismatch : Error<
8821 "in_reduction variable must have the same reduction operation as in a task_reduction clause">;
8822 def note_omp_previous_reduction_identifier : Note<
8823 "previously marked as task_reduction with different reduction operation">;
8824 def err_omp_prohibited_region : Error<
8825 "region cannot be%select{| closely}0 nested inside '%1' region"
8826 "%select{|; perhaps you forget to enclose 'omp %3' directive into a parallel region?|"
8827 "; perhaps you forget to enclose 'omp %3' directive into a for or a parallel for region with 'ordered' clause?|"
8828 "; perhaps you forget to enclose 'omp %3' directive into a target region?|"
8829 "; perhaps you forget to enclose 'omp %3' directive into a teams region?}2">;
8830 def err_omp_prohibited_region_simd : Error<
8831 "OpenMP constructs may not be nested inside a simd region">;
8832 def err_omp_prohibited_region_atomic : Error<
8833 "OpenMP constructs may not be nested inside an atomic region">;
8834 def err_omp_prohibited_region_critical_same_name : Error<
8835 "cannot nest 'critical' regions having the same name %0">;
8836 def note_omp_previous_critical_region : Note<
8837 "previous 'critical' region starts here">;
8838 def err_omp_sections_not_compound_stmt : Error<
8839 "the statement for '#pragma omp sections' must be a compound statement">;
8840 def err_omp_parallel_sections_not_compound_stmt : Error<
8841 "the statement for '#pragma omp parallel sections' must be a compound statement">;
8842 def err_omp_orphaned_section_directive : Error<
8843 "%select{orphaned 'omp section' directives are prohibited, it|'omp section' directive}0"
8844 " must be closely nested to a sections region%select{|, not a %1 region}0">;
8845 def err_omp_sections_substmt_not_section : Error<
8846 "statement in 'omp sections' directive must be enclosed into a section region">;
8847 def err_omp_parallel_sections_substmt_not_section : Error<
8848 "statement in 'omp parallel sections' directive must be enclosed into a section region">;
8849 def err_omp_parallel_reduction_in_task_firstprivate : Error<
8850 "argument of a reduction clause of a %0 construct must not appear in a firstprivate clause on a task construct">;
8851 def err_omp_atomic_read_not_expression_statement : Error<
8852 "the statement for 'atomic read' must be an expression statement of form 'v = x;',"
8853 " where v and x are both lvalue expressions with scalar type">;
8854 def note_omp_atomic_read_write: Note<
8855 "%select{expected an expression statement|expected built-in assignment operator|expected expression of scalar type|expected lvalue expression}0">;
8856 def err_omp_atomic_write_not_expression_statement : Error<
8857 "the statement for 'atomic write' must be an expression statement of form 'x = expr;',"
8858 " where x is a lvalue expression with scalar type">;
8859 def err_omp_atomic_update_not_expression_statement : Error<
8860 "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',"
8861 " where x is an l-value expression with scalar type">;
8862 def err_omp_atomic_not_expression_statement : Error<
8863 "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',"
8864 " where x is an l-value expression with scalar type">;
8865 def note_omp_atomic_update: Note<
8866 "%select{expected an expression statement|expected built-in binary or unary operator|expected unary decrement/increment operation|"
8867 "expected expression of scalar type|expected assignment expression|expected built-in binary operator|"
8868 "expected one of '+', '*', '-', '/', '&', '^', '%|', '<<', or '>>' built-in operations|expected in right hand side of expression}0">;
8869 def err_omp_atomic_capture_not_expression_statement : Error<
8870 "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',"
8871 " where x and v are both l-value expressions with scalar type">;
8872 def err_omp_atomic_capture_not_compound_statement : Error<
8873 "the statement for 'atomic capture' must be a compound statement of form '{v = x; x binop= expr;}', '{x binop= expr; v = x;}',"
8874 " '{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;}',"
8875 " '{v = x; x++;}', '{v = x; ++x;}', '{++x; v = x;}', '{x++; v = x;}', '{v = x; x--;}', '{v = x; --x;}', '{--x; v = x;}', '{x--; v = x;}'"
8876 " where x is an l-value expression with scalar type">;
8877 def note_omp_atomic_capture: Note<
8878 "%select{expected assignment expression|expected compound statement|expected exactly two expression statements|expected in right hand side of the first expression}0">;
8879 def err_omp_atomic_several_clauses : Error<
8880 "directive '#pragma omp atomic' cannot contain more than one 'read', 'write', 'update' or 'capture' clause">;
8881 def note_omp_atomic_previous_clause : Note<
8882 "'%0' clause used here">;
8883 def err_omp_target_contains_not_only_teams : Error<
8884 "target construct with nested teams region contains statements outside of the teams construct">;
8885 def note_omp_nested_teams_construct_here : Note<
8886 "nested teams construct here">;
8887 def note_omp_nested_statement_here : Note<
8888 "%select{statement|directive}0 outside teams construct here">;
8889 def err_omp_single_copyprivate_with_nowait : Error<
8890 "the 'copyprivate' clause must not be used with the 'nowait' clause">;
8891 def note_omp_nowait_clause_here : Note<
8892 "'nowait' clause is here">;
8893 def err_omp_single_decl_in_declare_simd : Error<
8894 "single declaration is expected after 'declare simd' directive">;
8895 def err_omp_function_expected : Error<
8896 "'#pragma omp declare simd' can only be applied to functions">;
8897 def err_omp_wrong_cancel_region : Error<
8898 "one of 'for', 'parallel', 'sections' or 'taskgroup' is expected">;
8899 def err_omp_parent_cancel_region_nowait : Error<
8900 "parent region for 'omp %select{cancellation point|cancel}0' construct cannot be nowait">;
8901 def err_omp_parent_cancel_region_ordered : Error<
8902 "parent region for 'omp %select{cancellation point|cancel}0' construct cannot be ordered">;
8903 def err_omp_reduction_wrong_type : Error<"reduction type cannot be %select{qualified with 'const', 'volatile' or 'restrict'|a function|a reference|an array}0 type">;
8904 def err_omp_wrong_var_in_declare_reduction : Error<"only %select{'omp_priv' or 'omp_orig'|'omp_in' or 'omp_out'}0 variables are allowed in %select{initializer|combiner}0 expression">;
8905 def err_omp_declare_reduction_redefinition : Error<"redefinition of user-defined reduction for type %0">;
8906 def err_omp_array_section_use : Error<"OpenMP array section is not allowed here">;
8907 def err_omp_typecheck_section_value : Error<
8908 "subscripted value is not an array or pointer">;
8909 def err_omp_typecheck_section_not_integer : Error<
8910 "array section %select{lower bound|length}0 is not an integer">;
8911 def err_omp_section_function_type : Error<
8912 "section of pointer to function type %0">;
8913 def warn_omp_section_is_char : Warning<"array section %select{lower bound|length}0 is of type 'char'">,
8914 InGroup<CharSubscript>, DefaultIgnore;
8915 def err_omp_section_incomplete_type : Error<
8916 "section of pointer to incomplete type %0">;
8917 def err_omp_section_not_subset_of_array : Error<
8918 "array section must be a subset of the original array">;
8919 def err_omp_section_length_negative : Error<
8920 "section length is evaluated to a negative value %0">;
8921 def err_omp_section_length_undefined : Error<
8922 "section length is unspecified and cannot be inferred because subscripted value is %select{not an array|an array of unknown bound}0">;
8923 def err_omp_wrong_linear_modifier : Error<
8924 "expected %select{'val' modifier|one of 'ref', val' or 'uval' modifiers}0">;
8925 def err_omp_wrong_linear_modifier_non_reference : Error<
8926 "variable of non-reference type %0 can be used only with 'val' modifier, but used with '%1'">;
8927 def err_omp_wrong_simdlen_safelen_values : Error<
8928 "the value of 'simdlen' parameter must be less than or equal to the value of the 'safelen' parameter">;
8929 def err_omp_wrong_if_directive_name_modifier : Error<
8930 "directive name modifier '%0' is not allowed for '#pragma omp %1'">;
8931 def err_omp_no_more_if_clause : Error<
8932 "no more 'if' clause is allowed">;
8933 def err_omp_unnamed_if_clause : Error<
8934 "expected %select{|one of}0 %1 directive name modifier%select{|s}0">;
8935 def note_omp_previous_named_if_clause : Note<
8936 "previous clause with directive name modifier specified here">;
8937 def err_omp_ordered_directive_with_param : Error<
8938 "'ordered' directive %select{without any clauses|with 'threads' clause}0 cannot be closely nested inside ordered region with specified parameter">;
8939 def err_omp_ordered_directive_without_param : Error<
8940 "'ordered' directive with 'depend' clause cannot be closely nested inside ordered region without specified parameter">;
8941 def note_omp_ordered_param : Note<
8942 "'ordered' clause with specified parameter">;
8943 def err_omp_expected_base_var_name : Error<
8944 "expected variable name as a base of the array %select{subscript|section}0">;
8945 def err_omp_map_shared_storage : Error<
8946 "variable already marked as mapped in current construct">;
8947 def err_omp_invalid_map_type_for_directive : Error<
8948 "%select{map type '%1' is not allowed|map type must be specified}0 for '#pragma omp %2'">;
8949 def err_omp_no_clause_for_directive : Error<
8950 "expected at least one %0 clause for '#pragma omp %1'">;
8951 def err_omp_threadprivate_in_clause : Error<
8952 "threadprivate variables are not allowed in '%0' clause">;
8953 def err_omp_wrong_ordered_loop_count : Error<
8954 "the parameter of the 'ordered' clause must be greater than or equal to the parameter of the 'collapse' clause">;
8955 def note_collapse_loop_count : Note<
8956 "parameter of the 'collapse' clause">;
8957 def err_omp_grainsize_num_tasks_mutually_exclusive : Error<
8958 "'%0' and '%1' clause are mutually exclusive and may not appear on the same directive">;
8959 def note_omp_previous_grainsize_num_tasks : Note<
8960 "'%0' clause is specified here">;
8961 def err_omp_hint_clause_no_name : Error<
8962 "the name of the construct must be specified in presence of 'hint' clause">;
8963 def err_omp_critical_with_hint : Error<
8964 "constructs with the same name must have a 'hint' clause with the same value">;
8965 def note_omp_critical_hint_here : Note<
8966 "%select{|previous }0'hint' clause with value '%1'">;
8967 def note_omp_critical_no_hint : Note<
8968 "%select{|previous }0directive with no 'hint' clause specified">;
8969 def err_omp_depend_clause_thread_simd : Error<
8970 "'depend' clauses cannot be mixed with '%0' clause">;
8971 def err_omp_depend_sink_expected_loop_iteration : Error<
8972 "expected%select{| %1}0 loop iteration variable">;
8973 def err_omp_depend_sink_unexpected_expr : Error<
8974 "unexpected expression: number of expressions is larger than the number of associated loops">;
8975 def err_omp_depend_sink_expected_plus_minus : Error<
8976 "expected '+' or '-' operation">;
8977 def err_omp_depend_sink_source_not_allowed : Error<
8978 "'depend(%select{source|sink:vec}0)' clause%select{|s}0 cannot be mixed with 'depend(%select{sink:vec|source}0)' clause%select{s|}0">;
8979 def err_omp_linear_ordered : Error<
8980 "'linear' clause cannot be specified along with 'ordered' clause with a parameter">;
8981 def err_omp_unexpected_schedule_modifier : Error<
8982 "modifier '%0' cannot be used along with modifier '%1'">;
8983 def err_omp_schedule_nonmonotonic_static : Error<
8984 "'nonmonotonic' modifier can only be specified with 'dynamic' or 'guided' schedule kind">;
8985 def err_omp_schedule_nonmonotonic_ordered : Error<
8986 "'schedule' clause with 'nonmonotonic' modifier cannot be specified if an 'ordered' clause is specified">;
8987 def err_omp_ordered_simd : Error<
8988 "'ordered' clause with a parameter can not be specified in '#pragma omp %0' directive">;
8989 def err_omp_variable_in_given_clause_and_dsa : Error<
8990 "%0 variable cannot be in a %1 clause in '#pragma omp %2' directive">;
8991 def err_omp_param_or_this_in_clause : Error<
8992 "expected reference to one of the parameters of function %0%select{| or 'this'}1">;
8993 def err_omp_expected_uniform_param : Error<
8994 "expected a reference to a parameter specified in a 'uniform' clause">;
8995 def err_omp_expected_int_param : Error<
8996 "expected a reference to an integer-typed parameter">;
8997 def err_omp_at_least_one_motion_clause_required : Error<
8998 "expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'">;
8999 def err_omp_usedeviceptr_not_a_pointer : Error<
9000 "expected pointer or reference to pointer in 'use_device_ptr' clause">;
9001 def err_omp_argument_type_isdeviceptr : Error <
9002 "expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'">;
9003 def warn_omp_nesting_simd : Warning<
9004 "OpenMP only allows an ordered construct with the simd clause nested in a simd construct">,
9005 InGroup<SourceUsesOpenMP>;
9006 def err_omp_orphaned_device_directive : Error<
9007 "orphaned 'omp %0' directives are prohibited"
9008 "; perhaps you forget to enclose the directive into a %select{|||target |teams }1region?">;
9009 def err_omp_reduction_non_addressable_expression : Error<
9010 "expected addressable reduction item for the task-based directives">;
9011 def err_omp_reduction_with_nogroup : Error<
9012 "'reduction' clause cannot be used with 'nogroup' clause">;
9013 def err_omp_reduction_vla_unsupported : Error<
9014 "cannot generate code for reduction on %select{|array section, which requires a }0variable length array">;
9015 def err_omp_linear_distribute_var_non_loop_iteration : Error<
9016 "only loop iteration variables are allowed in 'linear' clause in distribute directives">;
9017 def warn_omp_non_trivial_type_mapped : Warning<
9018 "Non-trivial type %0 is mapped, only trivial types are guaranteed to be mapped correctly">,
9019 InGroup<OpenMPTarget>;
9020 } // end of OpenMP category
9022 let CategoryName = "Related Result Type Issue" in {
9023 // Objective-C related result type compatibility
9024 def warn_related_result_type_compatibility_class : Warning<
9025 "method is expected to return an instance of its class type "
9026 "%diff{$, but is declared to return $|"
9027 ", but is declared to return different type}0,1">;
9028 def warn_related_result_type_compatibility_protocol : Warning<
9029 "protocol method is expected to return an instance of the implementing "
9030 "class, but is declared to return %0">;
9031 def note_related_result_type_family : Note<
9032 "%select{overridden|current}0 method is part of the '%select{|alloc|copy|init|"
9033 "mutableCopy|new|autorelease|dealloc|finalize|release|retain|retainCount|"
9034 "self}1' method family%select{| and is expected to return an instance of its "
9036 def note_related_result_type_overridden : Note<
9037 "overridden method returns an instance of its class type">;
9038 def note_related_result_type_inferred : Note<
9039 "%select{class|instance}0 method %1 is assumed to return an instance of "
9040 "its receiver type (%2)">;
9041 def note_related_result_type_explicit : Note<
9042 "%select{overridden|current}0 method is explicitly declared 'instancetype'"
9043 "%select{| and is expected to return an instance of its class type}0">;
9044 def err_invalid_type_for_program_scope_var : Error<
9045 "the %0 type cannot be used to declare a program scope variable">;
9049 let CategoryName = "Modules Issue" in {
9050 def err_module_decl_in_module_map_module : Error<
9051 "'module' declaration found while building module from module map">;
9052 def err_module_interface_implementation_mismatch : Error<
9053 "missing 'export' specifier in module declaration while "
9054 "building module interface">;
9055 def err_current_module_name_mismatch : Error<
9056 "module name '%0' specified on command line does not match name of module">;
9057 def err_module_redefinition : Error<
9058 "redefinition of module '%0'">;
9059 def note_prev_module_definition : Note<"previously defined here">;
9060 def note_prev_module_definition_from_ast_file : Note<"module loaded from '%0'">;
9061 def err_module_not_defined : Error<
9062 "definition of module '%0' is not available; use -fmodule-file= to specify "
9063 "path to precompiled module interface">;
9064 def err_module_redeclaration : Error<
9065 "translation unit contains multiple module declarations">;
9066 def note_prev_module_declaration : Note<"previous module declaration is here">;
9067 def err_module_declaration_missing : Error<
9068 "missing 'export module' declaration in module interface unit">;
9069 def err_module_private_specialization : Error<
9070 "%select{template|partial|member}0 specialization cannot be "
9071 "declared __module_private__">;
9072 def err_module_private_local : Error<
9073 "%select{local variable|parameter|typedef}0 %1 cannot be declared "
9074 "__module_private__">;
9075 def err_module_private_local_class : Error<
9076 "local %select{struct|interface|union|class|enum}0 cannot be declared "
9077 "__module_private__">;
9078 def err_module_unimported_use : Error<
9079 "%select{declaration|definition|default argument|"
9080 "explicit specialization|partial specialization}0 of %1 must be imported "
9081 "from module '%2' before it is required">;
9082 def err_module_unimported_use_header : Error<
9083 "missing '#include %3'; "
9084 "%select{declaration|definition|default argument|"
9085 "explicit specialization|partial specialization}0 of %1 must be imported "
9086 "from module '%2' before it is required">;
9087 def err_module_unimported_use_multiple : Error<
9088 "%select{declaration|definition|default argument|"
9089 "explicit specialization|partial specialization}0 of %1 must be imported "
9090 "from one of the following modules before it is required:%2">;
9091 def ext_module_import_in_extern_c : ExtWarn<
9092 "import of C++ module '%0' appears within extern \"C\" language linkage "
9093 "specification">, DefaultError,
9094 InGroup<DiagGroup<"module-import-in-extern-c">>;
9095 def err_module_import_not_at_top_level_fatal : Error<
9096 "import of module '%0' appears within %1">, DefaultFatal;
9097 def ext_module_import_not_at_top_level_noop : ExtWarn<
9098 "redundant #include of module '%0' appears within %1">, DefaultError,
9099 InGroup<DiagGroup<"modules-import-nested-redundant">>;
9100 def note_module_import_not_at_top_level : Note<"%0 begins here">;
9101 def err_module_self_import : Error<
9102 "import of module '%0' appears within same top-level module '%1'">;
9103 def err_module_import_in_implementation : Error<
9104 "@import of module '%0' in implementation of '%1'; use #import">;
9107 def err_export_within_export : Error<
9108 "export declaration appears within another export declaration">;
9109 def err_export_not_in_module_interface : Error<
9110 "export declaration can only be used within a module interface unit after "
9111 "the module declaration">;
9113 def ext_equivalent_internal_linkage_decl_in_modules : ExtWarn<
9114 "ambiguous use of internal linkage declaration %0 defined in multiple modules">,
9115 InGroup<DiagGroup<"modules-ambiguous-internal-linkage">>;
9116 def note_equivalent_internal_linkage_decl : Note<
9117 "declared here%select{ in module '%1'|}0">;
9119 def note_redefinition_modules_same_file : Note<
9120 "'%0' included multiple times, additional include site in header from module '%1'">;
9121 def note_redefinition_include_same_file : Note<
9122 "'%0' included multiple times, additional include site here">;
9125 let CategoryName = "Coroutines Issue" in {
9126 def err_return_in_coroutine : Error<
9127 "return statement not allowed in coroutine; did you mean 'co_return'?">;
9128 def note_declared_coroutine_here : Note<
9129 "function is a coroutine due to use of '%0' here">;
9130 def err_coroutine_objc_method : Error<
9131 "Objective-C methods as coroutines are not yet supported">;
9132 def err_coroutine_unevaluated_context : Error<
9133 "'%0' cannot be used in an unevaluated context">;
9134 def err_coroutine_outside_function : Error<
9135 "'%0' cannot be used outside a function">;
9136 def err_coroutine_invalid_func_context : Error<
9137 "'%1' cannot be used in %select{a constructor|a destructor"
9138 "|a copy assignment operator|a move assignment operator|the 'main' function"
9139 "|a constexpr function|a function with a deduced return type"
9140 "|a varargs function}0">;
9141 def err_implied_coroutine_type_not_found : Error<
9142 "%0 type was not found; include <experimental/coroutine> before defining "
9144 def err_implicit_coroutine_std_nothrow_type_not_found : Error<
9145 "std::nothrow was not found; include <new> before defining a coroutine which "
9146 "uses get_return_object_on_allocation_failure()">;
9147 def err_malformed_std_nothrow : Error<
9148 "std::nothrow must be a valid variable declaration">;
9149 def err_malformed_std_coroutine_handle : Error<
9150 "std::experimental::coroutine_handle must be a class template">;
9151 def err_coroutine_handle_missing_member : Error<
9152 "std::experimental::coroutine_handle missing a member named '%0'">;
9153 def err_malformed_std_coroutine_traits : Error<
9154 "'std::experimental::coroutine_traits' must be a class template">;
9155 def err_implied_std_coroutine_traits_promise_type_not_found : Error<
9156 "this function cannot be a coroutine: %q0 has no member named 'promise_type'">;
9157 def err_implied_std_coroutine_traits_promise_type_not_class : Error<
9158 "this function cannot be a coroutine: %0 is not a class">;
9159 def err_coroutine_promise_type_incomplete : Error<
9160 "this function cannot be a coroutine: %0 is an incomplete type">;
9161 def err_coroutine_type_missing_specialization : Error<
9162 "this function cannot be a coroutine: missing definition of "
9163 "specialization %0">;
9164 def err_coroutine_promise_incompatible_return_functions : Error<
9165 "the coroutine promise type %0 declares both 'return_value' and 'return_void'">;
9166 def err_coroutine_promise_requires_return_function : Error<
9167 "the coroutine promise type %0 must declare either 'return_value' or 'return_void'">;
9168 def note_coroutine_promise_implicit_await_transform_required_here : Note<
9169 "call to 'await_transform' implicitly required by 'co_await' here">;
9170 def note_coroutine_promise_suspend_implicitly_required : Note<
9171 "call to '%select{initial_suspend|final_suspend}0' implicitly "
9172 "required by the %select{initial suspend point|final suspend point}0">;
9173 def err_coroutine_promise_unhandled_exception_required : Error<
9174 "%0 is required to declare the member 'unhandled_exception()'">;
9175 def warn_coroutine_promise_unhandled_exception_required_with_exceptions : Warning<
9176 "%0 is required to declare the member 'unhandled_exception()' when exceptions are enabled">,
9177 InGroup<CoroutineMissingUnhandledException>;
9178 def err_coroutine_promise_get_return_object_on_allocation_failure : Error<
9179 "%0: 'get_return_object_on_allocation_failure()' must be a static member function">;
9180 def err_seh_in_a_coroutine_with_cxx_exceptions : Error<
9181 "cannot use SEH '__try' in a coroutine when C++ exceptions are enabled">;
9182 def err_coroutine_promise_new_requires_nothrow : Error<
9183 "%0 is required to have a non-throwing noexcept specification when the promise "
9184 "type declares 'get_return_object_on_allocation_failure()'">;
9185 def note_coroutine_promise_call_implicitly_required : Note<
9186 "call to %0 implicitly required by coroutine function here">;
9187 def err_await_suspend_invalid_return_type : Error<
9188 "return type of 'await_suspend' is required to be 'void' or 'bool' (have %0)"
9190 def note_await_ready_no_bool_conversion : Note<
9191 "return type of 'await_ready' is required to be contextually convertible to 'bool'"
9195 let CategoryName = "Documentation Issue" in {
9196 def warn_not_a_doxygen_trailing_member_comment : Warning<
9197 "not a Doxygen trailing comment">, InGroup<Documentation>, DefaultIgnore;
9198 } // end of documentation issue category
9200 let CategoryName = "Instrumentation Issue" in {
9201 def warn_profile_data_out_of_date : Warning<
9202 "profile data may be out of date: of %0 function%s0, %1 %plural{1:has|:have}1"
9203 " mismatched data that will be ignored">,
9204 InGroup<ProfileInstrOutOfDate>;
9205 def warn_profile_data_missing : Warning<
9206 "profile data may be incomplete: of %0 function%s0, %1 %plural{1:has|:have}1"
9208 InGroup<ProfileInstrMissing>,
9210 def warn_profile_data_unprofiled : Warning<
9211 "no profile data available for file \"%0\"">,
9212 InGroup<ProfileInstrUnprofiled>;
9214 } // end of instrumentation issue category
9216 let CategoryName = "Nullability Issue" in {
9218 def warn_mismatched_nullability_attr : Warning<
9219 "nullability specifier %0 conflicts with existing specifier %1">,
9220 InGroup<Nullability>;
9222 def warn_nullability_declspec : Warning<
9223 "nullability specifier %0 cannot be applied "
9224 "to non-pointer type %1; did you mean to apply the specifier to the "
9225 "%select{pointer|block pointer|member pointer|function pointer|"
9226 "member function pointer}2?">,
9227 InGroup<NullabilityDeclSpec>,
9230 def note_nullability_here : Note<"%0 specified here">;
9232 def err_nullability_nonpointer : Error<
9233 "nullability specifier %0 cannot be applied to non-pointer type %1">;
9235 def warn_nullability_lost : Warning<
9236 "implicit conversion from nullable pointer %0 to non-nullable pointer "
9238 InGroup<NullableToNonNullConversion>, DefaultIgnore;
9239 def warn_zero_as_null_pointer_constant : Warning<
9240 "zero as null pointer constant">,
9241 InGroup<DiagGroup<"zero-as-null-pointer-constant">>, DefaultIgnore;
9243 def err_nullability_cs_multilevel : Error<
9244 "nullability keyword %0 cannot be applied to multi-level pointer type %1">;
9245 def note_nullability_type_specifier : Note<
9246 "use nullability type specifier %0 to affect the innermost "
9247 "pointer type of %1">;
9249 def warn_null_resettable_setter : Warning<
9250 "synthesized setter %0 for null_resettable property %1 does not handle nil">,
9251 InGroup<Nullability>;
9253 def warn_nullability_missing : Warning<
9254 "%select{pointer|block pointer|member pointer}0 is missing a nullability "
9255 "type specifier (_Nonnull, _Nullable, or _Null_unspecified)">,
9256 InGroup<NullabilityCompleteness>;
9257 def warn_nullability_missing_array : Warning<
9258 "array parameter is missing a nullability type specifier (_Nonnull, "
9259 "_Nullable, or _Null_unspecified)">,
9260 InGroup<NullabilityCompletenessOnArrays>;
9261 def note_nullability_fix_it : Note<
9262 "insert '%select{_Nonnull|_Nullable|_Null_unspecified}0' if the "
9263 "%select{pointer|block pointer|member pointer|array parameter}1 "
9264 "%select{should never be null|may be null|should not declare nullability}0">;
9266 def warn_nullability_inferred_on_nested_type : Warning<
9267 "inferring '_Nonnull' for pointer type within %select{array|reference}0 is "
9269 InGroup<NullabilityInferredOnNestedType>;
9271 def err_objc_type_arg_explicit_nullability : Error<
9272 "type argument %0 cannot explicitly specify nullability">;
9274 def err_objc_type_param_bound_explicit_nullability : Error<
9275 "type parameter %0 bound %1 cannot explicitly specify nullability">;
9279 let CategoryName = "Generics Issue" in {
9281 def err_objc_type_param_bound_nonobject : Error<
9282 "type bound %0 for type parameter %1 is not an Objective-C pointer type">;
9284 def err_objc_type_param_bound_missing_pointer : Error<
9285 "missing '*' in type bound %0 for type parameter %1">;
9286 def err_objc_type_param_bound_qualified : Error<
9287 "type bound %1 for type parameter %0 cannot be qualified with '%2'">;
9289 def err_objc_type_param_redecl : Error<
9290 "redeclaration of type parameter %0">;
9292 def err_objc_type_param_arity_mismatch : Error<
9293 "%select{forward class declaration|class definition|category|extension}0 has "
9294 "too %select{few|many}1 type parameters (expected %2, have %3)">;
9296 def err_objc_type_param_bound_conflict : Error<
9297 "type bound %0 for type parameter %1 conflicts with "
9298 "%select{implicit|previous}2 bound %3%select{for type parameter %5|}4">;
9300 def err_objc_type_param_variance_conflict : Error<
9301 "%select{in|co|contra}0variant type parameter %1 conflicts with previous "
9302 "%select{in|co|contra}2variant type parameter %3">;
9304 def note_objc_type_param_here : Note<"type parameter %0 declared here">;
9306 def err_objc_type_param_bound_missing : Error<
9307 "missing type bound %0 for type parameter %1 in %select{@interface|@class}2">;
9309 def err_objc_parameterized_category_nonclass : Error<
9310 "%select{extension|category}0 of non-parameterized class %1 cannot have type "
9313 def err_objc_parameterized_forward_class : Error<
9314 "forward declaration of non-parameterized class %0 cannot have type "
9317 def err_objc_parameterized_forward_class_first : Error<
9318 "class %0 previously declared with type parameters">;
9320 def err_objc_type_arg_missing_star : Error<
9321 "type argument %0 must be a pointer (requires a '*')">;
9322 def err_objc_type_arg_qualified : Error<
9323 "type argument %0 cannot be qualified with '%1'">;
9325 def err_objc_type_arg_missing : Error<
9326 "no type or protocol named %0">;
9328 def err_objc_type_args_and_protocols : Error<
9329 "angle brackets contain both a %select{type|protocol}0 (%1) and a "
9330 "%select{protocol|type}0 (%2)">;
9332 def err_objc_type_args_non_class : Error<
9333 "type arguments cannot be applied to non-class type %0">;
9335 def err_objc_type_args_non_parameterized_class : Error<
9336 "type arguments cannot be applied to non-parameterized class %0">;
9338 def err_objc_type_args_specialized_class : Error<
9339 "type arguments cannot be applied to already-specialized class type %0">;
9341 def err_objc_type_args_wrong_arity : Error<
9342 "too %select{many|few}0 type arguments for class %1 (have %2, expected %3)">;
9345 def err_objc_type_arg_not_id_compatible : Error<
9346 "type argument %0 is neither an Objective-C object nor a block type">;
9348 def err_objc_type_arg_does_not_match_bound : Error<
9349 "type argument %0 does not satisfy the bound (%1) of type parameter %2">;
9351 def warn_objc_redundant_qualified_class_type : Warning<
9352 "parameterized class %0 already conforms to the protocols listed; did you "
9353 "forget a '*'?">, InGroup<ObjCProtocolQualifiers>;
9355 def warn_block_literal_attributes_on_omitted_return_type : Warning<
9356 "attribute %0 ignored, because it cannot be applied to omitted return type">,
9357 InGroup<IgnoredAttributes>;
9359 def warn_block_literal_qualifiers_on_omitted_return_type : Warning<
9360 "'%0' qualifier on omitted return type %1 has no effect">,
9361 InGroup<IgnoredQualifiers>;
9363 def ext_warn_gnu_final : ExtWarn<
9364 "__final is a GNU extension, consider using C++11 final">,
9367 def warn_shadow_field :
9368 Warning<"non-static data member %0 of %1 shadows member inherited from "
9370 InGroup<ShadowField>, DefaultIgnore;
9371 def note_shadow_field : Note<"declared here">;
9373 def err_multiversion_required_in_redecl : Error<
9374 "function declaration is missing %select{'target'|'cpu_specific' or "
9375 "'cpu_dispatch'}0 attribute in a multiversioned function">;
9376 def note_multiversioning_caused_here : Note<
9377 "function multiversioning caused by this declaration">;
9378 def err_multiversion_after_used : Error<
9379 "function declaration cannot become a multiversioned function after first "
9381 def err_bad_multiversion_option : Error<
9382 "function multiversioning doesn't support %select{feature|architecture}0 "
9384 def err_multiversion_duplicate : Error<
9385 "multiversioned function redeclarations require identical target attributes">;
9386 def err_multiversion_noproto : Error<
9387 "multiversioned function must have a prototype">;
9388 def err_multiversion_no_other_attrs : Error<
9389 "attribute '%select{target|cpu_specific|cpu_dispatch}0' multiversioning cannot be combined"
9390 " with other attributes">;
9391 def err_multiversion_diff : Error<
9392 "multiversioned function declaration has a different %select{calling convention"
9393 "|return type|constexpr specification|inline specification|storage class|"
9395 def err_multiversion_doesnt_support : Error<
9396 "attribute '%select{target|cpu_specific|cpu_dispatch}0' multiversioned functions do not "
9397 "yet support %select{function templates|virtual functions|"
9398 "deduced return types|constructors|destructors|deleted functions|"
9399 "defaulted functions|constexpr functions}1">;
9400 def err_multiversion_not_allowed_on_main : Error<
9401 "'main' cannot be a multiversioned function">;
9402 def err_multiversion_not_supported : Error<
9403 "function multiversioning is not supported on the current target">;
9404 def err_multiversion_types_mixed : Error<
9405 "multiversioning attributes cannot be combined">;
9406 def err_cpu_dispatch_mismatch : Error<
9407 "'cpu_dispatch' function redeclared with different CPUs">;
9408 def err_cpu_specific_multiple_defs : Error<
9409 "multiple 'cpu_specific' functions cannot specify the same CPU: %0">;
9410 def warn_multiversion_duplicate_entries : Warning<
9411 "CPU list contains duplicate entries; attribute ignored">,
9412 InGroup<FunctionMultiVersioning>;
9413 def warn_dispatch_body_ignored : Warning<
9414 "body of cpu_dispatch function will be ignored">,
9415 InGroup<FunctionMultiVersioning>;
9417 // three-way comparison operator diagnostics
9418 def err_implied_comparison_category_type_not_found : Error<
9419 "cannot deduce return type of 'operator<=>' because type '%0' was not found; "
9420 "include <compare>">;
9421 def err_spaceship_argument_narrowing : Error<
9422 "argument to 'operator<=>' "
9423 "%select{cannot be narrowed from type %1 to %2|"
9424 "evaluates to %1, which cannot be narrowed to type %2}0">;
9425 def err_std_compare_type_not_supported : Error<
9426 "standard library implementation of %0 is not supported; "
9427 "%select{member '%2' does not have expected form|"
9428 "member '%2' is missing|"
9429 "the type is not trivially copyable|"
9430 "the type does not have the expected form}1">;
9431 } // end of sema component.