1//==--- DiagnosticSemaKinds.td - libsema diagnostics ----------------------===// 2// 3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4// See https://llvm.org/LICENSE.txt for license information. 5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6// 7//===----------------------------------------------------------------------===// 8 9//===----------------------------------------------------------------------===// 10// Semantic Analysis 11//===----------------------------------------------------------------------===// 12 13let Component = "Sema" in { 14let CategoryName = "Semantic Issue" in { 15def note_previous_decl : Note<"%0 declared here">; 16def note_entity_declared_at : Note<"%0 declared here">; 17def note_callee_decl : Note<"%0 declared here">; 18def note_defined_here : Note<"%0 defined here">; 19 20// For loop analysis 21def warn_variables_not_in_loop_body : Warning< 22 "variable%select{s| %1|s %1 and %2|s %1, %2, and %3|s %1, %2, %3, and %4}0 " 23 "used in loop condition not modified in loop body">, 24 InGroup<ForLoopAnalysis>, DefaultIgnore; 25def warn_redundant_loop_iteration : Warning< 26 "variable %0 is %select{decremented|incremented}1 both in the loop header " 27 "and in the loop body">, 28 InGroup<ForLoopAnalysis>, DefaultIgnore; 29def note_loop_iteration_here : Note<"%select{decremented|incremented}0 here">; 30 31def warn_duplicate_enum_values : Warning< 32 "element %0 has been implicitly assigned %1 which another element has " 33 "been assigned">, InGroup<DiagGroup<"duplicate-enum">>, DefaultIgnore; 34def note_duplicate_element : Note<"element %0 also has value %1">; 35 36// Absolute value functions 37def warn_unsigned_abs : Warning< 38 "taking the absolute value of unsigned type %0 has no effect">, 39 InGroup<AbsoluteValue>; 40def note_remove_abs : Note< 41 "remove the call to '%0' since unsigned values cannot be negative">; 42def warn_abs_too_small : Warning< 43 "absolute value function %0 given an argument of type %1 but has parameter " 44 "of type %2 which may cause truncation of value">, InGroup<AbsoluteValue>; 45def warn_wrong_absolute_value_type : Warning< 46 "using %select{integer|floating point|complex}1 absolute value function %0 " 47 "when argument is of %select{integer|floating point|complex}2 type">, 48 InGroup<AbsoluteValue>; 49def note_replace_abs_function : Note<"use function '%0' instead">; 50def warn_pointer_abs : Warning< 51 "taking the absolute value of %select{pointer|function|array}0 type %1 is suspicious">, 52 InGroup<AbsoluteValue>; 53 54def warn_max_unsigned_zero : Warning< 55 "taking the max of " 56 "%select{a value and unsigned zero|unsigned zero and a value}0 " 57 "is always equal to the other value">, 58 InGroup<MaxUnsignedZero>; 59def note_remove_max_call : Note< 60 "remove call to max function and unsigned zero argument">; 61 62def warn_infinite_recursive_function : Warning< 63 "all paths through this function will call itself">, 64 InGroup<InfiniteRecursion>, DefaultIgnore; 65 66def warn_comma_operator : Warning<"possible misuse of comma operator here">, 67 InGroup<DiagGroup<"comma">>, DefaultIgnore; 68def note_cast_to_void : Note<"cast expression to void to silence warning">; 69def note_cast_operand_to_int : Note<"cast one or both operands to int to silence this warning">; 70 71// Constant expressions 72def err_expr_not_ice : Error< 73 "expression is not an %select{integer|integral}0 constant expression">; 74def ext_expr_not_ice : Extension< 75 "expression is not an %select{integer|integral}0 constant expression; " 76 "folding it to a constant is a GNU extension">, InGroup<GNUFoldingConstant>; 77def err_typecheck_converted_constant_expression : Error< 78 "value of type %0 is not implicitly convertible to %1">; 79def err_typecheck_converted_constant_expression_disallowed : Error< 80 "conversion from %0 to %1 is not allowed in a converted constant expression">; 81def err_typecheck_converted_constant_expression_indirect : Error< 82 "conversion from %0 to %1 in converted constant expression would " 83 "bind reference to a temporary">; 84def err_expr_not_cce : Error< 85 "%select{case value|enumerator value|non-type template argument|" 86 "array size|explicit specifier argument|noexcept specifier argument}0 " 87 "is not a constant expression">; 88def ext_cce_narrowing : ExtWarn< 89 "%select{case value|enumerator value|non-type template argument|" 90 "array size|explicit specifier argument|noexcept specifier argument}0 " 91 "%select{cannot be narrowed from type %2 to %3|" 92 "evaluates to %2, which cannot be narrowed to type %3}1">, 93 InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure; 94def err_ice_not_integral : Error< 95 "%select{integer|integral}1 constant expression must have " 96 "%select{integer|integral or unscoped enumeration}1 type, not %0">; 97def err_ice_incomplete_type : Error< 98 "integral constant expression has incomplete class type %0">; 99def err_ice_explicit_conversion : Error< 100 "integral constant expression requires explicit conversion from %0 to %1">; 101def note_ice_conversion_here : Note< 102 "conversion to %select{integral|enumeration}0 type %1 declared here">; 103def err_ice_ambiguous_conversion : Error< 104 "ambiguous conversion from type %0 to an integral or unscoped " 105 "enumeration type">; 106def err_ice_too_large : Error< 107 "integer constant expression evaluates to value %0 that cannot be " 108 "represented in a %1-bit %select{signed|unsigned}2 integer type">; 109def err_expr_not_string_literal : Error<"expression is not a string literal">; 110 111// Semantic analysis of constant literals. 112def ext_predef_outside_function : Warning< 113 "predefined identifier is only valid inside function">, 114 InGroup<DiagGroup<"predefined-identifier-outside-function">>; 115def warn_float_overflow : Warning< 116 "magnitude of floating-point constant too large for type %0; maximum is %1">, 117 InGroup<LiteralRange>; 118def warn_float_underflow : Warning< 119 "magnitude of floating-point constant too small for type %0; minimum is %1">, 120 InGroup<LiteralRange>; 121def warn_double_const_requires_fp64 : Warning< 122 "double precision constant requires %select{cl_khr_fp64|cl_khr_fp64 and __opencl_c_fp64}0, " 123 "casting to single precision">; 124def err_half_const_requires_fp16 : Error< 125 "half precision constant requires cl_khr_fp16">; 126 127// C99 variable-length arrays 128def ext_vla : Extension<"variable length arrays are a C99 feature">, 129 InGroup<VLAExtension>; 130def warn_vla_used : Warning<"variable length array used">, 131 InGroup<VLA>, DefaultIgnore; 132def err_vla_in_sfinae : Error< 133 "variable length array cannot be formed during template argument deduction">; 134def err_array_star_in_function_definition : Error< 135 "variable length array must be bound in function definition">; 136def err_vla_decl_in_file_scope : Error< 137 "variable length array declaration not allowed at file scope">; 138def err_vla_decl_has_static_storage : Error< 139 "variable length array declaration cannot have 'static' storage duration">; 140def err_vla_decl_has_extern_linkage : Error< 141 "variable length array declaration cannot have 'extern' linkage">; 142def ext_vla_folded_to_constant : ExtWarn< 143 "variable length array folded to constant array as an extension">, 144 InGroup<GNUFoldingConstant>; 145def err_vla_unsupported : Error< 146 "variable length arrays are not supported for the current target">; 147def note_vla_unsupported : Note< 148 "variable length arrays are not supported for the current target">; 149 150// C99 variably modified types 151def err_variably_modified_template_arg : Error< 152 "variably modified type %0 cannot be used as a template argument">; 153def err_variably_modified_nontype_template_param : Error< 154 "non-type template parameter of variably modified type %0">; 155def err_variably_modified_new_type : Error< 156 "'new' cannot allocate object of variably modified type %0">; 157 158// C99 Designated Initializers 159def ext_designated_init : Extension< 160 "designated initializers are a C99 feature">, InGroup<C99Designator>; 161def err_array_designator_negative : Error< 162 "array designator value '%0' is negative">; 163def err_array_designator_empty_range : Error< 164 "array designator range [%0, %1] is empty">; 165def err_array_designator_non_array : Error< 166 "array designator cannot initialize non-array type %0">; 167def err_array_designator_too_large : Error< 168 "array designator index (%0) exceeds array bounds (%1)">; 169def err_field_designator_non_aggr : Error< 170 "field designator cannot initialize a " 171 "%select{non-struct, non-union|non-class}0 type %1">; 172def err_field_designator_unknown : Error< 173 "field designator %0 does not refer to any field in type %1">; 174def err_field_designator_nonfield : Error< 175 "field designator %0 does not refer to a non-static data member">; 176def note_field_designator_found : Note<"field designator refers here">; 177def err_designator_for_scalar_or_sizeless_init : Error< 178 "designator in initializer for %select{scalar|indivisible sizeless}0 " 179 "type %1">; 180def warn_initializer_overrides : Warning< 181 "initializer %select{partially |}0overrides prior initialization of " 182 "this subobject">, InGroup<InitializerOverrides>; 183def ext_initializer_overrides : ExtWarn<warn_initializer_overrides.Text>, 184 InGroup<InitializerOverrides>, SFINAEFailure; 185def err_initializer_overrides_destructed : Error< 186 "initializer would partially override prior initialization of object of " 187 "type %1 with non-trivial destruction">; 188def note_previous_initializer : Note< 189 "previous initialization %select{|with side effects }0is here" 190 "%select{| (side effects will not occur at run time)}0">; 191def err_designator_into_flexible_array_member : Error< 192 "designator into flexible array member subobject">; 193def note_flexible_array_member : Note< 194 "initialized flexible array member %0 is here">; 195def ext_flexible_array_init : Extension< 196 "flexible array initialization is a GNU extension">, InGroup<GNUFlexibleArrayInitializer>; 197 198// C++20 designated initializers 199def ext_cxx_designated_init : Extension< 200 "designated initializers are a C++20 extension">, InGroup<CXX20Designator>; 201def warn_cxx17_compat_designated_init : Warning< 202 "designated initializers are incompatible with C++ standards before C++20">, 203 InGroup<CXXPre20CompatPedantic>, DefaultIgnore; 204def ext_designated_init_mixed : ExtWarn< 205 "mixture of designated and non-designated initializers in the same " 206 "initializer list is a C99 extension">, InGroup<C99Designator>; 207def note_designated_init_mixed : Note< 208 "first non-designated initializer is here">; 209def ext_designated_init_array : ExtWarn< 210 "array designators are a C99 extension">, InGroup<C99Designator>; 211def ext_designated_init_nested : ExtWarn< 212 "nested designators are a C99 extension">, InGroup<C99Designator>; 213def ext_designated_init_reordered : ExtWarn< 214 "ISO C++ requires field designators to be specified in declaration order; " 215 "field %1 will be initialized after field %0">, InGroup<ReorderInitList>, 216 SFINAEFailure; 217def note_previous_field_init : Note< 218 "previous initialization for field %0 is here">; 219def ext_designated_init_brace_elision : ExtWarn< 220 "brace elision for designated initializer is a C99 extension">, 221 InGroup<C99Designator>, SFINAEFailure; 222 223// Declarations. 224def ext_plain_complex : ExtWarn< 225 "plain '_Complex' requires a type specifier; assuming '_Complex double'">; 226def ext_imaginary_constant : Extension< 227 "imaginary constants are a GNU extension">, InGroup<GNUImaginaryConstant>; 228def ext_integer_complex : Extension< 229 "complex integer types are a GNU extension">, InGroup<GNUComplexInteger>; 230 231def err_invalid_saturation_spec : Error<"'_Sat' specifier is only valid on " 232 "'_Fract' or '_Accum', not '%0'">; 233def err_invalid_sign_spec : Error<"'%0' cannot be signed or unsigned">; 234def err_invalid_width_spec : Error< 235 "'%select{|short|long|long long}0 %1' is invalid">; 236def err_invalid_complex_spec : Error<"'_Complex %0' is invalid">; 237 238def ext_auto_type_specifier : ExtWarn< 239 "'auto' type specifier is a C++11 extension">, InGroup<CXX11>; 240def warn_auto_storage_class : Warning< 241 "'auto' storage class specifier is redundant and incompatible with C++11">, 242 InGroup<CXX11Compat>, DefaultIgnore; 243 244def warn_deprecated_register : Warning< 245 "'register' storage class specifier is deprecated " 246 "and incompatible with C++17">, InGroup<DeprecatedRegister>; 247def ext_register_storage_class : ExtWarn< 248 "ISO C++17 does not allow 'register' storage class specifier">, 249 DefaultError, InGroup<Register>; 250 251def err_invalid_decl_spec_combination : Error< 252 "cannot combine with previous '%0' declaration specifier">; 253def err_invalid_vector_decl_spec_combination : Error< 254 "cannot combine with previous '%0' declaration specifier. " 255 "'__vector' must be first">; 256def err_invalid_pixel_decl_spec_combination : Error< 257 "'__pixel' must be preceded by '__vector'. " 258 "'%0' declaration specifier not allowed here">; 259def err_invalid_vector_bool_decl_spec : Error< 260 "cannot use '%0' with '__vector bool'">; 261def err_invalid_vector_long_decl_spec : Error< 262 "cannot use 'long' with '__vector'">; 263def err_invalid_vector_float_decl_spec : Error< 264 "cannot use 'float' with '__vector'">; 265def err_invalid_vector_double_decl_spec : Error < 266 "use of 'double' with '__vector' requires VSX support to be enabled " 267 "(available on POWER7 or later)">; 268def err_invalid_vector_bool_int128_decl_spec : Error < 269 "use of '__int128' with '__vector bool' requires VSX support enabled (on " 270 "POWER10 or later)">; 271def err_invalid_vector_int128_decl_spec : Error< 272 "use of '__int128' with '__vector' requires extended Altivec support" 273 " (available on POWER8 or later)">; 274def err_invalid_vector_long_long_decl_spec : Error < 275 "use of 'long long' with '__vector' requires VSX support (available on " 276 "POWER7 or later) to be enabled">; 277def err_invalid_vector_long_double_decl_spec : Error< 278 "cannot use 'long double' with '__vector'">; 279def warn_vector_long_decl_spec_combination : Warning< 280 "Use of 'long' with '__vector' is deprecated">, InGroup<Deprecated>; 281 282def err_redeclaration_different_type : Error< 283 "redeclaration of %0 with a different type%diff{: $ vs $|}1,2">; 284def err_bad_variable_name : Error< 285 "%0 cannot be the name of a variable or data member">; 286def err_bad_parameter_name : Error< 287 "%0 cannot be the name of a parameter">; 288def err_bad_parameter_name_template_id : Error< 289 "parameter name cannot have template arguments">; 290def ext_parameter_name_omitted_c2x : ExtWarn< 291 "omitting the parameter name in a function definition is a C2x extension">, 292 InGroup<C2x>; 293def err_anyx86_interrupt_attribute : Error< 294 "%select{x86|x86-64}0 'interrupt' attribute only applies to functions that " 295 "have %select{a 'void' return type|" 296 "only a pointer parameter optionally followed by an integer parameter|" 297 "a pointer as the first parameter|a %2 type as the second parameter}1">; 298def err_anyx86_interrupt_called : Error< 299 "interrupt service routine cannot be called directly">; 300def warn_anyx86_interrupt_regsave : Warning< 301 "interrupt service routine should only call a function" 302 " with attribute 'no_caller_saved_registers'">, 303 InGroup<DiagGroup<"interrupt-service-routine">>; 304def warn_arm_interrupt_calling_convention : Warning< 305 "call to function without interrupt attribute could clobber interruptee's VFP registers">, 306 InGroup<Extra>; 307def warn_interrupt_attribute_invalid : Warning< 308 "%select{MIPS|MSP430|RISC-V}0 'interrupt' attribute only applies to " 309 "functions that have %select{no parameters|a 'void' return type}1">, 310 InGroup<IgnoredAttributes>; 311def warn_riscv_repeated_interrupt_attribute : Warning< 312 "repeated RISC-V 'interrupt' attribute">, InGroup<IgnoredAttributes>; 313def note_riscv_repeated_interrupt_attribute : Note< 314 "repeated RISC-V 'interrupt' attribute is here">; 315def warn_unused_parameter : Warning<"unused parameter %0">, 316 InGroup<UnusedParameter>, DefaultIgnore; 317def warn_unused_but_set_parameter : Warning<"parameter %0 set but not used">, 318 InGroup<UnusedButSetParameter>, DefaultIgnore; 319def warn_unused_variable : Warning<"unused variable %0">, 320 InGroup<UnusedVariable>, DefaultIgnore; 321def warn_unused_but_set_variable : Warning<"variable %0 set but not used">, 322 InGroup<UnusedButSetVariable>, DefaultIgnore; 323def warn_unused_local_typedef : Warning< 324 "unused %select{typedef|type alias}0 %1">, 325 InGroup<UnusedLocalTypedef>, DefaultIgnore; 326def warn_unused_property_backing_ivar : 327 Warning<"ivar %0 which backs the property is not " 328 "referenced in this property's accessor">, 329 InGroup<UnusedPropertyIvar>, DefaultIgnore; 330def warn_unused_const_variable : Warning<"unused variable %0">, 331 InGroup<UnusedConstVariable>, DefaultIgnore; 332def warn_unused_exception_param : Warning<"unused exception parameter %0">, 333 InGroup<UnusedExceptionParameter>, DefaultIgnore; 334def warn_decl_in_param_list : Warning< 335 "declaration of %0 will not be visible outside of this function">, 336 InGroup<Visibility>; 337def warn_redefinition_in_param_list : Warning< 338 "redefinition of %0 will not be visible outside of this function">, 339 InGroup<Visibility>; 340def warn_empty_parens_are_function_decl : Warning< 341 "empty parentheses interpreted as a function declaration">, 342 InGroup<VexingParse>; 343def warn_parens_disambiguated_as_function_declaration : Warning< 344 "parentheses were disambiguated as a function declaration">, 345 InGroup<VexingParse>; 346def warn_parens_disambiguated_as_variable_declaration : Warning< 347 "parentheses were disambiguated as redundant parentheses around declaration " 348 "of variable named %0">, InGroup<VexingParse>; 349def warn_redundant_parens_around_declarator : Warning< 350 "redundant parentheses surrounding declarator">, 351 InGroup<DiagGroup<"redundant-parens">>, DefaultIgnore; 352def note_additional_parens_for_variable_declaration : Note< 353 "add a pair of parentheses to declare a variable">; 354def note_raii_guard_add_name : Note< 355 "add a variable name to declare a %0 initialized with %1">; 356def note_function_style_cast_add_parentheses : Note< 357 "add enclosing parentheses to perform a function-style cast">; 358def note_remove_parens_for_variable_declaration : Note< 359 "remove parentheses to silence this warning">; 360def note_empty_parens_function_call : Note< 361 "change this ',' to a ';' to call %0">; 362def note_empty_parens_default_ctor : Note< 363 "remove parentheses to declare a variable">; 364def note_empty_parens_zero_initialize : Note< 365 "replace parentheses with an initializer to declare a variable">; 366def warn_unused_function : Warning<"unused function %0">, 367 InGroup<UnusedFunction>, DefaultIgnore; 368def warn_unused_template : Warning<"unused %select{function|variable}0 template %1">, 369 InGroup<UnusedTemplate>, DefaultIgnore; 370def warn_unused_member_function : Warning<"unused member function %0">, 371 InGroup<UnusedMemberFunction>, DefaultIgnore; 372def warn_used_but_marked_unused: Warning<"%0 was marked unused but was used">, 373 InGroup<UsedButMarkedUnused>, DefaultIgnore; 374def warn_unneeded_internal_decl : Warning< 375 "%select{function|variable}0 %1 is not needed and will not be emitted">, 376 InGroup<UnneededInternalDecl>, DefaultIgnore; 377def warn_unneeded_static_internal_decl : Warning< 378 "'static' function %0 declared in header file " 379 "should be declared 'static inline'">, 380 InGroup<UnneededInternalDecl>, DefaultIgnore; 381def warn_unneeded_member_function : Warning< 382 "member function %0 is not needed and will not be emitted">, 383 InGroup<UnneededMemberFunction>, DefaultIgnore; 384def warn_unused_private_field: Warning<"private field %0 is not used">, 385 InGroup<UnusedPrivateField>, DefaultIgnore; 386def warn_unused_lambda_capture: Warning<"lambda capture %0 is not " 387 "%select{used|required to be captured for this use}1">, 388 InGroup<UnusedLambdaCapture>, DefaultIgnore; 389 390def warn_reserved_extern_symbol: Warning< 391 "identifier %0 is reserved because %select{" 392 "<ERROR>|" // ReservedIdentifierStatus::NotReserved 393 "it starts with '_' at global scope|" 394 "it starts with '_' and has C language linkage|" 395 "it starts with '__'|" 396 "it starts with '_' followed by a capital letter|" 397 "it contains '__'}1">, 398 InGroup<ReservedIdentifier>, DefaultIgnore; 399 400def warn_parameter_size: Warning< 401 "%0 is a large (%1 bytes) pass-by-value argument; " 402 "pass it by reference instead ?">, InGroup<LargeByValueCopy>; 403def warn_return_value_size: Warning< 404 "return value of %0 is a large (%1 bytes) pass-by-value object; " 405 "pass it by reference instead ?">, InGroup<LargeByValueCopy>; 406def warn_return_value_udt: Warning< 407 "%0 has C-linkage specified, but returns user-defined type %1 which is " 408 "incompatible with C">, InGroup<ReturnTypeCLinkage>; 409def warn_return_value_udt_incomplete: Warning< 410 "%0 has C-linkage specified, but returns incomplete type %1 which could be " 411 "incompatible with C">, InGroup<ReturnTypeCLinkage>; 412def warn_implicit_function_decl : Warning< 413 "implicit declaration of function %0">, 414 InGroup<ImplicitFunctionDeclare>, DefaultIgnore; 415def ext_implicit_function_decl : ExtWarn< 416 "implicit declaration of function %0 is invalid in C99">, 417 InGroup<ImplicitFunctionDeclare>; 418def note_function_suggestion : Note<"did you mean %0?">; 419 420def err_ellipsis_first_param : Error< 421 "ISO C requires a named parameter before '...'">; 422def err_declarator_need_ident : Error<"declarator requires an identifier">; 423def err_language_linkage_spec_unknown : Error<"unknown linkage language">; 424def err_language_linkage_spec_not_ascii : Error< 425 "string literal in language linkage specifier cannot have an " 426 "encoding-prefix">; 427def ext_use_out_of_scope_declaration : ExtWarn< 428 "use of out-of-scope declaration of %0%select{| whose type is not " 429 "compatible with that of an implicit declaration}1">, 430 InGroup<DiagGroup<"out-of-scope-function">>; 431def err_inline_non_function : Error< 432 "'inline' can only appear on functions%select{| and non-local variables}0">; 433def err_noreturn_non_function : Error< 434 "'_Noreturn' can only appear on functions">; 435def warn_qual_return_type : Warning< 436 "'%0' type qualifier%s1 on return type %plural{1:has|:have}1 no effect">, 437 InGroup<IgnoredQualifiers>, DefaultIgnore; 438def warn_deprecated_redundant_constexpr_static_def : Warning< 439 "out-of-line definition of constexpr static data member is redundant " 440 "in C++17 and is deprecated">, 441 InGroup<Deprecated>, DefaultIgnore; 442 443def warn_decl_shadow : 444 Warning<"declaration shadows a %select{" 445 "local variable|" 446 "variable in %2|" 447 "static data member of %2|" 448 "field of %2|" 449 "typedef in %2|" 450 "type alias in %2|" 451 "structured binding}1">, 452 InGroup<Shadow>, DefaultIgnore; 453def warn_decl_shadow_uncaptured_local : 454 Warning<warn_decl_shadow.Text>, 455 InGroup<ShadowUncapturedLocal>, DefaultIgnore; 456def warn_ctor_parm_shadows_field: 457 Warning<"constructor parameter %0 shadows the field %1 of %2">, 458 InGroup<ShadowFieldInConstructor>, DefaultIgnore; 459def warn_modifying_shadowing_decl : 460 Warning<"modifying constructor parameter %0 that shadows a " 461 "field of %1">, 462 InGroup<ShadowFieldInConstructorModified>, DefaultIgnore; 463 464// C++ decomposition declarations 465def err_decomp_decl_context : Error< 466 "decomposition declaration not permitted in this context">; 467def warn_cxx14_compat_decomp_decl : Warning< 468 "decomposition declarations are incompatible with " 469 "C++ standards before C++17">, DefaultIgnore, InGroup<CXXPre17Compat>; 470def ext_decomp_decl : ExtWarn< 471 "decomposition declarations are a C++17 extension">, InGroup<CXX17>; 472def ext_decomp_decl_cond : ExtWarn< 473 "ISO C++17 does not permit structured binding declaration in a condition">, 474 InGroup<DiagGroup<"binding-in-condition">>; 475def err_decomp_decl_spec : Error< 476 "decomposition declaration cannot be declared " 477 "%plural{1:'%1'|:with '%1' specifiers}0">; 478def ext_decomp_decl_spec : ExtWarn< 479 "decomposition declaration declared " 480 "%plural{1:'%1'|:with '%1' specifiers}0 is a C++20 extension">, 481 InGroup<CXX20>; 482def warn_cxx17_compat_decomp_decl_spec : Warning< 483 "decomposition declaration declared " 484 "%plural{1:'%1'|:with '%1' specifiers}0 " 485 "is incompatible with C++ standards before C++20">, 486 InGroup<CXXPre20Compat>, DefaultIgnore; 487def err_decomp_decl_type : Error< 488 "decomposition declaration cannot be declared with type %0; " 489 "declared type must be 'auto' or reference to 'auto'">; 490def err_decomp_decl_parens : Error< 491 "decomposition declaration cannot be declared with parentheses">; 492def err_decomp_decl_template : Error< 493 "decomposition declaration template not supported">; 494def err_decomp_decl_not_alone : Error< 495 "decomposition declaration must be the only declaration in its group">; 496def err_decomp_decl_requires_init : Error< 497 "decomposition declaration %0 requires an initializer">; 498def err_decomp_decl_wrong_number_bindings : Error< 499 "type %0 decomposes into %3 %plural{1:element|:elements}2, but " 500 "%select{%plural{0:no|:only %1}1|%1}4 " 501 "%plural{1:name was|:names were}1 provided">; 502def err_decomp_decl_unbindable_type : Error< 503 "cannot decompose %select{union|non-class, non-array}1 type %2">; 504def err_decomp_decl_multiple_bases_with_members : Error< 505 "cannot decompose class type %1: " 506 "%select{its base classes %2 and|both it and its base class}0 %3 " 507 "have non-static data members">; 508def err_decomp_decl_ambiguous_base : Error< 509 "cannot decompose members of ambiguous base class %1 of %0:%2">; 510def err_decomp_decl_inaccessible_base : Error< 511 "cannot decompose members of inaccessible base class %1 of %0">, 512 AccessControl; 513def err_decomp_decl_inaccessible_field : Error< 514 "cannot decompose %select{private|protected}0 member %1 of %3">, 515 AccessControl; 516def err_decomp_decl_lambda : Error< 517 "cannot decompose lambda closure type">; 518def err_decomp_decl_anon_union_member : Error< 519 "cannot decompose class type %0 because it has an anonymous " 520 "%select{struct|union}1 member">; 521def err_decomp_decl_std_tuple_element_not_specialized : Error< 522 "cannot decompose this type; 'std::tuple_element<%0>::type' " 523 "does not name a type">; 524def err_decomp_decl_std_tuple_size_not_constant : Error< 525 "cannot decompose this type; 'std::tuple_size<%0>::value' " 526 "is not a valid integral constant expression">; 527def note_in_binding_decl_init : Note< 528 "in implicit initialization of binding declaration %0">; 529 530def err_std_type_trait_not_class_template : Error< 531 "unsupported standard library implementation: " 532 "'std::%0' is not a class template">; 533 534// C++ using declarations 535def err_using_requires_qualname : Error< 536 "using declaration requires a qualified name">; 537def err_using_typename_non_type : Error< 538 "'typename' keyword used on a non-type">; 539def err_using_dependent_value_is_type : Error< 540 "dependent using declaration resolved to type without 'typename'">; 541def err_using_decl_nested_name_specifier_is_not_class : Error< 542 "using declaration in class refers into '%0', which is not a class">; 543def warn_cxx17_compat_using_decl_non_member_enumerator : Warning< 544 "member using declaration naming non-class '%0' enumerator is " 545 "incompatible with C++ standards before C++20">, InGroup<CXXPre20Compat>, 546 DefaultIgnore; 547def err_using_decl_nested_name_specifier_is_current_class : Error< 548 "using declaration refers to its own class">; 549def err_using_decl_nested_name_specifier_is_not_base_class : Error< 550 "using declaration refers into '%0', which is not a base class of %1">; 551def err_using_decl_constructor_not_in_direct_base : Error< 552 "%0 is not a direct base of %1, cannot inherit constructors">; 553def err_using_decl_can_not_refer_to_class_member : Error< 554 "using declaration cannot refer to class member">; 555def warn_cxx17_compat_using_decl_class_member_enumerator : Warning< 556 "member using declaration naming a non-member enumerator is incompatible " 557 "with C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore; 558def ext_using_decl_class_member_enumerator : ExtWarn< 559 "member using declaration naming a non-member enumerator is " 560 "a C++20 extension">, InGroup<CXX20>; 561def err_using_enum_is_dependent : Error< 562 "using-enum cannot name a dependent type">; 563def err_ambiguous_inherited_constructor : Error< 564 "constructor of %0 inherited from multiple base class subobjects">; 565def note_ambiguous_inherited_constructor_using : Note< 566 "inherited from base class %0 here">; 567def note_using_decl_class_member_workaround : Note< 568 "use %select{an alias declaration|a typedef declaration|a reference|" 569 "a const variable|a constexpr variable}0 instead">; 570def err_using_decl_can_not_refer_to_namespace : Error< 571 "using declaration cannot refer to a namespace">; 572def warn_cxx17_compat_using_decl_scoped_enumerator: Warning< 573 "using declaration naming a scoped enumerator is incompatible with " 574 "C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore; 575def ext_using_decl_scoped_enumerator : ExtWarn< 576 "using declaration naming a scoped enumerator is a C++20 extension">, 577 InGroup<CXX20>; 578def err_using_decl_constructor : Error< 579 "using declaration cannot refer to a constructor">; 580def warn_cxx98_compat_using_decl_constructor : Warning< 581 "inheriting constructors are incompatible with C++98">, 582 InGroup<CXX98Compat>, DefaultIgnore; 583def err_using_decl_destructor : Error< 584 "using declaration cannot refer to a destructor">; 585def err_using_decl_template_id : Error< 586 "using declaration cannot refer to a template specialization">; 587def note_using_decl_target : Note<"target of using declaration">; 588def note_using_decl_conflict : Note<"conflicting declaration">; 589def err_using_decl_redeclaration : Error<"redeclaration of using declaration">; 590def err_using_decl_conflict : Error< 591 "target of using declaration conflicts with declaration already in scope">; 592def err_using_decl_conflict_reverse : Error< 593 "declaration conflicts with target of using declaration already in scope">; 594def note_using_decl : Note<"%select{|previous }0using declaration">; 595def err_using_decl_redeclaration_expansion : Error< 596 "using declaration pack expansion at block scope produces multiple values">; 597def err_use_of_empty_using_if_exists : Error< 598 "reference to unresolved using declaration">; 599def note_empty_using_if_exists_here : Note< 600 "using declaration annotated with 'using_if_exists' here">; 601def err_using_if_exists_on_ctor : Error< 602 "'using_if_exists' attribute cannot be applied to an inheriting constructor">; 603def err_using_enum_decl_redeclaration : Error< 604 "redeclaration of using-enum declaration">; 605def note_using_enum_decl : Note<"%select{|previous }0using-enum declaration">; 606 607def warn_access_decl_deprecated : Warning< 608 "access declarations are deprecated; use using declarations instead">, 609 InGroup<Deprecated>; 610def err_access_decl : Error< 611 "ISO C++11 does not allow access declarations; " 612 "use using declarations instead">; 613def warn_deprecated_copy : Warning< 614 "definition of implicit copy %select{constructor|assignment operator}1 " 615 "for %0 is deprecated because it has a user-declared copy " 616 "%select{assignment operator|constructor}1">, 617 InGroup<DeprecatedCopy>, DefaultIgnore; 618def warn_deprecated_copy_with_dtor : Warning< 619 "definition of implicit copy %select{constructor|assignment operator}1 " 620 "for %0 is deprecated because it has a user-declared destructor">, 621 InGroup<DeprecatedCopyWithDtor>, DefaultIgnore; 622def warn_deprecated_copy_with_user_provided_copy: Warning< 623 "definition of implicit copy %select{constructor|assignment operator}1 " 624 "for %0 is deprecated because it has a user-provided copy " 625 "%select{assignment operator|constructor}1">, 626 InGroup<DeprecatedCopyWithUserProvidedCopy>, DefaultIgnore; 627def warn_deprecated_copy_with_user_provided_dtor : Warning< 628 "definition of implicit copy %select{constructor|assignment operator}1 " 629 "for %0 is deprecated because it has a user-provided destructor">, 630 InGroup<DeprecatedCopyWithUserProvidedDtor>, DefaultIgnore; 631def warn_cxx17_compat_exception_spec_in_signature : Warning< 632 "mangled name of %0 will change in C++17 due to non-throwing exception " 633 "specification in function signature">, InGroup<CXX17CompatMangling>; 634 635def warn_global_constructor : Warning< 636 "declaration requires a global constructor">, 637 InGroup<GlobalConstructors>, DefaultIgnore; 638def warn_global_destructor : Warning< 639 "declaration requires a global destructor">, 640 InGroup<GlobalConstructors>, DefaultIgnore; 641def warn_exit_time_destructor : Warning< 642 "declaration requires an exit-time destructor">, 643 InGroup<ExitTimeDestructors>, DefaultIgnore; 644 645def err_invalid_thread : Error< 646 "'%0' is only allowed on variable declarations">; 647def err_thread_non_global : Error< 648 "'%0' variables must have global storage">; 649def err_thread_unsupported : Error< 650 "thread-local storage is not supported for the current target">; 651 652// FIXME: Combine fallout warnings to just one warning. 653def warn_maybe_falloff_nonvoid_function : Warning< 654 "non-void function does not return a value in all control paths">, 655 InGroup<ReturnType>; 656def warn_falloff_nonvoid_function : Warning< 657 "non-void function does not return a value">, 658 InGroup<ReturnType>; 659def err_maybe_falloff_nonvoid_block : Error< 660 "non-void block does not return a value in all control paths">; 661def err_falloff_nonvoid_block : Error< 662 "non-void block does not return a value">; 663def warn_maybe_falloff_nonvoid_coroutine : Warning< 664 "non-void coroutine does not return a value in all control paths">, 665 InGroup<ReturnType>; 666def warn_falloff_nonvoid_coroutine : Warning< 667 "non-void coroutine does not return a value">, 668 InGroup<ReturnType>; 669def warn_suggest_noreturn_function : Warning< 670 "%select{function|method}0 %1 could be declared with attribute 'noreturn'">, 671 InGroup<MissingNoreturn>, DefaultIgnore; 672def warn_suggest_noreturn_block : Warning< 673 "block could be declared with attribute 'noreturn'">, 674 InGroup<MissingNoreturn>, DefaultIgnore; 675 676// Unreachable code. 677def warn_unreachable : Warning< 678 "code will never be executed">, 679 InGroup<UnreachableCode>, DefaultIgnore; 680def warn_unreachable_break : Warning< 681 "'break' will never be executed">, 682 InGroup<UnreachableCodeBreak>, DefaultIgnore; 683def warn_unreachable_return : Warning< 684 "'return' will never be executed">, 685 InGroup<UnreachableCodeReturn>, DefaultIgnore; 686def warn_unreachable_loop_increment : Warning< 687 "loop will run at most once (loop increment never executed)">, 688 InGroup<UnreachableCodeLoopIncrement>, DefaultIgnore; 689def warn_unreachable_fallthrough_attr : Warning< 690 "fallthrough annotation in unreachable code">, 691 InGroup<UnreachableCodeFallthrough>, DefaultIgnore; 692def note_unreachable_silence : Note< 693 "silence by adding parentheses to mark code as explicitly dead">; 694 695/// Built-in functions. 696def ext_implicit_lib_function_decl : ExtWarn< 697 "implicitly declaring library function '%0' with type %1">, 698 InGroup<ImplicitFunctionDeclare>; 699def note_include_header_or_declare : Note< 700 "include the header <%0> or explicitly provide a declaration for '%1'">; 701def note_previous_builtin_declaration : Note<"%0 is a builtin with type %1">; 702def warn_implicit_decl_no_jmp_buf 703 : Warning<"declaration of built-in function '%0' requires the declaration" 704 " of the 'jmp_buf' type, commonly provided in the header <setjmp.h>.">, 705 InGroup<DiagGroup<"incomplete-setjmp-declaration">>; 706def warn_implicit_decl_requires_sysheader : Warning< 707 "declaration of built-in function '%1' requires inclusion of the header <%0>">, 708 InGroup<BuiltinRequiresHeader>; 709def warn_redecl_library_builtin : Warning< 710 "incompatible redeclaration of library function %0">, 711 InGroup<DiagGroup<"incompatible-library-redeclaration">>; 712def err_builtin_definition : Error<"definition of builtin function %0">; 713def err_builtin_redeclare : Error<"cannot redeclare builtin function %0">; 714def err_arm_invalid_specialreg : Error<"invalid special register for builtin">; 715def err_arm_invalid_coproc : Error<"coprocessor %0 must be configured as " 716 "%select{GCP|CDE}1">; 717def err_invalid_cpu_supports : Error<"invalid cpu feature string for builtin">; 718def err_invalid_cpu_is : Error<"invalid cpu name for builtin">; 719def err_invalid_cpu_specific_dispatch_value : Error< 720"invalid option '%0' for %select{cpu_specific|cpu_dispatch}1">; 721def warn_builtin_unknown : Warning<"use of unknown builtin %0">, 722 InGroup<ImplicitFunctionDeclare>, DefaultError; 723def warn_cstruct_memaccess : Warning< 724 "%select{destination for|source of|first operand of|second operand of}0 this " 725 "%1 call is a pointer to record %2 that is not trivial to " 726 "%select{primitive-default-initialize|primitive-copy}3">, 727 InGroup<NonTrivialMemaccess>; 728def note_nontrivial_field : Note< 729 "field is non-trivial to %select{copy|default-initialize}0">; 730def err_non_trivial_c_union_in_invalid_context : Error< 731 "cannot %select{" 732 "use type %1 for a function/method parameter|" 733 "use type %1 for function/method return|" 734 "default-initialize an object of type %1|" 735 "declare an automatic variable of type %1|" 736 "copy-initialize an object of type %1|" 737 "assign to a variable of type %1|" 738 "construct an automatic compound literal of type %1|" 739 "capture a variable of type %1|" 740 "cannot use volatile type %1 where it causes an lvalue-to-rvalue conversion" 741 "}3 " 742 "since it %select{contains|is}2 a union that is non-trivial to " 743 "%select{default-initialize|destruct|copy}0">; 744def note_non_trivial_c_union : Note< 745 "%select{%2 has subobjects that are|%3 has type %2 that is}0 " 746 "non-trivial to %select{default-initialize|destruct|copy}1">; 747def warn_dyn_class_memaccess : Warning< 748 "%select{destination for|source of|first operand of|second operand of}0 this " 749 "%1 call is a pointer to %select{|class containing a }2dynamic class %3; " 750 "vtable pointer will be %select{overwritten|copied|moved|compared}4">, 751 InGroup<DynamicClassMemaccess>; 752def note_bad_memaccess_silence : Note< 753 "explicitly cast the pointer to silence this warning">; 754def warn_sizeof_pointer_expr_memaccess : Warning< 755 "'%0' call operates on objects of type %1 while the size is based on a " 756 "different type %2">, 757 InGroup<SizeofPointerMemaccess>; 758def warn_sizeof_pointer_expr_memaccess_note : Note< 759 "did you mean to %select{dereference the argument to 'sizeof' (and multiply " 760 "it by the number of elements)|remove the addressof in the argument to " 761 "'sizeof' (and multiply it by the number of elements)|provide an explicit " 762 "length}0?">; 763def warn_sizeof_pointer_type_memaccess : Warning< 764 "argument to 'sizeof' in %0 call is the same pointer type %1 as the " 765 "%select{destination|source}2; expected %3 or an explicit length">, 766 InGroup<SizeofPointerMemaccess>; 767def warn_strlcpycat_wrong_size : Warning< 768 "size argument in %0 call appears to be size of the source; " 769 "expected the size of the destination">, 770 InGroup<DiagGroup<"strlcpy-strlcat-size">>; 771def note_strlcpycat_wrong_size : Note< 772 "change size argument to be the size of the destination">; 773def warn_memsize_comparison : Warning< 774 "size argument in %0 call is a comparison">, 775 InGroup<DiagGroup<"memsize-comparison">>; 776def note_memsize_comparison_paren : Note< 777 "did you mean to compare the result of %0 instead?">; 778def note_memsize_comparison_cast_silence : Note< 779 "explicitly cast the argument to size_t to silence this warning">; 780def warn_suspicious_sizeof_memset : Warning< 781 "%select{'size' argument to memset is '0'|" 782 "setting buffer to a 'sizeof' expression}0" 783 "; did you mean to transpose the last two arguments?">, 784 InGroup<MemsetTransposedArgs>; 785def note_suspicious_sizeof_memset_silence : Note< 786 "%select{parenthesize the third argument|" 787 "cast the second argument to 'int'}0 to silence">; 788def warn_suspicious_bzero_size : Warning<"'size' argument to bzero is '0'">, 789 InGroup<SuspiciousBzero>; 790def note_suspicious_bzero_size_silence : Note< 791 "parenthesize the second argument to silence">; 792 793def warn_strncat_large_size : Warning< 794 "the value of the size argument in 'strncat' is too large, might lead to a " 795 "buffer overflow">, InGroup<StrncatSize>; 796def warn_strncat_src_size : Warning<"size argument in 'strncat' call appears " 797 "to be size of the source">, InGroup<StrncatSize>; 798def warn_strncat_wrong_size : Warning< 799 "the value of the size argument to 'strncat' is wrong">, InGroup<StrncatSize>; 800def note_strncat_wrong_size : Note< 801 "change the argument to be the free space in the destination buffer minus " 802 "the terminating null byte">; 803 804def warn_assume_side_effects : Warning< 805 "the argument to %0 has side effects that will be discarded">, 806 InGroup<DiagGroup<"assume">>; 807def warn_assume_attribute_string_unknown : Warning< 808 "unknown assumption string '%0'; attribute is potentially ignored">, 809 InGroup<UnknownAssumption>; 810def warn_assume_attribute_string_unknown_suggested : Warning< 811 "unknown assumption string '%0' may be misspelled; attribute is potentially " 812 "ignored, did you mean '%1'?">, 813 InGroup<MisspelledAssumption>; 814 815def warn_builtin_chk_overflow : Warning< 816 "'%0' will always overflow; destination buffer has size %1," 817 " but size argument is %2">, 818 InGroup<DiagGroup<"builtin-memcpy-chk-size">>; 819 820def warn_fortify_source_overflow 821 : Warning<warn_builtin_chk_overflow.Text>, InGroup<FortifySource>; 822def warn_fortify_source_size_mismatch : Warning< 823 "'%0' size argument is too large; destination buffer has size %1," 824 " but size argument is %2">, InGroup<FortifySource>; 825 826def warn_fortify_strlen_overflow: Warning< 827 "'%0' will always overflow; destination buffer has size %1," 828 " but the source string has length %2 (including NUL byte)">, 829 InGroup<FortifySource>; 830 831def warn_fortify_source_format_overflow : Warning< 832 "'%0' will always overflow; destination buffer has size %1," 833 " but format string expands to at least %2">, 834 InGroup<FortifySource>; 835 836def warn_fortify_scanf_overflow : Warning< 837 "'%0' may overflow; destination buffer in argument %1 has size " 838 "%2, but the corresponding specifier may require size %3">, 839 InGroup<FortifySource>; 840 841/// main() 842// static main() is not an error in C, just in C++. 843def warn_static_main : Warning<"'main' should not be declared static">, 844 InGroup<Main>; 845def err_static_main : Error<"'main' is not allowed to be declared static">; 846def err_inline_main : Error<"'main' is not allowed to be declared inline">; 847def ext_variadic_main : ExtWarn< 848 "'main' is not allowed to be declared variadic">, InGroup<Main>; 849def ext_noreturn_main : ExtWarn< 850 "'main' is not allowed to be declared _Noreturn">, InGroup<Main>; 851def note_main_remove_noreturn : Note<"remove '_Noreturn'">; 852def err_constexpr_main : Error< 853 "'main' is not allowed to be declared %select{constexpr|consteval}0">; 854def err_deleted_main : Error<"'main' is not allowed to be deleted">; 855def err_mainlike_template_decl : Error<"%0 cannot be a template">; 856def err_main_returns_nonint : Error<"'main' must return 'int'">; 857def ext_main_returns_nonint : ExtWarn<"return type of 'main' is not 'int'">, 858 InGroup<MainReturnType>; 859def note_main_change_return_type : Note<"change return type to 'int'">; 860def err_main_surplus_args : Error<"too many parameters (%0) for 'main': " 861 "must be 0, 2, or 3">; 862def warn_main_one_arg : Warning<"only one parameter on 'main' declaration">, 863 InGroup<Main>; 864def err_main_arg_wrong : Error<"%select{first|second|third|fourth}0 " 865 "parameter of 'main' (%select{argument count|argument array|environment|" 866 "platform-specific data}0) must be of type %1">; 867def warn_main_returns_bool_literal : Warning<"bool literal returned from " 868 "'main'">, InGroup<Main>; 869def err_main_global_variable : 870 Error<"main cannot be declared as global variable">; 871def warn_main_redefined : Warning<"variable named 'main' with external linkage " 872 "has undefined behavior">, InGroup<Main>; 873def ext_main_used : Extension< 874 "ISO C++ does not allow 'main' to be used by a program">, InGroup<Main>; 875 876/// parser diagnostics 877def ext_no_declarators : ExtWarn<"declaration does not declare anything">, 878 InGroup<MissingDeclarations>; 879def err_no_declarators : Error<"declaration does not declare anything">; 880def ext_typedef_without_a_name : ExtWarn<"typedef requires a name">, 881 InGroup<MissingDeclarations>; 882def err_typedef_not_identifier : Error<"typedef name must be an identifier">; 883 884def ext_non_c_like_anon_struct_in_typedef : ExtWarn< 885 "anonymous non-C-compatible type given name for linkage purposes " 886 "by %select{typedef|alias}0 declaration; " 887 "add a tag name here">, InGroup<DiagGroup<"non-c-typedef-for-linkage">>; 888def err_non_c_like_anon_struct_in_typedef : Error< 889 "anonymous non-C-compatible type given name for linkage purposes " 890 "by %select{typedef|alias}0 declaration after its linkage was computed; " 891 "add a tag name here to establish linkage prior to definition">; 892def err_typedef_changes_linkage : Error< 893 "unsupported: anonymous type given name for linkage purposes " 894 "by %select{typedef|alias}0 declaration after its linkage was computed; " 895 "add a tag name here to establish linkage prior to definition">; 896def note_non_c_like_anon_struct : Note< 897 "type is not C-compatible due to this " 898 "%select{base class|default member initializer|lambda expression|" 899 "friend declaration|member declaration}0">; 900def note_typedef_for_linkage_here : Note< 901 "type is given name %0 for linkage purposes by this " 902 "%select{typedef|alias}1 declaration">; 903 904def err_statically_allocated_object : Error< 905 "interface type cannot be statically allocated">; 906def err_object_cannot_be_passed_returned_by_value : Error< 907 "interface type %1 cannot be %select{returned|passed}0 by value" 908 "; did you forget * in %1?">; 909def err_parameters_retval_cannot_have_fp16_type : Error< 910 "%select{parameters|function return value}0 cannot have __fp16 type; did you forget * ?">; 911def err_opencl_half_load_store : Error< 912 "%select{loading directly from|assigning directly to}0 pointer to type %1 requires " 913 "cl_khr_fp16. Use vector data %select{load|store}0 builtin functions instead">; 914def err_opencl_cast_to_half : Error<"casting to type %0 is not allowed">; 915def err_opencl_half_declaration : Error< 916 "declaring variable of type %0 is not allowed">; 917def err_opencl_invalid_param : Error< 918 "declaring function parameter of type %0 is not allowed%select{; did you forget * ?|}1">; 919def err_opencl_invalid_return : Error< 920 "declaring function return value of type %0 is not allowed %select{; did you forget * ?|}1">; 921def warn_enum_value_overflow : Warning<"overflow in enumeration value">; 922def warn_pragma_options_align_reset_failed : Warning< 923 "#pragma options align=reset failed: %0">, 924 InGroup<IgnoredPragmas>; 925def err_pragma_options_align_mac68k_target_unsupported : Error< 926 "mac68k alignment pragma is not supported on this target">; 927def warn_pragma_align_not_xl_compatible : Warning< 928 "#pragma align(packed) may not be compatible with objects generated with AIX XL C/C++">, 929 InGroup<AIXCompat>; 930def warn_pragma_pack_invalid_alignment : Warning< 931 "expected #pragma pack parameter to be '1', '2', '4', '8', or '16'">, 932 InGroup<IgnoredPragmas>; 933def err_pragma_pack_invalid_alignment : Error< 934 warn_pragma_pack_invalid_alignment.Text>; 935def warn_pragma_pack_non_default_at_include : Warning< 936 "non-default #pragma pack value changes the alignment of struct or union " 937 "members in the included file">, InGroup<PragmaPackSuspiciousInclude>, 938 DefaultIgnore; 939def warn_pragma_pack_modified_after_include : Warning< 940 "the current #pragma pack alignment value is modified in the included " 941 "file">, InGroup<PragmaPack>; 942def warn_pragma_pack_no_pop_eof : Warning<"unterminated " 943 "'#pragma pack (push, ...)' at end of file">, InGroup<PragmaPack>; 944def note_pragma_pack_here : Note< 945 "previous '#pragma pack' directive that modifies alignment is here">; 946def note_pragma_pack_pop_instead_reset : Note< 947 "did you intend to use '#pragma pack (pop)' instead of '#pragma pack()'?">; 948// Follow the Microsoft implementation. 949def warn_pragma_pack_show : Warning<"value of #pragma pack(show) == %0">; 950def warn_pragma_pack_pop_identifier_and_alignment : Warning< 951 "specifying both a name and alignment to 'pop' is undefined">; 952def warn_pragma_pop_failed : Warning<"#pragma %0(pop, ...) failed: %1">, 953 InGroup<IgnoredPragmas>; 954def err_pragma_fc_pp_scope : Error< 955 "'#pragma float_control push/pop' can only appear at file or namespace scope " 956 "or within a language linkage specification">; 957def err_pragma_fc_noprecise_requires_nofenv : Error< 958 "'#pragma float_control(precise, off)' is illegal when fenv_access is enabled">; 959def err_pragma_fc_except_requires_precise : Error< 960 "'#pragma float_control(except, on)' is illegal when precise is disabled">; 961def err_pragma_fc_noprecise_requires_noexcept : Error< 962 "'#pragma float_control(precise, off)' is illegal when except is enabled">; 963def err_pragma_fenv_requires_precise : Error< 964 "'#pragma STDC FENV_ACCESS ON' is illegal when precise is disabled">; 965def warn_cxx_ms_struct : 966 Warning<"ms_struct may not produce Microsoft-compatible layouts for classes " 967 "with base classes or virtual functions">, 968 DefaultError, InGroup<IncompatibleMSStruct>; 969def err_pragma_pack_identifer_not_supported : Error< 970 "specifying an identifier within `#pragma pack` is not supported on this target">; 971def err_section_conflict : Error<"%0 causes a section type conflict with %1">; 972def err_no_base_classes : Error<"invalid use of '__super', %0 has no base classes">; 973def err_invalid_super_scope : Error<"invalid use of '__super', " 974 "this keyword can only be used inside class or member function scope">; 975def err_super_in_lambda_unsupported : Error< 976 "use of '__super' inside a lambda is unsupported">; 977 978def warn_pragma_unused_undeclared_var : Warning< 979 "undeclared variable %0 used as an argument for '#pragma unused'">, 980 InGroup<IgnoredPragmas>; 981def warn_atl_uuid_deprecated : Warning< 982 "specifying 'uuid' as an ATL attribute is deprecated; use __declspec instead">, 983 InGroup<DeprecatedDeclarations>; 984def warn_pragma_unused_expected_var_arg : Warning< 985 "only variables can be arguments to '#pragma unused'">, 986 InGroup<IgnoredPragmas>; 987def err_pragma_push_visibility_mismatch : Error< 988 "#pragma visibility push with no matching #pragma visibility pop">; 989def note_surrounding_namespace_ends_here : Note< 990 "surrounding namespace with visibility attribute ends here">; 991def err_pragma_pop_visibility_mismatch : Error< 992 "#pragma visibility pop with no matching #pragma visibility push">; 993def note_surrounding_namespace_starts_here : Note< 994 "surrounding namespace with visibility attribute starts here">; 995def err_pragma_loop_invalid_argument_type : Error< 996 "invalid argument of type %0; expected an integer type">; 997def err_pragma_loop_invalid_argument_value : Error< 998 "%select{invalid value '%0'; must be positive|value '%0' is too large}1">; 999def err_pragma_loop_compatibility : Error< 1000 "%select{incompatible|duplicate}0 directives '%1' and '%2'">; 1001def err_pragma_loop_precedes_nonloop : Error< 1002 "expected a for, while, or do-while loop to follow '%0'">; 1003 1004def err_pragma_attribute_matcher_subrule_contradicts_rule : Error< 1005 "redundant attribute subject matcher sub-rule '%0'; '%1' already matches " 1006 "those declarations">; 1007def err_pragma_attribute_matcher_negated_subrule_contradicts_subrule : Error< 1008 "negated attribute subject matcher sub-rule '%0' contradicts sub-rule '%1'">; 1009def err_pragma_attribute_invalid_matchers : Error< 1010 "attribute %0 can't be applied to %1">; 1011def err_pragma_attribute_stack_mismatch : Error< 1012 "'#pragma clang attribute %select{%1.|}0pop' with no matching" 1013 " '#pragma clang attribute %select{%1.|}0push'">; 1014def warn_pragma_attribute_unused : Warning< 1015 "unused attribute %0 in '#pragma clang attribute push' region">, 1016 InGroup<PragmaClangAttribute>; 1017def note_pragma_attribute_region_ends_here : Note< 1018 "'#pragma clang attribute push' regions ends here">; 1019def err_pragma_attribute_no_pop_eof : Error<"unterminated " 1020 "'#pragma clang attribute push' at end of file">; 1021def note_pragma_attribute_applied_decl_here : Note< 1022 "when applied to this declaration">; 1023def err_pragma_attr_attr_no_push : Error< 1024 "'#pragma clang attribute' attribute with no matching " 1025 "'#pragma clang attribute push'">; 1026 1027/// Objective-C parser diagnostics 1028def err_duplicate_class_def : Error< 1029 "duplicate interface definition for class %0">; 1030def err_undef_superclass : Error< 1031 "cannot find interface declaration for %0, superclass of %1">; 1032def err_forward_superclass : Error< 1033 "attempting to use the forward class %0 as superclass of %1">; 1034def err_no_nsconstant_string_class : Error< 1035 "cannot find interface declaration for %0">; 1036def err_recursive_superclass : Error< 1037 "trying to recursively use %0 as superclass of %1">; 1038def err_conflicting_aliasing_type : Error<"conflicting types for alias %0">; 1039def warn_undef_interface : Warning<"cannot find interface declaration for %0">; 1040def warn_duplicate_protocol_def : Warning< 1041 "duplicate protocol definition of %0 is ignored">, 1042 InGroup<DiagGroup<"duplicate-protocol">>; 1043def err_protocol_has_circular_dependency : Error< 1044 "protocol has circular dependency">; 1045def err_undeclared_protocol : Error<"cannot find protocol declaration for %0">; 1046def warn_undef_protocolref : Warning<"cannot find protocol definition for %0">; 1047def err_atprotocol_protocol : Error< 1048 "@protocol is using a forward protocol declaration of %0">; 1049def warn_readonly_property : Warning< 1050 "attribute 'readonly' of property %0 restricts attribute " 1051 "'readwrite' of property inherited from %1">, 1052 InGroup<PropertyAttr>; 1053 1054def warn_property_attribute : Warning< 1055 "'%1' attribute on property %0 does not match the property inherited from %2">, 1056 InGroup<PropertyAttr>; 1057def warn_property_types_are_incompatible : Warning< 1058 "property type %0 is incompatible with type %1 inherited from %2">, 1059 InGroup<DiagGroup<"incompatible-property-type">>; 1060def warn_protocol_property_mismatch : Warning< 1061 "property %select{of type %1|with attribute '%1'|without attribute '%1'|with " 1062 "getter %1|with setter %1}0 was selected for synthesis">, 1063 InGroup<DiagGroup<"protocol-property-synthesis-ambiguity">>; 1064def err_protocol_property_mismatch: Error<warn_protocol_property_mismatch.Text>; 1065def err_undef_interface : Error<"cannot find interface declaration for %0">; 1066def err_category_forward_interface : Error< 1067 "cannot define %select{category|class extension}0 for undefined class %1">; 1068def err_class_extension_after_impl : Error< 1069 "cannot declare class extension for %0 after class implementation">; 1070def note_implementation_declared : Note< 1071 "class implementation is declared here">; 1072def note_while_in_implementation : Note< 1073 "detected while default synthesizing properties in class implementation">; 1074def note_class_declared : Note< 1075 "class is declared here">; 1076def note_receiver_class_declared : Note< 1077 "receiver is instance of class declared here">; 1078def note_receiver_expr_here : Note< 1079 "receiver expression is here">; 1080def note_receiver_is_id : Note< 1081 "receiver is treated with 'id' type for purpose of method lookup">; 1082def note_suppressed_class_declare : Note< 1083 "class with specified objc_requires_property_definitions attribute is declared here">; 1084def err_objc_root_class_subclass : Error< 1085 "objc_root_class attribute may only be specified on a root class declaration">; 1086def err_restricted_superclass_mismatch : Error< 1087 "cannot subclass a class that was declared with the " 1088 "'objc_subclassing_restricted' attribute">; 1089def err_class_stub_subclassing_mismatch : Error< 1090 "'objc_class_stub' attribute cannot be specified on a class that does not " 1091 "have the 'objc_subclassing_restricted' attribute">; 1092def err_implementation_of_class_stub : Error< 1093 "cannot declare implementation of a class declared with the " 1094 "'objc_class_stub' attribute">; 1095def warn_objc_root_class_missing : Warning< 1096 "class %0 defined without specifying a base class">, 1097 InGroup<ObjCRootClass>; 1098def err_objc_runtime_visible_category : Error< 1099 "cannot implement a category for class %0 that is only visible via the " 1100 "Objective-C runtime">; 1101def err_objc_runtime_visible_subclass : Error< 1102 "cannot implement subclass %0 of a superclass %1 that is only visible via the " 1103 "Objective-C runtime">; 1104def note_objc_needs_superclass : Note< 1105 "add a super class to fix this problem">; 1106def err_conflicting_super_class : Error<"conflicting super class name %0">; 1107def err_dup_implementation_class : Error<"reimplementation of class %0">; 1108def err_dup_implementation_category : Error< 1109 "reimplementation of category %1 for class %0">; 1110def err_conflicting_ivar_type : Error< 1111 "instance variable %0 has conflicting type%diff{: $ vs $|}1,2">; 1112def err_duplicate_ivar_declaration : Error< 1113 "instance variable is already declared">; 1114def warn_on_superclass_use : Warning< 1115 "class implementation may not have super class">; 1116def err_conflicting_ivar_bitwidth : Error< 1117 "instance variable %0 has conflicting bit-field width">; 1118def err_conflicting_ivar_name : Error< 1119 "conflicting instance variable names: %0 vs %1">; 1120def err_inconsistent_ivar_count : Error< 1121 "inconsistent number of instance variables specified">; 1122def warn_undef_method_impl : Warning<"method definition for %0 not found">, 1123 InGroup<DiagGroup<"incomplete-implementation">>; 1124def warn_objc_boxing_invalid_utf8_string : Warning< 1125 "string is ill-formed as UTF-8 and will become a null %0 when boxed">, 1126 InGroup<ObjCBoxing>; 1127 1128def err_objc_non_runtime_protocol_in_protocol_expr : Error< 1129 "cannot use a protocol declared 'objc_non_runtime_protocol' in a @protocol expression">; 1130def err_objc_direct_on_protocol : Error< 1131 "'objc_direct' attribute cannot be applied to %select{methods|properties}0 " 1132 "declared in an Objective-C protocol">; 1133def err_objc_direct_duplicate_decl : Error< 1134 "%select{|direct }0%select{method|property}1 declaration conflicts " 1135 "with previous %select{|direct }2declaration of %select{method|property}1 %3">; 1136def err_objc_direct_impl_decl_mismatch : Error< 1137 "direct method was declared in %select{the primary interface|an extension|a category}0 " 1138 "but is implemented in %select{the primary interface|a category|a different category}1">; 1139def err_objc_direct_missing_on_decl : Error< 1140 "direct method implementation was previously declared not direct">; 1141def err_objc_direct_on_override : Error< 1142 "methods that %select{override superclass methods|implement protocol requirements}0 cannot be direct">; 1143def err_objc_override_direct_method : Error< 1144 "cannot override a method that is declared direct by a superclass">; 1145def warn_objc_direct_ignored : Warning< 1146 "%0 attribute isn't implemented by this Objective-C runtime">, 1147 InGroup<IgnoredAttributes>; 1148def warn_objc_direct_property_ignored : Warning< 1149 "direct attribute on property %0 ignored (not implemented by this Objective-C runtime)">, 1150 InGroup<IgnoredAttributes>; 1151def err_objc_direct_dynamic_property : Error< 1152 "direct property cannot be @dynamic">; 1153def err_objc_direct_protocol_conformance : Error< 1154 "%select{category %1|class extension}0 cannot conform to protocol %2 because " 1155 "of direct members declared in interface %3">; 1156def note_direct_member_here : Note<"direct member declared here">; 1157 1158def warn_conflicting_overriding_ret_types : Warning< 1159 "conflicting return type in " 1160 "declaration of %0%diff{: $ vs $|}1,2">, 1161 InGroup<OverridingMethodMismatch>, DefaultIgnore; 1162 1163def warn_conflicting_ret_types : Warning< 1164 "conflicting return type in " 1165 "implementation of %0%diff{: $ vs $|}1,2">, 1166 InGroup<MismatchedReturnTypes>; 1167 1168def warn_conflicting_overriding_ret_type_modifiers : Warning< 1169 "conflicting distributed object modifiers on return type " 1170 "in declaration of %0">, 1171 InGroup<OverridingMethodMismatch>, DefaultIgnore; 1172 1173def warn_conflicting_ret_type_modifiers : Warning< 1174 "conflicting distributed object modifiers on return type " 1175 "in implementation of %0">, 1176 InGroup<DistributedObjectModifiers>; 1177 1178def warn_non_covariant_overriding_ret_types : Warning< 1179 "conflicting return type in " 1180 "declaration of %0: %1 vs %2">, 1181 InGroup<OverridingMethodMismatch>, DefaultIgnore; 1182 1183def warn_non_covariant_ret_types : Warning< 1184 "conflicting return type in " 1185 "implementation of %0: %1 vs %2">, 1186 InGroup<MethodSignatures>, DefaultIgnore; 1187 1188def warn_conflicting_overriding_param_types : Warning< 1189 "conflicting parameter types in " 1190 "declaration of %0%diff{: $ vs $|}1,2">, 1191 InGroup<OverridingMethodMismatch>, DefaultIgnore; 1192 1193def warn_conflicting_param_types : Warning< 1194 "conflicting parameter types in " 1195 "implementation of %0%diff{: $ vs $|}1,2">, 1196 InGroup<MismatchedParameterTypes>; 1197 1198def warn_conflicting_param_modifiers : Warning< 1199 "conflicting distributed object modifiers on parameter type " 1200 "in implementation of %0">, 1201 InGroup<DistributedObjectModifiers>; 1202 1203def warn_conflicting_overriding_param_modifiers : Warning< 1204 "conflicting distributed object modifiers on parameter type " 1205 "in declaration of %0">, 1206 InGroup<OverridingMethodMismatch>, DefaultIgnore; 1207 1208def warn_non_contravariant_overriding_param_types : Warning< 1209 "conflicting parameter types in " 1210 "declaration of %0: %1 vs %2">, 1211 InGroup<OverridingMethodMismatch>, DefaultIgnore; 1212 1213def warn_non_contravariant_param_types : Warning< 1214 "conflicting parameter types in " 1215 "implementation of %0: %1 vs %2">, 1216 InGroup<MethodSignatures>, DefaultIgnore; 1217 1218def warn_conflicting_overriding_variadic :Warning< 1219 "conflicting variadic declaration of method and its " 1220 "implementation">, 1221 InGroup<OverridingMethodMismatch>, DefaultIgnore; 1222 1223def warn_conflicting_variadic :Warning< 1224 "conflicting variadic declaration of method and its " 1225 "implementation">; 1226 1227def warn_category_method_impl_match:Warning< 1228 "category is implementing a method which will also be implemented" 1229 " by its primary class">, InGroup<ObjCProtocolMethodImpl>; 1230 1231def warn_implements_nscopying : Warning< 1232"default assign attribute on property %0 which implements " 1233"NSCopying protocol is not appropriate with -fobjc-gc[-only]">; 1234 1235def warn_multiple_method_decl : Warning<"multiple methods named %0 found">, 1236 InGroup<ObjCMultipleMethodNames>; 1237def warn_strict_multiple_method_decl : Warning< 1238 "multiple methods named %0 found">, InGroup<StrictSelector>, DefaultIgnore; 1239def warn_accessor_property_type_mismatch : Warning< 1240 "type of property %0 does not match type of accessor %1">; 1241def note_conv_function_declared_at : Note<"type conversion function declared here">; 1242def note_method_declared_at : Note<"method %0 declared here">; 1243def note_direct_method_declared_at : Note<"direct method %0 declared here">; 1244def note_property_attribute : Note<"property %0 is declared " 1245 "%select{deprecated|unavailable|partial}1 here">; 1246def err_setter_type_void : Error<"type of setter must be void">; 1247def err_duplicate_method_decl : Error<"duplicate declaration of method %0">; 1248def warn_duplicate_method_decl : 1249 Warning<"multiple declarations of method %0 found and ignored">, 1250 InGroup<MethodDuplicate>, DefaultIgnore; 1251def warn_objc_cdirective_format_string : 1252 Warning<"using %0 directive in %select{NSString|CFString}1 " 1253 "which is being passed as a formatting argument to the formatting " 1254 "%select{method|CFfunction}2">, 1255 InGroup<ObjCCStringFormat>, DefaultIgnore; 1256def err_objc_var_decl_inclass : 1257 Error<"cannot declare variable inside @interface or @protocol">; 1258def err_missing_method_context : Error< 1259 "missing context for method declaration">; 1260def err_objc_property_attr_mutually_exclusive : Error< 1261 "property attributes '%0' and '%1' are mutually exclusive">; 1262def err_objc_property_requires_object : Error< 1263 "property with '%0' attribute must be of object type">; 1264def warn_objc_property_assign_on_object : Warning< 1265 "'assign' property of object type may become a dangling reference; consider using 'unsafe_unretained'">, 1266 InGroup<ObjCPropertyAssignOnObjectType>, DefaultIgnore; 1267def warn_objc_property_no_assignment_attribute : Warning< 1268 "no 'assign', 'retain', or 'copy' attribute is specified - " 1269 "'assign' is assumed">, 1270 InGroup<ObjCPropertyNoAttribute>; 1271def warn_objc_isa_use : Warning< 1272 "direct access to Objective-C's isa is deprecated in favor of " 1273 "object_getClass()">, InGroup<DeprecatedObjCIsaUsage>; 1274def warn_objc_isa_assign : Warning< 1275 "assignment to Objective-C's isa is deprecated in favor of " 1276 "object_setClass()">, InGroup<DeprecatedObjCIsaUsage>; 1277def warn_objc_pointer_masking : Warning< 1278 "bitmasking for introspection of Objective-C object pointers is strongly " 1279 "discouraged">, 1280 InGroup<ObjCPointerIntrospect>; 1281def warn_objc_pointer_masking_performSelector : Warning<warn_objc_pointer_masking.Text>, 1282 InGroup<ObjCPointerIntrospectPerformSelector>; 1283def warn_objc_property_default_assign_on_object : Warning< 1284 "default property attribute 'assign' not appropriate for object">, 1285 InGroup<ObjCPropertyNoAttribute>; 1286def warn_property_attr_mismatch : Warning< 1287 "property attribute in class extension does not match the primary class">, 1288 InGroup<PropertyAttr>; 1289def warn_property_implicitly_mismatched : Warning < 1290 "primary property declaration is implicitly strong while redeclaration " 1291 "in class extension is weak">, 1292 InGroup<DiagGroup<"objc-property-implicit-mismatch">>; 1293def warn_objc_property_copy_missing_on_block : Warning< 1294 "'copy' attribute must be specified for the block property " 1295 "when -fobjc-gc-only is specified">; 1296def warn_objc_property_retain_of_block : Warning< 1297 "retain'ed block property does not copy the block " 1298 "- use copy attribute instead">, InGroup<ObjCRetainBlockProperty>; 1299def warn_objc_readonly_property_has_setter : Warning< 1300 "setter cannot be specified for a readonly property">, 1301 InGroup<ObjCReadonlyPropertyHasSetter>; 1302def warn_atomic_property_rule : Warning< 1303 "writable atomic property %0 cannot pair a synthesized %select{getter|setter}1 " 1304 "with a user defined %select{getter|setter}2">, 1305 InGroup<DiagGroup<"atomic-property-with-user-defined-accessor">>; 1306def note_atomic_property_fixup_suggest : Note<"setter and getter must both be " 1307 "synthesized, or both be user defined,or the property must be nonatomic">; 1308def err_atomic_property_nontrivial_assign_op : Error< 1309 "atomic property of reference type %0 cannot have non-trivial assignment" 1310 " operator">; 1311def warn_cocoa_naming_owned_rule : Warning< 1312 "property follows Cocoa naming" 1313 " convention for returning 'owned' objects">, 1314 InGroup<DiagGroup<"objc-property-matches-cocoa-ownership-rule">>; 1315def err_cocoa_naming_owned_rule : Error< 1316 "property follows Cocoa naming" 1317 " convention for returning 'owned' objects">; 1318def note_cocoa_naming_declare_family : Note< 1319 "explicitly declare getter %objcinstance0 with '%1' to return an 'unowned' " 1320 "object">; 1321def warn_auto_synthesizing_protocol_property :Warning< 1322 "auto property synthesis will not synthesize property %0" 1323 " declared in protocol %1">, 1324 InGroup<DiagGroup<"objc-protocol-property-synthesis">>; 1325def note_add_synthesize_directive : Note< 1326 "add a '@synthesize' directive">; 1327def warn_no_autosynthesis_shared_ivar_property : Warning < 1328 "auto property synthesis will not synthesize property " 1329 "%0 because it cannot share an ivar with another synthesized property">, 1330 InGroup<ObjCNoPropertyAutoSynthesis>; 1331def warn_no_autosynthesis_property : Warning< 1332 "auto property synthesis will not synthesize property " 1333 "%0 because it is 'readwrite' but it will be synthesized 'readonly' " 1334 "via another property">, 1335 InGroup<ObjCNoPropertyAutoSynthesis>; 1336def warn_autosynthesis_property_in_superclass : Warning< 1337 "auto property synthesis will not synthesize property " 1338 "%0; it will be implemented by its superclass, use @dynamic to " 1339 "acknowledge intention">, 1340 InGroup<ObjCNoPropertyAutoSynthesis>; 1341def warn_autosynthesis_property_ivar_match :Warning< 1342 "autosynthesized property %0 will use %select{|synthesized}1 instance variable " 1343 "%2, not existing instance variable %3">, 1344 InGroup<DiagGroup<"objc-autosynthesis-property-ivar-name-match">>; 1345def warn_missing_explicit_synthesis : Warning < 1346 "auto property synthesis is synthesizing property not explicitly synthesized">, 1347 InGroup<DiagGroup<"objc-missing-property-synthesis">>, DefaultIgnore; 1348def warn_property_getter_owning_mismatch : Warning< 1349 "property declared as returning non-retained objects" 1350 "; getter returning retained objects">; 1351def warn_property_redecl_getter_mismatch : Warning< 1352 "getter name mismatch between property redeclaration (%1) and its original " 1353 "declaration (%0)">, InGroup<PropertyAttr>; 1354def err_property_setter_ambiguous_use : Error< 1355 "synthesized properties %0 and %1 both claim setter %2 -" 1356 " use of this setter will cause unexpected behavior">; 1357def warn_default_atomic_custom_getter_setter : Warning< 1358 "atomic by default property %0 has a user defined %select{getter|setter}1 " 1359 "(property should be marked 'atomic' if this is intended)">, 1360 InGroup<CustomAtomic>, DefaultIgnore; 1361def err_use_continuation_class : Error< 1362 "illegal redeclaration of property in class extension %0" 1363 " (attribute must be 'readwrite', while its primary must be 'readonly')">; 1364def err_type_mismatch_continuation_class : Error< 1365 "type of property %0 in class extension does not match " 1366 "property type in primary class">; 1367def err_use_continuation_class_redeclaration_readwrite : Error< 1368 "illegal redeclaration of 'readwrite' property in class extension %0" 1369 " (perhaps you intended this to be a 'readwrite' redeclaration of a " 1370 "'readonly' public property?)">; 1371def err_continuation_class : Error<"class extension has no primary class">; 1372def err_property_type : Error<"property cannot have array or function type %0">; 1373def err_missing_property_context : Error< 1374 "missing context for property implementation declaration">; 1375def err_bad_property_decl : Error< 1376 "property implementation must have its declaration in interface %0 or one of " 1377 "its extensions">; 1378def err_category_property : Error< 1379 "property declared in category %0 cannot be implemented in " 1380 "class implementation">; 1381def note_property_declare : Note< 1382 "property declared here">; 1383def note_protocol_property_declare : Note< 1384 "it could also be property " 1385 "%select{of type %1|without attribute '%1'|with attribute '%1'|with getter " 1386 "%1|with setter %1}0 declared here">; 1387def note_property_synthesize : Note< 1388 "property synthesized here">; 1389def err_synthesize_category_decl : Error< 1390 "@synthesize not allowed in a category's implementation">; 1391def err_synthesize_on_class_property : Error< 1392 "@synthesize not allowed on a class property %0">; 1393def err_missing_property_interface : Error< 1394 "property implementation in a category with no category declaration">; 1395def err_bad_category_property_decl : Error< 1396 "property implementation must have its declaration in the category %0">; 1397def err_bad_property_context : Error< 1398 "property implementation must be in a class or category implementation">; 1399def err_missing_property_ivar_decl : Error< 1400 "synthesized property %0 must either be named the same as a compatible" 1401 " instance variable or must explicitly name an instance variable">; 1402def err_arc_perform_selector_retains : Error< 1403 "performSelector names a selector which retains the object">; 1404def warn_arc_perform_selector_leaks : Warning< 1405 "performSelector may cause a leak because its selector is unknown">, 1406 InGroup<DiagGroup<"arc-performSelector-leaks">>; 1407def warn_dealloc_in_category : Warning< 1408"-dealloc is being overridden in a category">, 1409InGroup<DeallocInCategory>; 1410def err_gc_weak_property_strong_type : Error< 1411 "weak attribute declared on a __strong type property in GC mode">; 1412def warn_arc_repeated_use_of_weak : Warning < 1413 "weak %select{variable|property|implicit property|instance variable}0 %1 is " 1414 "accessed multiple times in this %select{function|method|block|lambda}2 " 1415 "but may be unpredictably set to nil; assign to a strong variable to keep " 1416 "the object alive">, 1417 InGroup<ARCRepeatedUseOfWeak>, DefaultIgnore; 1418def warn_implicitly_retains_self : Warning < 1419 "block implicitly retains 'self'; explicitly mention 'self' to indicate " 1420 "this is intended behavior">, 1421 InGroup<DiagGroup<"implicit-retain-self">>, DefaultIgnore; 1422def warn_arc_possible_repeated_use_of_weak : Warning < 1423 "weak %select{variable|property|implicit property|instance variable}0 %1 may " 1424 "be accessed multiple times in this %select{function|method|block|lambda}2 " 1425 "and may be unpredictably set to nil; assign to a strong variable to keep " 1426 "the object alive">, 1427 InGroup<ARCRepeatedUseOfWeakMaybe>, DefaultIgnore; 1428def note_arc_weak_also_accessed_here : Note< 1429 "also accessed here">; 1430def err_incomplete_synthesized_property : Error< 1431 "cannot synthesize property %0 with incomplete type %1">; 1432 1433def err_property_ivar_type : Error< 1434 "type of property %0 (%1) does not match type of instance variable %2 (%3)">; 1435def err_property_accessor_type : Error< 1436 "type of property %0 (%1) does not match type of accessor %2 (%3)">; 1437def err_ivar_in_superclass_use : Error< 1438 "property %0 attempting to use instance variable %1 declared in super class %2">; 1439def err_weak_property : Error< 1440 "existing instance variable %1 for __weak property %0 must be __weak">; 1441def err_strong_property : Error< 1442 "existing instance variable %1 for strong property %0 may not be __weak">; 1443def err_dynamic_property_ivar_decl : Error< 1444 "dynamic property cannot have instance variable specification">; 1445def err_duplicate_ivar_use : Error< 1446 "synthesized properties %0 and %1 both claim instance variable %2">; 1447def err_property_implemented : Error<"property %0 is already implemented">; 1448def warn_objc_missing_super_call : Warning< 1449 "method possibly missing a [super %0] call">, 1450 InGroup<ObjCMissingSuperCalls>; 1451def err_dealloc_bad_result_type : Error< 1452 "dealloc return type must be correctly specified as 'void' under ARC, " 1453 "instead of %0">; 1454def warn_undeclared_selector : Warning< 1455 "undeclared selector %0">, InGroup<UndeclaredSelector>, DefaultIgnore; 1456def warn_undeclared_selector_with_typo : Warning< 1457 "undeclared selector %0; did you mean %1?">, 1458 InGroup<UndeclaredSelector>, DefaultIgnore; 1459def warn_implicit_atomic_property : Warning< 1460 "property is assumed atomic by default">, InGroup<ImplicitAtomic>, DefaultIgnore; 1461def note_auto_readonly_iboutlet_fixup_suggest : Note< 1462 "property should be changed to be readwrite">; 1463def warn_auto_readonly_iboutlet_property : Warning< 1464 "readonly IBOutlet property %0 when auto-synthesized may " 1465 "not work correctly with 'nib' loader">, 1466 InGroup<DiagGroup<"readonly-iboutlet-property">>; 1467def warn_auto_implicit_atomic_property : Warning< 1468 "property is assumed atomic when auto-synthesizing the property">, 1469 InGroup<ImplicitAtomic>, DefaultIgnore; 1470def warn_unimplemented_selector: Warning< 1471 "no method with selector %0 is implemented in this translation unit">, 1472 InGroup<Selector>, DefaultIgnore; 1473def warn_unimplemented_protocol_method : Warning< 1474 "method %0 in protocol %1 not implemented">, InGroup<Protocol>; 1475def warn_multiple_selectors: Warning< 1476 "several methods with selector %0 of mismatched types are found " 1477 "for the @selector expression">, 1478 InGroup<SelectorTypeMismatch>, DefaultIgnore; 1479def err_direct_selector_expression : Error< 1480 "@selector expression formed with direct selector %0">; 1481def warn_potentially_direct_selector_expression : Warning< 1482 "@selector expression formed with potentially direct selector %0">, 1483 InGroup<ObjCPotentiallyDirectSelector>; 1484def warn_strict_potentially_direct_selector_expression : Warning< 1485 warn_potentially_direct_selector_expression.Text>, 1486 InGroup<ObjCStrictPotentiallyDirectSelector>, DefaultIgnore; 1487 1488def err_objc_kindof_nonobject : Error< 1489 "'__kindof' specifier cannot be applied to non-object type %0">; 1490def err_objc_kindof_wrong_position : Error< 1491 "'__kindof' type specifier must precede the declarator">; 1492 1493def err_objc_method_unsupported_param_ret_type : Error< 1494 "%0 %select{parameter|return}1 type is unsupported; " 1495 "support for vector types for this target is introduced in %2">; 1496 1497def warn_messaging_unqualified_id : Warning< 1498 "messaging unqualified id">, DefaultIgnore, 1499 InGroup<DiagGroup<"objc-messaging-id">>; 1500def err_messaging_unqualified_id_with_direct_method : Error< 1501 "messaging unqualified id with a method that is possibly direct">; 1502def err_messaging_super_with_direct_method : Error< 1503 "messaging super with a direct method">; 1504def err_messaging_class_with_direct_method : Error< 1505 "messaging a Class with a method that is possibly direct">; 1506 1507// C++ declarations 1508def err_static_assert_expression_is_not_constant : Error< 1509 "static_assert expression is not an integral constant expression">; 1510def err_constexpr_if_condition_expression_is_not_constant : Error< 1511 "constexpr if condition is not a constant expression">; 1512def err_static_assert_failed : Error<"static_assert failed%select{ %1|}0">; 1513def err_static_assert_requirement_failed : Error< 1514 "static_assert failed due to requirement '%0'%select{ %2|}1">; 1515 1516def warn_consteval_if_always_true : Warning< 1517 "consteval if is always true in an %select{unevaluated|immediate}0 context">, 1518 InGroup<DiagGroup<"redundant-consteval-if">>; 1519 1520def ext_inline_variable : ExtWarn< 1521 "inline variables are a C++17 extension">, InGroup<CXX17>; 1522def warn_cxx14_compat_inline_variable : Warning< 1523 "inline variables are incompatible with C++ standards before C++17">, 1524 DefaultIgnore, InGroup<CXXPre17Compat>; 1525 1526def warn_inline_namespace_reopened_noninline : Warning< 1527 "inline namespace reopened as a non-inline namespace">, 1528 InGroup<InlineNamespaceReopenedNoninline>; 1529def err_inline_namespace_mismatch : Error< 1530 "non-inline namespace cannot be reopened as inline">; 1531 1532def err_unexpected_friend : Error< 1533 "friends can only be classes or functions">; 1534def ext_enum_friend : ExtWarn< 1535 "befriending enumeration type %0 is a C++11 extension">, InGroup<CXX11>; 1536def warn_cxx98_compat_enum_friend : Warning< 1537 "befriending enumeration type %0 is incompatible with C++98">, 1538 InGroup<CXX98Compat>, DefaultIgnore; 1539def ext_nonclass_type_friend : ExtWarn< 1540 "non-class friend type %0 is a C++11 extension">, InGroup<CXX11>; 1541def warn_cxx98_compat_nonclass_type_friend : Warning< 1542 "non-class friend type %0 is incompatible with C++98">, 1543 InGroup<CXX98Compat>, DefaultIgnore; 1544def err_friend_is_member : Error< 1545 "friends cannot be members of the declaring class">; 1546def warn_cxx98_compat_friend_is_member : Warning< 1547 "friend declaration naming a member of the declaring class is incompatible " 1548 "with C++98">, InGroup<CXX98Compat>, DefaultIgnore; 1549def ext_unelaborated_friend_type : ExtWarn< 1550 "unelaborated friend declaration is a C++11 extension; specify " 1551 "'%select{struct|interface|union|class|enum}0' to befriend %1">, 1552 InGroup<CXX11>; 1553def warn_cxx98_compat_unelaborated_friend_type : Warning< 1554 "befriending %1 without '%select{struct|interface|union|class|enum}0' " 1555 "keyword is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore; 1556def err_qualified_friend_no_match : Error< 1557 "friend declaration of %0 does not match any declaration in %1">; 1558def err_introducing_special_friend : Error< 1559 "%plural{[0,2]:must use a qualified name when declaring|3:cannot declare}0" 1560 " a %select{constructor|destructor|conversion operator|deduction guide}0 " 1561 "as a friend">; 1562def err_tagless_friend_type_template : Error< 1563 "friend type templates must use an elaborated type">; 1564def err_no_matching_local_friend : Error< 1565 "no matching function found in local scope">; 1566def err_no_matching_local_friend_suggest : Error< 1567 "no matching function %0 found in local scope; did you mean %3?">; 1568def err_partial_specialization_friend : Error< 1569 "partial specialization cannot be declared as a friend">; 1570def err_qualified_friend_def : Error< 1571 "friend function definition cannot be qualified with '%0'">; 1572def err_friend_def_in_local_class : Error< 1573 "friend function cannot be defined in a local class">; 1574def err_friend_not_first_in_declaration : Error< 1575 "'friend' must appear first in a non-function declaration">; 1576def err_using_decl_friend : Error< 1577 "cannot befriend target of using declaration">; 1578def warn_template_qualified_friend_unsupported : Warning< 1579 "dependent nested name specifier '%0' for friend class declaration is " 1580 "not supported; turning off access control for %1">, 1581 InGroup<UnsupportedFriend>; 1582def warn_template_qualified_friend_ignored : Warning< 1583 "dependent nested name specifier '%0' for friend template declaration is " 1584 "not supported; ignoring this friend declaration">, 1585 InGroup<UnsupportedFriend>; 1586def ext_friend_tag_redecl_outside_namespace : ExtWarn< 1587 "unqualified friend declaration referring to type outside of the nearest " 1588 "enclosing namespace is a Microsoft extension; add a nested name specifier">, 1589 InGroup<MicrosoftUnqualifiedFriend>; 1590def err_pure_friend : Error<"friend declaration cannot have a pure-specifier">; 1591 1592def err_invalid_base_in_interface : Error< 1593 "interface type cannot inherit from " 1594 "%select{struct|non-public interface|class}0 %1">; 1595 1596def err_abstract_type_in_decl : Error< 1597 "%select{return|parameter|variable|field|instance variable|" 1598 "synthesized instance variable}0 type %1 is an abstract class">; 1599def err_allocation_of_abstract_type : Error< 1600 "allocating an object of abstract class type %0">; 1601def err_throw_abstract_type : Error< 1602 "cannot throw an object of abstract type %0">; 1603def err_array_of_abstract_type : Error<"array of abstract class type %0">; 1604def err_capture_of_abstract_type : Error< 1605 "by-copy capture of value of abstract type %0">; 1606def err_capture_of_incomplete_or_sizeless_type : Error< 1607 "by-copy capture of variable %0 with %select{incomplete|sizeless}1 type %2">; 1608def err_capture_default_non_local : Error< 1609 "non-local lambda expression cannot have a capture-default">; 1610 1611def err_multiple_final_overriders : Error< 1612 "virtual function %q0 has more than one final overrider in %1">; 1613def note_final_overrider : Note<"final overrider of %q0 in %1">; 1614 1615def err_type_defined_in_type_specifier : Error< 1616 "%0 cannot be defined in a type specifier">; 1617def err_type_defined_in_result_type : Error< 1618 "%0 cannot be defined in the result type of a function">; 1619def err_type_defined_in_param_type : Error< 1620 "%0 cannot be defined in a parameter type">; 1621def err_type_defined_in_alias_template : Error< 1622 "%0 cannot be defined in a type alias template">; 1623def err_type_defined_in_condition : Error< 1624 "%0 cannot be defined in a condition">; 1625def err_type_defined_in_enum : Error< 1626 "%0 cannot be defined in an enumeration">; 1627 1628def note_pure_virtual_function : Note< 1629 "unimplemented pure virtual method %0 in %1">; 1630 1631def note_pure_qualified_call_kext : Note< 1632 "qualified call to %0::%1 is treated as a virtual call to %1 due to -fapple-kext">; 1633 1634def err_deleted_decl_not_first : Error< 1635 "deleted definition must be first declaration">; 1636 1637def err_deleted_override : Error< 1638 "deleted function %0 cannot override a non-deleted function">; 1639def err_non_deleted_override : Error< 1640 "non-deleted function %0 cannot override a deleted function">; 1641def err_consteval_override : Error< 1642 "consteval function %0 cannot override a non-consteval function">; 1643def err_non_consteval_override : Error< 1644 "non-consteval function %0 cannot override a consteval function">; 1645 1646def warn_weak_vtable : Warning< 1647 "%0 has no out-of-line virtual method definitions; its vtable will be " 1648 "emitted in every translation unit">, 1649 InGroup<DiagGroup<"weak-vtables">>, DefaultIgnore; 1650def warn_weak_template_vtable : Warning< 1651 "this warning is no longer in use and will be removed in the next release">, 1652 InGroup<DiagGroup<"weak-template-vtables">>, DefaultIgnore; 1653 1654def ext_using_undefined_std : ExtWarn< 1655 "using directive refers to implicitly-defined namespace 'std'">; 1656 1657// C++ exception specifications 1658def err_exception_spec_in_typedef : Error< 1659 "exception specifications are not allowed in %select{typedefs|type aliases}0">; 1660def err_distant_exception_spec : Error< 1661 "exception specifications are not allowed beyond a single level " 1662 "of indirection">; 1663def err_incomplete_in_exception_spec : Error< 1664 "%select{|pointer to |reference to }0incomplete type %1 is not allowed " 1665 "in exception specification">; 1666def err_sizeless_in_exception_spec : Error< 1667 "%select{|reference to }0sizeless type %1 is not allowed " 1668 "in exception specification">; 1669def ext_incomplete_in_exception_spec : ExtWarn<err_incomplete_in_exception_spec.Text>, 1670 InGroup<MicrosoftExceptionSpec>; 1671def err_rref_in_exception_spec : Error< 1672 "rvalue reference type %0 is not allowed in exception specification">; 1673def err_mismatched_exception_spec : Error< 1674 "exception specification in declaration does not match previous declaration">; 1675def ext_mismatched_exception_spec : ExtWarn<err_mismatched_exception_spec.Text>, 1676 InGroup<MicrosoftExceptionSpec>; 1677def err_override_exception_spec : Error< 1678 "exception specification of overriding function is more lax than " 1679 "base version">; 1680def ext_override_exception_spec : ExtWarn<err_override_exception_spec.Text>, 1681 InGroup<MicrosoftExceptionSpec>; 1682def err_incompatible_exception_specs : Error< 1683 "target exception specification is not superset of source">; 1684def warn_incompatible_exception_specs : Warning< 1685 err_incompatible_exception_specs.Text>, InGroup<IncompatibleExceptionSpec>; 1686def err_deep_exception_specs_differ : Error< 1687 "exception specifications of %select{return|argument}0 types differ">; 1688def warn_deep_exception_specs_differ : Warning< 1689 err_deep_exception_specs_differ.Text>, InGroup<IncompatibleExceptionSpec>; 1690def err_missing_exception_specification : Error< 1691 "%0 is missing exception specification '%1'">; 1692def ext_missing_exception_specification : ExtWarn< 1693 err_missing_exception_specification.Text>, 1694 InGroup<DiagGroup<"missing-exception-spec">>; 1695def ext_ms_missing_exception_specification : ExtWarn< 1696 err_missing_exception_specification.Text>, 1697 InGroup<MicrosoftExceptionSpec>; 1698def err_noexcept_needs_constant_expression : Error< 1699 "argument to noexcept specifier must be a constant expression">; 1700def err_exception_spec_not_parsed : Error< 1701 "exception specification is not available until end of class definition">; 1702def err_exception_spec_cycle : Error< 1703 "exception specification of %0 uses itself">; 1704def err_exception_spec_incomplete_type : Error< 1705 "exception specification needed for member of incomplete class %0">; 1706def warn_wasm_dynamic_exception_spec_ignored : ExtWarn< 1707 "dynamic exception specifications with types are currently ignored in wasm">, 1708 InGroup<WebAssemblyExceptionSpec>; 1709 1710// C++ access checking 1711def err_class_redeclared_with_different_access : Error< 1712 "%0 redeclared with '%1' access">; 1713def err_access : Error< 1714 "%1 is a %select{private|protected}0 member of %3">, AccessControl; 1715def ext_ms_using_declaration_inaccessible : ExtWarn< 1716 "using declaration referring to inaccessible member '%0' (which refers " 1717 "to accessible member '%1') is a Microsoft compatibility extension">, 1718 AccessControl, InGroup<MicrosoftUsingDecl>; 1719def err_access_ctor : Error< 1720 "calling a %select{private|protected}0 constructor of class %2">, 1721 AccessControl; 1722def ext_rvalue_to_reference_access_ctor : Extension< 1723 "C++98 requires an accessible copy constructor for class %2 when binding " 1724 "a reference to a temporary; was %select{private|protected}0">, 1725 AccessControl, InGroup<BindToTemporaryCopy>; 1726def err_access_base_ctor : Error< 1727 // The ERRORs represent other special members that aren't constructors, in 1728 // hopes that someone will bother noticing and reporting if they appear 1729 "%select{base class|inherited virtual base class}0 %1 has %select{private|" 1730 "protected}3 %select{default |copy |move |*ERROR* |*ERROR* " 1731 "|*ERROR*|}2constructor">, AccessControl; 1732def err_access_field_ctor : Error< 1733 // The ERRORs represent other special members that aren't constructors, in 1734 // hopes that someone will bother noticing and reporting if they appear 1735 "field of type %0 has %select{private|protected}2 " 1736 "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}1constructor">, 1737 AccessControl; 1738def err_access_friend_function : Error< 1739 "friend function %1 is a %select{private|protected}0 member of %3">, 1740 AccessControl; 1741 1742def err_access_dtor : Error< 1743 "calling a %select{private|protected}1 destructor of class %0">, 1744 AccessControl; 1745def err_access_dtor_base : 1746 Error<"base class %0 has %select{private|protected}1 destructor">, 1747 AccessControl; 1748def err_access_dtor_vbase : 1749 Error<"inherited virtual base class %1 has " 1750 "%select{private|protected}2 destructor">, 1751 AccessControl; 1752def err_access_dtor_temp : 1753 Error<"temporary of type %0 has %select{private|protected}1 destructor">, 1754 AccessControl; 1755def err_access_dtor_exception : 1756 Error<"exception object of type %0 has %select{private|protected}1 " 1757 "destructor">, AccessControl; 1758def err_access_dtor_field : 1759 Error<"field of type %1 has %select{private|protected}2 destructor">, 1760 AccessControl; 1761def err_access_dtor_var : 1762 Error<"variable of type %1 has %select{private|protected}2 destructor">, 1763 AccessControl; 1764def err_access_dtor_ivar : 1765 Error<"instance variable of type %0 has %select{private|protected}1 " 1766 "destructor">, 1767 AccessControl; 1768def note_previous_access_declaration : Note< 1769 "previously declared '%1' here">; 1770def note_access_natural : Note< 1771 "%select{|implicitly }1declared %select{private|protected}0 here">; 1772def note_access_constrained_by_path : Note< 1773 "constrained by %select{|implicitly }1%select{private|protected}0" 1774 " inheritance here">; 1775def note_access_protected_restricted_noobject : Note< 1776 "must name member using the type of the current context %0">; 1777def note_access_protected_restricted_ctordtor : Note< 1778 "protected %select{constructor|destructor}0 can only be used to " 1779 "%select{construct|destroy}0 a base class subobject">; 1780def note_access_protected_restricted_object : Note< 1781 "can only access this member on an object of type %0">; 1782def warn_cxx98_compat_sfinae_access_control : Warning< 1783 "substitution failure due to access control is incompatible with C++98">, 1784 InGroup<CXX98Compat>, DefaultIgnore, NoSFINAE; 1785 1786// C++ name lookup 1787def err_incomplete_nested_name_spec : Error< 1788 "incomplete type %0 named in nested name specifier">; 1789def err_incomplete_enum : Error< 1790 "enumeration %0 is incomplete">; 1791def err_dependent_nested_name_spec : Error< 1792 "nested name specifier for a declaration cannot depend on a template " 1793 "parameter">; 1794def err_nested_name_member_ref_lookup_ambiguous : Error< 1795 "lookup of %0 in member access expression is ambiguous">; 1796def ext_nested_name_member_ref_lookup_ambiguous : ExtWarn< 1797 "lookup of %0 in member access expression is ambiguous; using member of %1">, 1798 InGroup<AmbigMemberTemplate>; 1799def note_ambig_member_ref_object_type : Note< 1800 "lookup in the object type %0 refers here">; 1801def note_ambig_member_ref_scope : Note< 1802 "lookup from the current scope refers here">; 1803def err_qualified_member_nonclass : Error< 1804 "qualified member access refers to a member in %0">; 1805def err_incomplete_member_access : Error< 1806 "member access into incomplete type %0">; 1807def err_incomplete_type : Error< 1808 "incomplete type %0 where a complete type is required">; 1809def warn_cxx98_compat_enum_nested_name_spec : Warning< 1810 "enumeration type in nested name specifier is incompatible with C++98">, 1811 InGroup<CXX98Compat>, DefaultIgnore; 1812def err_nested_name_spec_is_not_class : Error< 1813 "%0 cannot appear before '::' because it is not a class" 1814 "%select{ or namespace|, namespace, or enumeration}1; did you mean ':'?">; 1815def ext_nested_name_spec_is_enum : ExtWarn< 1816 "use of enumeration in a nested name specifier is a C++11 extension">, 1817 InGroup<CXX11>; 1818def err_out_of_line_qualified_id_type_names_constructor : Error< 1819 "qualified reference to %0 is a constructor name rather than a " 1820 "%select{template name|type}1 in this context">; 1821def ext_out_of_line_qualified_id_type_names_constructor : ExtWarn< 1822 "ISO C++ specifies that " 1823 "qualified reference to %0 is a constructor name rather than a " 1824 "%select{template name|type}1 in this context, despite preceding " 1825 "%select{'typename'|'template'}2 keyword">, SFINAEFailure, 1826 InGroup<DiagGroup<"injected-class-name">>; 1827 1828// C++ class members 1829def err_storageclass_invalid_for_member : Error< 1830 "storage class specified for a member declaration">; 1831def err_mutable_function : Error<"'mutable' cannot be applied to functions">; 1832def err_mutable_reference : Error<"'mutable' cannot be applied to references">; 1833def ext_mutable_reference : ExtWarn< 1834 "'mutable' on a reference type is a Microsoft extension">, 1835 InGroup<MicrosoftMutableReference>; 1836def err_mutable_const : Error<"'mutable' and 'const' cannot be mixed">; 1837def err_mutable_nonmember : Error< 1838 "'mutable' can only be applied to member variables">; 1839def err_virtual_in_union : Error< 1840 "unions cannot have virtual functions">; 1841def err_virtual_non_function : Error< 1842 "'virtual' can only appear on non-static member functions">; 1843def err_virtual_out_of_class : Error< 1844 "'virtual' can only be specified inside the class definition">; 1845def err_virtual_member_function_template : Error< 1846 "'virtual' cannot be specified on member function templates">; 1847def err_static_overrides_virtual : Error< 1848 "'static' member function %0 overrides a virtual function in a base class">; 1849def err_explicit_non_function : Error< 1850 "'explicit' can only appear on non-static member functions">; 1851def err_explicit_out_of_class : Error< 1852 "'explicit' can only be specified inside the class definition">; 1853def err_explicit_non_ctor_or_conv_function : Error< 1854 "'explicit' can only be applied to a constructor or conversion function">; 1855def err_static_not_bitfield : Error<"static member %0 cannot be a bit-field">; 1856def err_static_out_of_line : Error< 1857 "'static' can only be specified inside the class definition">; 1858def ext_static_out_of_line : ExtWarn< 1859 err_static_out_of_line.Text>, 1860 InGroup<MicrosoftTemplate>; 1861def err_storage_class_for_static_member : Error< 1862 "static data member definition cannot specify a storage class">; 1863def err_typedef_not_bitfield : Error<"typedef member %0 cannot be a bit-field">; 1864def err_not_integral_type_bitfield : Error< 1865 "bit-field %0 has non-integral type %1">; 1866def err_not_integral_type_anon_bitfield : Error< 1867 "anonymous bit-field has non-integral type %0">; 1868def err_anon_bitfield_qualifiers : Error< 1869 "anonymous bit-field cannot have qualifiers">; 1870def err_member_function_initialization : Error< 1871 "initializer on function does not look like a pure-specifier">; 1872def err_non_virtual_pure : Error< 1873 "%0 is not virtual and cannot be declared pure">; 1874def ext_pure_function_definition : ExtWarn< 1875 "function definition with pure-specifier is a Microsoft extension">, 1876 InGroup<MicrosoftPureDefinition>; 1877def err_qualified_member_of_unrelated : Error< 1878 "%q0 is not a member of class %1">; 1879 1880def err_member_function_call_bad_cvr : Error< 1881 "'this' argument to member function %0 has type %1, but function is not marked " 1882 "%select{const|restrict|const or restrict|volatile|const or volatile|" 1883 "volatile or restrict|const, volatile, or restrict}2">; 1884def err_member_function_call_bad_ref : Error< 1885 "'this' argument to member function %0 is an %select{lvalue|rvalue}1, " 1886 "but function has %select{non-const lvalue|rvalue}2 ref-qualifier">; 1887def err_member_function_call_bad_type : Error< 1888 "cannot initialize object parameter of type %0 with an expression " 1889 "of type %1">; 1890 1891def warn_call_to_pure_virtual_member_function_from_ctor_dtor : Warning< 1892 "call to pure virtual member function %0 has undefined behavior; " 1893 "overrides of %0 in subclasses are not available in the " 1894 "%select{constructor|destructor}1 of %2">, InGroup<PureVirtualCallFromCtorDtor>; 1895 1896def select_special_member_kind : TextSubstitution< 1897 "%select{default constructor|copy constructor|move constructor|" 1898 "copy assignment operator|move assignment operator|destructor}0">; 1899 1900def note_member_declared_at : Note<"member is declared here">; 1901def note_ivar_decl : Note<"instance variable is declared here">; 1902def note_bitfield_decl : Note<"bit-field is declared here">; 1903def note_implicit_param_decl : Note<"%0 is an implicit parameter">; 1904def note_member_synthesized_at : Note< 1905 "in %select{implicit|defaulted}0 %sub{select_special_member_kind}1 for %2 " 1906 "first required here">; 1907def note_comparison_synthesized_at : Note< 1908 "in defaulted %sub{select_defaulted_comparison_kind}0 for %1 " 1909 "first required here">; 1910def err_missing_default_ctor : Error< 1911 "%select{constructor for %1 must explicitly initialize the|" 1912 "implicit default constructor for %1 must explicitly initialize the|" 1913 "cannot use constructor inherited from base class %4;}0 " 1914 "%select{base class|member}2 %3 %select{which|which|of %1}0 " 1915 "does not have a default constructor">; 1916def note_due_to_dllexported_class : Note< 1917 "due to %0 being dllexported%select{|; try compiling in C++11 mode}1">; 1918 1919def err_illegal_union_or_anon_struct_member : Error< 1920 "%select{anonymous struct|union}0 member %1 has a non-trivial " 1921 "%sub{select_special_member_kind}2">; 1922 1923def warn_frame_address : Warning< 1924 "calling '%0' with a nonzero argument is unsafe">, 1925 InGroup<FrameAddress>, DefaultIgnore; 1926 1927def warn_cxx98_compat_nontrivial_union_or_anon_struct_member : Warning< 1928 "%select{anonymous struct|union}0 member %1 with a non-trivial " 1929 "%sub{select_special_member_kind}2 is incompatible with C++98">, 1930 InGroup<CXX98Compat>, DefaultIgnore; 1931 1932def note_nontrivial_virtual_dtor : Note< 1933 "destructor for %0 is not trivial because it is virtual">; 1934def note_nontrivial_has_virtual : Note< 1935 "because type %0 has a virtual %select{member function|base class}1">; 1936def note_nontrivial_no_def_ctor : Note< 1937 "because %select{base class of |field of |}0type %1 has no " 1938 "default constructor">; 1939def note_user_declared_ctor : Note< 1940 "implicit default constructor suppressed by user-declared constructor">; 1941def note_nontrivial_no_copy : Note< 1942 "because no %select{<<ERROR>>|constructor|constructor|assignment operator|" 1943 "assignment operator|<<ERROR>>}2 can be used to " 1944 "%select{<<ERROR>>|copy|move|copy|move|<<ERROR>>}2 " 1945 "%select{base class|field|an object}0 of type %3">; 1946def note_nontrivial_user_provided : Note< 1947 "because %select{base class of |field of |}0type %1 has a user-provided " 1948 "%sub{select_special_member_kind}2">; 1949def note_nontrivial_default_member_init : Note< 1950 "because field %0 has an initializer">; 1951def note_nontrivial_param_type : Note< 1952 "because its parameter is %diff{of type $, not $|of the wrong type}2,3">; 1953def note_nontrivial_default_arg : Note<"because it has a default argument">; 1954def note_nontrivial_variadic : Note<"because it is a variadic function">; 1955def note_nontrivial_subobject : Note< 1956 "because the function selected to %select{construct|copy|move|copy|move|" 1957 "destroy}2 %select{base class|field}0 of type %1 is not trivial">; 1958def note_nontrivial_objc_ownership : Note< 1959 "because type %0 has a member with %select{no|no|__strong|__weak|" 1960 "__autoreleasing}1 ownership">; 1961 1962/// Selector for a TagTypeKind value. 1963def select_tag_type_kind : TextSubstitution< 1964 "%select{struct|interface|union|class|enum}0">; 1965 1966def err_static_data_member_not_allowed_in_anon_struct : Error< 1967 "static data member %0 not allowed in anonymous " 1968 "%sub{select_tag_type_kind}1">; 1969def ext_static_data_member_in_union : ExtWarn< 1970 "static data member %0 in union is a C++11 extension">, InGroup<CXX11>; 1971def warn_cxx98_compat_static_data_member_in_union : Warning< 1972 "static data member %0 in union is incompatible with C++98">, 1973 InGroup<CXX98Compat>, DefaultIgnore; 1974def ext_union_member_of_reference_type : ExtWarn< 1975 "union member %0 has reference type %1, which is a Microsoft extension">, 1976 InGroup<MicrosoftUnionMemberReference>; 1977def err_union_member_of_reference_type : Error< 1978 "union member %0 has reference type %1">; 1979def ext_anonymous_struct_union_qualified : Extension< 1980 "anonymous %select{struct|union}0 cannot be '%1'">; 1981def err_different_return_type_for_overriding_virtual_function : Error< 1982 "virtual function %0 has a different return type " 1983 "%diff{($) than the function it overrides (which has return type $)|" 1984 "than the function it overrides}1,2">; 1985def note_overridden_virtual_function : Note< 1986 "overridden virtual function is here">; 1987def err_conflicting_overriding_cc_attributes : Error< 1988 "virtual function %0 has different calling convention attributes " 1989 "%diff{($) than the function it overrides (which has calling convention $)|" 1990 "than the function it overrides}1,2">; 1991def warn_overriding_method_missing_noescape : Warning< 1992 "parameter of overriding method should be annotated with " 1993 "__attribute__((noescape))">, InGroup<MissingNoEscape>; 1994def note_overridden_marked_noescape : Note< 1995 "parameter of overridden method is annotated with __attribute__((noescape))">; 1996def note_cat_conform_to_noescape_prot : Note< 1997 "%select{category|class extension}0 conforms to protocol %1 which defines method %2">; 1998 1999def err_covariant_return_inaccessible_base : Error< 2000 "invalid covariant return for virtual function: %1 is a " 2001 "%select{private|protected}2 base class of %0">, AccessControl; 2002def err_covariant_return_ambiguous_derived_to_base_conv : Error< 2003 "return type of virtual function %3 is not covariant with the return type of " 2004 "the function it overrides (ambiguous conversion from derived class " 2005 "%0 to base class %1:%2)">; 2006def err_covariant_return_not_derived : Error< 2007 "return type of virtual function %0 is not covariant with the return type of " 2008 "the function it overrides (%1 is not derived from %2)">; 2009def err_covariant_return_incomplete : Error< 2010 "return type of virtual function %0 is not covariant with the return type of " 2011 "the function it overrides (%1 is incomplete)">; 2012def err_covariant_return_type_different_qualifications : Error< 2013 "return type of virtual function %0 is not covariant with the return type of " 2014 "the function it overrides (%1 has different qualifiers than %2)">; 2015def err_covariant_return_type_class_type_more_qualified : Error< 2016 "return type of virtual function %0 is not covariant with the return type of " 2017 "the function it overrides (class type %1 is more qualified than class " 2018 "type %2">; 2019 2020// C++ implicit special member functions 2021def note_in_declaration_of_implicit_special_member : Note< 2022 "while declaring the implicit %sub{select_special_member_kind}1" 2023 " for %0">; 2024 2025// C++ constructors 2026def err_constructor_cannot_be : Error<"constructor cannot be declared '%0'">; 2027def err_invalid_qualified_constructor : Error< 2028 "'%0' qualifier is not allowed on a constructor">; 2029def err_ref_qualifier_constructor : Error< 2030 "ref-qualifier '%select{&&|&}0' is not allowed on a constructor">; 2031 2032def err_constructor_return_type : Error< 2033 "constructor cannot have a return type">; 2034def err_constructor_redeclared : Error<"constructor cannot be redeclared">; 2035def err_constructor_byvalue_arg : Error< 2036 "copy constructor must pass its first argument by reference">; 2037def warn_no_constructor_for_refconst : Warning< 2038 "%select{struct|interface|union|class|enum}0 %1 does not declare any " 2039 "constructor to initialize its non-modifiable members">; 2040def note_refconst_member_not_initialized : Note< 2041 "%select{const|reference}0 member %1 will never be initialized">; 2042def ext_ms_explicit_constructor_call : ExtWarn< 2043 "explicit constructor calls are a Microsoft extension">, 2044 InGroup<MicrosoftExplicitConstructorCall>; 2045 2046// C++ destructors 2047def err_destructor_not_member : Error< 2048 "destructor must be a non-static member function">; 2049def err_destructor_cannot_be : Error<"destructor cannot be declared '%0'">; 2050def err_invalid_qualified_destructor : Error< 2051 "'%0' qualifier is not allowed on a destructor">; 2052def err_ref_qualifier_destructor : Error< 2053 "ref-qualifier '%select{&&|&}0' is not allowed on a destructor">; 2054def err_destructor_return_type : Error<"destructor cannot have a return type">; 2055def err_destructor_redeclared : Error<"destructor cannot be redeclared">; 2056def err_destructor_with_params : Error<"destructor cannot have any parameters">; 2057def err_destructor_variadic : Error<"destructor cannot be variadic">; 2058def ext_destructor_typedef_name : ExtWarn< 2059 "destructor cannot be declared using a %select{typedef|type alias}1 %0 " 2060 "of the class name">, DefaultError, InGroup<DiagGroup<"dtor-typedef">>; 2061def err_undeclared_destructor_name : Error< 2062 "undeclared identifier %0 in destructor name">; 2063def err_destructor_name : Error< 2064 "expected the class name after '~' to name the enclosing class">; 2065def err_destructor_name_nontype : Error< 2066 "identifier %0 after '~' in destructor name does not name a type">; 2067def err_destructor_expr_mismatch : Error< 2068 "identifier %0 in object destruction expression does not name the type " 2069 "%1 of the object being destroyed">; 2070def err_destructor_expr_nontype : Error< 2071 "identifier %0 in object destruction expression does not name a type">; 2072def err_destructor_expr_type_mismatch : Error< 2073 "destructor type %0 in object destruction expression does not match the " 2074 "type %1 of the object being destroyed">; 2075def note_destructor_type_here : Note< 2076 "type %0 found by destructor name lookup">; 2077def note_destructor_nontype_here : Note< 2078 "non-type declaration found by destructor name lookup">; 2079def ext_dtor_named_in_wrong_scope : Extension< 2080 "ISO C++ requires the name after '::~' to be found in the same scope as " 2081 "the name before '::~'">, InGroup<DtorName>; 2082def ext_qualified_dtor_named_in_lexical_scope : ExtWarn< 2083 "qualified destructor name only found in lexical scope; omit the qualifier " 2084 "to find this type name by unqualified lookup">, InGroup<DtorName>; 2085def ext_dtor_name_ambiguous : Extension< 2086 "ISO C++ considers this destructor name lookup to be ambiguous">, 2087 InGroup<DtorName>; 2088 2089def err_destroy_attr_on_non_static_var : Error< 2090 "%select{no_destroy|always_destroy}0 attribute can only be applied to a" 2091 " variable with static or thread storage duration">; 2092 2093def err_destructor_template : Error< 2094 "destructor cannot be declared as a template">; 2095 2096// C++ initialization 2097def err_init_conversion_failed : Error< 2098 "cannot initialize %select{a variable|a parameter|template parameter|" 2099 "return object|statement expression result|an " 2100 "exception object|a member subobject|an array element|a new value|a value|a " 2101 "base class|a constructor delegation|a vector element|a block element|a " 2102 "block element|a complex element|a lambda capture|a compound literal " 2103 "initializer|a related result|a parameter of CF audited function}0 " 2104 "%diff{of type $ with an %select{rvalue|lvalue}2 of type $|" 2105 "with an %select{rvalue|lvalue}2 of incompatible type}1,3" 2106 "%select{|: different classes%diff{ ($ vs $)|}5,6" 2107 "|: different number of parameters (%5 vs %6)" 2108 "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7" 2109 "|: different return type%diff{ ($ vs $)|}5,6" 2110 "|: different qualifiers (%5 vs %6)" 2111 "|: different exception specifications}4">; 2112def note_forward_class_conversion : Note<"%0 is not defined, but forward " 2113 "declared here; conversion would be valid if it was derived from %1">; 2114 2115def err_lvalue_to_rvalue_ref : Error<"rvalue reference %diff{to type $ cannot " 2116 "bind to lvalue of type $|cannot bind to incompatible lvalue}0,1">; 2117def err_lvalue_reference_bind_to_initlist : Error< 2118 "%select{non-const|volatile}0 lvalue reference to type %1 cannot bind to an " 2119 "initializer list temporary">; 2120def err_lvalue_reference_bind_to_temporary : Error< 2121 "%select{non-const|volatile}0 lvalue reference %diff{to type $ cannot bind " 2122 "to a temporary of type $|cannot bind to incompatible temporary}1,2">; 2123def err_lvalue_reference_bind_to_unrelated : Error< 2124 "%select{non-const|volatile}0 lvalue reference " 2125 "%diff{to type $ cannot bind to a value of unrelated type $|" 2126 "cannot bind to a value of unrelated type}1,2">; 2127def err_reference_bind_drops_quals : Error< 2128 "binding reference %diff{of type $ to value of type $|to value}0,1 " 2129 "%select{drops %3 qualifier%plural{1:|2:|4:|:s}4|changes address space|" 2130 "not permitted due to incompatible qualifiers}2">; 2131def err_reference_bind_failed : Error< 2132 "reference %diff{to %select{type|incomplete type}1 $ could not bind to an " 2133 "%select{rvalue|lvalue}2 of type $|could not bind to %select{rvalue|lvalue}2 of " 2134 "incompatible type}0,3">; 2135def err_reference_bind_temporary_addrspace : Error< 2136 "reference of type %0 cannot bind to a temporary object because of " 2137 "address space mismatch">; 2138def err_reference_bind_init_list : Error< 2139 "reference to type %0 cannot bind to an initializer list">; 2140def err_init_list_bad_dest_type : Error< 2141 "%select{|non-aggregate }0type %1 cannot be initialized with an initializer " 2142 "list">; 2143def warn_cxx20_compat_aggregate_init_with_ctors : Warning< 2144 "aggregate initialization of type %0 with user-declared constructors " 2145 "is incompatible with C++20">, DefaultIgnore, InGroup<CXX20Compat>; 2146 2147def err_reference_bind_to_bitfield : Error< 2148 "%select{non-const|volatile}0 reference cannot bind to " 2149 "bit-field%select{| %1}2">; 2150def err_reference_bind_to_vector_element : Error< 2151 "%select{non-const|volatile}0 reference cannot bind to vector element">; 2152def err_reference_bind_to_matrix_element : Error< 2153 "%select{non-const|volatile}0 reference cannot bind to matrix element">; 2154def err_reference_var_requires_init : Error< 2155 "declaration of reference variable %0 requires an initializer">; 2156def err_reference_without_init : Error< 2157 "reference to type %0 requires an initializer">; 2158def note_value_initialization_here : Note< 2159 "in value-initialization of type %0 here">; 2160def err_reference_has_multiple_inits : Error< 2161 "reference cannot be initialized with multiple values">; 2162def err_init_non_aggr_init_list : Error< 2163 "initialization of non-aggregate type %0 with an initializer list">; 2164def err_init_reference_member_uninitialized : Error< 2165 "reference member of type %0 uninitialized">; 2166def note_uninit_reference_member : Note< 2167 "uninitialized reference member is here">; 2168def warn_field_is_uninit : Warning<"field %0 is uninitialized when used here">, 2169 InGroup<Uninitialized>; 2170def warn_base_class_is_uninit : Warning< 2171 "base class %0 is uninitialized when used here to access %q1">, 2172 InGroup<Uninitialized>; 2173def warn_reference_field_is_uninit : Warning< 2174 "reference %0 is not yet bound to a value when used here">, 2175 InGroup<Uninitialized>; 2176def note_uninit_in_this_constructor : Note< 2177 "during field initialization in %select{this|the implicit default}0 " 2178 "constructor">; 2179def warn_static_self_reference_in_init : Warning< 2180 "static variable %0 is suspiciously used within its own initialization">, 2181 InGroup<UninitializedStaticSelfInit>; 2182def warn_uninit_self_reference_in_init : Warning< 2183 "variable %0 is uninitialized when used within its own initialization">, 2184 InGroup<Uninitialized>; 2185def warn_uninit_self_reference_in_reference_init : Warning< 2186 "reference %0 is not yet bound to a value when used within its own" 2187 " initialization">, 2188 InGroup<Uninitialized>; 2189def warn_uninit_var : Warning< 2190 "variable %0 is uninitialized when %select{used here|captured by block}1">, 2191 InGroup<Uninitialized>, DefaultIgnore; 2192def warn_sometimes_uninit_var : Warning< 2193 "variable %0 is %select{used|captured}1 uninitialized whenever " 2194 "%select{'%3' condition is %select{true|false}4|" 2195 "'%3' loop %select{is entered|exits because its condition is false}4|" 2196 "'%3' loop %select{condition is true|exits because its condition is false}4|" 2197 "switch %3 is taken|" 2198 "its declaration is reached|" 2199 "%3 is called}2">, 2200 InGroup<UninitializedSometimes>, DefaultIgnore; 2201def warn_maybe_uninit_var : Warning< 2202 "variable %0 may be uninitialized when " 2203 "%select{used here|captured by block}1">, 2204 InGroup<UninitializedMaybe>, DefaultIgnore; 2205def note_var_declared_here : Note<"variable %0 is declared here">; 2206def note_uninit_var_use : Note< 2207 "%select{uninitialized use occurs|variable is captured by block}0 here">; 2208def warn_uninit_byref_blockvar_captured_by_block : Warning< 2209 "block pointer variable %0 is %select{uninitialized|null}1 when captured by " 2210 "block">, InGroup<Uninitialized>, DefaultIgnore; 2211def note_block_var_fixit_add_initialization : Note< 2212 "did you mean to use __block %0?">; 2213def note_in_omitted_aggregate_initializer : Note< 2214 "in implicit initialization of %select{" 2215 "array element %1 with omitted initializer|" 2216 "field %1 with omitted initializer|" 2217 "trailing array elements in runtime-sized array new}0">; 2218def note_in_reference_temporary_list_initializer : Note< 2219 "in initialization of temporary of type %0 created to " 2220 "list-initialize this reference">; 2221def note_var_fixit_add_initialization : Note< 2222 "initialize the variable %0 to silence this warning">; 2223def note_uninit_fixit_remove_cond : Note< 2224 "remove the %select{'%1' if its condition|condition if it}0 " 2225 "is always %select{false|true}2">; 2226def err_init_incomplete_type : Error<"initialization of incomplete type %0">; 2227def err_list_init_in_parens : Error< 2228 "cannot initialize %select{non-class|reference}0 type %1 with a " 2229 "parenthesized initializer list">; 2230 2231def warn_uninit_const_reference : Warning< 2232 "variable %0 is uninitialized when passed as a const reference argument " 2233 "here">, InGroup<UninitializedConstReference>, DefaultIgnore; 2234 2235def warn_unsequenced_mod_mod : Warning< 2236 "multiple unsequenced modifications to %0">, InGroup<Unsequenced>; 2237def warn_unsequenced_mod_use : Warning< 2238 "unsequenced modification and access to %0">, InGroup<Unsequenced>; 2239 2240def select_initialized_entity_kind : TextSubstitution< 2241 "%select{copying variable|copying parameter|initializing template parameter|" 2242 "returning object|initializing statement expression result|" 2243 "throwing object|copying member subobject|copying array element|" 2244 "allocating object|copying temporary|initializing base subobject|" 2245 "initializing vector element|capturing value}0">; 2246 2247def err_temp_copy_no_viable : Error< 2248 "no viable constructor %sub{select_initialized_entity_kind}0 of type %1">; 2249def ext_rvalue_to_reference_temp_copy_no_viable : Extension< 2250 "no viable constructor %sub{select_initialized_entity_kind}0 of type %1; " 2251 "C++98 requires a copy constructor when binding a reference to a temporary">, 2252 InGroup<BindToTemporaryCopy>; 2253def err_temp_copy_ambiguous : Error< 2254 "ambiguous constructor call when %sub{select_initialized_entity_kind}0 " 2255 "of type %1">; 2256def err_temp_copy_deleted : Error< 2257 "%sub{select_initialized_entity_kind}0 of type %1 " 2258 "invokes deleted constructor">; 2259def err_temp_copy_incomplete : Error< 2260 "copying a temporary object of incomplete type %0">; 2261def warn_cxx98_compat_temp_copy : Warning< 2262 "%sub{select_initialized_entity_kind}1 " 2263 "of type %2 when binding a reference to a temporary would %select{invoke " 2264 "an inaccessible constructor|find no viable constructor|find ambiguous " 2265 "constructors|invoke a deleted constructor}0 in C++98">, 2266 InGroup<CXX98CompatBindToTemporaryCopy>, DefaultIgnore; 2267def err_selected_explicit_constructor : Error< 2268 "chosen constructor is explicit in copy-initialization">; 2269def note_explicit_ctor_deduction_guide_here : Note< 2270 "explicit %select{constructor|deduction guide}0 declared here">; 2271 2272// C++11 decltype 2273def err_decltype_in_declarator : Error< 2274 "'decltype' cannot be used to name a declaration">; 2275 2276// C++11 auto 2277def warn_cxx98_compat_auto_type_specifier : Warning< 2278 "'auto' type specifier is incompatible with C++98">, 2279 InGroup<CXX98Compat>, DefaultIgnore; 2280def err_auto_variable_cannot_appear_in_own_initializer : Error< 2281 "variable %0 declared with deduced type %1 " 2282 "cannot appear in its own initializer">; 2283def err_binding_cannot_appear_in_own_initializer : Error< 2284 "binding %0 cannot appear in the initializer of its own " 2285 "decomposition declaration">; 2286def err_illegal_decl_array_of_auto : Error< 2287 "'%0' declared as array of %1">; 2288def err_new_array_of_auto : Error< 2289 "cannot allocate array of 'auto'">; 2290def err_auto_not_allowed : Error< 2291 "%select{'auto'|'decltype(auto)'|'__auto_type'|" 2292 "use of " 2293 "%select{class template|function template|variable template|alias template|" 2294 "template template parameter|concept|template}2 %3 requires template " 2295 "arguments; argument deduction}0 not allowed " 2296 "%select{in function prototype" 2297 "|in non-static struct member|in struct member" 2298 "|in non-static union member|in union member" 2299 "|in non-static class member|in interface member" 2300 "|in exception declaration|in template parameter until C++17|in block literal" 2301 "|in template argument|in typedef|in type alias|in function return type" 2302 "|in conversion function type|here|in lambda parameter" 2303 "|in type allocated by 'new'|in K&R-style function parameter" 2304 "|in template parameter|in friend declaration|in function prototype that is " 2305 "not a function declaration|in requires expression parameter}1">; 2306def err_dependent_deduced_tst : Error< 2307 "typename specifier refers to " 2308 "%select{class template|function template|variable template|alias template|" 2309 "template template parameter|template}0 member in %1; " 2310 "argument deduction not allowed here">; 2311def err_deduced_tst : Error< 2312 "typename specifier refers to " 2313 "%select{class template|function template|variable template|alias template|" 2314 "template template parameter|template}0; argument deduction not allowed " 2315 "here">; 2316def err_auto_not_allowed_var_inst : Error< 2317 "'auto' variable template instantiation is not allowed">; 2318def err_auto_var_requires_init : Error< 2319 "declaration of variable %0 with deduced type %1 requires an initializer">; 2320def err_auto_new_requires_ctor_arg : Error< 2321 "new expression for type %0 requires a constructor argument">; 2322def ext_auto_new_list_init : Extension< 2323 "ISO C++ standards before C++17 do not allow new expression for " 2324 "type %0 to use list-initialization">, InGroup<CXX17>; 2325def err_auto_var_init_no_expression : Error< 2326 "initializer for variable %0 with type %1 is empty">; 2327def err_auto_var_init_multiple_expressions : Error< 2328 "initializer for variable %0 with type %1 contains multiple expressions">; 2329def err_auto_var_init_paren_braces : Error< 2330 "cannot deduce type for variable %1 with type %2 from " 2331 "%select{parenthesized|nested}0 initializer list">; 2332def err_auto_new_ctor_multiple_expressions : Error< 2333 "new expression for type %0 contains multiple constructor arguments">; 2334def err_auto_missing_trailing_return : Error< 2335 "'auto' return without trailing return type; deduced return types are a " 2336 "C++14 extension">; 2337def err_deduced_return_type : Error< 2338 "deduced return types are a C++14 extension">; 2339def err_trailing_return_without_auto : Error< 2340 "function with trailing return type must specify return type 'auto', not %0">; 2341def err_trailing_return_in_parens : Error< 2342 "trailing return type may not be nested within parentheses">; 2343def err_auto_var_deduction_failure : Error< 2344 "variable %0 with type %1 has incompatible initializer of type %2">; 2345def err_auto_var_deduction_failure_from_init_list : Error< 2346 "cannot deduce actual type for variable %0 with type %1 from initializer list">; 2347def err_auto_new_deduction_failure : Error< 2348 "new expression for type %0 has incompatible constructor argument of type %1">; 2349def err_auto_inconsistent_deduction : Error< 2350 "deduced conflicting types %diff{($ vs $) |}0,1" 2351 "for initializer list element type">; 2352def err_auto_different_deductions : Error< 2353 "%select{'auto'|'decltype(auto)'|'__auto_type'|template arguments}0 " 2354 "deduced as %1 in declaration of %2 and " 2355 "deduced as %3 in declaration of %4">; 2356def err_auto_non_deduced_not_alone : Error< 2357 "%select{function with deduced return type|" 2358 "declaration with trailing return type}0 " 2359 "must be the only declaration in its group">; 2360def err_implied_std_initializer_list_not_found : Error< 2361 "cannot deduce type of initializer list because std::initializer_list was " 2362 "not found; include <initializer_list>">; 2363def err_malformed_std_initializer_list : Error< 2364 "std::initializer_list must be a class template with a single type parameter">; 2365def err_auto_init_list_from_c : Error< 2366 "cannot use __auto_type with initializer list in C">; 2367def err_auto_bitfield : Error< 2368 "cannot pass bit-field as __auto_type initializer in C">; 2369 2370// C++1y decltype(auto) type 2371def err_decltype_auto_invalid : Error< 2372 "'decltype(auto)' not allowed here">; 2373def err_decltype_auto_cannot_be_combined : Error< 2374 "'decltype(auto)' cannot be combined with other type specifiers">; 2375def err_decltype_auto_function_declarator_not_declaration : Error< 2376 "'decltype(auto)' can only be used as a return type " 2377 "in a function declaration">; 2378def err_decltype_auto_compound_type : Error< 2379 "cannot form %select{pointer to|reference to|array of}0 'decltype(auto)'">; 2380def err_decltype_auto_initializer_list : Error< 2381 "cannot deduce 'decltype(auto)' from initializer list">; 2382 2383// C++17 deduced class template specialization types 2384def err_deduced_class_template_compound_type : Error< 2385 "cannot %select{form pointer to|form reference to|form array of|" 2386 "form function returning|use parentheses when declaring variable with}0 " 2387 "deduced class template specialization type">; 2388def err_deduced_non_class_template_specialization_type : Error< 2389 "%select{<error>|function template|variable template|alias template|" 2390 "template template parameter|concept|template}0 %1 requires template " 2391 "arguments; argument deduction only allowed for class templates">; 2392def err_deduced_class_template_ctor_ambiguous : Error< 2393 "ambiguous deduction for template arguments of %0">; 2394def err_deduced_class_template_ctor_no_viable : Error< 2395 "no viable constructor or deduction guide for deduction of " 2396 "template arguments of %0">; 2397def err_deduced_class_template_incomplete : Error< 2398 "template %0 has no definition and no %select{|viable }1deduction guides " 2399 "for deduction of template arguments">; 2400def err_deduced_class_template_deleted : Error< 2401 "class template argument deduction for %0 selected a deleted constructor">; 2402def err_deduced_class_template_explicit : Error< 2403 "class template argument deduction for %0 selected an explicit " 2404 "%select{constructor|deduction guide}1 for copy-list-initialization">; 2405def err_deduction_guide_no_trailing_return_type : Error< 2406 "deduction guide declaration without trailing return type">; 2407def err_deduction_guide_bad_trailing_return_type : Error< 2408 "deduced type %1 of deduction guide is not %select{|written as }2" 2409 "a specialization of template %0">; 2410def err_deduction_guide_with_complex_decl : Error< 2411 "cannot specify any part of a return type in the " 2412 "declaration of a deduction guide">; 2413def err_deduction_guide_invalid_specifier : Error< 2414 "deduction guide cannot be declared '%0'">; 2415def err_deduction_guide_name_not_class_template : Error< 2416 "cannot specify deduction guide for " 2417 "%select{<error>|function template|variable template|alias template|" 2418 "template template parameter|concept|dependent template name}0 %1">; 2419def err_deduction_guide_wrong_scope : Error< 2420 "deduction guide must be declared in the same scope as template %q0">; 2421def err_deduction_guide_defines_function : Error< 2422 "deduction guide cannot have a function definition">; 2423def err_deduction_guide_redeclared : Error< 2424 "redeclaration of deduction guide">; 2425def err_deduction_guide_specialized : Error<"deduction guide cannot be " 2426 "%select{explicitly instantiated|explicitly specialized}0">; 2427def err_deduction_guide_template_not_deducible : Error< 2428 "deduction guide template contains " 2429 "%select{a template parameter|template parameters}0 that cannot be " 2430 "deduced">; 2431def err_deduction_guide_wrong_access : Error< 2432 "deduction guide has different access from the corresponding " 2433 "member template">; 2434def note_deduction_guide_template_access : Note< 2435 "member template declared %0 here">; 2436def note_deduction_guide_access : Note< 2437 "deduction guide declared %0 by intervening access specifier">; 2438def warn_cxx14_compat_class_template_argument_deduction : Warning< 2439 "class template argument deduction is incompatible with C++ standards " 2440 "before C++17%select{|; for compatibility, use explicit type name %1}0">, 2441 InGroup<CXXPre17Compat>, DefaultIgnore; 2442def warn_ctad_maybe_unsupported : Warning< 2443 "%0 may not intend to support class template argument deduction">, 2444 InGroup<CTADMaybeUnsupported>, DefaultIgnore; 2445def note_suppress_ctad_maybe_unsupported : Note< 2446 "add a deduction guide to suppress this warning">; 2447 2448 2449// C++14 deduced return types 2450def err_auto_fn_deduction_failure : Error< 2451 "cannot deduce return type %0 from returned value of type %1">; 2452def err_auto_fn_different_deductions : Error< 2453 "'%select{auto|decltype(auto)}0' in return type deduced as %1 here but " 2454 "deduced as %2 in earlier return statement">; 2455def err_auto_fn_used_before_defined : Error< 2456 "function %0 with deduced return type cannot be used before it is defined">; 2457def err_auto_fn_no_return_but_not_auto : Error< 2458 "cannot deduce return type %0 for function with no return statements">; 2459def err_auto_fn_return_void_but_not_auto : Error< 2460 "cannot deduce return type %0 from omitted return expression">; 2461def err_auto_fn_return_init_list : Error< 2462 "cannot deduce return type from initializer list">; 2463def err_auto_fn_virtual : Error< 2464 "function with deduced return type cannot be virtual">; 2465def warn_cxx11_compat_deduced_return_type : Warning< 2466 "return type deduction is incompatible with C++ standards before C++14">, 2467 InGroup<CXXPre14Compat>, DefaultIgnore; 2468 2469// C++11 override control 2470def override_keyword_only_allowed_on_virtual_member_functions : Error< 2471 "only virtual member functions can be marked '%0'">; 2472def override_keyword_hides_virtual_member_function : Error< 2473 "non-virtual member function marked '%0' hides virtual member " 2474 "%select{function|functions}1">; 2475def err_function_marked_override_not_overriding : Error< 2476 "%0 marked 'override' but does not override any member functions">; 2477def warn_destructor_marked_not_override_overriding : TextSubstitution < 2478 "%0 overrides a destructor but is not marked 'override'">; 2479def warn_function_marked_not_override_overriding : TextSubstitution < 2480 "%0 overrides a member function but is not marked 'override'">; 2481def warn_inconsistent_destructor_marked_not_override_overriding : Warning < 2482 "%sub{warn_destructor_marked_not_override_overriding}0">, 2483 InGroup<CXX11WarnInconsistentOverrideDestructor>, DefaultIgnore; 2484def warn_inconsistent_function_marked_not_override_overriding : Warning < 2485 "%sub{warn_function_marked_not_override_overriding}0">, 2486 InGroup<CXX11WarnInconsistentOverrideMethod>; 2487def warn_suggest_destructor_marked_not_override_overriding : Warning < 2488 "%sub{warn_destructor_marked_not_override_overriding}0">, 2489 InGroup<CXX11WarnSuggestOverrideDestructor>, DefaultIgnore; 2490def warn_suggest_function_marked_not_override_overriding : Warning < 2491 "%sub{warn_function_marked_not_override_overriding}0">, 2492 InGroup<CXX11WarnSuggestOverride>, DefaultIgnore; 2493def err_class_marked_final_used_as_base : Error< 2494 "base %0 is marked '%select{final|sealed}1'">; 2495def warn_abstract_final_class : Warning< 2496 "abstract class is marked '%select{final|sealed}0'">, InGroup<AbstractFinalClass>; 2497def warn_final_dtor_non_final_class : Warning< 2498 "class with destructor marked '%select{final|sealed}0' cannot be inherited from">, 2499 InGroup<FinalDtorNonFinalClass>; 2500def note_final_dtor_non_final_class_silence : Note< 2501 "mark %0 as '%select{final|sealed}1' to silence this warning">; 2502 2503// C++11 attributes 2504def err_repeat_attribute : Error<"%0 attribute cannot be repeated">; 2505 2506// C++11 final 2507def err_final_function_overridden : Error< 2508 "declaration of %0 overrides a '%select{final|sealed}1' function">; 2509 2510// C++11 scoped enumerations 2511def err_enum_invalid_underlying : Error< 2512 "non-integral type %0 is an invalid underlying type">; 2513def err_enumerator_too_large : Error< 2514 "enumerator value is not representable in the underlying type %0">; 2515def ext_enumerator_too_large : Extension< 2516 "enumerator value is not representable in the underlying type %0">, 2517 InGroup<MicrosoftEnumValue>; 2518def err_enumerator_wrapped : Error< 2519 "enumerator value %0 is not representable in the underlying type %1">; 2520def err_enum_redeclare_type_mismatch : Error< 2521 "enumeration redeclared with different underlying type %0 (was %1)">; 2522def err_enum_redeclare_fixed_mismatch : Error< 2523 "enumeration previously declared with %select{non|}0fixed underlying type">; 2524def err_enum_redeclare_scoped_mismatch : Error< 2525 "enumeration previously declared as %select{un|}0scoped">; 2526def err_only_enums_have_underlying_types : Error< 2527 "only enumeration types have underlying types">; 2528def err_underlying_type_of_incomplete_enum : Error< 2529 "cannot determine underlying type of incomplete enumeration type %0">; 2530 2531// C++11 delegating constructors 2532def err_delegating_ctor : Error< 2533 "delegating constructors are permitted only in C++11">; 2534def warn_cxx98_compat_delegating_ctor : Warning< 2535 "delegating constructors are incompatible with C++98">, 2536 InGroup<CXX98Compat>, DefaultIgnore; 2537def err_delegating_initializer_alone : Error< 2538 "an initializer for a delegating constructor must appear alone">; 2539def warn_delegating_ctor_cycle : Warning< 2540 "constructor for %0 creates a delegation cycle">, DefaultError, 2541 InGroup<DelegatingCtorCycles>; 2542def note_it_delegates_to : Note<"it delegates to">; 2543def note_which_delegates_to : Note<"which delegates to">; 2544 2545// C++11 range-based for loop 2546def err_for_range_decl_must_be_var : Error< 2547 "for range declaration must declare a variable">; 2548def err_for_range_storage_class : Error< 2549 "loop variable %0 may not be declared %select{'extern'|'static'|" 2550 "'__private_extern__'|'auto'|'register'|'constexpr'|'thread_local'}1">; 2551def err_type_defined_in_for_range : Error< 2552 "types may not be defined in a for range declaration">; 2553def err_for_range_deduction_failure : Error< 2554 "cannot use type %0 as a range">; 2555def err_for_range_incomplete_type : Error< 2556 "cannot use incomplete type %0 as a range">; 2557def err_for_range_iter_deduction_failure : Error< 2558 "cannot use type %0 as an iterator">; 2559def ext_for_range_begin_end_types_differ : ExtWarn< 2560 "'begin' and 'end' returning different types (%0 and %1) is a C++17 extension">, 2561 InGroup<CXX17>; 2562def warn_for_range_begin_end_types_differ : Warning< 2563 "'begin' and 'end' returning different types (%0 and %1) is incompatible " 2564 "with C++ standards before C++17">, InGroup<CXXPre17Compat>, DefaultIgnore; 2565def note_in_for_range: Note< 2566 "when looking up '%select{begin|end}0' function for range expression " 2567 "of type %1">; 2568def err_for_range_invalid: Error< 2569 "invalid range expression of type %0; no viable '%select{begin|end}1' " 2570 "function available">; 2571def note_for_range_member_begin_end_ignored : Note< 2572 "member is not a candidate because range type %0 has no '%select{end|begin}1' member">; 2573def err_range_on_array_parameter : Error< 2574 "cannot build range expression with array function parameter %0 since " 2575 "parameter with array type %1 is treated as pointer type %2">; 2576def err_for_range_dereference : Error< 2577 "invalid range expression of type %0; did you mean to dereference it " 2578 "with '*'?">; 2579def note_for_range_invalid_iterator : Note < 2580 "in implicit call to 'operator%select{!=|*|++}0' for iterator of type %1">; 2581def note_for_range_begin_end : Note< 2582 "selected '%select{begin|end}0' %select{function|template }1%2 with iterator type %3">; 2583def warn_for_range_const_ref_binds_temp_built_from_ref : Warning< 2584 "loop variable %0 " 2585 "%diff{of type $ binds to a temporary constructed from type $" 2586 "|binds to a temporary constructed from a different type}1,2">, 2587 InGroup<RangeLoopConstruct>, DefaultIgnore; 2588def note_use_type_or_non_reference : Note< 2589 "use non-reference type %0 to make construction explicit or type %1 to prevent copying">; 2590def warn_for_range_ref_binds_ret_temp : Warning< 2591 "loop variable %0 binds to a temporary value produced by a range of type %1">, 2592 InGroup<RangeLoopBindReference>, DefaultIgnore; 2593def note_use_non_reference_type : Note<"use non-reference type %0">; 2594def warn_for_range_copy : Warning< 2595 "loop variable %0 creates a copy from type %1">, 2596 InGroup<RangeLoopConstruct>, DefaultIgnore; 2597def note_use_reference_type : Note<"use reference type %0 to prevent copying">; 2598def err_objc_for_range_init_stmt : Error< 2599 "initialization statement is not supported when iterating over Objective-C " 2600 "collection">; 2601 2602// C++11 constexpr 2603def warn_cxx98_compat_constexpr : Warning< 2604 "'constexpr' specifier is incompatible with C++98">, 2605 InGroup<CXX98Compat>, DefaultIgnore; 2606// FIXME: Maybe this should also go in -Wc++14-compat? 2607def warn_cxx14_compat_constexpr_not_const : Warning< 2608 "'constexpr' non-static member function will not be implicitly 'const' " 2609 "in C++14; add 'const' to avoid a change in behavior">, 2610 InGroup<DiagGroup<"constexpr-not-const">>; 2611def err_invalid_consteval_take_address : Error< 2612 "cannot take address of consteval function %0 outside" 2613 " of an immediate invocation">; 2614def err_invalid_consteval_call : Error< 2615 "call to consteval function %q0 is not a constant expression">; 2616def err_invalid_consteval_decl_kind : Error< 2617 "%0 cannot be declared consteval">; 2618def err_invalid_constexpr : Error< 2619 "%select{function parameter|typedef}0 " 2620 "cannot be %sub{select_constexpr_spec_kind}1">; 2621def err_invalid_constexpr_member : Error<"non-static data member cannot be " 2622 "constexpr%select{; did you intend to make it %select{const|static}0?|}1">; 2623def err_constexpr_tag : Error< 2624 "%select{class|struct|interface|union|enum}0 " 2625 "cannot be marked %sub{select_constexpr_spec_kind}1">; 2626def err_constexpr_dtor : Error< 2627 "destructor cannot be declared %sub{select_constexpr_spec_kind}0">; 2628def err_constexpr_dtor_subobject : Error< 2629 "destructor cannot be declared %sub{select_constexpr_spec_kind}0 because " 2630 "%select{data member %2|base class %3}1 does not have a " 2631 "constexpr destructor">; 2632def note_constexpr_dtor_subobject : Note< 2633 "%select{data member %1|base class %2}0 declared here">; 2634def err_constexpr_wrong_decl_kind : Error< 2635 "%sub{select_constexpr_spec_kind}0 can only be used " 2636 "in %select{|variable and function|function|variable}0 declarations">; 2637def err_invalid_constexpr_var_decl : Error< 2638 "constexpr variable declaration must be a definition">; 2639def err_constexpr_static_mem_var_requires_init : Error< 2640 "declaration of constexpr static data member %0 requires an initializer">; 2641def err_constexpr_var_non_literal : Error< 2642 "constexpr variable cannot have non-literal type %0">; 2643def err_constexpr_var_requires_const_init : Error< 2644 "constexpr variable %0 must be initialized by a constant expression">; 2645def err_constexpr_var_requires_const_destruction : Error< 2646 "constexpr variable %0 must have constant destruction">; 2647def err_constexpr_redecl_mismatch : Error< 2648 "%select{non-constexpr|constexpr|consteval}1 declaration of %0" 2649 " follows %select{non-constexpr|constexpr|consteval}2 declaration">; 2650def err_constexpr_virtual : Error<"virtual function cannot be constexpr">; 2651def warn_cxx17_compat_constexpr_virtual : Warning< 2652 "virtual constexpr functions are incompatible with " 2653 "C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore; 2654def err_constexpr_virtual_base : Error< 2655 "constexpr %select{member function|constructor}0 not allowed in " 2656 "%select{struct|interface|class}1 with virtual base " 2657 "%plural{1:class|:classes}2">; 2658def note_non_literal_incomplete : Note< 2659 "incomplete type %0 is not a literal type">; 2660def note_non_literal_virtual_base : Note<"%select{struct|interface|class}0 " 2661 "with virtual base %plural{1:class|:classes}1 is not a literal type">; 2662def note_constexpr_virtual_base_here : Note<"virtual base class declared here">; 2663def err_constexpr_non_literal_return : Error< 2664 "%select{constexpr|consteval}0 function's return type %1 is not a literal type">; 2665def err_constexpr_non_literal_param : Error< 2666 "%select{constexpr|consteval}2 %select{function|constructor}1's %ordinal0 parameter type %3 is " 2667 "not a literal type">; 2668def err_constexpr_body_invalid_stmt : Error< 2669 "statement not allowed in %select{constexpr|consteval}1 %select{function|constructor}0">; 2670def ext_constexpr_body_invalid_stmt : ExtWarn< 2671 "use of this statement in a constexpr %select{function|constructor}0 " 2672 "is a C++14 extension">, InGroup<CXX14>; 2673def warn_cxx11_compat_constexpr_body_invalid_stmt : Warning< 2674 "use of this statement in a constexpr %select{function|constructor}0 " 2675 "is incompatible with C++ standards before C++14">, 2676 InGroup<CXXPre14Compat>, DefaultIgnore; 2677def ext_constexpr_body_invalid_stmt_cxx20 : ExtWarn< 2678 "use of this statement in a constexpr %select{function|constructor}0 " 2679 "is a C++20 extension">, InGroup<CXX20>; 2680def warn_cxx17_compat_constexpr_body_invalid_stmt : Warning< 2681 "use of this statement in a constexpr %select{function|constructor}0 " 2682 "is incompatible with C++ standards before C++20">, 2683 InGroup<CXXPre20Compat>, DefaultIgnore; 2684def ext_constexpr_type_definition : ExtWarn< 2685 "type definition in a constexpr %select{function|constructor}0 " 2686 "is a C++14 extension">, InGroup<CXX14>; 2687def warn_cxx11_compat_constexpr_type_definition : Warning< 2688 "type definition in a constexpr %select{function|constructor}0 " 2689 "is incompatible with C++ standards before C++14">, 2690 InGroup<CXXPre14Compat>, DefaultIgnore; 2691def err_constexpr_vla : Error< 2692 "variably-modified type %0 cannot be used in a constexpr " 2693 "%select{function|constructor}1">; 2694def ext_constexpr_local_var : ExtWarn< 2695 "variable declaration in a constexpr %select{function|constructor}0 " 2696 "is a C++14 extension">, InGroup<CXX14>; 2697def warn_cxx11_compat_constexpr_local_var : Warning< 2698 "variable declaration in a constexpr %select{function|constructor}0 " 2699 "is incompatible with C++ standards before C++14">, 2700 InGroup<CXXPre14Compat>, DefaultIgnore; 2701def err_constexpr_local_var_static : Error< 2702 "%select{static|thread_local}1 variable not permitted in a constexpr " 2703 "%select{function|constructor}0">; 2704def err_constexpr_local_var_non_literal_type : Error< 2705 "variable of non-literal type %1 cannot be defined in a constexpr " 2706 "%select{function|constructor}0">; 2707def ext_constexpr_local_var_no_init : ExtWarn< 2708 "uninitialized variable in a constexpr %select{function|constructor}0 " 2709 "is a C++20 extension">, InGroup<CXX20>; 2710def warn_cxx17_compat_constexpr_local_var_no_init : Warning< 2711 "uninitialized variable in a constexpr %select{function|constructor}0 " 2712 "is incompatible with C++ standards before C++20">, 2713 InGroup<CXXPre20Compat>, DefaultIgnore; 2714def ext_constexpr_function_never_constant_expr : ExtWarn< 2715 "%select{constexpr|consteval}1 %select{function|constructor}0 never produces a " 2716 "constant expression">, InGroup<DiagGroup<"invalid-constexpr">>, DefaultError; 2717def err_attr_cond_never_constant_expr : Error< 2718 "%0 attribute expression never produces a constant expression">; 2719def err_diagnose_if_invalid_diagnostic_type : Error< 2720 "invalid diagnostic type for 'diagnose_if'; use \"error\" or \"warning\" " 2721 "instead">; 2722def err_constexpr_body_no_return : Error< 2723 "no return statement in %select{constexpr|consteval}0 function">; 2724def err_constexpr_return_missing_expr : Error< 2725 "non-void %select{constexpr|consteval}1 function %0 should return a value">; 2726def warn_cxx11_compat_constexpr_body_no_return : Warning< 2727 "constexpr function with no return statements is incompatible with C++ " 2728 "standards before C++14">, InGroup<CXXPre14Compat>, DefaultIgnore; 2729def ext_constexpr_body_multiple_return : ExtWarn< 2730 "multiple return statements in constexpr function is a C++14 extension">, 2731 InGroup<CXX14>; 2732def warn_cxx11_compat_constexpr_body_multiple_return : Warning< 2733 "multiple return statements in constexpr function " 2734 "is incompatible with C++ standards before C++14">, 2735 InGroup<CXXPre14Compat>, DefaultIgnore; 2736def note_constexpr_body_previous_return : Note< 2737 "previous return statement is here">; 2738 2739// C++20 function try blocks in constexpr 2740def ext_constexpr_function_try_block_cxx20 : ExtWarn< 2741 "function try block in constexpr %select{function|constructor}0 is " 2742 "a C++20 extension">, InGroup<CXX20>; 2743def warn_cxx17_compat_constexpr_function_try_block : Warning< 2744 "function try block in constexpr %select{function|constructor}0 is " 2745 "incompatible with C++ standards before C++20">, 2746 InGroup<CXXPre20Compat>, DefaultIgnore; 2747 2748def ext_constexpr_union_ctor_no_init : ExtWarn< 2749 "constexpr union constructor that does not initialize any member " 2750 "is a C++20 extension">, InGroup<CXX20>; 2751def warn_cxx17_compat_constexpr_union_ctor_no_init : Warning< 2752 "constexpr union constructor that does not initialize any member " 2753 "is incompatible with C++ standards before C++20">, 2754 InGroup<CXXPre20Compat>, DefaultIgnore; 2755def ext_constexpr_ctor_missing_init : ExtWarn< 2756 "constexpr constructor that does not initialize all members " 2757 "is a C++20 extension">, InGroup<CXX20>; 2758def warn_cxx17_compat_constexpr_ctor_missing_init : Warning< 2759 "constexpr constructor that does not initialize all members " 2760 "is incompatible with C++ standards before C++20">, 2761 InGroup<CXXPre20Compat>, DefaultIgnore; 2762def note_constexpr_ctor_missing_init : Note< 2763 "member not initialized by constructor">; 2764def note_non_literal_no_constexpr_ctors : Note< 2765 "%0 is not literal because it is not an aggregate and has no constexpr " 2766 "constructors other than copy or move constructors">; 2767def note_non_literal_base_class : Note< 2768 "%0 is not literal because it has base class %1 of non-literal type">; 2769def note_non_literal_field : Note< 2770 "%0 is not literal because it has data member %1 of " 2771 "%select{non-literal|volatile}3 type %2">; 2772def note_non_literal_user_provided_dtor : Note< 2773 "%0 is not literal because it has a user-provided destructor">; 2774def note_non_literal_nontrivial_dtor : Note< 2775 "%0 is not literal because it has a non-trivial destructor">; 2776def note_non_literal_non_constexpr_dtor : Note< 2777 "%0 is not literal because its destructor is not constexpr">; 2778def note_non_literal_lambda : Note< 2779 "lambda closure types are non-literal types before C++17">; 2780def warn_private_extern : Warning< 2781 "use of __private_extern__ on a declaration may not produce external symbol " 2782 "private to the linkage unit and is deprecated">, InGroup<PrivateExtern>; 2783def note_private_extern : Note< 2784 "use __attribute__((visibility(\"hidden\"))) attribute instead">; 2785 2786// C++ Concepts 2787def err_concept_decls_may_only_appear_in_global_namespace_scope : Error< 2788 "concept declarations may only appear in global or namespace scope">; 2789def err_concept_no_parameters : Error< 2790 "concept template parameter list must have at least one parameter; explicit " 2791 "specialization of concepts is not allowed">; 2792def err_concept_extra_headers : Error< 2793 "extraneous template parameter list in concept definition">; 2794def err_concept_no_associated_constraints : Error< 2795 "concept cannot have associated constraints">; 2796def err_non_constant_constraint_expression : Error< 2797 "substitution into constraint expression resulted in a non-constant " 2798 "expression">; 2799def err_non_bool_atomic_constraint : Error< 2800 "atomic constraint must be of type 'bool' (found %0)">; 2801def err_template_arg_list_constraints_not_satisfied : Error< 2802 "constraints not satisfied for %select{class template|function template|variable template|alias template|" 2803 "template template parameter|template}0 %1%2">; 2804def note_substituted_constraint_expr_is_ill_formed : Note< 2805 "because substituted constraint expression is ill-formed%0">; 2806def note_atomic_constraint_evaluated_to_false : Note< 2807 "%select{and|because}0 '%1' evaluated to false">; 2808def note_concept_specialization_constraint_evaluated_to_false : Note< 2809 "%select{and|because}0 '%1' evaluated to false">; 2810def note_single_arg_concept_specialization_constraint_evaluated_to_false : Note< 2811 "%select{and|because}0 %1 does not satisfy %2">; 2812def note_atomic_constraint_evaluated_to_false_elaborated : Note< 2813 "%select{and|because}0 '%1' (%2 %3 %4) evaluated to false">; 2814def err_constrained_virtual_method : Error< 2815 "virtual function cannot have a requires clause">; 2816def err_trailing_requires_clause_on_deduction_guide : Error< 2817 "deduction guide cannot have a requires clause">; 2818def err_reference_to_function_with_unsatisfied_constraints : Error< 2819 "invalid reference to function %0: constraints not satisfied">; 2820def err_requires_expr_local_parameter_default_argument : Error< 2821 "default arguments not allowed for parameters of a requires expression">; 2822def err_requires_expr_parameter_referenced_in_evaluated_context : Error< 2823 "constraint variable %0 cannot be used in an evaluated context">; 2824def note_expr_requirement_expr_substitution_error : Note< 2825 "%select{and|because}0 '%1' would be invalid: %2">; 2826def note_expr_requirement_expr_unknown_substitution_error : Note< 2827 "%select{and|because}0 '%1' would be invalid">; 2828def note_expr_requirement_noexcept_not_met : Note< 2829 "%select{and|because}0 '%1' may throw an exception">; 2830def note_expr_requirement_type_requirement_substitution_error : Note< 2831 "%select{and|because}0 '%1' would be invalid: %2">; 2832def note_expr_requirement_type_requirement_unknown_substitution_error : Note< 2833 "%select{and|because}0 '%1' would be invalid">; 2834def note_expr_requirement_constraints_not_satisfied : Note< 2835 "%select{and|because}0 type constraint '%1' was not satisfied:">; 2836def note_expr_requirement_constraints_not_satisfied_simple : Note< 2837 "%select{and|because}0 %1 does not satisfy %2:">; 2838def note_type_requirement_substitution_error : Note< 2839 "%select{and|because}0 '%1' would be invalid: %2">; 2840def note_type_requirement_unknown_substitution_error : Note< 2841 "%select{and|because}0 '%1' would be invalid">; 2842def note_nested_requirement_substitution_error : Note< 2843 "%select{and|because}0 '%1' would be invalid: %2">; 2844def note_nested_requirement_unknown_substitution_error : Note< 2845 "%select{and|because}0 '%1' would be invalid">; 2846def note_ambiguous_atomic_constraints : Note< 2847 "similar constraint expressions not considered equivalent; constraint " 2848 "expressions cannot be considered equivalent unless they originate from the " 2849 "same concept">; 2850def note_ambiguous_atomic_constraints_similar_expression : Note< 2851 "similar constraint expression here">; 2852def err_unsupported_placeholder_constraint : Error< 2853 "constrained placeholder types other than simple 'auto' on non-type template " 2854 "parameters not supported yet">; 2855 2856def err_template_different_requires_clause : Error< 2857 "requires clause differs in template redeclaration">; 2858def err_template_different_type_constraint : Error< 2859 "type constraint differs in template redeclaration">; 2860def err_template_template_parameter_not_at_least_as_constrained : Error< 2861 "template template argument %0 is more constrained than template template " 2862 "parameter %1">; 2863 2864def err_type_constraint_non_type_concept : Error< 2865 "concept named in type constraint is not a type concept">; 2866def err_type_constraint_missing_arguments : Error< 2867 "%0 requires more than 1 template argument; provide the remaining arguments " 2868 "explicitly to use it here">; 2869def err_placeholder_constraints_not_satisfied : Error< 2870 "deduced type %0 does not satisfy %1">; 2871 2872// C++11 char16_t/char32_t 2873def warn_cxx98_compat_unicode_type : Warning< 2874 "'%0' type specifier is incompatible with C++98">, 2875 InGroup<CXX98Compat>, DefaultIgnore; 2876def warn_cxx17_compat_unicode_type : Warning< 2877 "'char8_t' type specifier is incompatible with C++ standards before C++20">, 2878 InGroup<CXXPre20Compat>, DefaultIgnore; 2879 2880// __make_integer_seq 2881def err_integer_sequence_negative_length : Error< 2882 "integer sequences must have non-negative sequence length">; 2883def err_integer_sequence_integral_element_type : Error< 2884 "integer sequences must have integral element type">; 2885 2886// __type_pack_element 2887def err_type_pack_element_out_of_bounds : Error< 2888 "a parameter pack may not be accessed at an out of bounds index">; 2889 2890// Objective-C++ 2891def err_objc_decls_may_only_appear_in_global_scope : Error< 2892 "Objective-C declarations may only appear in global scope">; 2893def warn_auto_var_is_id : Warning< 2894 "'auto' deduced as 'id' in declaration of %0">, 2895 InGroup<DiagGroup<"auto-var-id">>; 2896 2897// Attributes 2898def warn_nomerge_attribute_ignored_in_stmt: Warning< 2899 "%0 attribute is ignored because there exists no call expression inside the " 2900 "statement">, 2901 InGroup<IgnoredAttributes>; 2902 2903def err_musttail_needs_trivial_args : Error< 2904 "tail call requires that the return value, all parameters, and any " 2905 "temporaries created by the expression are trivially destructible">; 2906def err_musttail_needs_call : Error< 2907 "%0 attribute requires that the return value is the result of a function call" 2908 >; 2909def err_musttail_needs_prototype : Error< 2910 "%0 attribute requires that both caller and callee functions have a " 2911 "prototype">; 2912def note_musttail_fix_non_prototype : Note< 2913 "add 'void' to the parameter list to turn an old-style K&R function " 2914 "declaration into a prototype">; 2915def err_musttail_structors_forbidden : Error<"cannot perform a tail call " 2916 "%select{from|to}0 a %select{constructor|destructor}1">; 2917def note_musttail_structors_forbidden : Note<"target " 2918 "%select{constructor|destructor}0 is declared here">; 2919def err_musttail_forbidden_from_this_context : Error< 2920 "%0 attribute cannot be used from " 2921 "%select{a block|an Objective-C function|this context}1">; 2922def err_musttail_member_mismatch : Error< 2923 "%select{non-member|static member|non-static member}0 " 2924 "function cannot perform a tail call to " 2925 "%select{non-member|static member|non-static member|pointer-to-member}1 " 2926 "function%select{| %3}2">; 2927def note_musttail_callee_defined_here : Note<"%0 declared here">; 2928def note_tail_call_required : Note<"tail call required by %0 attribute here">; 2929def err_musttail_mismatch : Error< 2930 "cannot perform a tail call to function%select{| %1}0 because its signature " 2931 "is incompatible with the calling function">; 2932def note_musttail_mismatch : Note< 2933 "target function " 2934 "%select{is a member of different class%diff{ (expected $ but has $)|}1,2" 2935 "|has different number of parameters (expected %1 but has %2)" 2936 "|has type mismatch at %ordinal3 parameter" 2937 "%diff{ (expected $ but has $)|}1,2" 2938 "|has different return type%diff{ ($ expected but has $)|}1,2}0">; 2939def err_musttail_callconv_mismatch : Error< 2940 "cannot perform a tail call to function%select{| %1}0 because it uses an " 2941 "incompatible calling convention">; 2942def note_musttail_callconv_mismatch : Note< 2943 "target function has calling convention %1 (expected %0)">; 2944def err_musttail_scope : Error< 2945 "cannot perform a tail call from this return statement">; 2946def err_musttail_no_variadic : Error< 2947 "%0 attribute may not be used with variadic functions">; 2948 2949def err_nsobject_attribute : Error< 2950 "'NSObject' attribute is for pointer types only">; 2951def err_attributes_are_not_compatible : Error< 2952 "%0 and %1 attributes are not compatible">; 2953def err_attribute_invalid_argument : Error< 2954 "%select{a reference type|an array type|a non-vector or " 2955 "non-vectorizable scalar type}0 is an invalid argument to attribute %1">; 2956def err_attribute_wrong_number_arguments : Error< 2957 "%0 attribute %plural{0:takes no arguments|1:takes one argument|" 2958 ":requires exactly %1 arguments}1">; 2959def err_attribute_too_many_arguments : Error< 2960 "%0 attribute takes no more than %1 argument%s1">; 2961def err_attribute_too_few_arguments : Error< 2962 "%0 attribute takes at least %1 argument%s1">; 2963def err_attribute_invalid_vector_type : Error<"invalid vector element type %0">; 2964def err_attribute_invalid_matrix_type : Error<"invalid matrix element type %0">; 2965def err_attribute_bad_neon_vector_size : Error< 2966 "Neon vector size must be 64 or 128 bits">; 2967def err_attribute_invalid_sve_type : Error< 2968 "%0 attribute applied to non-SVE type %1">; 2969def err_attribute_bad_sve_vector_size : Error< 2970 "invalid SVE vector size '%0', must match value set by " 2971 "'-msve-vector-bits' ('%1')">; 2972def err_attribute_arm_feature_sve_bits_unsupported : Error< 2973 "%0 is only supported when '-msve-vector-bits=<bits>' is specified with a " 2974 "value of 128, 256, 512, 1024 or 2048.">; 2975def err_attribute_requires_positive_integer : Error< 2976 "%0 attribute requires a %select{positive|non-negative}1 " 2977 "integral compile time constant expression">; 2978def err_attribute_requires_opencl_version : Error< 2979 "attribute %0 is supported in the OpenCL version %1%select{| onwards}2">; 2980def err_invalid_branch_protection_spec : Error< 2981 "invalid or misplaced branch protection specification '%0'">; 2982def warn_unsupported_branch_protection_spec : Warning< 2983 "unsupported branch protection specification '%0'">, InGroup<BranchProtection>; 2984 2985def warn_unsupported_target_attribute 2986 : Warning<"%select{unsupported|duplicate|unknown}0%select{| architecture|" 2987 " tune CPU}1 '%2' in the '%select{target|target_clones}3' " 2988 "attribute string; '%select{target|target_clones}3' " 2989 "attribute ignored">, 2990 InGroup<IgnoredAttributes>; 2991def err_attribute_unsupported 2992 : Error<"%0 attribute is not supported on targets missing %1;" 2993 " specify an appropriate -march= or -mcpu=">; 2994// The err_*_attribute_argument_not_int are separate because they're used by 2995// VerifyIntegerConstantExpression. 2996def err_aligned_attribute_argument_not_int : Error< 2997 "'aligned' attribute requires integer constant">; 2998def err_align_value_attribute_argument_not_int : Error< 2999 "'align_value' attribute requires integer constant">; 3000def err_alignas_attribute_wrong_decl_type : Error< 3001 "%0 attribute cannot be applied to a %select{function parameter|" 3002 "variable with 'register' storage class|'catch' variable|bit-field}1">; 3003def err_alignas_missing_on_definition : Error< 3004 "%0 must be specified on definition if it is specified on any declaration">; 3005def note_alignas_on_declaration : Note<"declared with %0 attribute here">; 3006def err_alignas_mismatch : Error< 3007 "redeclaration has different alignment requirement (%1 vs %0)">; 3008def err_alignas_underaligned : Error< 3009 "requested alignment is less than minimum alignment of %1 for type %0">; 3010def warn_aligned_attr_underaligned : Warning<err_alignas_underaligned.Text>, 3011 InGroup<IgnoredAttributes>; 3012def err_attribute_sizeless_type : Error< 3013 "%0 attribute cannot be applied to sizeless type %1">; 3014def err_attribute_argument_n_type : Error< 3015 "%0 attribute requires parameter %1 to be %select{int or bool|an integer " 3016 "constant|a string|an identifier|a constant expression}2">; 3017def err_attribute_argument_type : Error< 3018 "%0 attribute requires %select{int or bool|an integer " 3019 "constant|a string|an identifier}1">; 3020def err_attribute_argument_out_of_range : Error< 3021 "%0 attribute requires integer constant between %1 and %2 inclusive">; 3022def err_init_priority_object_attr : Error< 3023 "can only use 'init_priority' attribute on file-scope definitions " 3024 "of objects of class type">; 3025def err_attribute_argument_out_of_bounds : Error< 3026 "%0 attribute parameter %1 is out of bounds">; 3027def err_attribute_only_once_per_parameter : Error< 3028 "%0 attribute can only be applied once per parameter">; 3029def err_mismatched_uuid : Error<"uuid does not match previous declaration">; 3030def note_previous_uuid : Note<"previous uuid specified here">; 3031def warn_attribute_pointers_only : Warning< 3032 "%0 attribute only applies to%select{| constant}1 pointer arguments">, 3033 InGroup<IgnoredAttributes>; 3034def err_attribute_pointers_only : Error<warn_attribute_pointers_only.Text>; 3035def err_attribute_integers_only : Error< 3036 "%0 attribute argument may only refer to a function parameter of integer " 3037 "type">; 3038def warn_attribute_return_pointers_only : Warning< 3039 "%0 attribute only applies to return values that are pointers">, 3040 InGroup<IgnoredAttributes>; 3041def warn_attribute_return_pointers_refs_only : Warning< 3042 "%0 attribute only applies to return values that are pointers or references">, 3043 InGroup<IgnoredAttributes>; 3044def warn_attribute_pointer_or_reference_only : Warning< 3045 "%0 attribute only applies to a pointer or reference (%1 is invalid)">, 3046 InGroup<IgnoredAttributes>; 3047def err_attribute_no_member_pointers : Error< 3048 "%0 attribute cannot be used with pointers to members">; 3049def err_attribute_invalid_implicit_this_argument : Error< 3050 "%0 attribute is invalid for the implicit this argument">; 3051def err_ownership_type : Error< 3052 "%0 attribute only applies to %select{pointer|integer}1 arguments">; 3053def err_ownership_returns_index_mismatch : Error< 3054 "'ownership_returns' attribute index does not match; here it is %0">; 3055def note_ownership_returns_index_mismatch : Note< 3056 "declared with index %0 here">; 3057def err_format_strftime_third_parameter : Error< 3058 "strftime format attribute requires 3rd parameter to be 0">; 3059def err_format_attribute_requires_variadic : Error< 3060 "format attribute requires variadic function">; 3061def err_format_attribute_not : Error<"format argument not %0">; 3062def err_format_attribute_result_not : Error<"function does not return %0">; 3063def err_format_attribute_implicit_this_format_string : Error< 3064 "format attribute cannot specify the implicit this argument as the format " 3065 "string">; 3066def err_callback_attribute_no_callee : Error< 3067 "'callback' attribute specifies no callback callee">; 3068def err_callback_attribute_invalid_callee : Error< 3069 "'callback' attribute specifies invalid callback callee">; 3070def err_callback_attribute_multiple : Error< 3071 "multiple 'callback' attributes specified">; 3072def err_callback_attribute_argument_unknown : Error< 3073 "'callback' attribute argument %0 is not a known function parameter">; 3074def err_callback_callee_no_function_type : Error< 3075 "'callback' attribute callee does not have function type">; 3076def err_callback_callee_is_variadic : Error< 3077 "'callback' attribute callee may not be variadic">; 3078def err_callback_implicit_this_not_available : Error< 3079 "'callback' argument at position %0 references unavailable implicit 'this'">; 3080def err_init_method_bad_return_type : Error< 3081 "init methods must return an object pointer type, not %0">; 3082def err_attribute_invalid_size : Error< 3083 "vector size not an integral multiple of component size">; 3084def err_attribute_zero_size : Error<"zero %0 size">; 3085def err_attribute_size_too_large : Error<"%0 size too large">; 3086def err_typecheck_sve_ambiguous : Error< 3087 "cannot combine fixed-length and sizeless SVE vectors in expression, result is ambiguous (%0 and %1)">; 3088def err_typecheck_sve_gnu_ambiguous : Error< 3089 "cannot combine GNU and SVE vectors in expression, result is ambiguous (%0 and %1)">; 3090def err_typecheck_vector_not_convertable_implict_truncation : Error< 3091 "cannot convert between %select{scalar|vector}0 type %1 and vector type" 3092 " %2 as implicit conversion would cause truncation">; 3093def err_typecheck_vector_not_convertable : Error< 3094 "cannot convert between vector values of different size (%0 and %1)">; 3095def err_typecheck_vector_not_convertable_non_scalar : Error< 3096 "cannot convert between vector and non-scalar values (%0 and %1)">; 3097def err_typecheck_vector_lengths_not_equal : Error< 3098 "vector operands do not have the same number of elements (%0 and %1)">; 3099def warn_typecheck_vector_element_sizes_not_equal : Warning< 3100 "vector operands do not have the same elements sizes (%0 and %1)">, 3101 InGroup<DiagGroup<"vec-elem-size">>, DefaultError; 3102def err_ext_vector_component_exceeds_length : Error< 3103 "vector component access exceeds type %0">; 3104def err_ext_vector_component_name_illegal : Error< 3105 "illegal vector component name '%0'">; 3106def err_attribute_address_space_negative : Error< 3107 "address space is negative">; 3108def err_attribute_address_space_too_high : Error< 3109 "address space is larger than the maximum supported (%0)">; 3110def err_attribute_address_multiple_qualifiers : Error< 3111 "multiple address spaces specified for type">; 3112def warn_attribute_address_multiple_identical_qualifiers : Warning< 3113 "multiple identical address spaces specified for type">, 3114 InGroup<DuplicateDeclSpecifier>; 3115def err_attribute_not_clinkage : Error< 3116 "function type with %0 attribute must have C linkage">; 3117def err_function_decl_cmse_ns_call : Error< 3118 "functions may not be declared with 'cmse_nonsecure_call' attribute">; 3119def err_attribute_address_function_type : Error< 3120 "function type may not be qualified with an address space">; 3121def err_as_qualified_auto_decl : Error< 3122 "automatic variable qualified with an%select{| invalid}0 address space">; 3123def err_arg_with_address_space : Error< 3124 "parameter may not be qualified with an address space">; 3125def err_field_with_address_space : Error< 3126 "field may not be qualified with an address space">; 3127def err_compound_literal_with_address_space : Error< 3128 "compound literal in function scope may not be qualified with an address space">; 3129def err_address_space_mismatch_templ_inst : Error< 3130 "conflicting address space qualifiers are provided between types %0 and %1">; 3131def err_attr_objc_ownership_redundant : Error< 3132 "the type %0 is already explicitly ownership-qualified">; 3133def err_invalid_nsnumber_type : Error< 3134 "%0 is not a valid literal type for NSNumber">; 3135def err_objc_illegal_boxed_expression_type : Error< 3136 "illegal type %0 used in a boxed expression">; 3137def err_objc_non_trivially_copyable_boxed_expression_type : Error< 3138 "non-trivially copyable type %0 cannot be used in a boxed expression">; 3139def err_objc_incomplete_boxed_expression_type : Error< 3140 "incomplete type %0 used in a boxed expression">; 3141def err_undeclared_objc_literal_class : Error< 3142 "definition of class %0 must be available to use Objective-C " 3143 "%select{array literals|dictionary literals|numeric literals|boxed expressions|" 3144 "string literals}1">; 3145def err_undeclared_boxing_method : Error< 3146 "declaration of %0 is missing in %1 class">; 3147def err_objc_literal_method_sig : Error< 3148 "literal construction method %0 has incompatible signature">; 3149def note_objc_literal_method_param : Note< 3150 "%select{first|second|third}0 parameter has unexpected type %1 " 3151 "(should be %2)">; 3152def note_objc_literal_method_return : Note< 3153 "method returns unexpected type %0 (should be an object type)">; 3154def err_invalid_collection_element : Error< 3155 "collection element of type %0 is not an Objective-C object">; 3156def err_box_literal_collection : Error< 3157 "%select{string|character|boolean|numeric}0 literal must be prefixed by '@' " 3158 "in a collection">; 3159def warn_objc_literal_comparison : Warning< 3160 "direct comparison of %select{an array literal|a dictionary literal|" 3161 "a numeric literal|a boxed expression|}0 has undefined behavior">, 3162 InGroup<ObjCLiteralComparison>; 3163def err_missing_atsign_prefix : Error< 3164 "%select{string|numeric}0 literal must be prefixed by '@'">; 3165def warn_objc_string_literal_comparison : Warning< 3166 "direct comparison of a string literal has undefined behavior">, 3167 InGroup<ObjCStringComparison>; 3168def warn_concatenated_literal_array_init : Warning< 3169 "suspicious concatenation of string literals in an array initialization; " 3170 "did you mean to separate the elements with a comma?">, 3171 InGroup<StringConcatation>, DefaultIgnore; 3172def warn_concatenated_nsarray_literal : Warning< 3173 "concatenated NSString literal for an NSArray expression - " 3174 "possibly missing a comma">, 3175 InGroup<ObjCStringConcatenation>; 3176def note_objc_literal_comparison_isequal : Note< 3177 "use 'isEqual:' instead">; 3178def warn_objc_collection_literal_element : Warning< 3179 "object of type %0 is not compatible with " 3180 "%select{array element type|dictionary key type|dictionary value type}1 %2">, 3181 InGroup<ObjCLiteralConversion>; 3182def warn_nsdictionary_duplicate_key : Warning< 3183 "duplicate key in dictionary literal">, 3184 InGroup<DiagGroup<"objc-dictionary-duplicate-keys">>; 3185def note_nsdictionary_duplicate_key_here : Note< 3186 "previous equal key is here">; 3187def err_swift_param_attr_not_swiftcall : Error< 3188 "'%0' parameter can only be used with swiftcall%select{ or swiftasynccall|}1 " 3189 "calling convention%select{|s}1">; 3190def err_swift_indirect_result_not_first : Error< 3191 "'swift_indirect_result' parameters must be first parameters of function">; 3192def err_swift_error_result_not_after_swift_context : Error< 3193 "'swift_error_result' parameter must follow 'swift_context' parameter">; 3194def err_swift_abi_parameter_wrong_type : Error< 3195 "'%0' parameter must have pointer%select{| to unqualified pointer}1 type; " 3196 "type here is %2">; 3197 3198def err_attribute_argument_invalid : Error< 3199 "%0 attribute argument is invalid: %select{max must be 0 since min is 0|" 3200 "min must not be greater than max}1">; 3201def err_attribute_argument_is_zero : Error< 3202 "%0 attribute must be greater than 0">; 3203def warn_attribute_argument_n_negative : Warning< 3204 "%0 attribute parameter %1 is negative and will be ignored">, 3205 InGroup<CudaCompat>; 3206def err_property_function_in_objc_container : Error< 3207 "use of Objective-C property in function nested in Objective-C " 3208 "container not supported, move function outside its container">; 3209 3210let CategoryName = "Cocoa API Issue" in { 3211def warn_objc_redundant_literal_use : Warning< 3212 "using %0 with a literal is redundant">, InGroup<ObjCRedundantLiteralUse>; 3213} 3214 3215def err_attr_tlsmodel_arg : Error<"tls_model must be \"global-dynamic\", " 3216 "\"local-dynamic\", \"initial-exec\" or \"local-exec\"">; 3217 3218def err_aix_attr_unsupported_tls_model : Error<"TLS model '%0' is not yet supported on AIX">; 3219 3220def err_tls_var_aligned_over_maximum : Error< 3221 "alignment (%0) of thread-local variable %1 is greater than the maximum supported " 3222 "alignment (%2) for a thread-local variable on this target">; 3223 3224def err_only_annotate_after_access_spec : Error< 3225 "access specifier can only have annotation attributes">; 3226 3227def err_attribute_section_invalid_for_target : Error< 3228 "argument to %select{'code_seg'|'section'}1 attribute is not valid for this target: %0">; 3229def err_pragma_section_invalid_for_target : Error< 3230 "argument to #pragma section is not valid for this target: %0">; 3231def warn_attribute_section_drectve : Warning< 3232 "#pragma %0(\".drectve\") has undefined behavior, " 3233 "use #pragma comment(linker, ...) instead">, InGroup<MicrosoftDrectveSection>; 3234def warn_mismatched_section : Warning< 3235 "%select{codeseg|section}0 does not match previous declaration">, InGroup<Section>; 3236def warn_attribute_section_on_redeclaration : Warning< 3237 "section attribute is specified on redeclared variable">, InGroup<Section>; 3238def err_mismatched_code_seg_base : Error< 3239 "derived class must specify the same code segment as its base classes">; 3240def err_mismatched_code_seg_override : Error< 3241 "overriding virtual function must specify the same code segment as its overridden function">; 3242def err_conflicting_codeseg_attribute : Error< 3243 "conflicting code segment specifiers">; 3244def warn_duplicate_codeseg_attribute : Warning< 3245 "duplicate code segment specifiers">, InGroup<Section>; 3246 3247def err_anonymous_property: Error< 3248 "anonymous property is not supported">; 3249def err_property_is_variably_modified : Error< 3250 "property %0 has a variably modified type">; 3251def err_no_accessor_for_property : Error< 3252 "no %select{getter|setter}0 defined for property %1">; 3253def err_cannot_find_suitable_accessor : Error< 3254 "cannot find suitable %select{getter|setter}0 for property %1">; 3255 3256def warn_alloca : Warning< 3257 "use of function %0 is discouraged; there is no way to check for failure but " 3258 "failure may still occur, resulting in a possibly exploitable security vulnerability">, 3259 InGroup<DiagGroup<"alloca">>, DefaultIgnore; 3260 3261def warn_alloca_align_alignof : Warning< 3262 "second argument to __builtin_alloca_with_align is supposed to be in bits">, 3263 InGroup<DiagGroup<"alloca-with-align-alignof">>; 3264 3265def err_alignment_too_small : Error< 3266 "requested alignment must be %0 or greater">; 3267def err_alignment_too_big : Error< 3268 "requested alignment must be %0 or smaller">; 3269def err_alignment_not_power_of_two : Error< 3270 "requested alignment is not a power of 2">; 3271def warn_alignment_not_power_of_two : Warning< 3272 err_alignment_not_power_of_two.Text>, 3273 InGroup<DiagGroup<"non-power-of-two-alignment">>; 3274def err_alignment_dependent_typedef_name : Error< 3275 "requested alignment is dependent but declaration is not dependent">; 3276 3277def warn_alignment_builtin_useless : Warning< 3278 "%select{aligning a value|the result of checking whether a value is aligned}0" 3279 " to 1 byte is %select{a no-op|always true}0">, InGroup<TautologicalCompare>; 3280def err_attribute_aligned_too_great : Error< 3281 "requested alignment must be %0 bytes or smaller">; 3282def warn_assume_aligned_too_great 3283 : Warning<"requested alignment must be %0 bytes or smaller; maximum " 3284 "alignment assumed">, 3285 InGroup<DiagGroup<"builtin-assume-aligned-alignment">>; 3286def warn_not_xl_compatible 3287 : Warning<"requesting an alignment of 16 bytes or greater for struct" 3288 " members is not binary compatible with IBM XL C/C++ for AIX" 3289 " 16.1.0 and older">, 3290 InGroup<AIXCompat>; 3291def warn_redeclaration_without_attribute_prev_attribute_ignored : Warning< 3292 "%q0 redeclared without %1 attribute: previous %1 ignored">, 3293 InGroup<MicrosoftInconsistentDllImport>; 3294def warn_redeclaration_without_import_attribute : Warning< 3295 "%q0 redeclared without 'dllimport' attribute: 'dllexport' attribute added">, 3296 InGroup<MicrosoftInconsistentDllImport>; 3297def warn_dllimport_dropped_from_inline_function : Warning< 3298 "%q0 redeclared inline; %1 attribute ignored">, 3299 InGroup<IgnoredAttributes>; 3300def warn_attribute_ignored : Warning<"%0 attribute ignored">, 3301 InGroup<IgnoredAttributes>; 3302def warn_nothrow_attribute_ignored : Warning<"'nothrow' attribute conflicts with" 3303 " exception specification; attribute ignored">, 3304 InGroup<IgnoredAttributes>; 3305def warn_attribute_ignored_on_non_definition : 3306 Warning<"%0 attribute ignored on a non-definition declaration">, 3307 InGroup<IgnoredAttributes>; 3308def warn_attribute_ignored_on_inline : 3309 Warning<"%0 attribute ignored on inline function">, 3310 InGroup<IgnoredAttributes>; 3311def warn_nocf_check_attribute_ignored : 3312 Warning<"'nocf_check' attribute ignored; use -fcf-protection to enable the attribute">, 3313 InGroup<IgnoredAttributes>; 3314def warn_attribute_after_definition_ignored : Warning< 3315 "attribute %0 after definition is ignored">, 3316 InGroup<IgnoredAttributes>; 3317def warn_attributes_likelihood_ifstmt_conflict 3318 : Warning<"conflicting attributes %0 are ignored">, 3319 InGroup<IgnoredAttributes>; 3320def warn_cxx11_gnu_attribute_on_type : Warning< 3321 "attribute %0 ignored, because it cannot be applied to a type">, 3322 InGroup<IgnoredAttributes>; 3323def warn_unhandled_ms_attribute_ignored : Warning< 3324 "__declspec attribute %0 is not supported">, 3325 InGroup<IgnoredAttributes>; 3326def warn_attribute_has_no_effect_on_infinite_loop : Warning< 3327 "attribute %0 has no effect when annotating an infinite loop">, 3328 InGroup<IgnoredAttributes>; 3329def note_attribute_has_no_effect_on_infinite_loop_here : Note< 3330 "annotating the infinite loop here">; 3331def warn_attribute_has_no_effect_on_compile_time_if : Warning< 3332 "attribute %0 has no effect when annotating an 'if %select{constexpr|consteval}1' statement">, 3333 InGroup<IgnoredAttributes>; 3334def note_attribute_has_no_effect_on_compile_time_if_here : Note< 3335 "annotating the 'if %select{constexpr|consteval}0' statement here">; 3336def err_decl_attribute_invalid_on_stmt : Error< 3337 "%0 attribute cannot be applied to a statement">; 3338def err_stmt_attribute_invalid_on_decl : Error< 3339 "%0 attribute cannot be applied to a declaration">; 3340def warn_declspec_attribute_ignored : Warning< 3341 "attribute %0 is ignored, place it after " 3342 "\"%select{class|struct|interface|union|enum}1\" to apply attribute to " 3343 "type declaration">, InGroup<IgnoredAttributes>; 3344def warn_attribute_precede_definition : Warning< 3345 "attribute declaration must precede definition">, 3346 InGroup<IgnoredAttributes>; 3347def warn_attribute_void_function_method : Warning< 3348 "attribute %0 cannot be applied to " 3349 "%select{functions|Objective-C method}1 without return value">, 3350 InGroup<IgnoredAttributes>; 3351def warn_attribute_weak_on_field : Warning< 3352 "__weak attribute cannot be specified on a field declaration">, 3353 InGroup<IgnoredAttributes>; 3354def warn_gc_attribute_weak_on_local : Warning< 3355 "Objective-C GC does not allow weak variables on the stack">, 3356 InGroup<IgnoredAttributes>; 3357def warn_nsobject_attribute : Warning< 3358 "'NSObject' attribute may be put on a typedef only; attribute is ignored">, 3359 InGroup<NSobjectAttribute>; 3360def warn_independentclass_attribute : Warning< 3361 "'objc_independent_class' attribute may be put on a typedef only; " 3362 "attribute is ignored">, 3363 InGroup<IndependentClassAttribute>; 3364def warn_ptr_independentclass_attribute : Warning< 3365 "'objc_independent_class' attribute may be put on Objective-C object " 3366 "pointer type only; attribute is ignored">, 3367 InGroup<IndependentClassAttribute>; 3368def warn_attribute_weak_on_local : Warning< 3369 "__weak attribute cannot be specified on an automatic variable when ARC " 3370 "is not enabled">, 3371 InGroup<IgnoredAttributes>; 3372def warn_weak_identifier_undeclared : Warning< 3373 "weak identifier %0 never declared">; 3374def warn_attribute_cmse_entry_static : Warning< 3375 "'cmse_nonsecure_entry' cannot be applied to functions with internal linkage">, 3376 InGroup<IgnoredAttributes>; 3377def warn_cmse_nonsecure_union : Warning< 3378 "passing union across security boundary via %select{parameter %1|return value}0 " 3379 "may leak information">, 3380 InGroup<DiagGroup<"cmse-union-leak">>; 3381def err_attribute_weak_static : Error< 3382 "weak declaration cannot have internal linkage">; 3383def err_attribute_selectany_non_extern_data : Error< 3384 "'selectany' can only be applied to data items with external linkage">; 3385def err_declspec_thread_on_thread_variable : Error< 3386 "'__declspec(thread)' applied to variable that already has a " 3387 "thread-local storage specifier">; 3388def err_attribute_dll_not_extern : Error< 3389 "%q0 must have external linkage when declared %q1">; 3390def err_attribute_dll_thread_local : Error< 3391 "%q0 cannot be thread local when declared %q1">; 3392def err_attribute_dll_lambda : Error< 3393 "lambda cannot be declared %0">; 3394def warn_attribute_invalid_on_definition : Warning< 3395 "'%0' attribute cannot be specified on a definition">, 3396 InGroup<IgnoredAttributes>; 3397def err_attribute_dll_redeclaration : Error< 3398 "redeclaration of %q0 cannot add %q1 attribute">; 3399def warn_attribute_dll_redeclaration : Warning< 3400 "redeclaration of %q0 should not add %q1 attribute">, 3401 InGroup<DiagGroup<"dll-attribute-on-redeclaration">>; 3402def err_attribute_dllimport_function_definition : Error< 3403 "dllimport cannot be applied to non-inline function definition">; 3404def err_attribute_dll_deleted : Error< 3405 "attribute %q0 cannot be applied to a deleted function">; 3406def err_attribute_dllimport_data_definition : Error< 3407 "definition of dllimport data">; 3408def err_attribute_dllimport_static_field_definition : Error< 3409 "definition of dllimport static field not allowed">; 3410def warn_attribute_dllimport_static_field_definition : Warning< 3411 "definition of dllimport static field">, 3412 InGroup<DiagGroup<"dllimport-static-field-def">>; 3413def warn_attribute_dllexport_explicit_instantiation_decl : Warning< 3414 "explicit instantiation declaration should not be 'dllexport'">, 3415 InGroup<DllexportExplicitInstantiationDecl>; 3416def warn_attribute_dllexport_explicit_instantiation_def : Warning< 3417 "'dllexport' attribute ignored on explicit instantiation definition">, 3418 InGroup<IgnoredAttributes>; 3419def warn_invalid_initializer_from_system_header : Warning< 3420 "invalid constructor from class in system header, should not be explicit">, 3421 InGroup<DiagGroup<"invalid-initializer-from-system-header">>; 3422def note_used_in_initialization_here : Note<"used in initialization here">; 3423def err_attribute_dll_member_of_dll_class : Error< 3424 "attribute %q0 cannot be applied to member of %q1 class">; 3425def warn_attribute_dll_instantiated_base_class : Warning< 3426 "propagating dll attribute to %select{already instantiated|explicitly specialized}0 " 3427 "base class template without dll attribute is not supported">, 3428 InGroup<DiagGroup<"unsupported-dll-base-class-template">>, DefaultIgnore; 3429def err_attribute_dll_ambiguous_default_ctor : Error< 3430 "'__declspec(dllexport)' cannot be applied to more than one default constructor in %0">; 3431def err_attribute_weakref_not_static : Error< 3432 "weakref declaration must have internal linkage">; 3433def err_attribute_weakref_not_global_context : Error< 3434 "weakref declaration of %0 must be in a global context">; 3435def err_attribute_weakref_without_alias : Error< 3436 "weakref declaration of %0 must also have an alias attribute">; 3437def err_alias_not_supported_on_darwin : Error < 3438 "aliases are not supported on darwin">; 3439def warn_attribute_wrong_decl_type_str : Warning< 3440 "%0 attribute only applies to %1">, InGroup<IgnoredAttributes>; 3441def err_attribute_wrong_decl_type_str : Error< 3442 warn_attribute_wrong_decl_type_str.Text>; 3443def warn_attribute_wrong_decl_type : Warning< 3444 "%0 attribute only applies to %select{" 3445 "functions" 3446 "|unions" 3447 "|variables and functions" 3448 "|functions and methods" 3449 "|functions, methods and blocks" 3450 "|functions, methods, and parameters" 3451 "|variables" 3452 "|variables and fields" 3453 "|variables, data members and tag types" 3454 "|types and namespaces" 3455 "|variables, functions and classes" 3456 "|kernel functions" 3457 "|non-K&R-style functions}1">, 3458 InGroup<IgnoredAttributes>; 3459def err_attribute_wrong_decl_type : Error<warn_attribute_wrong_decl_type.Text>; 3460def warn_type_attribute_wrong_type : Warning< 3461 "'%0' only applies to %select{function|pointer|" 3462 "Objective-C object or block pointer}1 types; type here is %2">, 3463 InGroup<IgnoredAttributes>; 3464def warn_incomplete_encoded_type : Warning< 3465 "encoding of %0 type is incomplete because %1 component has unknown encoding">, 3466 InGroup<DiagGroup<"encode-type">>; 3467def warn_gnu_inline_attribute_requires_inline : Warning< 3468 "'gnu_inline' attribute requires function to be marked 'inline'," 3469 " attribute ignored">, 3470 InGroup<IgnoredAttributes>; 3471def warn_gnu_inline_cplusplus_without_extern : Warning< 3472 "'gnu_inline' attribute without 'extern' in C++ treated as externally" 3473 " available, this changed in Clang 10">, 3474 InGroup<DiagGroup<"gnu-inline-cpp-without-extern">>; 3475def err_attribute_vecreturn_only_vector_member : Error< 3476 "the vecreturn attribute can only be used on a class or structure with one member, which must be a vector">; 3477def err_attribute_vecreturn_only_pod_record : Error< 3478 "the vecreturn attribute can only be used on a POD (plain old data) class or structure (i.e. no virtual functions)">; 3479def err_cconv_change : Error< 3480 "function declared '%0' here was previously declared " 3481 "%select{'%2'|without calling convention}1">; 3482def warn_cconv_unsupported : Warning< 3483 "%0 calling convention is not supported %select{" 3484 // Use CallingConventionIgnoredReason Enum to specify these. 3485 "for this target" 3486 "|on variadic function" 3487 "|on constructor/destructor" 3488 "|on builtin function" 3489 "}1">, 3490 InGroup<IgnoredAttributes>; 3491def error_cconv_unsupported : Error<warn_cconv_unsupported.Text>; 3492def err_cconv_knr : Error< 3493 "function with no prototype cannot use the %0 calling convention">; 3494def warn_cconv_knr : Warning< 3495 err_cconv_knr.Text>, 3496 InGroup<DiagGroup<"missing-prototype-for-cc">>; 3497def err_cconv_varargs : Error< 3498 "variadic function cannot use %0 calling convention">; 3499def err_regparm_mismatch : Error<"function declared with regparm(%0) " 3500 "attribute was previously declared " 3501 "%plural{0:without the regparm|:with the regparm(%1)}1 attribute">; 3502def err_function_attribute_mismatch : Error< 3503 "function declared with %0 attribute " 3504 "was previously declared without the %0 attribute">; 3505def err_objc_precise_lifetime_bad_type : Error< 3506 "objc_precise_lifetime only applies to retainable types; type here is %0">; 3507def warn_objc_precise_lifetime_meaningless : Error< 3508 "objc_precise_lifetime is not meaningful for " 3509 "%select{__unsafe_unretained|__autoreleasing}0 objects">; 3510def err_invalid_pcs : Error<"invalid PCS type">; 3511def warn_attribute_not_on_decl : Warning< 3512 "%0 attribute ignored when parsing type">, InGroup<IgnoredAttributes>; 3513def err_base_specifier_attribute : Error< 3514 "%0 attribute cannot be applied to a base specifier">; 3515def err_invalid_attribute_on_virtual_function : Error< 3516 "%0 attribute cannot be applied to virtual functions">; 3517def warn_declspec_allocator_nonpointer : Warning< 3518 "ignoring __declspec(allocator) because the function return type %0 is not " 3519 "a pointer or reference type">, InGroup<IgnoredAttributes>; 3520def err_cconv_incomplete_param_type : Error< 3521 "parameter %0 must have a complete type to use function %1 with the %2 " 3522 "calling convention">; 3523def err_attribute_output_parameter : Error< 3524 "attribute only applies to output parameters">; 3525 3526def ext_cannot_use_trivial_abi : ExtWarn< 3527 "'trivial_abi' cannot be applied to %0">, InGroup<IgnoredAttributes>; 3528def note_cannot_use_trivial_abi_reason : Note< 3529 "'trivial_abi' is disallowed on %0 because %select{" 3530 "its copy constructors and move constructors are all deleted|" 3531 "it is polymorphic|" 3532 "it has a base of a non-trivial class type|it has a virtual base|" 3533 "it has a __weak field|it has a field of a non-trivial class type}1">; 3534 3535// Availability attribute 3536def warn_availability_unknown_platform : Warning< 3537 "unknown platform %0 in availability macro">, InGroup<Availability>; 3538def warn_availability_version_ordering : Warning< 3539 "feature cannot be %select{introduced|deprecated|obsoleted}0 in %1 version " 3540 "%2 before it was %select{introduced|deprecated|obsoleted}3 in version %4; " 3541 "attribute ignored">, InGroup<Availability>; 3542def warn_mismatched_availability: Warning< 3543 "availability does not match previous declaration">, InGroup<Availability>; 3544def warn_mismatched_availability_override : Warning< 3545 "%select{|overriding }4method %select{introduced after|" 3546 "deprecated before|obsoleted before}0 " 3547 "%select{the protocol method it implements|overridden method}4 " 3548 "on %1 (%2 vs. %3)">, InGroup<Availability>; 3549def warn_mismatched_availability_override_unavail : Warning< 3550 "%select{|overriding }1method cannot be unavailable on %0 when " 3551 "%select{the protocol method it implements|its overridden method}1 is " 3552 "available">, 3553 InGroup<Availability>; 3554def warn_availability_on_static_initializer : Warning< 3555 "ignoring availability attribute %select{on '+load' method|" 3556 "with constructor attribute|with destructor attribute}0">, 3557 InGroup<Availability>; 3558def note_overridden_method : Note< 3559 "overridden method is here">; 3560def warn_availability_swift_unavailable_deprecated_only : Warning< 3561 "only 'unavailable' and 'deprecated' are supported for Swift availability">, 3562 InGroup<Availability>; 3563def note_protocol_method : Note< 3564 "protocol method is here">; 3565def warn_availability_fuchsia_unavailable_minor : Warning< 3566 "Fuchsia API Level prohibits specifying a minor or sub-minor version">, 3567 InGroup<Availability>; 3568 3569def warn_unguarded_availability : 3570 Warning<"%0 is only available on %1 %2 or newer">, 3571 InGroup<UnguardedAvailability>, DefaultIgnore; 3572def warn_unguarded_availability_new : 3573 Warning<warn_unguarded_availability.Text>, 3574 InGroup<UnguardedAvailabilityNew>; 3575def note_decl_unguarded_availability_silence : Note< 3576 "annotate %select{%1|anonymous %1}0 with an availability attribute to silence this warning">; 3577def note_unguarded_available_silence : Note< 3578 "enclose %0 in %select{an @available|a __builtin_available}1 check to silence" 3579 " this warning">; 3580def warn_at_available_unchecked_use : Warning< 3581 "%select{@available|__builtin_available}0 does not guard availability here; " 3582 "use if (%select{@available|__builtin_available}0) instead">, 3583 InGroup<DiagGroup<"unsupported-availability-guard">>; 3584 3585def warn_missing_sdksettings_for_availability_checking : Warning< 3586 "%0 availability is ignored without a valid 'SDKSettings.json' in the SDK">, 3587 InGroup<DiagGroup<"ignored-availability-without-sdk-settings">>; 3588 3589// Thread Safety Attributes 3590def warn_thread_attribute_ignored : Warning< 3591 "ignoring %0 attribute because its argument is invalid">, 3592 InGroup<ThreadSafetyAttributes>, DefaultIgnore; 3593def warn_thread_attribute_not_on_non_static_member : Warning< 3594 "%0 attribute without capability arguments can only be applied to non-static " 3595 "methods of a class">, 3596 InGroup<ThreadSafetyAttributes>, DefaultIgnore; 3597def warn_thread_attribute_not_on_capability_member : Warning< 3598 "%0 attribute without capability arguments refers to 'this', but %1 isn't " 3599 "annotated with 'capability' or 'scoped_lockable' attribute">, 3600 InGroup<ThreadSafetyAttributes>, DefaultIgnore; 3601def warn_thread_attribute_argument_not_lockable : Warning< 3602 "%0 attribute requires arguments whose type is annotated " 3603 "with 'capability' attribute; type here is %1">, 3604 InGroup<ThreadSafetyAttributes>, DefaultIgnore; 3605def warn_thread_attribute_decl_not_lockable : Warning< 3606 "%0 attribute can only be applied in a context annotated " 3607 "with 'capability' attribute">, 3608 InGroup<ThreadSafetyAttributes>, DefaultIgnore; 3609def warn_thread_attribute_decl_not_pointer : Warning< 3610 "%0 only applies to pointer types; type here is %1">, 3611 InGroup<ThreadSafetyAttributes>, DefaultIgnore; 3612def err_attribute_argument_out_of_bounds_extra_info : Error< 3613 "%0 attribute parameter %1 is out of bounds: " 3614 "%plural{0:no parameters to index into|" 3615 "1:can only be 1, since there is one parameter|" 3616 ":must be between 1 and %2}2">; 3617 3618// Thread Safety Analysis 3619def warn_unlock_but_no_lock : Warning<"releasing %0 '%1' that was not held">, 3620 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3621def warn_unlock_kind_mismatch : Warning< 3622 "releasing %0 '%1' using %select{shared|exclusive}2 access, expected " 3623 "%select{shared|exclusive}3 access">, 3624 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3625def warn_double_lock : Warning<"acquiring %0 '%1' that is already held">, 3626 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3627def warn_no_unlock : Warning< 3628 "%0 '%1' is still held at the end of function">, 3629 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3630def warn_expecting_locked : Warning< 3631 "expecting %0 '%1' to be held at the end of function">, 3632 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3633// FIXME: improve the error message about locks not in scope 3634def warn_lock_some_predecessors : Warning< 3635 "%0 '%1' is not held on every path through here">, 3636 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3637def warn_expecting_lock_held_on_loop : Warning< 3638 "expecting %0 '%1' to be held at start of each loop">, 3639 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3640def note_locked_here : Note<"%0 acquired here">; 3641def note_unlocked_here : Note<"%0 released here">; 3642def warn_lock_exclusive_and_shared : Warning< 3643 "%0 '%1' is acquired exclusively and shared in the same scope">, 3644 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3645def note_lock_exclusive_and_shared : Note< 3646 "the other acquisition of %0 '%1' is here">; 3647def warn_variable_requires_any_lock : Warning< 3648 "%select{reading|writing}1 variable %0 requires holding " 3649 "%select{any mutex|any mutex exclusively}1">, 3650 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3651def warn_var_deref_requires_any_lock : Warning< 3652 "%select{reading|writing}1 the value pointed to by %0 requires holding " 3653 "%select{any mutex|any mutex exclusively}1">, 3654 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3655def warn_fun_excludes_mutex : Warning< 3656 "cannot call function '%1' while %0 '%2' is held">, 3657 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3658def warn_cannot_resolve_lock : Warning< 3659 "cannot resolve lock expression">, 3660 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3661def warn_acquired_before : Warning< 3662 "%0 '%1' must be acquired before '%2'">, 3663 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3664def warn_acquired_before_after_cycle : Warning< 3665 "Cycle in acquired_before/after dependencies, starting with '%0'">, 3666 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3667 3668 3669// Thread safety warnings negative capabilities 3670def warn_acquire_requires_negative_cap : Warning< 3671 "acquiring %0 '%1' requires negative capability '%2'">, 3672 InGroup<ThreadSafetyNegative>, DefaultIgnore; 3673def warn_fun_requires_negative_cap : Warning< 3674 "calling function %0 requires negative capability '%1'">, 3675 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3676 3677// Thread safety warnings on pass by reference 3678def warn_guarded_pass_by_reference : Warning< 3679 "passing variable %1 by reference requires holding %0 " 3680 "%select{'%2'|'%2' exclusively}3">, 3681 InGroup<ThreadSafetyReference>, DefaultIgnore; 3682def warn_pt_guarded_pass_by_reference : Warning< 3683 "passing the value that %1 points to by reference requires holding %0 " 3684 "%select{'%2'|'%2' exclusively}3">, 3685 InGroup<ThreadSafetyReference>, DefaultIgnore; 3686 3687// Imprecise thread safety warnings 3688def warn_variable_requires_lock : Warning< 3689 "%select{reading|writing}3 variable %1 requires holding %0 " 3690 "%select{'%2'|'%2' exclusively}3">, 3691 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3692def warn_var_deref_requires_lock : Warning< 3693 "%select{reading|writing}3 the value pointed to by %1 requires " 3694 "holding %0 %select{'%2'|'%2' exclusively}3">, 3695 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3696def warn_fun_requires_lock : Warning< 3697 "calling function %1 requires holding %0 %select{'%2'|'%2' exclusively}3">, 3698 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3699 3700// Precise thread safety warnings 3701def warn_variable_requires_lock_precise : 3702 Warning<warn_variable_requires_lock.Text>, 3703 InGroup<ThreadSafetyPrecise>, DefaultIgnore; 3704def warn_var_deref_requires_lock_precise : 3705 Warning<warn_var_deref_requires_lock.Text>, 3706 InGroup<ThreadSafetyPrecise>, DefaultIgnore; 3707def warn_fun_requires_lock_precise : 3708 Warning<warn_fun_requires_lock.Text>, 3709 InGroup<ThreadSafetyPrecise>, DefaultIgnore; 3710def note_found_mutex_near_match : Note<"found near match '%0'">; 3711 3712// Verbose thread safety warnings 3713def warn_thread_safety_verbose : Warning<"thread safety verbose warning">, 3714 InGroup<ThreadSafetyVerbose>, DefaultIgnore; 3715def note_thread_warning_in_fun : Note<"thread warning in function %0">; 3716def note_guarded_by_declared_here : Note<"guarded_by declared here">; 3717 3718// Dummy warning that will trigger "beta" warnings from the analysis if enabled. 3719def warn_thread_safety_beta : Warning<"thread safety beta warning">, 3720 InGroup<ThreadSafetyBeta>, DefaultIgnore; 3721 3722// Consumed warnings 3723def warn_use_in_invalid_state : Warning< 3724 "invalid invocation of method '%0' on object '%1' while it is in the '%2' " 3725 "state">, InGroup<Consumed>, DefaultIgnore; 3726def warn_use_of_temp_in_invalid_state : Warning< 3727 "invalid invocation of method '%0' on a temporary object while it is in the " 3728 "'%1' state">, InGroup<Consumed>, DefaultIgnore; 3729def warn_attr_on_unconsumable_class : Warning< 3730 "consumed analysis attribute is attached to member of class %0 which isn't " 3731 "marked as consumable">, InGroup<Consumed>, DefaultIgnore; 3732def warn_return_typestate_for_unconsumable_type : Warning< 3733 "return state set for an unconsumable type '%0'">, InGroup<Consumed>, 3734 DefaultIgnore; 3735def warn_return_typestate_mismatch : Warning< 3736 "return value not in expected state; expected '%0', observed '%1'">, 3737 InGroup<Consumed>, DefaultIgnore; 3738def warn_loop_state_mismatch : Warning< 3739 "state of variable '%0' must match at the entry and exit of loop">, 3740 InGroup<Consumed>, DefaultIgnore; 3741def warn_param_return_typestate_mismatch : Warning< 3742 "parameter '%0' not in expected state when the function returns: expected " 3743 "'%1', observed '%2'">, InGroup<Consumed>, DefaultIgnore; 3744def warn_param_typestate_mismatch : Warning< 3745 "argument not in expected state; expected '%0', observed '%1'">, 3746 InGroup<Consumed>, DefaultIgnore; 3747 3748// no_sanitize attribute 3749def warn_unknown_sanitizer_ignored : Warning< 3750 "unknown sanitizer '%0' ignored">, InGroup<UnknownSanitizers>; 3751 3752def warn_impcast_vector_scalar : Warning< 3753 "implicit conversion turns vector to scalar: %0 to %1">, 3754 InGroup<Conversion>, DefaultIgnore; 3755def warn_impcast_complex_scalar : Warning< 3756 "implicit conversion discards imaginary component: %0 to %1">, 3757 InGroup<Conversion>, DefaultIgnore; 3758def err_impcast_complex_scalar : Error< 3759 "implicit conversion from %0 to %1 is not permitted in C++">; 3760def warn_impcast_float_precision : Warning< 3761 "implicit conversion loses floating-point precision: %0 to %1">, 3762 InGroup<ImplicitFloatConversion>, DefaultIgnore; 3763def warn_impcast_float_result_precision : Warning< 3764 "implicit conversion when assigning computation result loses floating-point precision: %0 to %1">, 3765 InGroup<ImplicitFloatConversion>, DefaultIgnore; 3766def warn_impcast_double_promotion : Warning< 3767 "implicit conversion increases floating-point precision: %0 to %1">, 3768 InGroup<DoublePromotion>, DefaultIgnore; 3769def warn_impcast_integer_sign : Warning< 3770 "implicit conversion changes signedness: %0 to %1">, 3771 InGroup<SignConversion>, DefaultIgnore; 3772def warn_impcast_integer_sign_conditional : Warning< 3773 "operand of ? changes signedness: %0 to %1">, 3774 InGroup<SignConversion>, DefaultIgnore; 3775def warn_impcast_integer_precision : Warning< 3776 "implicit conversion loses integer precision: %0 to %1">, 3777 InGroup<ImplicitIntConversion>, DefaultIgnore; 3778def warn_impcast_high_order_zero_bits : Warning< 3779 "higher order bits are zeroes after implicit conversion">, 3780 InGroup<ImplicitIntConversion>, DefaultIgnore; 3781def warn_impcast_nonnegative_result : Warning< 3782 "the resulting value is always non-negative after implicit conversion">, 3783 InGroup<SignConversion>, DefaultIgnore; 3784def warn_impcast_integer_64_32 : Warning< 3785 "implicit conversion loses integer precision: %0 to %1">, 3786 InGroup<Shorten64To32>, DefaultIgnore; 3787def warn_impcast_integer_precision_constant : Warning< 3788 "implicit conversion from %2 to %3 changes value from %0 to %1">, 3789 InGroup<ConstantConversion>; 3790def warn_impcast_bitfield_precision_constant : Warning< 3791 "implicit truncation from %2 to bit-field changes value from %0 to %1">, 3792 InGroup<BitFieldConstantConversion>; 3793def warn_impcast_constant_value_to_objc_bool : Warning< 3794 "implicit conversion from constant value %0 to 'BOOL'; " 3795 "the only well defined values for 'BOOL' are YES and NO">, 3796 InGroup<ObjCBoolConstantConversion>; 3797 3798def warn_impcast_fixed_point_range : Warning< 3799 "implicit conversion from %0 cannot fit within the range of values for %1">, 3800 InGroup<ImplicitFixedPointConversion>; 3801 3802def warn_impcast_literal_float_to_integer : Warning< 3803 "implicit conversion from %0 to %1 changes value from %2 to %3">, 3804 InGroup<LiteralConversion>; 3805def warn_impcast_literal_float_to_integer_out_of_range : Warning< 3806 "implicit conversion of out of range value from %0 to %1 is undefined">, 3807 InGroup<LiteralConversion>; 3808def warn_impcast_float_integer : Warning< 3809 "implicit conversion turns floating-point number into integer: %0 to %1">, 3810 InGroup<FloatConversion>, DefaultIgnore; 3811def warn_impcast_float_to_objc_signed_char_bool : Warning< 3812 "implicit conversion from floating-point type %0 to 'BOOL'">, 3813 InGroup<ObjCSignedCharBoolImplicitFloatConversion>; 3814def warn_impcast_int_to_objc_signed_char_bool : Warning< 3815 "implicit conversion from integral type %0 to 'BOOL'">, 3816 InGroup<ObjCSignedCharBoolImplicitIntConversion>, DefaultIgnore; 3817 3818// Implicit int -> float conversion precision loss warnings. 3819def warn_impcast_integer_float_precision : Warning< 3820 "implicit conversion from %0 to %1 may lose precision">, 3821 InGroup<ImplicitIntFloatConversion>, DefaultIgnore; 3822def warn_impcast_integer_float_precision_constant : Warning< 3823 "implicit conversion from %2 to %3 changes value from %0 to %1">, 3824 InGroup<ImplicitConstIntFloatConversion>; 3825 3826def warn_impcast_float_to_integer : Warning< 3827 "implicit conversion from %0 to %1 changes value from %2 to %3">, 3828 InGroup<FloatOverflowConversion>, DefaultIgnore; 3829def warn_impcast_float_to_integer_out_of_range : Warning< 3830 "implicit conversion of out of range value from %0 to %1 is undefined">, 3831 InGroup<FloatOverflowConversion>, DefaultIgnore; 3832def warn_impcast_float_to_integer_zero : Warning< 3833 "implicit conversion from %0 to %1 changes non-zero value from %2 to %3">, 3834 InGroup<FloatZeroConversion>, DefaultIgnore; 3835 3836def warn_impcast_string_literal_to_bool : Warning< 3837 "implicit conversion turns string literal into bool: %0 to %1">, 3838 InGroup<StringConversion>, DefaultIgnore; 3839def warn_impcast_different_enum_types : Warning< 3840 "implicit conversion from enumeration type %0 to different enumeration type " 3841 "%1">, InGroup<EnumConversion>; 3842def warn_impcast_bool_to_null_pointer : Warning< 3843 "initialization of pointer of type %0 to null from a constant boolean " 3844 "expression">, InGroup<BoolConversion>; 3845def warn_non_literal_null_pointer : Warning< 3846 "expression which evaluates to zero treated as a null pointer constant of " 3847 "type %0">, InGroup<NonLiteralNullConversion>; 3848def warn_pointer_compare : Warning< 3849 "comparing a pointer to a null character constant; did you mean " 3850 "to compare to %select{NULL|(void *)0}0?">, 3851 InGroup<DiagGroup<"pointer-compare">>; 3852def warn_impcast_null_pointer_to_integer : Warning< 3853 "implicit conversion of %select{NULL|nullptr}0 constant to %1">, 3854 InGroup<NullConversion>; 3855def warn_impcast_floating_point_to_bool : Warning< 3856 "implicit conversion turns floating-point number into bool: %0 to %1">, 3857 InGroup<ImplicitConversionFloatingPointToBool>; 3858def ext_ms_impcast_fn_obj : ExtWarn< 3859 "implicit conversion between pointer-to-function and pointer-to-object is a " 3860 "Microsoft extension">, InGroup<MicrosoftCast>; 3861 3862def warn_impcast_pointer_to_bool : Warning< 3863 "address of%select{| function| array}0 '%1' will always evaluate to " 3864 "'true'">, 3865 InGroup<PointerBoolConversion>; 3866def warn_cast_nonnull_to_bool : Warning< 3867 "nonnull %select{function call|parameter}0 '%1' will evaluate to " 3868 "'true' on first encounter">, 3869 InGroup<PointerBoolConversion>; 3870def warn_this_bool_conversion : Warning< 3871 "'this' pointer cannot be null in well-defined C++ code; pointer may be " 3872 "assumed to always convert to true">, InGroup<UndefinedBoolConversion>; 3873def warn_address_of_reference_bool_conversion : Warning< 3874 "reference cannot be bound to dereferenced null pointer in well-defined C++ " 3875 "code; pointer may be assumed to always convert to true">, 3876 InGroup<UndefinedBoolConversion>; 3877 3878def warn_xor_used_as_pow : Warning< 3879 "result of '%0' is %1; did you mean exponentiation?">, 3880 InGroup<XorUsedAsPow>; 3881def warn_xor_used_as_pow_base_extra : Warning< 3882 "result of '%0' is %1; did you mean '%2' (%3)?">, 3883 InGroup<XorUsedAsPow>; 3884def warn_xor_used_as_pow_base : Warning< 3885 "result of '%0' is %1; did you mean '%2'?">, 3886 InGroup<XorUsedAsPow>; 3887def note_xor_used_as_pow_silence : Note< 3888 "replace expression with '%0' %select{|or use 'xor' instead of '^' }1to silence this warning">; 3889 3890def warn_null_pointer_compare : Warning< 3891 "comparison of %select{address of|function|array}0 '%1' %select{not |}2" 3892 "equal to a null pointer is always %select{true|false}2">, 3893 InGroup<TautologicalPointerCompare>; 3894def warn_nonnull_expr_compare : Warning< 3895 "comparison of nonnull %select{function call|parameter}0 '%1' " 3896 "%select{not |}2equal to a null pointer is '%select{true|false}2' on first " 3897 "encounter">, 3898 InGroup<TautologicalPointerCompare>; 3899def warn_this_null_compare : Warning< 3900 "'this' pointer cannot be null in well-defined C++ code; comparison may be " 3901 "assumed to always evaluate to %select{true|false}0">, 3902 InGroup<TautologicalUndefinedCompare>; 3903def warn_address_of_reference_null_compare : Warning< 3904 "reference cannot be bound to dereferenced null pointer in well-defined C++ " 3905 "code; comparison may be assumed to always evaluate to " 3906 "%select{true|false}0">, 3907 InGroup<TautologicalUndefinedCompare>; 3908def note_reference_is_return_value : Note<"%0 returns a reference">; 3909 3910def note_pointer_declared_here : Note< 3911 "pointer %0 declared here">; 3912def warn_division_sizeof_ptr : Warning< 3913 "'%0' will return the size of the pointer, not the array itself">, 3914 InGroup<DiagGroup<"sizeof-pointer-div">>; 3915def warn_division_sizeof_array : Warning< 3916 "expression does not compute the number of elements in this array; element " 3917 "type is %0, not %1">, 3918 InGroup<DiagGroup<"sizeof-array-div">>; 3919 3920def note_function_warning_silence : Note< 3921 "prefix with the address-of operator to silence this warning">; 3922def note_function_to_function_call : Note< 3923 "suffix with parentheses to turn this into a function call">; 3924def warn_impcast_objective_c_literal_to_bool : Warning< 3925 "implicit boolean conversion of Objective-C object literal always " 3926 "evaluates to true">, 3927 InGroup<ObjCLiteralConversion>; 3928 3929def warn_cast_align : Warning< 3930 "cast from %0 to %1 increases required alignment from %2 to %3">, 3931 InGroup<CastAlign>, DefaultIgnore; 3932def warn_old_style_cast : Warning< 3933 "use of old-style cast">, InGroup<OldStyleCast>, DefaultIgnore; 3934 3935// Separate between casts to void* and non-void* pointers. 3936// Some APIs use (abuse) void* for something like a user context, 3937// and often that value is an integer even if it isn't a pointer itself. 3938// Having a separate warning flag allows users to control the warning 3939// for their workflow. 3940def warn_int_to_pointer_cast : Warning< 3941 "cast to %1 from smaller integer type %0">, 3942 InGroup<IntToPointerCast>; 3943def warn_int_to_void_pointer_cast : Warning< 3944 "cast to %1 from smaller integer type %0">, 3945 InGroup<IntToVoidPointerCast>; 3946def warn_pointer_to_int_cast : Warning< 3947 "cast to smaller integer type %1 from %0">, 3948 InGroup<PointerToIntCast>; 3949def warn_pointer_to_enum_cast : Warning< 3950 warn_pointer_to_int_cast.Text>, 3951 InGroup<PointerToEnumCast>; 3952def warn_void_pointer_to_int_cast : Warning< 3953 "cast to smaller integer type %1 from %0">, 3954 InGroup<VoidPointerToIntCast>; 3955def warn_void_pointer_to_enum_cast : Warning< 3956 warn_void_pointer_to_int_cast.Text>, 3957 InGroup<VoidPointerToEnumCast>; 3958 3959def warn_attribute_ignored_for_field_of_type : Warning< 3960 "%0 attribute ignored for field of type %1">, 3961 InGroup<IgnoredAttributes>; 3962def warn_no_underlying_type_specified_for_enum_bitfield : Warning< 3963 "enums in the Microsoft ABI are signed integers by default; consider giving " 3964 "the enum %0 an unsigned underlying type to make this code portable">, 3965 InGroup<SignedEnumBitfield>, DefaultIgnore; 3966def warn_attribute_packed_for_bitfield : Warning< 3967 "'packed' attribute was ignored on bit-fields with single-byte alignment " 3968 "in older versions of GCC and Clang">, 3969 InGroup<DiagGroup<"attribute-packed-for-bitfield">>; 3970def warn_transparent_union_attribute_field_size_align : Warning< 3971 "%select{alignment|size}0 of field %1 (%2 bits) does not match the " 3972 "%select{alignment|size}0 of the first field in transparent union; " 3973 "transparent_union attribute ignored">, 3974 InGroup<IgnoredAttributes>; 3975def note_transparent_union_first_field_size_align : Note< 3976 "%select{alignment|size}0 of first field is %1 bits">; 3977def warn_transparent_union_attribute_not_definition : Warning< 3978 "transparent_union attribute can only be applied to a union definition; " 3979 "attribute ignored">, 3980 InGroup<IgnoredAttributes>; 3981def warn_transparent_union_attribute_floating : Warning< 3982 "first field of a transparent union cannot have %select{floating point|" 3983 "vector}0 type %1; transparent_union attribute ignored">, 3984 InGroup<IgnoredAttributes>; 3985def warn_transparent_union_attribute_zero_fields : Warning< 3986 "transparent union definition must contain at least one field; " 3987 "transparent_union attribute ignored">, 3988 InGroup<IgnoredAttributes>; 3989def warn_attribute_type_not_supported : Warning< 3990 "%0 attribute argument not supported: %1">, 3991 InGroup<IgnoredAttributes>; 3992def warn_attribute_unknown_visibility : Warning<"unknown visibility %0">, 3993 InGroup<IgnoredAttributes>; 3994def warn_attribute_protected_visibility : 3995 Warning<"target does not support 'protected' visibility; using 'default'">, 3996 InGroup<DiagGroup<"unsupported-visibility">>; 3997def err_mismatched_visibility: Error<"visibility does not match previous declaration">; 3998def note_previous_attribute : Note<"previous attribute is here">; 3999def note_conflicting_attribute : Note<"conflicting attribute is here">; 4000def note_attribute : Note<"attribute is here">; 4001def err_mismatched_ms_inheritance : Error< 4002 "inheritance model does not match %select{definition|previous declaration}0">; 4003def warn_ignored_ms_inheritance : Warning< 4004 "inheritance model ignored on %select{primary template|partial specialization}0">, 4005 InGroup<IgnoredAttributes>; 4006def note_previous_ms_inheritance : Note< 4007 "previous inheritance model specified here">; 4008def err_machine_mode : Error<"%select{unknown|unsupported}0 machine mode %1">; 4009def err_mode_not_primitive : Error< 4010 "mode attribute only supported for integer and floating-point types">; 4011def err_mode_wrong_type : Error< 4012 "type of machine mode does not match type of base type">; 4013def warn_vector_mode_deprecated : Warning< 4014 "specifying vector types with the 'mode' attribute is deprecated; " 4015 "use the 'vector_size' attribute instead">, 4016 InGroup<DeprecatedAttributes>; 4017def err_complex_mode_vector_type : Error< 4018 "type of machine mode does not support base vector types">; 4019def err_enum_mode_vector_type : Error< 4020 "mode %0 is not supported for enumeration types">; 4021def warn_attribute_nonnull_no_pointers : Warning< 4022 "'nonnull' attribute applied to function with no pointer arguments">, 4023 InGroup<IgnoredAttributes>; 4024def warn_attribute_nonnull_parm_no_args : Warning< 4025 "'nonnull' attribute when used on parameters takes no arguments">, 4026 InGroup<IgnoredAttributes>; 4027def note_declared_nonnull : Note< 4028 "declared %select{'returns_nonnull'|'nonnull'}0 here">; 4029def warn_attribute_sentinel_named_arguments : Warning< 4030 "'sentinel' attribute requires named arguments">, 4031 InGroup<IgnoredAttributes>; 4032def warn_attribute_sentinel_not_variadic : Warning< 4033 "'sentinel' attribute only supported for variadic %select{functions|blocks}0">, 4034 InGroup<IgnoredAttributes>; 4035def warn_deprecated_ignored_on_using : Warning< 4036 "%0 currently has no effect on a using declaration">, 4037 InGroup<IgnoredAttributes>; 4038def err_attribute_sentinel_less_than_zero : Error< 4039 "'sentinel' parameter 1 less than zero">; 4040def err_attribute_sentinel_not_zero_or_one : Error< 4041 "'sentinel' parameter 2 not 0 or 1">; 4042def warn_cleanup_ext : Warning< 4043 "GCC does not allow the 'cleanup' attribute argument to be anything other " 4044 "than a simple identifier">, 4045 InGroup<GccCompat>; 4046def err_attribute_cleanup_arg_not_function : Error< 4047 "'cleanup' argument %select{|%1 |%1 }0is not a %select{||single }0function">; 4048def err_attribute_cleanup_func_must_take_one_arg : Error< 4049 "'cleanup' function %0 must take 1 parameter">; 4050def err_attribute_cleanup_func_arg_incompatible_type : Error< 4051 "'cleanup' function %0 parameter has " 4052 "%diff{type $ which is incompatible with type $|incompatible type}1,2">; 4053def err_attribute_regparm_wrong_platform : Error< 4054 "'regparm' is not valid on this platform">; 4055def err_attribute_regparm_invalid_number : Error< 4056 "'regparm' parameter must be between 0 and %0 inclusive">; 4057def err_attribute_not_supported_in_lang : Error< 4058 "%0 attribute is not supported in %select{C|C++|Objective-C}1">; 4059def err_attribute_not_supported_on_arch 4060 : Error<"%0 attribute is not supported on '%1'">; 4061def warn_gcc_ignores_type_attr : Warning< 4062 "GCC does not allow the %0 attribute to be written on a type">, 4063 InGroup<GccCompat>; 4064 4065// Clang-Specific Attributes 4066def warn_attribute_iboutlet : Warning< 4067 "%0 attribute can only be applied to instance variables or properties">, 4068 InGroup<IgnoredAttributes>; 4069def err_iboutletcollection_type : Error< 4070 "invalid type %0 as argument of iboutletcollection attribute">; 4071def err_iboutletcollection_builtintype : Error< 4072 "type argument of iboutletcollection attribute cannot be a builtin type">; 4073def warn_iboutlet_object_type : Warning< 4074 "%select{instance variable|property}2 with %0 attribute must " 4075 "be an object type (invalid %1)">, InGroup<ObjCInvalidIBOutletProperty>; 4076def warn_iboutletcollection_property_assign : Warning< 4077 "IBOutletCollection properties should be copy/strong and not assign">, 4078 InGroup<ObjCInvalidIBOutletProperty>; 4079 4080def err_attribute_overloadable_mismatch : Error< 4081 "redeclaration of %0 must %select{not |}1have the 'overloadable' attribute">; 4082def note_attribute_overloadable_prev_overload : Note< 4083 "previous %select{unmarked |}0overload of function is here">; 4084def err_attribute_overloadable_no_prototype : Error< 4085 "'overloadable' function %0 must have a prototype">; 4086def err_attribute_overloadable_multiple_unmarked_overloads : Error< 4087 "at most one overload for a given name may lack the 'overloadable' " 4088 "attribute">; 4089def warn_attribute_no_builtin_invalid_builtin_name : Warning< 4090 "'%0' is not a valid builtin name for %1">, 4091 InGroup<DiagGroup<"invalid-no-builtin-names">>; 4092def err_attribute_no_builtin_wildcard_or_builtin_name : Error< 4093 "empty %0 cannot be composed with named ones">; 4094def err_attribute_no_builtin_on_non_definition : Error< 4095 "%0 attribute is permitted on definitions only">; 4096def err_attribute_no_builtin_on_defaulted_deleted_function : Error< 4097 "%0 attribute has no effect on defaulted or deleted functions">; 4098def warn_ns_attribute_wrong_return_type : Warning< 4099 "%0 attribute only applies to %select{functions|methods|properties}1 that " 4100 "return %select{an Objective-C object|a pointer|a non-retainable pointer}2">, 4101 InGroup<IgnoredAttributes>; 4102def err_ns_attribute_wrong_parameter_type : Error< 4103 "%0 attribute only applies to " 4104 "%select{Objective-C object|pointer|pointer-to-CF-pointer}1 parameters">; 4105def warn_ns_attribute_wrong_parameter_type : Warning< 4106 "%0 attribute only applies to " 4107 "%select{Objective-C object|pointer|pointer-to-CF-pointer|pointer/reference-to-OSObject-pointer}1 parameters">, 4108 InGroup<IgnoredAttributes>; 4109def warn_objc_requires_super_protocol : Warning< 4110 "%0 attribute cannot be applied to %select{methods in protocols|dealloc}1">, 4111 InGroup<DiagGroup<"requires-super-attribute">>; 4112def note_protocol_decl : Note< 4113 "protocol is declared here">; 4114def note_protocol_decl_undefined : Note< 4115 "protocol %0 has no definition">; 4116def err_attribute_preferred_name_arg_invalid : Error< 4117 "argument %0 to 'preferred_name' attribute is not a typedef for " 4118 "a specialization of %1">; 4119def err_attribute_builtin_alias : Error< 4120 "%0 attribute can only be applied to a ARM or RISC-V builtin">; 4121 4122// called-once attribute diagnostics. 4123def err_called_once_attribute_wrong_type : Error< 4124 "'called_once' attribute only applies to function-like parameters">; 4125 4126def warn_completion_handler_never_called : Warning< 4127 "%select{|captured }1completion handler is never called">, 4128 InGroup<CompletionHandler>, DefaultIgnore; 4129def warn_called_once_never_called : Warning< 4130 "%select{|captured }1%0 parameter marked 'called_once' is never called">, 4131 InGroup<CalledOnceParameter>; 4132 4133def warn_completion_handler_never_called_when : Warning< 4134 "completion handler is never %select{used|called}1 when " 4135 "%select{taking true branch|taking false branch|" 4136 "handling this case|none of the cases applies|" 4137 "entering the loop|skipping the loop|taking one of the branches}2">, 4138 InGroup<CompletionHandler>, DefaultIgnore; 4139def warn_called_once_never_called_when : Warning< 4140 "%0 parameter marked 'called_once' is never %select{used|called}1 when " 4141 "%select{taking true branch|taking false branch|" 4142 "handling this case|none of the cases applies|" 4143 "entering the loop|skipping the loop|taking one of the branches}2">, 4144 InGroup<CalledOnceParameter>; 4145 4146def warn_completion_handler_called_twice : Warning< 4147 "completion handler is called twice">, 4148 InGroup<CompletionHandler>, DefaultIgnore; 4149def warn_called_once_gets_called_twice : Warning< 4150 "%0 parameter marked 'called_once' is called twice">, 4151 InGroup<CalledOnceParameter>; 4152def note_called_once_gets_called_twice : Note< 4153 "previous call is here%select{; set to nil to indicate " 4154 "it cannot be called afterwards|}0">; 4155 4156// objc_designated_initializer attribute diagnostics. 4157def warn_objc_designated_init_missing_super_call : Warning< 4158 "designated initializer missing a 'super' call to a designated initializer of the super class">, 4159 InGroup<ObjCDesignatedInit>; 4160def note_objc_designated_init_marked_here : Note< 4161 "method marked as designated initializer of the class here">; 4162def warn_objc_designated_init_non_super_designated_init_call : Warning< 4163 "designated initializer should only invoke a designated initializer on 'super'">, 4164 InGroup<ObjCDesignatedInit>; 4165def warn_objc_designated_init_non_designated_init_call : Warning< 4166 "designated initializer invoked a non-designated initializer">, 4167 InGroup<ObjCDesignatedInit>; 4168def warn_objc_secondary_init_super_init_call : Warning< 4169 "convenience initializer should not invoke an initializer on 'super'">, 4170 InGroup<ObjCDesignatedInit>; 4171def warn_objc_secondary_init_missing_init_call : Warning< 4172 "convenience initializer missing a 'self' call to another initializer">, 4173 InGroup<ObjCDesignatedInit>; 4174def warn_objc_implementation_missing_designated_init_override : Warning< 4175 "method override for the designated initializer of the superclass %objcinstance0 not found">, 4176 InGroup<ObjCDesignatedInit>; 4177def err_designated_init_attr_non_init : Error< 4178 "'objc_designated_initializer' attribute only applies to init methods " 4179 "of interface or class extension declarations">; 4180 4181// objc_bridge attribute diagnostics. 4182def err_objc_attr_not_id : Error< 4183 "parameter of %0 attribute must be a single name of an Objective-C %select{class|protocol}1">; 4184def err_objc_attr_typedef_not_id : Error< 4185 "parameter of %0 attribute must be 'id' when used on a typedef">; 4186def err_objc_attr_typedef_not_void_pointer : Error< 4187 "'objc_bridge(id)' is only allowed on structs and typedefs of void pointers">; 4188def err_objc_cf_bridged_not_interface : Error< 4189 "CF object of type %0 is bridged to %1, which is not an Objective-C class">; 4190def err_objc_ns_bridged_invalid_cfobject : Error< 4191 "ObjectiveC object of type %0 is bridged to %1, which is not valid CF object">; 4192def warn_objc_invalid_bridge : Warning< 4193 "%0 bridges to %1, not %2">, InGroup<ObjCBridge>; 4194def warn_objc_invalid_bridge_to_cf : Warning< 4195 "%0 cannot bridge to %1">, InGroup<ObjCBridge>; 4196 4197// objc_bridge_related attribute diagnostics. 4198def err_objc_bridged_related_invalid_class : Error< 4199 "could not find Objective-C class %0 to convert %1 to %2">; 4200def err_objc_bridged_related_invalid_class_name : Error< 4201 "%0 must be name of an Objective-C class to be able to convert %1 to %2">; 4202def err_objc_bridged_related_known_method : Error< 4203 "%0 must be explicitly converted to %1; use %select{%objcclass2|%objcinstance2}3 " 4204 "method for this conversion">; 4205 4206def err_objc_attr_protocol_requires_definition : Error< 4207 "attribute %0 can only be applied to @protocol definitions, not forward declarations">; 4208 4209// Swift attributes. 4210def warn_attr_swift_name_function 4211 : Warning<"%0 attribute argument must be a string literal specifying a Swift function name">, 4212 InGroup<SwiftNameAttribute>; 4213def warn_attr_swift_name_invalid_identifier 4214 : Warning<"%0 attribute has invalid identifier for the %select{base|context|parameter}1 name">, 4215 InGroup<SwiftNameAttribute>; 4216def warn_attr_swift_name_decl_kind 4217 : Warning<"%0 attribute cannot be applied to this declaration">, 4218 InGroup<SwiftNameAttribute>; 4219def warn_attr_swift_name_subscript_invalid_parameter 4220 : Warning<"%0 attribute for 'subscript' must %select{be a getter or setter|" 4221 "have at least one parameter|" 4222 "have a 'self:' parameter}1">, 4223 InGroup<SwiftNameAttribute>; 4224def warn_attr_swift_name_missing_parameters 4225 : Warning<"%0 attribute is missing parameter label clause">, 4226 InGroup<SwiftNameAttribute>; 4227def warn_attr_swift_name_setter_parameters 4228 : Warning<"%0 attribute for setter must have one parameter for new value">, 4229 InGroup<SwiftNameAttribute>; 4230def warn_attr_swift_name_multiple_selfs 4231 : Warning<"%0 attribute cannot specify more than one 'self:' parameter">, 4232 InGroup<SwiftNameAttribute>; 4233def warn_attr_swift_name_getter_parameters 4234 : Warning<"%0 attribute for getter must not have any parameters besides 'self:'">, 4235 InGroup<SwiftNameAttribute>; 4236def warn_attr_swift_name_subscript_setter_no_newValue 4237 : Warning<"%0 attribute for 'subscript' setter must have a 'newValue:' parameter">, 4238 InGroup<SwiftNameAttribute>; 4239def warn_attr_swift_name_subscript_setter_multiple_newValues 4240 : Warning<"%0 attribute for 'subscript' setter cannot have multiple 'newValue:' parameters">, 4241 InGroup<SwiftNameAttribute>; 4242def warn_attr_swift_name_subscript_getter_newValue 4243 : Warning<"%0 attribute for 'subscript' getter cannot have a 'newValue:' parameter">, 4244 InGroup<SwiftNameAttribute>; 4245def warn_attr_swift_name_num_params 4246 : Warning<"too %select{few|many}0 parameters in the signature specified by " 4247 "the %1 attribute (expected %2; got %3)">, 4248 InGroup<SwiftNameAttribute>; 4249def warn_attr_swift_name_decl_missing_params 4250 : Warning<"%0 attribute cannot be applied to a %select{function|method}1 " 4251 "with no parameters">, 4252 InGroup<SwiftNameAttribute>; 4253 4254def err_attr_swift_error_no_error_parameter : Error< 4255 "%0 attribute can only be applied to a %select{function|method}1 with an " 4256 "error parameter">; 4257def err_attr_swift_error_return_type : Error< 4258 "%0 attribute with '%1' convention can only be applied to a " 4259 "%select{function|method}2 returning %select{an integral type|a pointer}3">; 4260 4261def err_swift_async_no_access : Error< 4262 "first argument to 'swift_async' must be either 'none', 'swift_private', or " 4263 "'not_swift_private'">; 4264def err_swift_async_bad_block_type : Error< 4265 "'swift_async' completion handler parameter must have block type returning" 4266 " 'void', type here is %0">; 4267 4268def err_swift_async_error_without_swift_async : Error< 4269 "%0 attribute must be applied to a %select{function|method}1 annotated " 4270 "with non-'none' attribute 'swift_async'">; 4271def err_swift_async_error_no_error_parameter : Error< 4272 "%0 attribute with 'nonnull_error' convention can only be applied to a " 4273 "%select{function|method}1 with a completion handler with an error " 4274 "parameter">; 4275def err_swift_async_error_non_integral : Error< 4276 "%0 attribute with '%1' convention must have an integral-typed parameter " 4277 "in completion handler at index %2, type here is %3">; 4278 4279def warn_ignored_objc_externally_retained : Warning< 4280 "'objc_externally_retained' can only be applied to local variables " 4281 "%select{of retainable type|with strong ownership}0">, 4282 InGroup<IgnoredAttributes>; 4283 4284// Function Parameter Semantic Analysis. 4285def err_param_with_void_type : Error<"argument may not have 'void' type">; 4286def err_void_only_param : Error< 4287 "'void' must be the first and only parameter if specified">; 4288def err_void_param_qualified : Error< 4289 "'void' as parameter must not have type qualifiers">; 4290def err_ident_list_in_fn_declaration : Error< 4291 "a parameter list without types is only allowed in a function definition">; 4292def ext_param_not_declared : Extension< 4293 "parameter %0 was not declared, defaulting to type 'int'">; 4294def err_param_default_argument : Error< 4295 "C does not support default arguments">; 4296def err_param_default_argument_redefinition : Error< 4297 "redefinition of default argument">; 4298def ext_param_default_argument_redefinition : ExtWarn< 4299 err_param_default_argument_redefinition.Text>, 4300 InGroup<MicrosoftDefaultArgRedefinition>; 4301def err_param_default_argument_missing : Error< 4302 "missing default argument on parameter">; 4303def err_param_default_argument_missing_name : Error< 4304 "missing default argument on parameter %0">; 4305def err_param_default_argument_references_param : Error< 4306 "default argument references parameter %0">; 4307def err_param_default_argument_references_local : Error< 4308 "default argument references local variable %0 of enclosing function">; 4309def err_param_default_argument_references_this : Error< 4310 "default argument references 'this'">; 4311def err_param_default_argument_nonfunc : Error< 4312 "default arguments can only be specified for parameters in a function " 4313 "declaration">; 4314def err_param_default_argument_template_redecl : Error< 4315 "default arguments cannot be added to a function template that has already " 4316 "been declared">; 4317def err_param_default_argument_member_template_redecl : Error< 4318 "default arguments cannot be added to an out-of-line definition of a member " 4319 "of a %select{class template|class template partial specialization|nested " 4320 "class in a template}0">; 4321def err_param_default_argument_on_parameter_pack : Error< 4322 "parameter pack cannot have a default argument">; 4323def err_uninitialized_member_for_assign : Error< 4324 "cannot define the implicit copy assignment operator for %0, because " 4325 "non-static %select{reference|const}1 member %2 cannot use copy " 4326 "assignment operator">; 4327def err_uninitialized_member_in_ctor : Error< 4328 "%select{constructor for %1|" 4329 "implicit default constructor for %1|" 4330 "cannot use constructor inherited from %1:}0 must explicitly " 4331 "initialize the %select{reference|const}2 member %3">; 4332def err_default_arg_makes_ctor_special : Error< 4333 "addition of default argument on redeclaration makes this constructor a " 4334 "%select{default|copy|move}0 constructor">; 4335 4336def err_use_of_default_argument_to_function_declared_later : Error< 4337 "use of default argument to function %0 that is declared later in class %1">; 4338def note_default_argument_declared_here : Note< 4339 "default argument declared here">; 4340def err_recursive_default_argument : Error<"recursive evaluation of default argument">; 4341def note_recursive_default_argument_used_here : Note< 4342 "default argument used here">; 4343 4344def ext_param_promoted_not_compatible_with_prototype : ExtWarn< 4345 "%diff{promoted type $ of K&R function parameter is not compatible with the " 4346 "parameter type $|promoted type of K&R function parameter is not compatible " 4347 "with parameter type}0,1 declared in a previous prototype">, 4348 InGroup<KNRPromotedParameter>; 4349 4350 4351// C++ Overloading Semantic Analysis. 4352def err_ovl_diff_return_type : Error< 4353 "functions that differ only in their return type cannot be overloaded">; 4354def err_ovl_static_nonstatic_member : Error< 4355 "static and non-static member functions with the same parameter types " 4356 "cannot be overloaded">; 4357 4358let Deferrable = 1 in { 4359 4360def err_ovl_no_viable_function_in_call : Error< 4361 "no matching function for call to %0">; 4362def err_ovl_no_viable_member_function_in_call : Error< 4363 "no matching member function for call to %0">; 4364def err_ovl_ambiguous_call : Error< 4365 "call to %0 is ambiguous">; 4366def err_ovl_deleted_call : Error<"call to deleted function %0">; 4367def err_ovl_ambiguous_member_call : Error< 4368 "call to member function %0 is ambiguous">; 4369def err_ovl_deleted_member_call : Error< 4370 "call to deleted member function %0">; 4371def note_ovl_too_many_candidates : Note< 4372 "remaining %0 candidate%s0 omitted; " 4373 "pass -fshow-overloads=all to show them">; 4374 4375def select_ovl_candidate_kind : TextSubstitution< 4376 "%select{function|function|function (with reversed parameter order)|" 4377 "constructor|" 4378 "constructor (the implicit default constructor)|" 4379 "constructor (the implicit copy constructor)|" 4380 "constructor (the implicit move constructor)|" 4381 "function (the implicit copy assignment operator)|" 4382 "function (the implicit move assignment operator)|" 4383 "function (the implicit 'operator==' for this 'operator<=>)'|" 4384 "inherited constructor}0%select{| template| %2}1">; 4385 4386def note_ovl_candidate : Note< 4387 "candidate %sub{select_ovl_candidate_kind}0,1,3" 4388 "%select{| has different class%diff{ (expected $ but has $)|}5,6" 4389 "| has different number of parameters (expected %5 but has %6)" 4390 "| has type mismatch at %ordinal5 parameter" 4391 "%diff{ (expected $ but has $)|}6,7" 4392 "| has different return type%diff{ ($ expected but has $)|}5,6" 4393 "| has different qualifiers (expected %5 but found %6)" 4394 "| has different exception specification}4">; 4395 4396def note_ovl_candidate_explicit : Note< 4397 "explicit %select{constructor|conversion function|deduction guide}0 " 4398 "is not a candidate%select{| (explicit specifier evaluates to true)}1">; 4399def note_ovl_candidate_inherited_constructor : Note< 4400 "constructor from base class %0 inherited here">; 4401def note_ovl_candidate_inherited_constructor_slice : Note< 4402 "candidate %select{constructor|template}0 ignored: " 4403 "inherited constructor cannot be used to %select{copy|move}1 object">; 4404def note_ovl_candidate_illegal_constructor : Note< 4405 "candidate %select{constructor|template}0 ignored: " 4406 "instantiation %select{takes|would take}0 its own class type by value">; 4407def note_ovl_candidate_illegal_constructor_adrspace_mismatch : Note< 4408 "candidate constructor ignored: cannot be used to construct an object " 4409 "in address space %0">; 4410def note_ovl_candidate_bad_deduction : Note< 4411 "candidate template ignored: failed template argument deduction">; 4412def note_ovl_candidate_incomplete_deduction : Note<"candidate template ignored: " 4413 "couldn't infer template argument %0">; 4414def note_ovl_candidate_incomplete_deduction_pack : Note< 4415 "candidate template ignored: " 4416 "deduced too few arguments for expanded pack %0; no argument for %ordinal1 " 4417 "expanded parameter in deduced argument pack %2">; 4418def note_ovl_candidate_inconsistent_deduction : Note< 4419 "candidate template ignored: deduced %select{conflicting types|" 4420 "conflicting values|conflicting templates|packs of different lengths}0 " 4421 "for parameter %1%diff{ ($ vs. $)|}2,3">; 4422def note_ovl_candidate_inconsistent_deduction_types : Note< 4423 "candidate template ignored: deduced values %diff{" 4424 "of conflicting types for parameter %0 (%1 of type $ vs. %3 of type $)|" 4425 "%1 and %3 of conflicting types for parameter %0}2,4">; 4426def note_ovl_candidate_explicit_arg_mismatch_named : Note< 4427 "candidate template ignored: invalid explicitly-specified argument " 4428 "for template parameter %0">; 4429def note_ovl_candidate_unsatisfied_constraints : Note< 4430 "candidate template ignored: constraints not satisfied%0">; 4431def note_ovl_candidate_explicit_arg_mismatch_unnamed : Note< 4432 "candidate template ignored: invalid explicitly-specified argument " 4433 "for %ordinal0 template parameter">; 4434def note_ovl_candidate_instantiation_depth : Note< 4435 "candidate template ignored: substitution exceeded maximum template " 4436 "instantiation depth">; 4437def note_ovl_candidate_underqualified : Note< 4438 "candidate template ignored: cannot deduce a type for %0 that would " 4439 "make %2 equal %1">; 4440def note_ovl_candidate_substitution_failure : Note< 4441 "candidate template ignored: substitution failure%0%1">; 4442def note_ovl_candidate_disabled_by_enable_if : Note< 4443 "candidate template ignored: disabled by %0%1">; 4444def note_ovl_candidate_disabled_by_requirement : Note< 4445 "candidate template ignored: requirement '%0' was not satisfied%1">; 4446def note_ovl_candidate_has_pass_object_size_params: Note< 4447 "candidate address cannot be taken because parameter %0 has " 4448 "pass_object_size attribute">; 4449def err_diagnose_if_succeeded : Error<"%0">; 4450def warn_diagnose_if_succeeded : Warning<"%0">, InGroup<UserDefinedWarnings>, 4451 ShowInSystemHeader; 4452def note_ovl_candidate_disabled_by_function_cond_attr : Note< 4453 "candidate disabled: %0">; 4454def err_addrof_function_disabled_by_enable_if_attr : Error< 4455 "cannot take address of function %0 because it has one or more " 4456 "non-tautological enable_if conditions">; 4457def err_addrof_function_constraints_not_satisfied : Error< 4458 "cannot take address of function %0 because its constraints are not " 4459 "satisfied">; 4460def note_addrof_ovl_candidate_disabled_by_enable_if_attr : Note< 4461 "candidate function made ineligible by enable_if">; 4462def note_ovl_candidate_deduced_mismatch : Note< 4463 "candidate template ignored: deduced type " 4464 "%diff{$ of %select{|element of }4%ordinal0 parameter does not match " 4465 "adjusted type $ of %select{|element of }4argument" 4466 "|of %select{|element of }4%ordinal0 parameter does not match " 4467 "adjusted type of %select{|element of }4argument}1,2%3">; 4468def note_ovl_candidate_non_deduced_mismatch : Note< 4469 "candidate template ignored: could not match %diff{$ against $|types}0,1">; 4470// This note is needed because the above note would sometimes print two 4471// different types with the same name. Remove this note when the above note 4472// can handle that case properly. 4473def note_ovl_candidate_non_deduced_mismatch_qualified : Note< 4474 "candidate template ignored: could not match %q0 against %q1">; 4475 4476// Note that we don't treat templates differently for this diagnostic. 4477def note_ovl_candidate_arity : Note<"candidate " 4478 "%sub{select_ovl_candidate_kind}0,1,2 not viable: " 4479 "requires%select{ at least| at most|}3 %4 argument%s4, but %5 " 4480 "%plural{1:was|:were}5 provided">; 4481 4482def note_ovl_candidate_arity_one : Note<"candidate " 4483 "%sub{select_ovl_candidate_kind}0,1,2 not viable: " 4484 "%select{requires at least|allows at most single|requires single}3 " 4485 "argument %4, but %plural{0:no|:%5}5 arguments were provided">; 4486 4487def note_ovl_candidate_deleted : Note< 4488 "candidate %sub{select_ovl_candidate_kind}0,1,2 has been " 4489 "%select{explicitly made unavailable|explicitly deleted|" 4490 "implicitly deleted}3">; 4491 4492// Giving the index of the bad argument really clutters this message, and 4493// it's relatively unimportant because 1) it's generally obvious which 4494// argument(s) are of the given object type and 2) the fix is usually 4495// to complete the type, which doesn't involve changes to the call line 4496// anyway. If people complain, we can change it. 4497def note_ovl_candidate_bad_conv_incomplete : Note< 4498 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " 4499 "cannot convert argument of incomplete type " 4500 "%diff{$ to $|to parameter type}3,4 for " 4501 "%select{%ordinal6 argument|object argument}5" 4502 "%select{|; dereference the argument with *|" 4503 "; take the address of the argument with &|" 4504 "; remove *|" 4505 "; remove &}7">; 4506def note_ovl_candidate_bad_list_argument : Note< 4507 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " 4508 "%select{cannot convert initializer list|too few initializers in list" 4509 "|too many initializers in list}7 argument to %4">; 4510def note_ovl_candidate_bad_overload : Note< 4511 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " 4512 "no overload of %4 matching %3 for %ordinal5 argument">; 4513def note_ovl_candidate_bad_conv : Note< 4514 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " 4515 "no known conversion " 4516 "%diff{from $ to $|from argument type to parameter type}3,4 for " 4517 "%select{%ordinal6 argument|object argument}5" 4518 "%select{|; dereference the argument with *|" 4519 "; take the address of the argument with &|" 4520 "; remove *|" 4521 "; remove &}7">; 4522def note_ovl_candidate_bad_arc_conv : Note< 4523 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " 4524 "cannot implicitly convert argument " 4525 "%diff{of type $ to $|type to parameter type}3,4 for " 4526 "%select{%ordinal6 argument|object argument}5 under ARC">; 4527def note_ovl_candidate_bad_value_category : Note< 4528 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " 4529 "expects an %select{lvalue|rvalue}5 for " 4530 "%select{%ordinal4 argument|object argument}3">; 4531def note_ovl_candidate_bad_addrspace : Note< 4532 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " 4533 "cannot %select{pass pointer to|bind reference in}5 %3 " 4534 "%select{as a pointer to|to object in}5 %4 in %ordinal6 " 4535 "argument">; 4536def note_ovl_candidate_bad_addrspace_this : Note< 4537 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " 4538 "'this' object is in %3, but method expects object in %4">; 4539def note_ovl_candidate_bad_gc : Note< 4540 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " 4541 "%select{%ordinal7|'this'}6 argument (%3) has %select{no|__weak|__strong}4 " 4542 "ownership, but parameter has %select{no|__weak|__strong}5 ownership">; 4543def note_ovl_candidate_bad_ownership : Note< 4544 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " 4545 "%select{%ordinal7|'this'}6 argument (%3) has " 4546 "%select{no|__unsafe_unretained|__strong|__weak|__autoreleasing}4 ownership," 4547 " but parameter has %select{no|__unsafe_unretained|__strong|__weak|" 4548 "__autoreleasing}5 ownership">; 4549def note_ovl_candidate_bad_cvr_this : Note< 4550 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " 4551 "'this' argument has type %3, but method is not marked " 4552 "%select{const|restrict|const or restrict|volatile|const or volatile|" 4553 "volatile or restrict|const, volatile, or restrict}4">; 4554def note_ovl_candidate_bad_cvr : Note< 4555 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " 4556 "%ordinal5 argument (%3) would lose " 4557 "%select{const|restrict|const and restrict|volatile|const and volatile|" 4558 "volatile and restrict|const, volatile, and restrict}4 qualifier" 4559 "%select{||s||s|s|s}4">; 4560def note_ovl_candidate_bad_unaligned : Note< 4561 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " 4562 "%ordinal5 argument (%3) would lose __unaligned qualifier">; 4563def note_ovl_candidate_bad_base_to_derived_conv : Note< 4564 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " 4565 "cannot %select{convert from|convert from|bind}3 " 4566 "%select{base class pointer|superclass|base class object of type}3 %4 to " 4567 "%select{derived class pointer|subclass|derived class reference}3 %5 for " 4568 "%ordinal6 argument">; 4569def note_ovl_candidate_bad_target : Note< 4570 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " 4571 "call to " 4572 "%select{__device__|__global__|__host__|__host__ __device__|invalid}3 function from" 4573 " %select{__device__|__global__|__host__|__host__ __device__|invalid}4 function">; 4574def note_ovl_candidate_constraints_not_satisfied : Note< 4575 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: constraints " 4576 "not satisfied">; 4577def note_implicit_member_target_infer_collision : Note< 4578 "implicit %sub{select_special_member_kind}0 inferred target collision: call to both " 4579 "%select{__device__|__global__|__host__|__host__ __device__}1 and " 4580 "%select{__device__|__global__|__host__|__host__ __device__}2 members">; 4581 4582def note_ambiguous_type_conversion: Note< 4583 "because of ambiguity in conversion %diff{of $ to $|between types}0,1">; 4584def note_ovl_builtin_candidate : Note<"built-in candidate %0">; 4585def err_ovl_no_viable_function_in_init : Error< 4586 "no matching constructor for initialization of %0">; 4587def err_ovl_no_conversion_in_cast : Error< 4588 "cannot convert %1 to %2 without a conversion operator">; 4589def err_ovl_no_viable_conversion_in_cast : Error< 4590 "no matching conversion for %select{|static_cast|reinterpret_cast|" 4591 "dynamic_cast|C-style cast|functional-style cast|}0 from %1 to %2">; 4592def err_ovl_ambiguous_conversion_in_cast : Error< 4593 "ambiguous conversion for %select{|static_cast|reinterpret_cast|" 4594 "dynamic_cast|C-style cast|functional-style cast|}0 from %1 to %2">; 4595def err_ovl_deleted_conversion_in_cast : Error< 4596 "%select{|static_cast|reinterpret_cast|dynamic_cast|C-style cast|" 4597 "functional-style cast|}0 from %1 to %2 uses deleted function">; 4598def err_ovl_ambiguous_init : Error<"call to constructor of %0 is ambiguous">; 4599def err_ref_init_ambiguous : Error< 4600 "reference initialization of type %0 with initializer of type %1 is ambiguous">; 4601def err_ovl_deleted_init : Error< 4602 "call to deleted constructor of %0">; 4603def err_ovl_deleted_special_init : Error< 4604 "call to implicitly-deleted %select{default constructor|copy constructor|" 4605 "move constructor|copy assignment operator|move assignment operator|" 4606 "destructor|function}0 of %1">; 4607def err_ovl_ambiguous_oper_unary : Error< 4608 "use of overloaded operator '%0' is ambiguous (operand type %1)">; 4609def err_ovl_ambiguous_oper_binary : Error< 4610 "use of overloaded operator '%0' is ambiguous (with operand types %1 and %2)">; 4611def ext_ovl_ambiguous_oper_binary_reversed : ExtWarn< 4612 "ISO C++20 considers use of overloaded operator '%0' (with operand types %1 " 4613 "and %2) to be ambiguous despite there being a unique best viable function" 4614 "%select{ with non-reversed arguments|}3">, 4615 InGroup<DiagGroup<"ambiguous-reversed-operator">>, SFINAEFailure; 4616def note_ovl_ambiguous_oper_binary_reversed_self : Note< 4617 "ambiguity is between a regular call to this operator and a call with the " 4618 "argument order reversed">; 4619def note_ovl_ambiguous_oper_binary_selected_candidate : Note< 4620 "candidate function with non-reversed arguments">; 4621def note_ovl_ambiguous_oper_binary_reversed_candidate : Note< 4622 "ambiguous candidate function with reversed arguments">; 4623def err_ovl_no_viable_oper : Error<"no viable overloaded '%0'">; 4624def note_assign_lhs_incomplete : Note<"type %0 is incomplete">; 4625def err_ovl_deleted_oper : Error< 4626 "overload resolution selected deleted operator '%0'">; 4627def err_ovl_deleted_special_oper : Error< 4628 "object of type %0 cannot be %select{constructed|copied|moved|assigned|" 4629 "assigned|destroyed}1 because its %sub{select_special_member_kind}1 is " 4630 "implicitly deleted">; 4631def err_ovl_deleted_comparison : Error< 4632 "object of type %0 cannot be compared because its %1 is implicitly deleted">; 4633def err_ovl_rewrite_equalequal_not_bool : Error< 4634 "return type %0 of selected 'operator==' function for rewritten " 4635 "'%1' comparison is not 'bool'">; 4636def ext_ovl_rewrite_equalequal_not_bool : ExtWarn< 4637 "ISO C++20 requires return type of selected 'operator==' function for " 4638 "rewritten '%1' comparison to be 'bool', not %0">, 4639 InGroup<DiagGroup<"rewrite-not-bool">>, SFINAEFailure; 4640def err_ovl_no_viable_subscript : 4641 Error<"no viable overloaded operator[] for type %0">; 4642def err_ovl_no_oper : 4643 Error<"type %0 does not provide a %select{subscript|call}1 operator">; 4644def err_ovl_unresolvable : Error< 4645 "reference to %select{overloaded|multiversioned}1 function could not be " 4646 "resolved; did you mean to call it%select{| with no arguments}0?">; 4647def err_bound_member_function : Error< 4648 "reference to non-static member function must be called" 4649 "%select{|; did you mean to call it with no arguments?}0">; 4650def note_possible_target_of_call : Note<"possible target for call">; 4651 4652def err_ovl_no_viable_object_call : Error< 4653 "no matching function for call to object of type %0">; 4654def err_ovl_ambiguous_object_call : Error< 4655 "call to object of type %0 is ambiguous">; 4656def err_ovl_deleted_object_call : Error< 4657 "call to deleted function call operator in type %0">; 4658def note_ovl_surrogate_cand : Note<"conversion candidate of type %0">; 4659def err_member_call_without_object : Error< 4660 "call to non-static member function without an object argument">; 4661 4662// C++ Address of Overloaded Function 4663def err_addr_ovl_no_viable : Error< 4664 "address of overloaded function %0 does not match required type %1">; 4665def err_addr_ovl_ambiguous : Error< 4666 "address of overloaded function %0 is ambiguous">; 4667def err_addr_ovl_not_func_ptrref : Error< 4668 "address of overloaded function %0 cannot be converted to type %1">; 4669def err_addr_ovl_no_qualifier : Error< 4670 "cannot form member pointer of type %0 without '&' and class name">; 4671 4672} // let Deferrable 4673 4674// C++11 Literal Operators 4675def err_ovl_no_viable_literal_operator : Error< 4676 "no matching literal operator for call to %0" 4677 "%select{| with argument of type %2| with arguments of types %2 and %3}1" 4678 "%select{| or 'const char *'}4" 4679 "%select{|, and no matching literal operator template}5">; 4680 4681// C++ Template Declarations 4682def err_template_param_shadow : Error< 4683 "declaration of %0 shadows template parameter">; 4684def ext_template_param_shadow : ExtWarn< 4685 err_template_param_shadow.Text>, InGroup<MicrosoftTemplateShadow>; 4686def note_template_param_here : Note<"template parameter is declared here">; 4687def warn_template_export_unsupported : Warning< 4688 "exported templates are unsupported">; 4689def err_template_outside_namespace_or_class_scope : Error< 4690 "templates can only be declared in namespace or class scope">; 4691def err_template_inside_local_class : Error< 4692 "templates cannot be declared inside of a local class">; 4693def err_template_linkage : Error<"templates must have C++ linkage">; 4694def err_template_typedef : Error<"a typedef cannot be a template">; 4695def err_template_unnamed_class : Error< 4696 "cannot declare a class template with no name">; 4697def err_template_param_list_different_arity : Error< 4698 "%select{too few|too many}0 template parameters in template " 4699 "%select{|template parameter }1redeclaration">; 4700def note_template_param_list_different_arity : Note< 4701 "%select{too few|too many}0 template parameters in template template " 4702 "argument">; 4703def note_template_prev_declaration : Note< 4704 "previous template %select{declaration|template parameter}0 is here">; 4705def err_template_param_different_kind : Error< 4706 "template parameter has a different kind in template " 4707 "%select{|template parameter }0redeclaration">; 4708def note_template_param_different_kind : Note< 4709 "template parameter has a different kind in template argument">; 4710 4711def err_invalid_decl_specifier_in_nontype_parm : Error< 4712 "invalid declaration specifier in template non-type parameter">; 4713 4714def err_template_nontype_parm_different_type : Error< 4715 "template non-type parameter has a different type %0 in template " 4716 "%select{|template parameter }1redeclaration">; 4717 4718def note_template_nontype_parm_different_type : Note< 4719 "template non-type parameter has a different type %0 in template argument">; 4720def note_template_nontype_parm_prev_declaration : Note< 4721 "previous non-type template parameter with type %0 is here">; 4722def err_template_nontype_parm_bad_type : Error< 4723 "a non-type template parameter cannot have type %0">; 4724def err_template_nontype_parm_bad_structural_type : Error< 4725 "a non-type template parameter cannot have type %0 before C++20">; 4726def err_template_nontype_parm_incomplete : Error< 4727 "non-type template parameter has incomplete type %0">; 4728def err_template_nontype_parm_not_literal : Error< 4729 "non-type template parameter has non-literal type %0">; 4730def err_template_nontype_parm_rvalue_ref : Error< 4731 "non-type template parameter has rvalue reference type %0">; 4732def err_template_nontype_parm_not_structural : Error< 4733 "type %0 of non-type template parameter is not a structural type">; 4734def note_not_structural_non_public : Note< 4735 "%0 is not a structural type because it has a " 4736 "%select{non-static data member|base class}1 that is not public">; 4737def note_not_structural_mutable_field : Note< 4738 "%0 is not a structural type because it has a mutable " 4739 "non-static data member">; 4740def note_not_structural_rvalue_ref_field : Note< 4741 "%0 is not a structural type because it has a non-static data member " 4742 "of rvalue reference type">; 4743def note_not_structural_subobject : Note< 4744 "%0 is not a structural type because it has a " 4745 "%select{non-static data member|base class}1 of non-structural type %2">; 4746def warn_cxx17_compat_template_nontype_parm_type : Warning< 4747 "non-type template parameter of type %0 is incompatible with " 4748 "C++ standards before C++20">, 4749 DefaultIgnore, InGroup<CXXPre20Compat>; 4750def warn_cxx14_compat_template_nontype_parm_auto_type : Warning< 4751 "non-type template parameters declared with %0 are incompatible with C++ " 4752 "standards before C++17">, 4753 DefaultIgnore, InGroup<CXXPre17Compat>; 4754def err_template_param_default_arg_redefinition : Error< 4755 "template parameter redefines default argument">; 4756def note_template_param_prev_default_arg : Note< 4757 "previous default template argument defined here">; 4758def err_template_param_default_arg_missing : Error< 4759 "template parameter missing a default argument">; 4760def ext_template_parameter_default_in_function_template : ExtWarn< 4761 "default template arguments for a function template are a C++11 extension">, 4762 InGroup<CXX11>; 4763def warn_cxx98_compat_template_parameter_default_in_function_template : Warning< 4764 "default template arguments for a function template are incompatible with C++98">, 4765 InGroup<CXX98Compat>, DefaultIgnore; 4766def err_template_parameter_default_template_member : Error< 4767 "cannot add a default template argument to the definition of a member of a " 4768 "class template">; 4769def err_template_parameter_default_friend_template : Error< 4770 "default template argument not permitted on a friend template">; 4771def err_template_template_parm_no_parms : Error< 4772 "template template parameter must have its own template parameters">; 4773 4774def ext_variable_template : ExtWarn<"variable templates are a C++14 extension">, 4775 InGroup<CXX14>; 4776def warn_cxx11_compat_variable_template : Warning< 4777 "variable templates are incompatible with C++ standards before C++14">, 4778 InGroup<CXXPre14Compat>, DefaultIgnore; 4779def err_template_variable_noparams : Error< 4780 "extraneous 'template<>' in declaration of variable %0">; 4781def err_template_member : Error<"member %0 declared as a template">; 4782def err_template_member_noparams : Error< 4783 "extraneous 'template<>' in declaration of member %0">; 4784def err_template_tag_noparams : Error< 4785 "extraneous 'template<>' in declaration of %0 %1">; 4786 4787def warn_cxx17_compat_adl_only_template_id : Warning< 4788 "use of function template name with no prior function template " 4789 "declaration in function call with explicit template arguments " 4790 "is incompatible with C++ standards before C++20">, 4791 InGroup<CXXPre20Compat>, DefaultIgnore; 4792def ext_adl_only_template_id : ExtWarn< 4793 "use of function template name with no prior declaration in function call " 4794 "with explicit template arguments is a C++20 extension">, InGroup<CXX20>; 4795 4796// C++ Template Argument Lists 4797def err_template_missing_args : Error< 4798 "use of " 4799 "%select{class template|function template|variable template|alias template|" 4800 "template template parameter|concept|template}0 %1 requires template " 4801 "arguments">; 4802def err_template_arg_list_different_arity : Error< 4803 "%select{too few|too many}0 template arguments for " 4804 "%select{class template|function template|variable template|alias template|" 4805 "template template parameter|concept|template}1 %2">; 4806def note_template_decl_here : Note<"template is declared here">; 4807def err_template_arg_must_be_type : Error< 4808 "template argument for template type parameter must be a type">; 4809def err_template_arg_must_be_type_suggest : Error< 4810 "template argument for template type parameter must be a type; " 4811 "did you forget 'typename'?">; 4812def ext_ms_template_type_arg_missing_typename : ExtWarn< 4813 "template argument for template type parameter must be a type; " 4814 "omitted 'typename' is a Microsoft extension">, 4815 InGroup<MicrosoftTemplate>; 4816def err_template_arg_must_be_expr : Error< 4817 "template argument for non-type template parameter must be an expression">; 4818def err_template_arg_nontype_ambig : Error< 4819 "template argument for non-type template parameter is treated as function type %0">; 4820def err_template_arg_must_be_template : Error< 4821 "template argument for template template parameter must be a class template%select{| or type alias template}0">; 4822def ext_template_arg_local_type : ExtWarn< 4823 "template argument uses local type %0">, InGroup<LocalTypeTemplateArgs>; 4824def ext_template_arg_unnamed_type : ExtWarn< 4825 "template argument uses unnamed type">, InGroup<UnnamedTypeTemplateArgs>; 4826def warn_cxx98_compat_template_arg_local_type : Warning< 4827 "local type %0 as template argument is incompatible with C++98">, 4828 InGroup<CXX98CompatLocalTypeTemplateArgs>, DefaultIgnore; 4829def warn_cxx98_compat_template_arg_unnamed_type : Warning< 4830 "unnamed type as template argument is incompatible with C++98">, 4831 InGroup<CXX98CompatUnnamedTypeTemplateArgs>, DefaultIgnore; 4832def note_template_unnamed_type_here : Note< 4833 "unnamed type used in template argument was declared here">; 4834def err_template_arg_overload_type : Error< 4835 "template argument is the type of an unresolved overloaded function">; 4836def err_template_arg_not_valid_template : Error< 4837 "template argument does not refer to a class or alias template, or template " 4838 "template parameter">; 4839def note_template_arg_refers_here_func : Note< 4840 "template argument refers to function template %0, here">; 4841def err_template_arg_template_params_mismatch : Error< 4842 "template template argument has different template parameters than its " 4843 "corresponding template template parameter">; 4844def err_template_arg_not_integral_or_enumeral : Error< 4845 "non-type template argument of type %0 must have an integral or enumeration" 4846 " type">; 4847def err_template_arg_not_ice : Error< 4848 "non-type template argument of type %0 is not an integral constant " 4849 "expression">; 4850def err_template_arg_not_address_constant : Error< 4851 "non-type template argument of type %0 is not a constant expression">; 4852def warn_cxx98_compat_template_arg_null : Warning< 4853 "use of null pointer as non-type template argument is incompatible with " 4854 "C++98">, InGroup<CXX98Compat>, DefaultIgnore; 4855def err_template_arg_untyped_null_constant : Error< 4856 "null non-type template argument must be cast to template parameter type %0">; 4857def err_template_arg_wrongtype_null_constant : Error< 4858 "null non-type template argument of type %0 does not match template parameter " 4859 "of type %1">; 4860def err_non_type_template_parm_type_deduction_failure : Error< 4861 "non-type template parameter %0 with type %1 has incompatible initializer of type %2">; 4862def err_deduced_non_type_template_arg_type_mismatch : Error< 4863 "deduced non-type template argument does not have the same type as the " 4864 "corresponding template parameter%diff{ ($ vs $)|}0,1">; 4865def err_non_type_template_arg_subobject : Error< 4866 "non-type template argument refers to subobject '%0'">; 4867def err_non_type_template_arg_addr_label_diff : Error< 4868 "template argument / label address difference / what did you expect?">; 4869def err_non_type_template_arg_unsupported : Error< 4870 "sorry, non-type template argument of type %0 is not yet supported">; 4871def err_template_arg_not_convertible : Error< 4872 "non-type template argument of type %0 cannot be converted to a value " 4873 "of type %1">; 4874def warn_template_arg_negative : Warning< 4875 "non-type template argument with value '%0' converted to '%1' for unsigned " 4876 "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore; 4877def warn_template_arg_too_large : Warning< 4878 "non-type template argument value '%0' truncated to '%1' for " 4879 "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore; 4880def err_template_arg_no_ref_bind : Error< 4881 "non-type template parameter of reference type " 4882 "%diff{$ cannot bind to template argument of type $" 4883 "|cannot bind to template of incompatible argument type}0,1">; 4884def err_template_arg_ref_bind_ignores_quals : Error< 4885 "reference binding of non-type template parameter " 4886 "%diff{of type $ to template argument of type $|to template argument}0,1 " 4887 "ignores qualifiers">; 4888def err_template_arg_not_decl_ref : Error< 4889 "non-type template argument does not refer to any declaration">; 4890def err_template_arg_not_address_of : Error< 4891 "non-type template argument for template parameter of pointer type %0 must " 4892 "have its address taken">; 4893def err_template_arg_address_of_non_pointer : Error< 4894 "address taken in non-type template argument for template parameter of " 4895 "reference type %0">; 4896def err_template_arg_reference_var : Error< 4897 "non-type template argument of reference type %0 is not an object">; 4898def err_template_arg_field : Error< 4899 "non-type template argument refers to non-static data member %0">; 4900def err_template_arg_method : Error< 4901 "non-type template argument refers to non-static member function %0">; 4902def err_template_arg_object_no_linkage : Error< 4903 "non-type template argument refers to %select{function|object}0 %1 that " 4904 "does not have linkage">; 4905def warn_cxx98_compat_template_arg_object_internal : Warning< 4906 "non-type template argument referring to %select{function|object}0 %1 with " 4907 "internal linkage is incompatible with C++98">, 4908 InGroup<CXX98Compat>, DefaultIgnore; 4909def ext_template_arg_object_internal : ExtWarn< 4910 "non-type template argument referring to %select{function|object}0 %1 with " 4911 "internal linkage is a C++11 extension">, InGroup<CXX11>; 4912def err_template_arg_thread_local : Error< 4913 "non-type template argument refers to thread-local object">; 4914def note_template_arg_internal_object : Note< 4915 "non-type template argument refers to %select{function|object}0 here">; 4916def note_template_arg_refers_here : Note< 4917 "non-type template argument refers here">; 4918def err_template_arg_not_object_or_func : Error< 4919 "non-type template argument does not refer to an object or function">; 4920def err_template_arg_not_pointer_to_member_form : Error< 4921 "non-type template argument is not a pointer to member constant">; 4922def err_template_arg_member_ptr_base_derived_not_supported : Error< 4923 "sorry, non-type template argument of pointer-to-member type %1 that refers " 4924 "to member %q0 of a different class is not supported yet">; 4925def ext_template_arg_extra_parens : ExtWarn< 4926 "address non-type template argument cannot be surrounded by parentheses">; 4927def warn_cxx98_compat_template_arg_extra_parens : Warning< 4928 "redundant parentheses surrounding address non-type template argument are " 4929 "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore; 4930def err_pointer_to_member_type : Error< 4931 "invalid use of pointer to member type after %select{.*|->*}0">; 4932def err_pointer_to_member_call_drops_quals : Error< 4933 "call to pointer to member function of type %0 drops '%1' qualifier%s2">; 4934def err_pointer_to_member_oper_value_classify: Error< 4935 "pointer-to-member function type %0 can only be called on an " 4936 "%select{rvalue|lvalue}1">; 4937def ext_pointer_to_const_ref_member_on_rvalue : Extension< 4938 "invoking a pointer to a 'const &' member function on an rvalue is a C++20 extension">, 4939 InGroup<CXX20>, SFINAEFailure; 4940def warn_cxx17_compat_pointer_to_const_ref_member_on_rvalue : Warning< 4941 "invoking a pointer to a 'const &' member function on an rvalue is " 4942 "incompatible with C++ standards before C++20">, 4943 InGroup<CXXPre20CompatPedantic>, DefaultIgnore; 4944def ext_ms_deref_template_argument: ExtWarn< 4945 "non-type template argument containing a dereference operation is a " 4946 "Microsoft extension">, InGroup<MicrosoftTemplate>; 4947def ext_ms_delayed_template_argument: ExtWarn< 4948 "using the undeclared type %0 as a default template argument is a " 4949 "Microsoft extension">, InGroup<MicrosoftTemplate>; 4950def err_template_arg_deduced_incomplete_pack : Error< 4951 "deduced incomplete pack %0 for template parameter %1">; 4952 4953// C++ template specialization 4954def err_template_spec_unknown_kind : Error< 4955 "can only provide an explicit specialization for a class template, function " 4956 "template, variable template, or a member function, static data member, " 4957 "%select{or member class|member class, or member enumeration}0 of a " 4958 "class template">; 4959def note_specialized_entity : Note< 4960 "explicitly specialized declaration is here">; 4961def note_explicit_specialization_declared_here : Note< 4962 "explicit specialization declared here">; 4963def err_template_spec_decl_function_scope : Error< 4964 "explicit specialization of %0 in function scope">; 4965def err_template_spec_decl_friend : Error< 4966 "cannot declare an explicit specialization in a friend">; 4967def err_template_spec_redecl_out_of_scope : Error< 4968 "%select{class template|class template partial|variable template|" 4969 "variable template partial|function template|member " 4970 "function|static data member|member class|member enumeration}0 " 4971 "specialization of %1 not in %select{a namespace enclosing %2|" 4972 "class %2 or an enclosing namespace}3">; 4973def ext_ms_template_spec_redecl_out_of_scope: ExtWarn< 4974 "%select{class template|class template partial|variable template|" 4975 "variable template partial|function template|member " 4976 "function|static data member|member class|member enumeration}0 " 4977 "specialization of %1 not in %select{a namespace enclosing %2|" 4978 "class %2 or an enclosing namespace}3 " 4979 "is a Microsoft extension">, InGroup<MicrosoftTemplate>; 4980def err_template_spec_redecl_global_scope : Error< 4981 "%select{class template|class template partial|variable template|" 4982 "variable template partial|function template|member " 4983 "function|static data member|member class|member enumeration}0 " 4984 "specialization of %1 must occur at global scope">; 4985def err_spec_member_not_instantiated : Error< 4986 "specialization of member %q0 does not specialize an instantiated member">; 4987def note_specialized_decl : Note<"attempt to specialize declaration here">; 4988def err_specialization_after_instantiation : Error< 4989 "explicit specialization of %0 after instantiation">; 4990def note_instantiation_required_here : Note< 4991 "%select{implicit|explicit}0 instantiation first required here">; 4992def err_template_spec_friend : Error< 4993 "template specialization declaration cannot be a friend">; 4994def err_template_spec_default_arg : Error< 4995 "default argument not permitted on an explicit " 4996 "%select{instantiation|specialization}0 of function %1">; 4997def err_not_class_template_specialization : Error< 4998 "cannot specialize a %select{dependent template|template template " 4999 "parameter}0">; 5000def ext_explicit_specialization_storage_class : ExtWarn< 5001 "explicit specialization cannot have a storage class">; 5002def err_explicit_specialization_inconsistent_storage_class : Error< 5003 "explicit specialization has extraneous, inconsistent storage class " 5004 "'%select{none|extern|static|__private_extern__|auto|register}0'">; 5005def err_dependent_function_template_spec_no_match : Error< 5006 "no candidate function template was found for dependent" 5007 " friend function template specialization">; 5008def note_dependent_function_template_spec_discard_reason : Note< 5009 "candidate ignored: %select{not a function template" 5010 "|not a member of the enclosing namespace;" 5011 " did you mean to explicitly qualify the specialization?}0">; 5012 5013// C++ class template specializations and out-of-line definitions 5014def err_template_spec_needs_header : Error< 5015 "template specialization requires 'template<>'">; 5016def err_template_spec_needs_template_parameters : Error< 5017 "template specialization or definition requires a template parameter list " 5018 "corresponding to the nested type %0">; 5019def err_template_param_list_matches_nontemplate : Error< 5020 "template parameter list matching the non-templated nested type %0 should " 5021 "be empty ('template<>')">; 5022def err_alias_template_extra_headers : Error< 5023 "extraneous template parameter list in alias template declaration">; 5024def err_template_spec_extra_headers : Error< 5025 "extraneous template parameter list in template specialization or " 5026 "out-of-line template definition">; 5027def warn_template_spec_extra_headers : Warning< 5028 "extraneous template parameter list in template specialization">; 5029def note_explicit_template_spec_does_not_need_header : Note< 5030 "'template<>' header not required for explicitly-specialized class %0 " 5031 "declared here">; 5032def err_template_qualified_declarator_no_match : Error< 5033 "nested name specifier '%0' for declaration does not refer into a class, " 5034 "class template or class template partial specialization">; 5035def err_specialize_member_of_template : Error< 5036 "cannot specialize %select{|(with 'template<>') }0a member of an " 5037 "unspecialized template">; 5038 5039// C++ Class Template Partial Specialization 5040def err_default_arg_in_partial_spec : Error< 5041 "default template argument in a class template partial specialization">; 5042def err_dependent_non_type_arg_in_partial_spec : Error< 5043 "type of specialized non-type template argument depends on a template " 5044 "parameter of the partial specialization">; 5045def note_dependent_non_type_default_arg_in_partial_spec : Note< 5046 "template parameter is used in default argument declared here">; 5047def err_dependent_typed_non_type_arg_in_partial_spec : Error< 5048 "non-type template argument specializes a template parameter with " 5049 "dependent type %0">; 5050def err_partial_spec_args_match_primary_template : Error< 5051 "%select{class|variable}0 template partial specialization does not " 5052 "specialize any template argument; to %select{declare|define}1 the " 5053 "primary template, remove the template argument list">; 5054def ext_partial_spec_not_more_specialized_than_primary : ExtWarn< 5055 "%select{class|variable}0 template partial specialization is not " 5056 "more specialized than the primary template">, DefaultError, 5057 InGroup<DiagGroup<"invalid-partial-specialization">>; 5058def note_partial_spec_not_more_specialized_than_primary : Note<"%0">; 5059def ext_partial_specs_not_deducible : ExtWarn< 5060 "%select{class|variable}0 template partial specialization contains " 5061 "%select{a template parameter|template parameters}1 that cannot be " 5062 "deduced; this partial specialization will never be used">, 5063 DefaultError, InGroup<DiagGroup<"unusable-partial-specialization">>; 5064def note_non_deducible_parameter : Note< 5065 "non-deducible template parameter %0">; 5066def err_partial_spec_ordering_ambiguous : Error< 5067 "ambiguous partial specializations of %0">; 5068def note_partial_spec_match : Note<"partial specialization matches %0">; 5069def err_partial_spec_redeclared : Error< 5070 "class template partial specialization %0 cannot be redeclared">; 5071def note_partial_specialization_declared_here : Note< 5072 "explicit specialization declared here">; 5073def note_prev_partial_spec_here : Note< 5074 "previous declaration of class template partial specialization %0 is here">; 5075def err_partial_spec_fully_specialized : Error< 5076 "partial specialization of %0 does not use any of its template parameters">; 5077 5078// C++ Variable Template Partial Specialization 5079def err_var_partial_spec_redeclared : Error< 5080 "variable template partial specialization %0 cannot be redefined">; 5081def note_var_prev_partial_spec_here : Note< 5082 "previous declaration of variable template partial specialization is here">; 5083def err_var_spec_no_template : Error< 5084 "no variable template matches%select{| partial}0 specialization">; 5085def err_var_spec_no_template_but_method : Error< 5086 "no variable template matches specialization; " 5087 "did you mean to use %0 as function template instead?">; 5088 5089// C++ Function template specializations 5090def err_function_template_spec_no_match : Error< 5091 "no function template matches function template specialization %0">; 5092def err_function_template_spec_ambiguous : Error< 5093 "function template specialization %0 ambiguously refers to more than one " 5094 "function template; explicitly specify%select{| additional}1 template " 5095 "arguments to identify a particular function template">; 5096def note_function_template_spec_matched : Note< 5097 "function template %q0 matches specialization %1">; 5098def err_function_template_partial_spec : Error< 5099 "function template partial specialization is not allowed">; 5100 5101// C++ Template Instantiation 5102def err_template_recursion_depth_exceeded : Error< 5103 "recursive template instantiation exceeded maximum depth of %0">, 5104 DefaultFatal, NoSFINAE; 5105def note_template_recursion_depth : Note< 5106 "use -ftemplate-depth=N to increase recursive template instantiation depth">; 5107 5108def err_template_instantiate_within_definition : Error< 5109 "%select{implicit|explicit}0 instantiation of template %1 within its" 5110 " own definition">; 5111def err_template_instantiate_undefined : Error< 5112 "%select{implicit|explicit}0 instantiation of undefined template %1">; 5113def err_implicit_instantiate_member_undefined : Error< 5114 "implicit instantiation of undefined member %0">; 5115def note_template_class_instantiation_was_here : Note< 5116 "class template %0 was instantiated here">; 5117def note_template_class_explicit_specialization_was_here : Note< 5118 "class template %0 was explicitly specialized here">; 5119def note_template_class_instantiation_here : Note< 5120 "in instantiation of template class %q0 requested here">; 5121def note_template_member_class_here : Note< 5122 "in instantiation of member class %q0 requested here">; 5123def note_template_member_function_here : Note< 5124 "in instantiation of member function %q0 requested here">; 5125def note_function_template_spec_here : Note< 5126 "in instantiation of function template specialization %q0 requested here">; 5127def note_template_static_data_member_def_here : Note< 5128 "in instantiation of static data member %q0 requested here">; 5129def note_template_variable_def_here : Note< 5130 "in instantiation of variable template specialization %q0 requested here">; 5131def note_template_enum_def_here : Note< 5132 "in instantiation of enumeration %q0 requested here">; 5133def note_template_nsdmi_here : Note< 5134 "in instantiation of default member initializer %q0 requested here">; 5135def note_template_type_alias_instantiation_here : Note< 5136 "in instantiation of template type alias %0 requested here">; 5137def note_template_exception_spec_instantiation_here : Note< 5138 "in instantiation of exception specification for %0 requested here">; 5139def note_template_requirement_instantiation_here : Note< 5140 "in instantiation of requirement here">; 5141def warn_var_template_missing : Warning<"instantiation of variable %q0 " 5142 "required here, but no definition is available">, 5143 InGroup<UndefinedVarTemplate>; 5144def warn_func_template_missing : Warning<"instantiation of function %q0 " 5145 "required here, but no definition is available">, 5146 InGroup<UndefinedFuncTemplate>, DefaultIgnore; 5147def note_forward_template_decl : Note< 5148 "forward declaration of template entity is here">; 5149def note_inst_declaration_hint : Note<"add an explicit instantiation " 5150 "declaration to suppress this warning if %q0 is explicitly instantiated in " 5151 "another translation unit">; 5152def note_evaluating_exception_spec_here : Note< 5153 "in evaluation of exception specification for %q0 needed here">; 5154 5155def note_default_arg_instantiation_here : Note< 5156 "in instantiation of default argument for '%0' required here">; 5157def note_default_function_arg_instantiation_here : Note< 5158 "in instantiation of default function argument expression " 5159 "for '%0' required here">; 5160def note_explicit_template_arg_substitution_here : Note< 5161 "while substituting explicitly-specified template arguments into function " 5162 "template %0 %1">; 5163def note_function_template_deduction_instantiation_here : Note< 5164 "while substituting deduced template arguments into function template %0 " 5165 "%1">; 5166def note_deduced_template_arg_substitution_here : Note< 5167 "during template argument deduction for %select{class|variable}0 template " 5168 "%select{partial specialization |}1%2 %3">; 5169def note_prior_template_arg_substitution : Note< 5170 "while substituting prior template arguments into %select{non-type|template}0" 5171 " template parameter%1 %2">; 5172def note_template_default_arg_checking : Note< 5173 "while checking a default template argument used here">; 5174def note_concept_specialization_here : Note< 5175 "while checking the satisfaction of concept '%0' requested here">; 5176def note_nested_requirement_here : Note< 5177 "while checking the satisfaction of nested requirement requested here">; 5178def note_checking_constraints_for_template_id_here : Note< 5179 "while checking constraint satisfaction for template '%0' required here">; 5180def note_checking_constraints_for_var_spec_id_here : Note< 5181 "while checking constraint satisfaction for variable template " 5182 "partial specialization '%0' required here">; 5183def note_checking_constraints_for_class_spec_id_here : Note< 5184 "while checking constraint satisfaction for class template partial " 5185 "specialization '%0' required here">; 5186def note_checking_constraints_for_function_here : Note< 5187 "while checking constraint satisfaction for function '%0' required here">; 5188def note_constraint_substitution_here : Note< 5189 "while substituting template arguments into constraint expression here">; 5190def note_constraint_normalization_here : Note< 5191 "while calculating associated constraint of template '%0' here">; 5192def note_parameter_mapping_substitution_here : Note< 5193 "while substituting into concept arguments here; substitution failures not " 5194 "allowed in concept arguments">; 5195def note_instantiation_contexts_suppressed : Note< 5196 "(skipping %0 context%s0 in backtrace; use -ftemplate-backtrace-limit=0 to " 5197 "see all)">; 5198 5199def err_field_instantiates_to_function : Error< 5200 "data member instantiated with function type %0">; 5201def err_variable_instantiates_to_function : Error< 5202 "%select{variable|static data member}0 instantiated with function type %1">; 5203def err_nested_name_spec_non_tag : Error< 5204 "type %0 cannot be used prior to '::' because it has no members">; 5205 5206def err_using_pack_expansion_empty : Error< 5207 "%select{|member}0 using declaration %1 instantiates to an empty pack">; 5208 5209// C++ Explicit Instantiation 5210def err_explicit_instantiation_duplicate : Error< 5211 "duplicate explicit instantiation of %0">; 5212def ext_explicit_instantiation_duplicate : ExtWarn< 5213 "duplicate explicit instantiation of %0 ignored as a Microsoft extension">, 5214 InGroup<MicrosoftTemplate>; 5215def note_previous_explicit_instantiation : Note< 5216 "previous explicit instantiation is here">; 5217def warn_explicit_instantiation_after_specialization : Warning< 5218 "explicit instantiation of %0 that occurs after an explicit " 5219 "specialization has no effect">, 5220 InGroup<DiagGroup<"instantiation-after-specialization">>; 5221def note_previous_template_specialization : Note< 5222 "previous template specialization is here">; 5223def err_explicit_instantiation_nontemplate_type : Error< 5224 "explicit instantiation of non-templated type %0">; 5225def note_nontemplate_decl_here : Note< 5226 "non-templated declaration is here">; 5227def err_explicit_instantiation_in_class : Error< 5228 "explicit instantiation of %0 in class scope">; 5229def err_explicit_instantiation_out_of_scope : Error< 5230 "explicit instantiation of %0 not in a namespace enclosing %1">; 5231def err_explicit_instantiation_must_be_global : Error< 5232 "explicit instantiation of %0 must occur at global scope">; 5233def warn_explicit_instantiation_out_of_scope_0x : Warning< 5234 "explicit instantiation of %0 not in a namespace enclosing %1">, 5235 InGroup<CXX11Compat>, DefaultIgnore; 5236def warn_explicit_instantiation_must_be_global_0x : Warning< 5237 "explicit instantiation of %0 must occur at global scope">, 5238 InGroup<CXX11Compat>, DefaultIgnore; 5239 5240def err_explicit_instantiation_requires_name : Error< 5241 "explicit instantiation declaration requires a name">; 5242def err_explicit_instantiation_of_typedef : Error< 5243 "explicit instantiation of typedef %0">; 5244def err_explicit_instantiation_storage_class : Error< 5245 "explicit instantiation cannot have a storage class">; 5246def err_explicit_instantiation_internal_linkage : Error< 5247 "explicit instantiation declaration of %0 with internal linkage">; 5248def err_explicit_instantiation_not_known : Error< 5249 "explicit instantiation of %0 does not refer to a function template, " 5250 "variable template, member function, member class, or static data member">; 5251def note_explicit_instantiation_here : Note< 5252 "explicit instantiation refers here">; 5253def err_explicit_instantiation_data_member_not_instantiated : Error< 5254 "explicit instantiation refers to static data member %q0 that is not an " 5255 "instantiation">; 5256def err_explicit_instantiation_member_function_not_instantiated : Error< 5257 "explicit instantiation refers to member function %q0 that is not an " 5258 "instantiation">; 5259def err_explicit_instantiation_ambiguous : Error< 5260 "partial ordering for explicit instantiation of %0 is ambiguous">; 5261def note_explicit_instantiation_candidate : Note< 5262 "explicit instantiation candidate function %q0 template here %1">; 5263def err_explicit_instantiation_inline : Error< 5264 "explicit instantiation cannot be 'inline'">; 5265def warn_explicit_instantiation_inline_0x : Warning< 5266 "explicit instantiation cannot be 'inline'">, InGroup<CXX11Compat>, 5267 DefaultIgnore; 5268def err_explicit_instantiation_constexpr : Error< 5269 "explicit instantiation cannot be 'constexpr'">; 5270def ext_explicit_instantiation_without_qualified_id : Extension< 5271 "qualifier in explicit instantiation of %q0 requires a template-id " 5272 "(a typedef is not permitted)">; 5273def err_explicit_instantiation_without_template_id : Error< 5274 "explicit instantiation of %q0 must specify a template argument list">; 5275def err_explicit_instantiation_unqualified_wrong_namespace : Error< 5276 "explicit instantiation of %q0 must occur in namespace %1">; 5277def warn_explicit_instantiation_unqualified_wrong_namespace_0x : Warning< 5278 "explicit instantiation of %q0 must occur in namespace %1">, 5279 InGroup<CXX11Compat>, DefaultIgnore; 5280def err_explicit_instantiation_undefined_member : Error< 5281 "explicit instantiation of undefined %select{member class|member function|" 5282 "static data member}0 %1 of class template %2">; 5283def err_explicit_instantiation_undefined_func_template : Error< 5284 "explicit instantiation of undefined function template %0">; 5285def err_explicit_instantiation_undefined_var_template : Error< 5286 "explicit instantiation of undefined variable template %q0">; 5287def err_explicit_instantiation_declaration_after_definition : Error< 5288 "explicit instantiation declaration (with 'extern') follows explicit " 5289 "instantiation definition (without 'extern')">; 5290def note_explicit_instantiation_definition_here : Note< 5291 "explicit instantiation definition is here">; 5292def err_invalid_var_template_spec_type : Error<"type %2 " 5293 "of %select{explicit instantiation|explicit specialization|" 5294 "partial specialization|redeclaration}0 of %1 does not match" 5295 " expected type %3">; 5296def err_mismatched_exception_spec_explicit_instantiation : Error< 5297 "exception specification in explicit instantiation does not match " 5298 "instantiated one">; 5299def ext_mismatched_exception_spec_explicit_instantiation : ExtWarn< 5300 err_mismatched_exception_spec_explicit_instantiation.Text>, 5301 InGroup<MicrosoftExceptionSpec>; 5302def err_explicit_instantiation_dependent : Error< 5303 "explicit instantiation has dependent template arguments">; 5304 5305// C++ typename-specifiers 5306def err_typename_nested_not_found : Error<"no type named %0 in %1">; 5307def err_typename_nested_not_found_enable_if : Error< 5308 "no type named 'type' in %0; 'enable_if' cannot be used to disable " 5309 "this declaration">; 5310def err_typename_nested_not_found_requirement : Error< 5311 "failed requirement '%0'; 'enable_if' cannot be used to disable this " 5312 "declaration">; 5313def err_typename_nested_not_type : Error< 5314 "typename specifier refers to non-type member %0 in %1">; 5315def err_typename_not_type : Error< 5316 "typename specifier refers to non-type %0">; 5317def note_typename_member_refers_here : Note< 5318 "referenced member %0 is declared here">; 5319def note_typename_refers_here : Note< 5320 "referenced %0 is declared here">; 5321def err_typename_missing : Error< 5322 "missing 'typename' prior to dependent type name '%0%1'">; 5323def err_typename_missing_template : Error< 5324 "missing 'typename' prior to dependent type template name '%0%1'">; 5325def ext_typename_missing : ExtWarn< 5326 "missing 'typename' prior to dependent type name '%0%1'">, 5327 InGroup<DiagGroup<"typename-missing">>; 5328def ext_typename_outside_of_template : ExtWarn< 5329 "'typename' occurs outside of a template">, InGroup<CXX11>; 5330def warn_cxx98_compat_typename_outside_of_template : Warning< 5331 "use of 'typename' outside of a template is incompatible with C++98">, 5332 InGroup<CXX98Compat>, DefaultIgnore; 5333def err_typename_refers_to_using_value_decl : Error< 5334 "typename specifier refers to a dependent using declaration for a value " 5335 "%0 in %1">; 5336def note_using_value_decl_missing_typename : Note< 5337 "add 'typename' to treat this using declaration as a type">; 5338 5339def err_template_kw_refers_to_non_template : Error< 5340 "%0%select{| following the 'template' keyword}1 " 5341 "does not refer to a template">; 5342def note_template_kw_refers_to_non_template : Note< 5343 "declared as a non-template here">; 5344def err_template_kw_refers_to_dependent_non_template : Error< 5345 "%0%select{| following the 'template' keyword}1 " 5346 "cannot refer to a dependent template">; 5347def err_template_kw_refers_to_class_template : Error< 5348 "'%0%1' instantiated to a class template, not a function template">; 5349def note_referenced_class_template : Note< 5350 "class template declared here">; 5351def err_template_kw_missing : Error< 5352 "missing 'template' keyword prior to dependent template name '%0%1'">; 5353def ext_template_outside_of_template : ExtWarn< 5354 "'template' keyword outside of a template">, InGroup<CXX11>; 5355def warn_cxx98_compat_template_outside_of_template : Warning< 5356 "use of 'template' keyword outside of a template is incompatible with C++98">, 5357 InGroup<CXX98Compat>, DefaultIgnore; 5358 5359def err_non_type_template_in_nested_name_specifier : Error< 5360 "qualified name refers into a specialization of %select{function|variable}0 " 5361 "template %1">; 5362def err_template_id_not_a_type : Error< 5363 "template name refers to non-type template %0">; 5364def note_template_declared_here : Note< 5365 "%select{function template|class template|variable template" 5366 "|type alias template|template template parameter}0 " 5367 "%1 declared here">; 5368def err_template_expansion_into_fixed_list : Error< 5369 "pack expansion used as argument for non-pack parameter of %select{alias " 5370 "template|concept}0">; 5371def note_parameter_type : Note< 5372 "parameter of type %0 is declared here">; 5373 5374// C++11 Variadic Templates 5375def err_template_param_pack_default_arg : Error< 5376 "template parameter pack cannot have a default argument">; 5377def err_template_param_pack_must_be_last_template_parameter : Error< 5378 "template parameter pack must be the last template parameter">; 5379 5380def err_template_parameter_pack_non_pack : Error< 5381 "%select{template type|non-type template|template template}0 parameter" 5382 "%select{| pack}1 conflicts with previous %select{template type|" 5383 "non-type template|template template}0 parameter%select{ pack|}1">; 5384def note_template_parameter_pack_non_pack : Note< 5385 "%select{template type|non-type template|template template}0 parameter" 5386 "%select{| pack}1 does not match %select{template type|non-type template" 5387 "|template template}0 parameter%select{ pack|}1 in template argument">; 5388def note_template_parameter_pack_here : Note< 5389 "previous %select{template type|non-type template|template template}0 " 5390 "parameter%select{| pack}1 declared here">; 5391 5392def err_unexpanded_parameter_pack : Error< 5393 "%select{expression|base type|declaration type|data member type|bit-field " 5394 "size|static assertion|fixed underlying type|enumerator value|" 5395 "using declaration|friend declaration|qualifier|initializer|default argument|" 5396 "non-type template parameter type|exception type|partial specialization|" 5397 "__if_exists name|__if_not_exists name|lambda|block|type constraint|" 5398 "requirement|requires clause}0 " 5399 "contains%plural{0: an|:}1 unexpanded parameter pack" 5400 "%plural{0:|1: %2|2:s %2 and %3|:s %2, %3, ...}1">; 5401 5402def err_pack_expansion_without_parameter_packs : Error< 5403 "pack expansion does not contain any unexpanded parameter packs">; 5404def err_pack_expansion_length_conflict : Error< 5405 "pack expansion contains parameter packs %0 and %1 that have different " 5406 "lengths (%2 vs. %3)">; 5407def err_pack_expansion_length_conflict_multilevel : Error< 5408 "pack expansion contains parameter pack %0 that has a different " 5409 "length (%1 vs. %2) from outer parameter packs">; 5410def err_pack_expansion_length_conflict_partial : Error< 5411 "pack expansion contains parameter pack %0 that has a different " 5412 "length (at least %1 vs. %2) from outer parameter packs">; 5413def err_pack_expansion_member_init : Error< 5414 "pack expansion for initialization of member %0">; 5415 5416def err_function_parameter_pack_without_parameter_packs : Error< 5417 "type %0 of function parameter pack does not contain any unexpanded " 5418 "parameter packs">; 5419def err_ellipsis_in_declarator_not_parameter : Error< 5420 "only function and template parameters can be parameter packs">; 5421 5422def err_sizeof_pack_no_pack_name : Error< 5423 "%0 does not refer to the name of a parameter pack">; 5424 5425def err_fold_expression_packs_both_sides : Error< 5426 "binary fold expression has unexpanded parameter packs in both operands">; 5427def err_fold_expression_empty : Error< 5428 "unary fold expression has empty expansion for operator '%0' " 5429 "with no fallback value">; 5430def err_fold_expression_bad_operand : Error< 5431 "expression not permitted as operand of fold expression">; 5432def err_fold_expression_limit_exceeded: Error< 5433 "instantiating fold expression with %0 arguments exceeded expression nesting " 5434 "limit of %1">, DefaultFatal, NoSFINAE; 5435 5436def err_unexpected_typedef : Error< 5437 "unexpected type name %0: expected expression">; 5438def err_unexpected_namespace : Error< 5439 "unexpected namespace name %0: expected expression">; 5440def err_undeclared_var_use : Error<"use of undeclared identifier %0">; 5441def ext_undeclared_unqual_id_with_dependent_base : ExtWarn< 5442 "use of undeclared identifier %0; " 5443 "unqualified lookup into dependent bases of class template %1 is a Microsoft extension">, 5444 InGroup<MicrosoftTemplate>; 5445def err_found_in_dependent_base : Error< 5446 "explicit qualification required to use member %0 from dependent base class">; 5447def ext_found_in_dependent_base : ExtWarn<"use of member %0 " 5448 "found via unqualified lookup into dependent bases of class templates is a " 5449 "Microsoft extension">, InGroup<MicrosoftTemplate>; 5450def err_found_later_in_class : Error<"member %0 used before its declaration">; 5451def ext_found_later_in_class : ExtWarn< 5452 "use of member %0 before its declaration is a Microsoft extension">, 5453 InGroup<MicrosoftTemplate>; 5454def note_dependent_member_use : Note< 5455 "must qualify identifier to find this declaration in dependent base class">; 5456def err_not_found_by_two_phase_lookup : Error<"call to function %0 that is neither " 5457 "visible in the template definition nor found by argument-dependent lookup">; 5458def note_not_found_by_two_phase_lookup : Note<"%0 should be declared prior to the " 5459 "call site%select{| or in %2| or in an associated namespace of one of its arguments}1">; 5460def err_undeclared_use : Error<"use of undeclared %0">; 5461def warn_deprecated : Warning<"%0 is deprecated">, 5462 InGroup<DeprecatedDeclarations>; 5463def note_from_diagnose_if : Note<"from 'diagnose_if' attribute on %0:">; 5464def warn_property_method_deprecated : 5465 Warning<"property access is using %0 method which is deprecated">, 5466 InGroup<DeprecatedDeclarations>; 5467def warn_deprecated_message : Warning<"%0 is deprecated: %1">, 5468 InGroup<DeprecatedDeclarations>; 5469def warn_deprecated_anonymous_namespace : Warning< 5470 "'deprecated' attribute on anonymous namespace ignored">, 5471 InGroup<IgnoredAttributes>; 5472def warn_deprecated_fwdclass_message : Warning< 5473 "%0 may be deprecated because the receiver type is unknown">, 5474 InGroup<DeprecatedDeclarations>; 5475def warn_deprecated_def : Warning< 5476 "implementing deprecated %select{method|class|category}0">, 5477 InGroup<DeprecatedImplementations>, DefaultIgnore; 5478def warn_unavailable_def : Warning< 5479 "implementing unavailable method">, 5480 InGroup<DeprecatedImplementations>, DefaultIgnore; 5481def err_unavailable : Error<"%0 is unavailable">; 5482def err_property_method_unavailable : 5483 Error<"property access is using %0 method which is unavailable">; 5484def err_unavailable_message : Error<"%0 is unavailable: %1">; 5485def warn_unavailable_fwdclass_message : Warning< 5486 "%0 may be unavailable because the receiver type is unknown">, 5487 InGroup<UnavailableDeclarations>; 5488def note_availability_specified_here : Note< 5489 "%0 has been explicitly marked " 5490 "%select{unavailable|deleted|deprecated}1 here">; 5491def note_partial_availability_specified_here : Note< 5492 "%0 has been marked as being introduced in %1 %2 here, " 5493 "but the deployment target is %1 %3">; 5494def note_implicitly_deleted : Note< 5495 "explicitly defaulted function was implicitly deleted here">; 5496def warn_not_enough_argument : Warning< 5497 "not enough variable arguments in %0 declaration to fit a sentinel">, 5498 InGroup<Sentinel>; 5499def warn_missing_sentinel : Warning < 5500 "missing sentinel in %select{function call|method dispatch|block call}0">, 5501 InGroup<Sentinel>; 5502def note_sentinel_here : Note< 5503 "%select{function|method|block}0 has been explicitly marked sentinel here">; 5504def warn_missing_prototype : Warning< 5505 "no previous prototype for function %0">, 5506 InGroup<DiagGroup<"missing-prototypes">>, DefaultIgnore; 5507def note_declaration_not_a_prototype : Note< 5508 "this declaration is not a prototype; add %select{'void'|parameter declarations}0 " 5509 "to make it %select{a prototype for a zero-parameter function|one}0">; 5510def warn_strict_prototypes : Warning< 5511 "this %select{function declaration is not|block declaration is not|" 5512 "old-style function definition is not preceded by}0 a prototype">, 5513 InGroup<DiagGroup<"strict-prototypes">>, DefaultIgnore; 5514def warn_missing_variable_declarations : Warning< 5515 "no previous extern declaration for non-static variable %0">, 5516 InGroup<DiagGroup<"missing-variable-declarations">>, DefaultIgnore; 5517def note_static_for_internal_linkage : Note< 5518 "declare 'static' if the %select{variable|function}0 is not intended to be " 5519 "used outside of this translation unit">; 5520def err_static_data_member_reinitialization : 5521 Error<"static data member %0 already has an initializer">; 5522def err_redefinition : Error<"redefinition of %0">; 5523def err_alias_after_tentative : 5524 Error<"alias definition of %0 after tentative definition">; 5525def err_alias_is_definition : 5526 Error<"definition %0 cannot also be an %select{alias|ifunc}1">; 5527def err_definition_of_implicitly_declared_member : Error< 5528 "definition of implicitly declared %select{default constructor|copy " 5529 "constructor|move constructor|copy assignment operator|move assignment " 5530 "operator|destructor|function}1">; 5531def err_definition_of_explicitly_defaulted_member : Error< 5532 "definition of explicitly defaulted %select{default constructor|copy " 5533 "constructor|move constructor|copy assignment operator|move assignment " 5534 "operator|destructor|function}0">; 5535def err_redefinition_extern_inline : Error< 5536 "redefinition of a 'extern inline' function %0 is not supported in " 5537 "%select{C99 mode|C++}1">; 5538def warn_attr_abi_tag_namespace : Warning< 5539 "'abi_tag' attribute on %select{non-inline|anonymous}0 namespace ignored">, 5540 InGroup<IgnoredAttributes>; 5541def err_abi_tag_on_redeclaration : Error< 5542 "cannot add 'abi_tag' attribute in a redeclaration">; 5543def err_new_abi_tag_on_redeclaration : Error< 5544 "'abi_tag' %0 missing in original declaration">; 5545def note_use_ifdef_guards : Note< 5546 "unguarded header; consider using #ifdef guards or #pragma once">; 5547 5548def note_deleted_dtor_no_operator_delete : Note< 5549 "virtual destructor requires an unambiguous, accessible 'operator delete'">; 5550def note_deleted_special_member_class_subobject : Note< 5551 "%select{default constructor of|copy constructor of|move constructor of|" 5552 "copy assignment operator of|move assignment operator of|destructor of|" 5553 "constructor inherited by}0 " 5554 "%1 is implicitly deleted because " 5555 "%select{base class %3|%select{||||variant }4field %3}2 " 5556 "%select{has " 5557 "%select{no|a deleted|multiple|an inaccessible|a non-trivial}4 " 5558 "%select{%select{default constructor|copy constructor|move constructor|copy " 5559 "assignment operator|move assignment operator|destructor|" 5560 "%select{default|corresponding|default|default|default}4 constructor}0|" 5561 "destructor}5" 5562 "%select{||s||}4" 5563 "|is an ObjC pointer}6">; 5564def note_deleted_default_ctor_uninit_field : Note< 5565 "%select{default constructor of|constructor inherited by}0 " 5566 "%1 is implicitly deleted because field %2 of " 5567 "%select{reference|const-qualified}4 type %3 would not be initialized">; 5568def note_deleted_default_ctor_all_const : Note< 5569 "%select{default constructor of|constructor inherited by}0 " 5570 "%1 is implicitly deleted because all " 5571 "%select{data members|data members of an anonymous union member}2" 5572 " are const-qualified">; 5573def note_deleted_copy_ctor_rvalue_reference : Note< 5574 "copy constructor of %0 is implicitly deleted because field %1 is of " 5575 "rvalue reference type %2">; 5576def note_deleted_copy_user_declared_move : Note< 5577 "copy %select{constructor|assignment operator}0 is implicitly deleted because" 5578 " %1 has a user-declared move %select{constructor|assignment operator}2">; 5579def note_deleted_assign_field : Note< 5580 "%select{copy|move}0 assignment operator of %1 is implicitly deleted " 5581 "because field %2 is of %select{reference|const-qualified}4 type %3">; 5582 5583// These should be errors. 5584def warn_undefined_internal : Warning< 5585 "%select{function|variable}0 %q1 has internal linkage but is not defined">, 5586 InGroup<DiagGroup<"undefined-internal">>; 5587def err_undefined_internal_type : Error< 5588 "%select{function|variable}0 %q1 is used but not defined in this " 5589 "translation unit, and cannot be defined in any other translation unit " 5590 "because its type does not have linkage">; 5591def ext_undefined_internal_type : Extension< 5592 "ISO C++ requires a definition in this translation unit for " 5593 "%select{function|variable}0 %q1 because its type does not have linkage">, 5594 InGroup<DiagGroup<"undefined-internal-type">>; 5595def warn_undefined_inline : Warning<"inline function %q0 is not defined">, 5596 InGroup<DiagGroup<"undefined-inline">>; 5597def err_undefined_inline_var : Error<"inline variable %q0 is not defined">; 5598def note_used_here : Note<"used here">; 5599 5600def err_attribute_missing_on_first_decl : Error< 5601 "%0 attribute does not appear on the first declaration">; 5602def warn_internal_linkage_local_storage : Warning< 5603 "'internal_linkage' attribute on a non-static local variable is ignored">, 5604 InGroup<IgnoredAttributes>; 5605 5606def ext_internal_in_extern_inline : ExtWarn< 5607 "static %select{function|variable}0 %1 is used in an inline function with " 5608 "external linkage">, InGroup<StaticInInline>; 5609def ext_internal_in_extern_inline_quiet : Extension< 5610 "static %select{function|variable}0 %1 is used in an inline function with " 5611 "external linkage">, InGroup<StaticInInline>; 5612def warn_static_local_in_extern_inline : Warning< 5613 "non-constant static local variable in inline function may be different " 5614 "in different files">, InGroup<StaticLocalInInline>; 5615def note_convert_inline_to_static : Note< 5616 "use 'static' to give inline function %0 internal linkage">; 5617 5618def ext_redefinition_of_typedef : ExtWarn< 5619 "redefinition of typedef %0 is a C11 feature">, 5620 InGroup<DiagGroup<"typedef-redefinition"> >; 5621def err_redefinition_variably_modified_typedef : Error< 5622 "redefinition of %select{typedef|type alias}0 for variably-modified type %1">; 5623 5624def err_inline_decl_follows_def : Error< 5625 "inline declaration of %0 follows non-inline definition">; 5626def err_inline_declaration_block_scope : Error< 5627 "inline declaration of %0 not allowed in block scope">; 5628def err_static_non_static : Error< 5629 "static declaration of %0 follows non-static declaration">; 5630def err_different_language_linkage : Error< 5631 "declaration of %0 has a different language linkage">; 5632def ext_retained_language_linkage : Extension< 5633 "friend function %0 retaining previous language linkage is an extension">, 5634 InGroup<DiagGroup<"retained-language-linkage">>; 5635def err_extern_c_global_conflict : Error< 5636 "declaration of %1 %select{with C language linkage|in global scope}0 " 5637 "conflicts with declaration %select{in global scope|with C language linkage}0">; 5638def note_extern_c_global_conflict : Note< 5639 "declared %select{in global scope|with C language linkage}0 here">; 5640def note_extern_c_begins_here : Note< 5641 "extern \"C\" language linkage specification begins here">; 5642def warn_weak_import : Warning < 5643 "an already-declared variable is made a weak_import declaration %0">; 5644def ext_static_non_static : Extension< 5645 "redeclaring non-static %0 as static is a Microsoft extension">, 5646 InGroup<MicrosoftRedeclareStatic>; 5647def err_non_static_static : Error< 5648 "non-static declaration of %0 follows static declaration">; 5649def err_extern_non_extern : Error< 5650 "extern declaration of %0 follows non-extern declaration">; 5651def err_non_extern_extern : Error< 5652 "non-extern declaration of %0 follows extern declaration">; 5653def err_non_thread_thread : Error< 5654 "non-thread-local declaration of %0 follows thread-local declaration">; 5655def err_thread_non_thread : Error< 5656 "thread-local declaration of %0 follows non-thread-local declaration">; 5657def err_thread_thread_different_kind : Error< 5658 "thread-local declaration of %0 with %select{static|dynamic}1 initialization " 5659 "follows declaration with %select{dynamic|static}1 initialization">; 5660def err_mismatched_owning_module : Error< 5661 "declaration of %0 in %select{the global module|module %2}1 follows " 5662 "declaration in %select{the global module|module %4}3">; 5663def err_redefinition_different_type : Error< 5664 "redefinition of %0 with a different type%diff{: $ vs $|}1,2">; 5665def err_redefinition_different_kind : Error< 5666 "redefinition of %0 as different kind of symbol">; 5667def err_redefinition_different_namespace_alias : Error< 5668 "redefinition of %0 as an alias for a different namespace">; 5669def note_previous_namespace_alias : Note< 5670 "previously defined as an alias for %0">; 5671def warn_forward_class_redefinition : Warning< 5672 "redefinition of forward class %0 of a typedef name of an object type is ignored">, 5673 InGroup<DiagGroup<"objc-forward-class-redefinition">>; 5674def err_redefinition_different_typedef : Error< 5675 "%select{typedef|type alias|type alias template}0 " 5676 "redefinition with different types%diff{ ($ vs $)|}1,2">; 5677def err_tag_reference_non_tag : Error< 5678 "%select{non-struct type|non-class type|non-union type|non-enum " 5679 "type|typedef|type alias|template|type alias template|template " 5680 "template argument}1 %0 cannot be referenced with a " 5681 "%select{struct|interface|union|class|enum}2 specifier">; 5682def err_tag_reference_conflict : Error< 5683 "implicit declaration introduced by elaborated type conflicts with a " 5684 "%select{non-struct type|non-class type|non-union type|non-enum " 5685 "type|typedef|type alias|template|type alias template|template " 5686 "template argument}0 of the same name">; 5687def err_dependent_tag_decl : Error< 5688 "%select{declaration|definition}0 of " 5689 "%select{struct|interface|union|class|enum}1 in a dependent scope">; 5690def err_tag_definition_of_typedef : Error< 5691 "definition of type %0 conflicts with %select{typedef|type alias}1 of the same name">; 5692def err_conflicting_types : Error<"conflicting types for %0">; 5693def err_different_pass_object_size_params : Error< 5694 "conflicting pass_object_size attributes on parameters">; 5695def err_late_asm_label_name : Error< 5696 "cannot apply asm label to %select{variable|function}0 after its first use">; 5697def err_different_asm_label : Error<"conflicting asm label">; 5698def err_nested_redefinition : Error<"nested redefinition of %0">; 5699def err_use_with_wrong_tag : Error< 5700 "use of %0 with tag type that does not match previous declaration">; 5701def warn_struct_class_tag_mismatch : Warning< 5702 "%select{struct|interface|class}0%select{| template}1 %2 was previously " 5703 "declared as a %select{struct|interface|class}3%select{| template}1; " 5704 "this is valid, but may result in linker errors under the Microsoft C++ ABI">, 5705 InGroup<MismatchedTags>, DefaultIgnore; 5706def warn_struct_class_previous_tag_mismatch : Warning< 5707 "%2 defined as %select{a struct|an interface|a class}0%select{| template}1 " 5708 "here but previously declared as " 5709 "%select{a struct|an interface|a class}3%select{| template}1; " 5710 "this is valid, but may result in linker errors under the Microsoft C++ ABI">, 5711 InGroup<MismatchedTags>, DefaultIgnore; 5712def note_struct_class_suggestion : Note< 5713 "did you mean %select{struct|interface|class}0 here?">; 5714def ext_forward_ref_enum : Extension< 5715 "ISO C forbids forward references to 'enum' types">; 5716def err_forward_ref_enum : Error< 5717 "ISO C++ forbids forward references to 'enum' types">; 5718def ext_ms_forward_ref_enum : ExtWarn< 5719 "forward references to 'enum' types are a Microsoft extension">, 5720 InGroup<MicrosoftEnumForwardReference>; 5721def ext_forward_ref_enum_def : Extension< 5722 "redeclaration of already-defined enum %0 is a GNU extension">, 5723 InGroup<GNURedeclaredEnum>; 5724 5725def err_redefinition_of_enumerator : Error<"redefinition of enumerator %0">; 5726def err_duplicate_member : Error<"duplicate member %0">; 5727def err_misplaced_ivar : Error< 5728 "instance variables may not be placed in %select{categories|class extension}0">; 5729def warn_ivars_in_interface : Warning< 5730 "declaration of instance variables in the interface is deprecated">, 5731 InGroup<DiagGroup<"objc-interface-ivars">>, DefaultIgnore; 5732def ext_enum_value_not_int : Extension< 5733 "ISO C restricts enumerator values to range of 'int' (%0 is too " 5734 "%select{small|large}1)">; 5735def ext_enum_too_large : ExtWarn< 5736 "enumeration values exceed range of largest integer">, InGroup<EnumTooLarge>; 5737def ext_enumerator_increment_too_large : ExtWarn< 5738 "incremented enumerator value %0 is not representable in the " 5739 "largest integer type">, InGroup<EnumTooLarge>; 5740def warn_flag_enum_constant_out_of_range : Warning< 5741 "enumeration value %0 is out of range of flags in enumeration type %1">, 5742 InGroup<FlagEnum>; 5743 5744def err_vm_decl_in_file_scope : Error< 5745 "variably modified type declaration not allowed at file scope">; 5746def err_vm_decl_has_extern_linkage : Error< 5747 "variably modified type declaration cannot have 'extern' linkage">; 5748def err_typecheck_field_variable_size : Error< 5749 "fields must have a constant size: 'variable length array in structure' " 5750 "extension will never be supported">; 5751def err_vm_func_decl : Error< 5752 "function declaration cannot have variably modified type">; 5753def err_array_too_large : Error< 5754 "array is too large (%0 elements)">; 5755 5756def err_typecheck_negative_array_size : Error<"array size is negative">; 5757def warn_typecheck_function_qualifiers_ignored : Warning< 5758 "'%0' qualifier on function type %1 has no effect">, 5759 InGroup<IgnoredQualifiers>; 5760def warn_typecheck_function_qualifiers_unspecified : Warning< 5761 "'%0' qualifier on function type %1 has unspecified behavior">; 5762def warn_typecheck_reference_qualifiers : Warning< 5763 "'%0' qualifier on reference type %1 has no effect">, 5764 InGroup<IgnoredReferenceQualifiers>; 5765def err_typecheck_invalid_restrict_not_pointer : Error< 5766 "restrict requires a pointer or reference (%0 is invalid)">; 5767def err_typecheck_invalid_restrict_not_pointer_noarg : Error< 5768 "restrict requires a pointer or reference">; 5769def err_typecheck_invalid_restrict_invalid_pointee : Error< 5770 "pointer to function type %0 may not be 'restrict' qualified">; 5771def ext_typecheck_zero_array_size : Extension< 5772 "zero size arrays are an extension">, InGroup<ZeroLengthArray>; 5773def err_typecheck_zero_array_size : Error< 5774 "zero-length arrays are not permitted in C++">; 5775def err_array_size_non_int : Error<"size of array has non-integer type %0">; 5776def err_init_element_not_constant : Error< 5777 "initializer element is not a compile-time constant">; 5778def ext_aggregate_init_not_constant : Extension< 5779 "initializer for aggregate is not a compile-time constant">, InGroup<C99>; 5780def err_local_cant_init : Error< 5781 "'__local' variable cannot have an initializer">; 5782def err_loader_uninitialized_cant_init 5783 : Error<"variable with 'loader_uninitialized' attribute cannot have an " 5784 "initializer">; 5785def err_loader_uninitialized_trivial_ctor 5786 : Error<"variable with 'loader_uninitialized' attribute must have a " 5787 "trivial default constructor">; 5788def err_loader_uninitialized_redeclaration 5789 : Error<"redeclaration cannot add 'loader_uninitialized' attribute">; 5790def err_loader_uninitialized_extern_decl 5791 : Error<"variable %0 cannot be declared both 'extern' and with the " 5792 "'loader_uninitialized' attribute">; 5793def err_block_extern_cant_init : Error< 5794 "'extern' variable cannot have an initializer">; 5795def warn_extern_init : Warning<"'extern' variable has an initializer">, 5796 InGroup<DiagGroup<"extern-initializer">>; 5797def err_variable_object_no_init : Error< 5798 "variable-sized object may not be initialized">; 5799def err_excess_initializers : Error< 5800 "excess elements in %select{array|vector|scalar|union|struct}0 initializer">; 5801def ext_excess_initializers : ExtWarn< 5802 "excess elements in %select{array|vector|scalar|union|struct}0 initializer">, 5803 InGroup<ExcessInitializers>; 5804def err_excess_initializers_for_sizeless_type : Error< 5805 "excess elements in initializer for indivisible sizeless type %0">; 5806def ext_excess_initializers_for_sizeless_type : ExtWarn< 5807 "excess elements in initializer for indivisible sizeless type %0">, 5808 InGroup<ExcessInitializers>; 5809def err_excess_initializers_in_char_array_initializer : Error< 5810 "excess elements in char array initializer">; 5811def ext_excess_initializers_in_char_array_initializer : ExtWarn< 5812 "excess elements in char array initializer">, 5813 InGroup<ExcessInitializers>; 5814def err_initializer_string_for_char_array_too_long : Error< 5815 "initializer-string for char array is too long">; 5816def ext_initializer_string_for_char_array_too_long : ExtWarn< 5817 "initializer-string for char array is too long">, 5818 InGroup<ExcessInitializers>; 5819def warn_missing_field_initializers : Warning< 5820 "missing field %0 initializer">, 5821 InGroup<MissingFieldInitializers>, DefaultIgnore; 5822def warn_braces_around_init : Warning< 5823 "braces around %select{scalar |}0initializer">, 5824 InGroup<DiagGroup<"braced-scalar-init">>; 5825def ext_many_braces_around_init : ExtWarn< 5826 "too many braces around %select{scalar |}0initializer">, 5827 InGroup<DiagGroup<"many-braces-around-scalar-init">>, SFINAEFailure; 5828def ext_complex_component_init : Extension< 5829 "complex initialization specifying real and imaginary components " 5830 "is an extension">, InGroup<DiagGroup<"complex-component-init">>; 5831def err_empty_scalar_initializer : Error<"scalar initializer cannot be empty">; 5832def err_empty_sizeless_initializer : Error< 5833 "initializer for sizeless type %0 cannot be empty">; 5834def warn_cxx98_compat_empty_scalar_initializer : Warning< 5835 "scalar initialized from empty initializer list is incompatible with C++98">, 5836 InGroup<CXX98Compat>, DefaultIgnore; 5837def warn_cxx98_compat_empty_sizeless_initializer : Warning< 5838 "initializing %0 from an empty initializer list is incompatible with C++98">, 5839 InGroup<CXX98Compat>, DefaultIgnore; 5840def warn_cxx98_compat_reference_list_init : Warning< 5841 "reference initialized from initializer list is incompatible with C++98">, 5842 InGroup<CXX98Compat>, DefaultIgnore; 5843def warn_cxx98_compat_initializer_list_init : Warning< 5844 "initialization of initializer_list object is incompatible with C++98">, 5845 InGroup<CXX98Compat>, DefaultIgnore; 5846def warn_cxx98_compat_ctor_list_init : Warning< 5847 "constructor call from initializer list is incompatible with C++98">, 5848 InGroup<CXX98Compat>, DefaultIgnore; 5849def err_illegal_initializer : Error< 5850 "illegal initializer (only variables can be initialized)">; 5851def err_illegal_initializer_type : Error<"illegal initializer type %0">; 5852def ext_init_list_type_narrowing : ExtWarn< 5853 "type %0 cannot be narrowed to %1 in initializer list">, 5854 InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure; 5855def ext_init_list_variable_narrowing : ExtWarn< 5856 "non-constant-expression cannot be narrowed from type %0 to %1 in " 5857 "initializer list">, InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure; 5858def ext_init_list_constant_narrowing : ExtWarn< 5859 "constant expression evaluates to %0 which cannot be narrowed to type %1">, 5860 InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure; 5861def warn_init_list_type_narrowing : Warning< 5862 "type %0 cannot be narrowed to %1 in initializer list in C++11">, 5863 InGroup<CXX11Narrowing>, DefaultIgnore; 5864def warn_init_list_variable_narrowing : Warning< 5865 "non-constant-expression cannot be narrowed from type %0 to %1 in " 5866 "initializer list in C++11">, 5867 InGroup<CXX11Narrowing>, DefaultIgnore; 5868def warn_init_list_constant_narrowing : Warning< 5869 "constant expression evaluates to %0 which cannot be narrowed to type %1 in " 5870 "C++11">, 5871 InGroup<CXX11Narrowing>, DefaultIgnore; 5872def note_init_list_narrowing_silence : Note< 5873 "insert an explicit cast to silence this issue">; 5874def err_init_objc_class : Error< 5875 "cannot initialize Objective-C class type %0">; 5876def err_implicit_empty_initializer : Error< 5877 "initializer for aggregate with no elements requires explicit braces">; 5878def err_bitfield_has_negative_width : Error< 5879 "bit-field %0 has negative width (%1)">; 5880def err_anon_bitfield_has_negative_width : Error< 5881 "anonymous bit-field has negative width (%0)">; 5882def err_bitfield_has_zero_width : Error<"named bit-field %0 has zero width">; 5883def err_bitfield_width_exceeds_type_width : Error< 5884 "width of%select{ anonymous|}0 bit-field%select{| %1}0 (%2 bits) exceeds the " 5885 "%select{width|size}3 of its type (%4 bit%s4)">; 5886def err_incorrect_number_of_vector_initializers : Error< 5887 "number of elements must be either one or match the size of the vector">; 5888 5889// Used by C++ which allows bit-fields that are wider than the type. 5890def warn_bitfield_width_exceeds_type_width: Warning< 5891 "width of bit-field %0 (%1 bits) exceeds the width of its type; value will " 5892 "be truncated to %2 bit%s2">, InGroup<BitFieldWidth>; 5893def err_bitfield_too_wide : Error< 5894 "%select{bit-field %1|anonymous bit-field}0 is too wide (%2 bits)">; 5895def warn_bitfield_too_small_for_enum : Warning< 5896 "bit-field %0 is not wide enough to store all enumerators of %1">, 5897 InGroup<BitFieldEnumConversion>, DefaultIgnore; 5898def note_widen_bitfield : Note< 5899 "widen this field to %0 bits to store all values of %1">; 5900def warn_unsigned_bitfield_assigned_signed_enum : Warning< 5901 "assigning value of signed enum type %1 to unsigned bit-field %0; " 5902 "negative enumerators of enum %1 will be converted to positive values">, 5903 InGroup<BitFieldEnumConversion>, DefaultIgnore; 5904def warn_signed_bitfield_enum_conversion : Warning< 5905 "signed bit-field %0 needs an extra bit to represent the largest positive " 5906 "enumerators of %1">, 5907 InGroup<BitFieldEnumConversion>, DefaultIgnore; 5908def note_change_bitfield_sign : Note< 5909 "consider making the bitfield type %select{unsigned|signed}0">; 5910 5911def warn_missing_braces : Warning< 5912 "suggest braces around initialization of subobject">, 5913 InGroup<MissingBraces>, DefaultIgnore; 5914 5915def err_redefinition_of_label : Error<"redefinition of label %0">; 5916def err_undeclared_label_use : Error<"use of undeclared label %0">; 5917def err_goto_ms_asm_label : Error< 5918 "cannot jump from this goto statement to label %0 inside an inline assembly block">; 5919def note_goto_ms_asm_label : Note< 5920 "inline assembly label %0 declared here">; 5921def warn_unused_label : Warning<"unused label %0">, 5922 InGroup<UnusedLabel>, DefaultIgnore; 5923 5924def err_continue_from_cond_var_init : Error< 5925 "cannot jump from this continue statement to the loop increment; " 5926 "jump bypasses initialization of loop condition variable">; 5927def err_goto_into_protected_scope : Error< 5928 "cannot jump from this goto statement to its label">; 5929def ext_goto_into_protected_scope : ExtWarn< 5930 "jump from this goto statement to its label is a Microsoft extension">, 5931 InGroup<MicrosoftGoto>; 5932def warn_cxx98_compat_goto_into_protected_scope : Warning< 5933 "jump from this goto statement to its label is incompatible with C++98">, 5934 InGroup<CXX98Compat>, DefaultIgnore; 5935def err_switch_into_protected_scope : Error< 5936 "cannot jump from switch statement to this case label">; 5937def warn_cxx98_compat_switch_into_protected_scope : Warning< 5938 "jump from switch statement to this case label is incompatible with C++98">, 5939 InGroup<CXX98Compat>, DefaultIgnore; 5940def err_indirect_goto_without_addrlabel : Error< 5941 "indirect goto in function with no address-of-label expressions">; 5942def err_indirect_goto_in_protected_scope : Error< 5943 "cannot jump from this %select{indirect|asm}0 goto statement to one of its possible targets">; 5944def warn_cxx98_compat_indirect_goto_in_protected_scope : Warning< 5945 "jump from this %select{indirect|asm}0 goto statement to one of its possible targets " 5946 "is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore; 5947def note_indirect_goto_target : Note< 5948 "possible target of %select{indirect|asm}0 goto statement">; 5949def note_protected_by_variable_init : Note< 5950 "jump bypasses variable initialization">; 5951def note_protected_by_variable_nontriv_destructor : Note< 5952 "jump bypasses variable with a non-trivial destructor">; 5953def note_protected_by_variable_non_pod : Note< 5954 "jump bypasses initialization of non-POD variable">; 5955def note_protected_by_cleanup : Note< 5956 "jump bypasses initialization of variable with __attribute__((cleanup))">; 5957def note_protected_by_vla_typedef : Note< 5958 "jump bypasses initialization of VLA typedef">; 5959def note_protected_by_vla_type_alias : Note< 5960 "jump bypasses initialization of VLA type alias">; 5961def note_protected_by_constexpr_if : Note< 5962 "jump enters controlled statement of constexpr if">; 5963def note_protected_by_consteval_if : Note< 5964 "jump enters controlled statement of consteval if">; 5965def note_protected_by_if_available : Note< 5966 "jump enters controlled statement of if available">; 5967def note_protected_by_vla : Note< 5968 "jump bypasses initialization of variable length array">; 5969def note_protected_by_objc_fast_enumeration : Note< 5970 "jump enters Objective-C fast enumeration loop">; 5971def note_protected_by_objc_try : Note< 5972 "jump bypasses initialization of @try block">; 5973def note_protected_by_objc_catch : Note< 5974 "jump bypasses initialization of @catch block">; 5975def note_protected_by_objc_finally : Note< 5976 "jump bypasses initialization of @finally block">; 5977def note_protected_by_objc_synchronized : Note< 5978 "jump bypasses initialization of @synchronized block">; 5979def note_protected_by_objc_autoreleasepool : Note< 5980 "jump bypasses auto release push of @autoreleasepool block">; 5981def note_protected_by_cxx_try : Note< 5982 "jump bypasses initialization of try block">; 5983def note_protected_by_cxx_catch : Note< 5984 "jump bypasses initialization of catch block">; 5985def note_protected_by_seh_try : Note< 5986 "jump bypasses initialization of __try block">; 5987def note_protected_by_seh_except : Note< 5988 "jump bypasses initialization of __except block">; 5989def note_protected_by_seh_finally : Note< 5990 "jump bypasses initialization of __finally block">; 5991def note_protected_by___block : Note< 5992 "jump bypasses setup of __block variable">; 5993def note_protected_by_objc_strong_init : Note< 5994 "jump bypasses initialization of __strong variable">; 5995def note_protected_by_objc_weak_init : Note< 5996 "jump bypasses initialization of __weak variable">; 5997def note_protected_by_non_trivial_c_struct_init : Note< 5998 "jump bypasses initialization of variable of non-trivial C struct type">; 5999def note_enters_block_captures_cxx_obj : Note< 6000 "jump enters lifetime of block which captures a destructible C++ object">; 6001def note_enters_block_captures_strong : Note< 6002 "jump enters lifetime of block which strongly captures a variable">; 6003def note_enters_block_captures_weak : Note< 6004 "jump enters lifetime of block which weakly captures a variable">; 6005def note_enters_block_captures_non_trivial_c_struct : Note< 6006 "jump enters lifetime of block which captures a C struct that is non-trivial " 6007 "to destroy">; 6008def note_enters_compound_literal_scope : Note< 6009 "jump enters lifetime of a compound literal that is non-trivial to destruct">; 6010 6011def note_exits_cleanup : Note< 6012 "jump exits scope of variable with __attribute__((cleanup))">; 6013def note_exits_dtor : Note< 6014 "jump exits scope of variable with non-trivial destructor">; 6015def note_exits_temporary_dtor : Note< 6016 "jump exits scope of lifetime-extended temporary with non-trivial " 6017 "destructor">; 6018def note_exits___block : Note< 6019 "jump exits scope of __block variable">; 6020def note_exits_objc_try : Note< 6021 "jump exits @try block">; 6022def note_exits_objc_catch : Note< 6023 "jump exits @catch block">; 6024def note_exits_objc_finally : Note< 6025 "jump exits @finally block">; 6026def note_exits_objc_synchronized : Note< 6027 "jump exits @synchronized block">; 6028def note_exits_cxx_try : Note< 6029 "jump exits try block">; 6030def note_exits_cxx_catch : Note< 6031 "jump exits catch block">; 6032def note_exits_seh_try : Note< 6033 "jump exits __try block">; 6034def note_exits_seh_except : Note< 6035 "jump exits __except block">; 6036def note_exits_seh_finally : Note< 6037 "jump exits __finally block">; 6038def note_exits_objc_autoreleasepool : Note< 6039 "jump exits autoreleasepool block">; 6040def note_exits_objc_strong : Note< 6041 "jump exits scope of __strong variable">; 6042def note_exits_objc_weak : Note< 6043 "jump exits scope of __weak variable">; 6044def note_exits_block_captures_cxx_obj : Note< 6045 "jump exits lifetime of block which captures a destructible C++ object">; 6046def note_exits_block_captures_strong : Note< 6047 "jump exits lifetime of block which strongly captures a variable">; 6048def note_exits_block_captures_weak : Note< 6049 "jump exits lifetime of block which weakly captures a variable">; 6050def note_exits_block_captures_non_trivial_c_struct : Note< 6051 "jump exits lifetime of block which captures a C struct that is non-trivial " 6052 "to destroy">; 6053def note_exits_compound_literal_scope : Note< 6054 "jump exits lifetime of a compound literal that is non-trivial to destruct">; 6055 6056def err_func_returning_qualified_void : ExtWarn< 6057 "function cannot return qualified void type %0">, 6058 InGroup<DiagGroup<"qualified-void-return-type">>; 6059def err_func_returning_array_function : Error< 6060 "function cannot return %select{array|function}0 type %1">; 6061def err_field_declared_as_function : Error<"field %0 declared as a function">; 6062def err_field_incomplete_or_sizeless : Error< 6063 "field has %select{incomplete|sizeless}0 type %1">; 6064def ext_variable_sized_type_in_struct : ExtWarn< 6065 "field %0 with variable sized type %1 not at the end of a struct or class is" 6066 " a GNU extension">, InGroup<GNUVariableSizedTypeNotAtEnd>; 6067 6068def ext_c99_flexible_array_member : Extension< 6069 "flexible array members are a C99 feature">, InGroup<C99>; 6070def err_flexible_array_virtual_base : Error< 6071 "flexible array member %0 not allowed in " 6072 "%select{struct|interface|union|class|enum}1 which has a virtual base class">; 6073def err_flexible_array_empty_aggregate : Error< 6074 "flexible array member %0 not allowed in otherwise empty " 6075 "%select{struct|interface|union|class|enum}1">; 6076def err_flexible_array_has_nontrivial_dtor : Error< 6077 "flexible array member %0 of type %1 with non-trivial destruction">; 6078def ext_flexible_array_in_struct : Extension< 6079 "%0 may not be nested in a struct due to flexible array member">, 6080 InGroup<FlexibleArrayExtensions>; 6081def ext_flexible_array_in_array : Extension< 6082 "%0 may not be used as an array element due to flexible array member">, 6083 InGroup<FlexibleArrayExtensions>; 6084def err_flexible_array_init : Error< 6085 "initialization of flexible array member is not allowed">; 6086def ext_flexible_array_empty_aggregate_ms : Extension< 6087 "flexible array member %0 in otherwise empty " 6088 "%select{struct|interface|union|class|enum}1 is a Microsoft extension">, 6089 InGroup<MicrosoftFlexibleArray>; 6090def err_flexible_array_union : Error< 6091 "flexible array member %0 in a union is not allowed">; 6092def ext_flexible_array_union_ms : Extension< 6093 "flexible array member %0 in a union is a Microsoft extension">, 6094 InGroup<MicrosoftFlexibleArray>; 6095def ext_flexible_array_empty_aggregate_gnu : Extension< 6096 "flexible array member %0 in otherwise empty " 6097 "%select{struct|interface|union|class|enum}1 is a GNU extension">, 6098 InGroup<GNUEmptyStruct>; 6099def ext_flexible_array_union_gnu : Extension< 6100 "flexible array member %0 in a union is a GNU extension">, InGroup<GNUFlexibleArrayUnionMember>; 6101 6102def err_flexible_array_not_at_end : Error< 6103 "flexible array member %0 with type %1 is not at the end of" 6104 " %select{struct|interface|union|class|enum}2">; 6105def err_objc_variable_sized_type_not_at_end : Error< 6106 "field %0 with variable sized type %1 is not at the end of class">; 6107def note_next_field_declaration : Note< 6108 "next field declaration is here">; 6109def note_next_ivar_declaration : Note< 6110 "next %select{instance variable declaration|synthesized instance variable}0" 6111 " is here">; 6112def err_synthesize_variable_sized_ivar : Error< 6113 "synthesized property with variable size type %0" 6114 " requires an existing instance variable">; 6115def err_flexible_array_arc_retainable : Error< 6116 "ARC forbids flexible array members with retainable object type">; 6117def warn_variable_sized_ivar_visibility : Warning< 6118 "field %0 with variable sized type %1 is not visible to subclasses and" 6119 " can conflict with their instance variables">, InGroup<ObjCFlexibleArray>; 6120def warn_superclass_variable_sized_type_not_at_end : Warning< 6121 "field %0 can overwrite instance variable %1 with variable sized type %2" 6122 " in superclass %3">, InGroup<ObjCFlexibleArray>; 6123 6124let CategoryName = "ARC Semantic Issue" in { 6125 6126// ARC-mode diagnostics. 6127 6128let CategoryName = "ARC Weak References" in { 6129 6130def err_arc_weak_no_runtime : Error< 6131 "cannot create __weak reference because the current deployment target " 6132 "does not support weak references">; 6133def err_arc_weak_disabled : Error< 6134 "cannot create __weak reference in file using manual reference counting">; 6135def err_synthesizing_arc_weak_property_disabled : Error< 6136 "cannot synthesize weak property in file using manual reference counting">; 6137def err_synthesizing_arc_weak_property_no_runtime : Error< 6138 "cannot synthesize weak property because the current deployment target " 6139 "does not support weak references">; 6140def err_arc_unsupported_weak_class : Error< 6141 "class is incompatible with __weak references">; 6142def err_arc_weak_unavailable_assign : Error< 6143 "assignment of a weak-unavailable object to a __weak object">; 6144def err_arc_weak_unavailable_property : Error< 6145 "synthesizing __weak instance variable of type %0, which does not " 6146 "support weak references">; 6147def note_implemented_by_class : Note< 6148 "when implemented by class %0">; 6149def err_arc_convesion_of_weak_unavailable : Error< 6150 "%select{implicit conversion|cast}0 of weak-unavailable object of type %1 to" 6151 " a __weak object of type %2">; 6152 6153} // end "ARC Weak References" category 6154 6155let CategoryName = "ARC Restrictions" in { 6156 6157def err_unavailable_in_arc : Error< 6158 "%0 is unavailable in ARC">; 6159def note_arc_forbidden_type : Note< 6160 "declaration uses type that is ill-formed in ARC">; 6161def note_performs_forbidden_arc_conversion : Note< 6162 "inline function performs a conversion which is forbidden in ARC">; 6163def note_arc_init_returns_unrelated : Note< 6164 "init method must return a type related to its receiver type">; 6165def note_arc_weak_disabled : Note< 6166 "declaration uses __weak, but ARC is disabled">; 6167def note_arc_weak_no_runtime : Note<"declaration uses __weak, which " 6168 "the current deployment target does not support">; 6169def note_arc_field_with_ownership : Note< 6170 "field has non-trivial ownership qualification">; 6171 6172def err_arc_illegal_explicit_message : Error< 6173 "ARC forbids explicit message send of %0">; 6174def err_arc_unused_init_message : Error< 6175 "the result of a delegate init call must be immediately returned " 6176 "or assigned to 'self'">; 6177def err_arc_mismatched_cast : Error< 6178 "%select{implicit conversion|cast}0 of " 6179 "%select{%2|a non-Objective-C pointer type %2|a block pointer|" 6180 "an Objective-C pointer|an indirect pointer to an Objective-C pointer}1" 6181 " to %3 is disallowed with ARC">; 6182def err_arc_nolifetime_behavior : Error< 6183 "explicit ownership qualifier on cast result has no effect">; 6184def err_arc_objc_property_default_assign_on_object : Error< 6185 "ARC forbids synthesizing a property of an Objective-C object " 6186 "with unspecified ownership or storage attribute">; 6187def err_arc_illegal_selector : Error< 6188 "ARC forbids use of %0 in a @selector">; 6189def err_arc_illegal_method_def : Error< 6190 "ARC forbids %select{implementation|synthesis}0 of %1">; 6191def warn_arc_strong_pointer_objc_pointer : Warning< 6192 "method parameter of type %0 with no explicit ownership">, 6193 InGroup<DiagGroup<"explicit-ownership-type">>, DefaultIgnore; 6194 6195} // end "ARC Restrictions" category 6196 6197def err_arc_lost_method_convention : Error< 6198 "method was declared as %select{an 'alloc'|a 'copy'|an 'init'|a 'new'}0 " 6199 "method, but its implementation doesn't match because %select{" 6200 "its result type is not an object pointer|" 6201 "its result type is unrelated to its receiver type}1">; 6202def note_arc_lost_method_convention : Note<"declaration in interface">; 6203def err_arc_gained_method_convention : Error< 6204 "method implementation does not match its declaration">; 6205def note_arc_gained_method_convention : Note< 6206 "declaration in interface is not in the '%select{alloc|copy|init|new}0' " 6207 "family because %select{its result type is not an object pointer|" 6208 "its result type is unrelated to its receiver type}1">; 6209def err_typecheck_arc_assign_self : Error< 6210 "cannot assign to 'self' outside of a method in the init family">; 6211def err_typecheck_arc_assign_self_class_method : Error< 6212 "cannot assign to 'self' in a class method">; 6213def err_typecheck_arr_assign_enumeration : Error< 6214 "fast enumeration variables cannot be modified in ARC by default; " 6215 "declare the variable __strong to allow this">; 6216def err_typecheck_arc_assign_externally_retained : Error< 6217 "variable declared with 'objc_externally_retained' " 6218 "cannot be modified in ARC">; 6219def warn_arc_retained_assign : Warning< 6220 "assigning retained object to %select{weak|unsafe_unretained}0 " 6221 "%select{property|variable}1" 6222 "; object will be released after assignment">, 6223 InGroup<ARCUnsafeRetainedAssign>; 6224def warn_arc_retained_property_assign : Warning< 6225 "assigning retained object to unsafe property" 6226 "; object will be released after assignment">, 6227 InGroup<ARCUnsafeRetainedAssign>; 6228def warn_arc_literal_assign : Warning< 6229 "assigning %select{array literal|dictionary literal|numeric literal|boxed expression|<should not happen>|block literal}0" 6230 " to a weak %select{property|variable}1" 6231 "; object will be released after assignment">, 6232 InGroup<ARCUnsafeRetainedAssign>; 6233def err_arc_new_array_without_ownership : Error< 6234 "'new' cannot allocate an array of %0 with no explicit ownership">; 6235def err_arc_autoreleasing_var : Error< 6236 "%select{__block variables|global variables|fields|instance variables}0 cannot have " 6237 "__autoreleasing ownership">; 6238def err_arc_autoreleasing_capture : Error< 6239 "cannot capture __autoreleasing variable in a " 6240 "%select{block|lambda by copy}0">; 6241def err_arc_thread_ownership : Error< 6242 "thread-local variable has non-trivial ownership: type is %0">; 6243def err_arc_indirect_no_ownership : Error< 6244 "%select{pointer|reference}1 to non-const type %0 with no explicit ownership">; 6245def err_arc_array_param_no_ownership : Error< 6246 "must explicitly describe intended ownership of an object array parameter">; 6247def err_arc_pseudo_dtor_inconstant_quals : Error< 6248 "pseudo-destructor destroys object of type %0 with inconsistently-qualified " 6249 "type %1">; 6250def err_arc_init_method_unrelated_result_type : Error< 6251 "init methods must return a type related to the receiver type">; 6252def err_arc_nonlocal_writeback : Error< 6253 "passing address of %select{non-local|non-scalar}0 object to " 6254 "__autoreleasing parameter for write-back">; 6255def err_arc_method_not_found : Error< 6256 "no known %select{instance|class}1 method for selector %0">; 6257def err_arc_receiver_forward_class : Error< 6258 "receiver %0 for class message is a forward declaration">; 6259def err_arc_may_not_respond : Error< 6260 "no visible @interface for %0 declares the selector %1">; 6261def err_arc_receiver_forward_instance : Error< 6262 "receiver type %0 for instance message is a forward declaration">; 6263def warn_receiver_forward_instance : Warning< 6264 "receiver type %0 for instance message is a forward declaration">, 6265 InGroup<ForwardClassReceiver>, DefaultIgnore; 6266def err_arc_collection_forward : Error< 6267 "collection expression type %0 is a forward declaration">; 6268def err_arc_multiple_method_decl : Error< 6269 "multiple methods named %0 found with mismatched result, " 6270 "parameter type or attributes">; 6271def warn_arc_lifetime_result_type : Warning< 6272 "ARC %select{unused|__unsafe_unretained|__strong|__weak|__autoreleasing}0 " 6273 "lifetime qualifier on return type is ignored">, 6274 InGroup<IgnoredQualifiers>; 6275 6276let CategoryName = "ARC Retain Cycle" in { 6277 6278def warn_arc_retain_cycle : Warning< 6279 "capturing %0 strongly in this block is likely to lead to a retain cycle">, 6280 InGroup<ARCRetainCycles>; 6281def note_arc_retain_cycle_owner : Note< 6282 "block will be retained by %select{the captured object|an object strongly " 6283 "retained by the captured object}0">; 6284 6285} // end "ARC Retain Cycle" category 6286 6287def warn_arc_object_memaccess : Warning< 6288 "%select{destination for|source of}0 this %1 call is a pointer to " 6289 "ownership-qualified type %2">, InGroup<ARCNonPodMemAccess>; 6290 6291let CategoryName = "ARC and @properties" in { 6292 6293def err_arc_strong_property_ownership : Error< 6294 "existing instance variable %1 for strong property %0 may not be " 6295 "%select{|__unsafe_unretained||__weak}2">; 6296def err_arc_assign_property_ownership : Error< 6297 "existing instance variable %1 for property %0 with %select{unsafe_unretained|assign}2 " 6298 "attribute must be __unsafe_unretained">; 6299def err_arc_inconsistent_property_ownership : Error< 6300 "%select{|unsafe_unretained|strong|weak}1 property %0 may not also be " 6301 "declared %select{|__unsafe_unretained|__strong|__weak|__autoreleasing}2">; 6302 6303} // end "ARC and @properties" category 6304 6305def warn_block_capture_autoreleasing : Warning< 6306 "block captures an autoreleasing out-parameter, which may result in " 6307 "use-after-free bugs">, 6308 InGroup<BlockCaptureAutoReleasing>; 6309def note_declare_parameter_strong : Note< 6310 "declare the parameter __strong or capture a __block __strong variable to " 6311 "keep values alive across autorelease pools">; 6312 6313def err_arc_atomic_ownership : Error< 6314 "cannot perform atomic operation on a pointer to type %0: type has " 6315 "non-trivial ownership">; 6316 6317let CategoryName = "ARC Casting Rules" in { 6318 6319def err_arc_bridge_cast_incompatible : Error< 6320 "incompatible types casting %0 to %1 with a %select{__bridge|" 6321 "__bridge_transfer|__bridge_retained}2 cast">; 6322def err_arc_bridge_cast_wrong_kind : Error< 6323 "cast of %select{Objective-C|block|C}0 pointer type %1 to " 6324 "%select{Objective-C|block|C}2 pointer type %3 cannot use %select{__bridge|" 6325 "__bridge_transfer|__bridge_retained}4">; 6326def err_arc_cast_requires_bridge : Error< 6327 "%select{cast|implicit conversion}0 of %select{Objective-C|block|C}1 " 6328 "pointer type %2 to %select{Objective-C|block|C}3 pointer type %4 " 6329 "requires a bridged cast">; 6330def note_arc_bridge : Note< 6331 "use __bridge to convert directly (no change in ownership)">; 6332def note_arc_cstyle_bridge : Note< 6333 "use __bridge with C-style cast to convert directly (no change in ownership)">; 6334def note_arc_bridge_transfer : Note< 6335 "use %select{__bridge_transfer|CFBridgingRelease call}1 to transfer " 6336 "ownership of a +1 %0 into ARC">; 6337def note_arc_cstyle_bridge_transfer : Note< 6338 "use __bridge_transfer with C-style cast to transfer " 6339 "ownership of a +1 %0 into ARC">; 6340def note_arc_bridge_retained : Note< 6341 "use %select{__bridge_retained|CFBridgingRetain call}1 to make an " 6342 "ARC object available as a +1 %0">; 6343def note_arc_cstyle_bridge_retained : Note< 6344 "use __bridge_retained with C-style cast to make an " 6345 "ARC object available as a +1 %0">; 6346 6347} // ARC Casting category 6348 6349} // ARC category name 6350 6351def err_flexible_array_init_needs_braces : Error< 6352 "flexible array requires brace-enclosed initializer">; 6353def err_illegal_decl_array_of_functions : Error< 6354 "'%0' declared as array of functions of type %1">; 6355def err_array_incomplete_or_sizeless_type : Error< 6356 "array has %select{incomplete|sizeless}0 element type %1">; 6357def err_illegal_message_expr_incomplete_type : Error< 6358 "Objective-C message has incomplete result type %0">; 6359def err_illegal_decl_array_of_references : Error< 6360 "'%0' declared as array of references of type %1">; 6361def err_decl_negative_array_size : Error< 6362 "'%0' declared as an array with a negative size">; 6363def err_array_static_outside_prototype : Error< 6364 "%0 used in array declarator outside of function prototype">; 6365def err_array_static_not_outermost : Error< 6366 "%0 used in non-outermost array type derivation">; 6367def err_array_star_outside_prototype : Error< 6368 "star modifier used outside of function prototype">; 6369def err_illegal_decl_pointer_to_reference : Error< 6370 "'%0' declared as a pointer to a reference of type %1">; 6371def err_illegal_decl_mempointer_to_reference : Error< 6372 "'%0' declared as a member pointer to a reference of type %1">; 6373def err_illegal_decl_mempointer_to_void : Error< 6374 "'%0' declared as a member pointer to void">; 6375def err_illegal_decl_mempointer_in_nonclass : Error< 6376 "'%0' does not point into a class">; 6377def err_mempointer_in_nonclass_type : Error< 6378 "member pointer refers into non-class type %0">; 6379def err_reference_to_void : Error<"cannot form a reference to 'void'">; 6380def err_nonfunction_block_type : Error< 6381 "block pointer to non-function type is invalid">; 6382def err_return_block_has_expr : Error<"void block should not return a value">; 6383def err_block_return_missing_expr : Error< 6384 "non-void block should return a value">; 6385def err_func_def_incomplete_result : Error< 6386 "incomplete result type %0 in function definition">; 6387def err_atomic_specifier_bad_type 6388 : Error<"_Atomic cannot be applied to " 6389 "%select{incomplete |array |function |reference |atomic |qualified " 6390 "|sizeless ||integer }0type " 6391 "%1 %select{|||||||which is not trivially copyable|}0">; 6392 6393// Expressions. 6394def ext_sizeof_alignof_function_type : Extension< 6395 "invalid application of '%0' to a function type">, InGroup<PointerArith>; 6396def ext_sizeof_alignof_void_type : Extension< 6397 "invalid application of '%0' to a void type">, InGroup<PointerArith>; 6398def err_opencl_sizeof_alignof_type : Error< 6399 "invalid application of '%0' to a void type">; 6400def err_sizeof_alignof_incomplete_or_sizeless_type : Error< 6401 "invalid application of '%0' to %select{an incomplete|sizeless}1 type %2">; 6402def err_sizeof_alignof_function_type : Error< 6403 "invalid application of '%0' to a function type">; 6404def err_openmp_default_simd_align_expr : Error< 6405 "invalid application of '__builtin_omp_required_simd_align' to an expression, only type is allowed">; 6406def err_sizeof_alignof_typeof_bitfield : Error< 6407 "invalid application of '%select{sizeof|alignof|typeof}0' to bit-field">; 6408def err_alignof_member_of_incomplete_type : Error< 6409 "invalid application of 'alignof' to a field of a class still being defined">; 6410def err_vecstep_non_scalar_vector_type : Error< 6411 "'vec_step' requires built-in scalar or vector type, %0 invalid">; 6412def err_offsetof_incomplete_type : Error< 6413 "offsetof of incomplete type %0">; 6414def err_offsetof_record_type : Error< 6415 "offsetof requires struct, union, or class type, %0 invalid">; 6416def err_offsetof_array_type : Error<"offsetof requires array type, %0 invalid">; 6417def ext_offsetof_non_pod_type : ExtWarn<"offset of on non-POD type %0">, 6418 InGroup<InvalidOffsetof>; 6419def ext_offsetof_non_standardlayout_type : ExtWarn< 6420 "offset of on non-standard-layout type %0">, InGroup<InvalidOffsetof>; 6421def err_offsetof_bitfield : Error<"cannot compute offset of bit-field %0">; 6422def err_offsetof_field_of_virtual_base : Error< 6423 "invalid application of 'offsetof' to a field of a virtual base">; 6424def warn_sub_ptr_zero_size_types : Warning< 6425 "subtraction of pointers to type %0 of zero size has undefined behavior">, 6426 InGroup<PointerArith>; 6427def warn_pointer_arith_null_ptr : Warning< 6428 "performing pointer arithmetic on a null pointer has undefined behavior%select{| if the offset is nonzero}0">, 6429 InGroup<NullPointerArithmetic>, DefaultIgnore; 6430def warn_gnu_null_ptr_arith : Warning< 6431 "arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension">, 6432 InGroup<NullPointerArithmetic>, DefaultIgnore; 6433def warn_pointer_sub_null_ptr : Warning< 6434 "performing pointer subtraction with a null pointer %select{has|may have}0 undefined behavior">, 6435 InGroup<NullPointerSubtraction>, DefaultIgnore; 6436 6437def warn_floatingpoint_eq : Warning< 6438 "comparing floating point with == or != is unsafe">, 6439 InGroup<DiagGroup<"float-equal">>, DefaultIgnore; 6440 6441def warn_remainder_division_by_zero : Warning< 6442 "%select{remainder|division}0 by zero is undefined">, 6443 InGroup<DivZero>; 6444def warn_shift_lhs_negative : Warning<"shifting a negative signed value is undefined">, 6445 InGroup<DiagGroup<"shift-negative-value">>; 6446def warn_shift_negative : Warning<"shift count is negative">, 6447 InGroup<DiagGroup<"shift-count-negative">>; 6448def warn_shift_gt_typewidth : Warning<"shift count >= width of type">, 6449 InGroup<DiagGroup<"shift-count-overflow">>; 6450def warn_shift_result_gt_typewidth : Warning< 6451 "signed shift result (%0) requires %1 bits to represent, but %2 only has " 6452 "%3 bits">, InGroup<DiagGroup<"shift-overflow">>; 6453def warn_shift_result_sets_sign_bit : Warning< 6454 "signed shift result (%0) sets the sign bit of the shift expression's " 6455 "type (%1) and becomes negative">, 6456 InGroup<DiagGroup<"shift-sign-overflow">>, DefaultIgnore; 6457 6458def warn_precedence_bitwise_rel : Warning< 6459 "%0 has lower precedence than %1; %1 will be evaluated first">, 6460 InGroup<Parentheses>; 6461def note_precedence_bitwise_first : Note< 6462 "place parentheses around the %0 expression to evaluate it first">; 6463def note_precedence_silence : Note< 6464 "place parentheses around the '%0' expression to silence this warning">; 6465 6466def warn_precedence_conditional : Warning< 6467 "operator '?:' has lower precedence than '%0'; '%0' will be evaluated first">, 6468 InGroup<Parentheses>; 6469def warn_precedence_bitwise_conditional : Warning< 6470 "operator '?:' has lower precedence than '%0'; '%0' will be evaluated first">, 6471 InGroup<BitwiseConditionalParentheses>; 6472def note_precedence_conditional_first : Note< 6473 "place parentheses around the '?:' expression to evaluate it first">; 6474 6475def warn_enum_constant_in_bool_context : Warning< 6476 "converting the enum constant to a boolean">, 6477 InGroup<IntInBoolContext>, DefaultIgnore; 6478def warn_left_shift_in_bool_context : Warning< 6479 "converting the result of '<<' to a boolean; did you mean '(%0) != 0'?">, 6480 InGroup<IntInBoolContext>, DefaultIgnore; 6481def warn_logical_instead_of_bitwise : Warning< 6482 "use of logical '%0' with constant operand">, 6483 InGroup<DiagGroup<"constant-logical-operand">>; 6484def note_logical_instead_of_bitwise_change_operator : Note< 6485 "use '%0' for a bitwise operation">; 6486def note_logical_instead_of_bitwise_remove_constant : Note< 6487 "remove constant to silence this warning">; 6488 6489def warn_bitwise_op_in_bitwise_op : Warning< 6490 "'%0' within '%1'">, InGroup<BitwiseOpParentheses>, DefaultIgnore; 6491 6492def warn_logical_and_in_logical_or : Warning< 6493 "'&&' within '||'">, InGroup<LogicalOpParentheses>, DefaultIgnore; 6494 6495def warn_overloaded_shift_in_comparison :Warning< 6496 "overloaded operator %select{>>|<<}0 has higher precedence than " 6497 "comparison operator">, 6498 InGroup<OverloadedShiftOpParentheses>; 6499def note_evaluate_comparison_first :Note< 6500 "place parentheses around comparison expression to evaluate it first">; 6501 6502def note_concatenated_string_literal_silence :Note< 6503 "place parentheses around the string literal to silence warning">; 6504 6505def warn_addition_in_bitshift : Warning< 6506 "operator '%0' has lower precedence than '%1'; " 6507 "'%1' will be evaluated first">, InGroup<ShiftOpParentheses>; 6508 6509def warn_self_assignment_builtin : Warning< 6510 "explicitly assigning value of variable of type %0 to itself">, 6511 InGroup<SelfAssignment>, DefaultIgnore; 6512def warn_self_assignment_overloaded : Warning< 6513 "explicitly assigning value of variable of type %0 to itself">, 6514 InGroup<SelfAssignmentOverloaded>, DefaultIgnore; 6515def warn_self_move : Warning< 6516 "explicitly moving variable of type %0 to itself">, 6517 InGroup<SelfMove>, DefaultIgnore; 6518 6519def warn_redundant_move_on_return : Warning< 6520 "redundant move in return statement">, 6521 InGroup<RedundantMove>, DefaultIgnore; 6522def warn_pessimizing_move_on_return : Warning< 6523 "moving a local object in a return statement prevents copy elision">, 6524 InGroup<PessimizingMove>, DefaultIgnore; 6525def warn_pessimizing_move_on_initialization : Warning< 6526 "moving a temporary object prevents copy elision">, 6527 InGroup<PessimizingMove>, DefaultIgnore; 6528def note_remove_move : Note<"remove std::move call here">; 6529 6530def warn_string_plus_int : Warning< 6531 "adding %0 to a string does not append to the string">, 6532 InGroup<StringPlusInt>; 6533def warn_string_plus_char : Warning< 6534 "adding %0 to a string pointer does not append to the string">, 6535 InGroup<StringPlusChar>; 6536def note_string_plus_scalar_silence : Note< 6537 "use array indexing to silence this warning">; 6538 6539def warn_sizeof_array_param : Warning< 6540 "sizeof on array function parameter will return size of %0 instead of %1">, 6541 InGroup<SizeofArrayArgument>; 6542 6543def warn_sizeof_array_decay : Warning< 6544 "sizeof on pointer operation will return size of %0 instead of %1">, 6545 InGroup<SizeofArrayDecay>; 6546 6547def err_sizeof_nonfragile_interface : Error< 6548 "application of '%select{alignof|sizeof}1' to interface %0 is " 6549 "not supported on this architecture and platform">; 6550def err_atdef_nonfragile_interface : Error< 6551 "use of @defs is not supported on this architecture and platform">; 6552def err_subscript_nonfragile_interface : Error< 6553 "subscript requires size of interface %0, which is not constant for " 6554 "this architecture and platform">; 6555 6556def err_arithmetic_nonfragile_interface : Error< 6557 "arithmetic on pointer to interface %0, which is not a constant size for " 6558 "this architecture and platform">; 6559 6560def warn_deprecated_comma_subscript : Warning< 6561 "top-level comma expression in array subscript is deprecated">, 6562 InGroup<DeprecatedCommaSubscript>; 6563 6564def ext_subscript_non_lvalue : Extension< 6565 "ISO C90 does not allow subscripting non-lvalue array">; 6566def err_typecheck_subscript_value : Error< 6567 "subscripted value is not an array, pointer, or vector">; 6568def err_typecheck_subscript_not_integer : Error< 6569 "array subscript is not an integer">; 6570def err_subscript_function_type : Error< 6571 "subscript of pointer to function type %0">; 6572def err_subscript_incomplete_or_sizeless_type : Error< 6573 "subscript of pointer to %select{incomplete|sizeless}0 type %1">; 6574def err_dereference_incomplete_type : Error< 6575 "dereference of pointer to incomplete type %0">; 6576def ext_gnu_subscript_void_type : Extension< 6577 "subscript of a pointer to void is a GNU extension">, InGroup<PointerArith>; 6578def err_typecheck_member_reference_struct_union : Error< 6579 "member reference base type %0 is not a structure or union">; 6580def err_typecheck_member_reference_ivar : Error< 6581 "%0 does not have a member named %1">; 6582def err_arc_weak_ivar_access : Error< 6583 "dereferencing a __weak pointer is not allowed due to possible " 6584 "null value caused by race condition, assign it to strong variable first">; 6585def err_typecheck_member_reference_arrow : Error< 6586 "member reference type %0 is not a pointer">; 6587def err_typecheck_member_reference_suggestion : Error< 6588 "member reference type %0 is %select{a|not a}1 pointer; did you mean to use '%select{->|.}1'?">; 6589def note_typecheck_member_reference_suggestion : Note< 6590 "did you mean to use '.' instead?">; 6591def note_member_reference_arrow_from_operator_arrow : Note< 6592 "'->' applied to return value of the operator->() declared here">; 6593def err_typecheck_member_reference_type : Error< 6594 "cannot refer to type member %0 in %1 with '%select{.|->}2'">; 6595def err_typecheck_member_reference_unknown : Error< 6596 "cannot refer to member %0 in %1 with '%select{.|->}2'">; 6597def err_member_reference_needs_call : Error< 6598 "base of member reference is a function; perhaps you meant to call " 6599 "it%select{| with no arguments}0?">; 6600def warn_subscript_is_char : Warning<"array subscript is of type 'char'">, 6601 InGroup<CharSubscript>, DefaultIgnore; 6602 6603def err_typecheck_incomplete_tag : Error<"incomplete definition of type %0">; 6604def err_no_member : Error<"no member named %0 in %1">; 6605def err_no_member_overloaded_arrow : Error< 6606 "no member named %0 in %1; did you mean to use '->' instead of '.'?">; 6607 6608def err_member_not_yet_instantiated : Error< 6609 "no member %0 in %1; it has not yet been instantiated">; 6610def note_non_instantiated_member_here : Note< 6611 "not-yet-instantiated member is declared here">; 6612 6613def err_enumerator_does_not_exist : Error< 6614 "enumerator %0 does not exist in instantiation of %1">; 6615def note_enum_specialized_here : Note< 6616 "enum %0 was explicitly specialized here">; 6617 6618def err_specialization_not_primary_template : Error< 6619 "cannot reference member of primary template because deduced class " 6620 "template specialization %0 is %select{instantiated from a partial|" 6621 "an explicit}1 specialization">; 6622 6623def err_member_redeclared : Error<"class member cannot be redeclared">; 6624def ext_member_redeclared : ExtWarn<"class member cannot be redeclared">, 6625 InGroup<RedeclaredClassMember>; 6626def err_member_redeclared_in_instantiation : Error< 6627 "multiple overloads of %0 instantiate to the same signature %1">; 6628def err_member_name_of_class : Error<"member %0 has the same name as its class">; 6629def err_member_def_undefined_record : Error< 6630 "out-of-line definition of %0 from class %1 without definition">; 6631def err_member_decl_does_not_match : Error< 6632 "out-of-line %select{declaration|definition}2 of %0 " 6633 "does not match any declaration in %1">; 6634def err_friend_decl_with_def_arg_must_be_def : Error< 6635 "friend declaration specifying a default argument must be a definition">; 6636def err_friend_decl_with_def_arg_redeclared : Error< 6637 "friend declaration specifying a default argument must be the only declaration">; 6638def err_friend_decl_does_not_match : Error< 6639 "friend declaration of %0 does not match any declaration in %1">; 6640def err_member_decl_does_not_match_suggest : Error< 6641 "out-of-line %select{declaration|definition}2 of %0 " 6642 "does not match any declaration in %1; did you mean %3?">; 6643def err_member_def_does_not_match_ret_type : Error< 6644 "return type of out-of-line definition of %q0 differs from " 6645 "that in the declaration">; 6646def err_nonstatic_member_out_of_line : Error< 6647 "non-static data member defined out-of-line">; 6648def err_qualified_typedef_declarator : Error< 6649 "typedef declarator cannot be qualified">; 6650def err_qualified_param_declarator : Error< 6651 "parameter declarator cannot be qualified">; 6652def ext_out_of_line_declaration : ExtWarn< 6653 "out-of-line declaration of a member must be a definition">, 6654 InGroup<OutOfLineDeclaration>, DefaultError; 6655def err_member_extra_qualification : Error< 6656 "extra qualification on member %0">; 6657def warn_member_extra_qualification : Warning< 6658 err_member_extra_qualification.Text>, InGroup<MicrosoftExtraQualification>; 6659def warn_namespace_member_extra_qualification : Warning< 6660 "extra qualification on member %0">, 6661 InGroup<DiagGroup<"extra-qualification">>; 6662def err_member_qualification : Error< 6663 "non-friend class member %0 cannot have a qualified name">; 6664def note_member_def_close_match : Note<"member declaration nearly matches">; 6665def note_member_def_close_const_match : Note< 6666 "member declaration does not match because " 6667 "it %select{is|is not}0 const qualified">; 6668def note_member_def_close_param_match : Note< 6669 "type of %ordinal0 parameter of member declaration does not match definition" 6670 "%diff{ ($ vs $)|}1,2">; 6671def note_local_decl_close_match : Note<"local declaration nearly matches">; 6672def note_local_decl_close_param_match : Note< 6673 "type of %ordinal0 parameter of local declaration does not match definition" 6674 "%diff{ ($ vs $)|}1,2">; 6675def err_typecheck_ivar_variable_size : Error< 6676 "instance variables must have a constant size">; 6677def err_ivar_reference_type : Error< 6678 "instance variables cannot be of reference type">; 6679def err_typecheck_illegal_increment_decrement : Error< 6680 "cannot %select{decrement|increment}1 value of type %0">; 6681def err_typecheck_expect_int : Error< 6682 "used type %0 where integer is required">; 6683def err_typecheck_arithmetic_incomplete_or_sizeless_type : Error< 6684 "arithmetic on a pointer to %select{an incomplete|sizeless}0 type %1">; 6685def err_typecheck_pointer_arith_function_type : Error< 6686 "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 " 6687 "function type%select{|s}2 %1%select{| and %3}2">; 6688def err_typecheck_pointer_arith_void_type : Error< 6689 "arithmetic on%select{ a|}0 pointer%select{|s}0 to void">; 6690def err_typecheck_decl_incomplete_type : Error< 6691 "variable has incomplete type %0">; 6692def ext_typecheck_decl_incomplete_type : ExtWarn< 6693 "tentative definition of variable with internal linkage has incomplete non-array type %0">, 6694 InGroup<DiagGroup<"tentative-definition-incomplete-type">>; 6695def err_tentative_def_incomplete_type : Error< 6696 "tentative definition has type %0 that is never completed">; 6697def warn_tentative_incomplete_array : Warning< 6698 "tentative array definition assumed to have one element">; 6699def err_typecheck_incomplete_array_needs_initializer : Error< 6700 "definition of variable with array type needs an explicit size " 6701 "or an initializer">; 6702def err_array_init_not_init_list : Error< 6703 "array initializer must be an initializer " 6704 "list%select{| or string literal| or wide string literal}0">; 6705def err_array_init_narrow_string_into_wchar : Error< 6706 "initializing wide char array with non-wide string literal">; 6707def err_array_init_wide_string_into_char : Error< 6708 "initializing char array with wide string literal">; 6709def err_array_init_incompat_wide_string_into_wchar : Error< 6710 "initializing wide char array with incompatible wide string literal">; 6711def err_array_init_plain_string_into_char8_t : Error< 6712 "initializing 'char8_t' array with plain string literal">; 6713def note_array_init_plain_string_into_char8_t : Note< 6714 "add 'u8' prefix to form a 'char8_t' string literal">; 6715def err_array_init_utf8_string_into_char : Error< 6716 "%select{|ISO C++20 does not permit }0initialization of char array with " 6717 "UTF-8 string literal%select{ is not permitted by '-fchar8_t'|}0">; 6718def warn_cxx20_compat_utf8_string : Warning< 6719 "type of UTF-8 string literal will change from array of const char to " 6720 "array of const char8_t in C++20">, InGroup<CXX20Compat>, DefaultIgnore; 6721def note_cxx20_compat_utf8_string_remove_u8 : Note< 6722 "remove 'u8' prefix to avoid a change of behavior; " 6723 "Clang encodes unprefixed narrow string literals as UTF-8">; 6724def err_array_init_different_type : Error< 6725 "cannot initialize array %diff{of type $ with array of type $|" 6726 "with different type of array}0,1">; 6727def err_array_init_non_constant_array : Error< 6728 "cannot initialize array %diff{of type $ with non-constant array of type $|" 6729 "with different type of array}0,1">; 6730def ext_array_init_copy : Extension< 6731 "initialization of an array " 6732 "%diff{of type $ from a compound literal of type $|" 6733 "from a compound literal}0,1 is a GNU extension">, InGroup<GNUCompoundLiteralInitializer>; 6734// This is intentionally not disabled by -Wno-gnu. 6735def ext_array_init_parens : ExtWarn< 6736 "parenthesized initialization of a member array is a GNU extension">, 6737 InGroup<DiagGroup<"gnu-array-member-paren-init">>, DefaultError; 6738def warn_deprecated_string_literal_conversion : Warning< 6739 "conversion from string literal to %0 is deprecated">, 6740 InGroup<CXX11CompatDeprecatedWritableStr>; 6741def ext_deprecated_string_literal_conversion : ExtWarn< 6742 "ISO C++11 does not allow conversion from string literal to %0">, 6743 InGroup<WritableStrings>, SFINAEFailure; 6744def err_realimag_invalid_type : Error<"invalid type %0 to %1 operator">; 6745def err_typecheck_sclass_fscope : Error< 6746 "illegal storage class on file-scoped variable">; 6747def warn_standalone_specifier : Warning<"'%0' ignored on this declaration">, 6748 InGroup<MissingDeclarations>; 6749def ext_standalone_specifier : ExtWarn<"'%0' is not permitted on a declaration " 6750 "of a type">, InGroup<MissingDeclarations>; 6751def err_standalone_class_nested_name_specifier : Error< 6752 "forward declaration of %select{class|struct|interface|union|enum}0 cannot " 6753 "have a nested name specifier">; 6754def err_typecheck_sclass_func : Error<"illegal storage class on function">; 6755def err_static_block_func : Error< 6756 "function declared in block scope cannot have 'static' storage class">; 6757def err_typecheck_address_of : Error<"address of %select{bit-field" 6758 "|vector element|property expression|register variable|matrix element}0 requested">; 6759def ext_typecheck_addrof_void : Extension< 6760 "ISO C forbids taking the address of an expression of type 'void'">; 6761def err_unqualified_pointer_member_function : Error< 6762 "must explicitly qualify name of member function when taking its address">; 6763def err_invalid_form_pointer_member_function : Error< 6764 "cannot create a non-constant pointer to member function">; 6765def err_address_of_function_with_pass_object_size_params: Error< 6766 "cannot take address of function %0 because parameter %1 has " 6767 "pass_object_size attribute">; 6768def err_parens_pointer_member_function : Error< 6769 "cannot parenthesize the name of a method when forming a member pointer">; 6770def err_typecheck_invalid_lvalue_addrof_addrof_function : Error< 6771 "extra '&' taking address of overloaded function">; 6772def err_typecheck_invalid_lvalue_addrof : Error< 6773 "cannot take the address of an rvalue of type %0">; 6774def ext_typecheck_addrof_temporary : ExtWarn< 6775 "taking the address of a temporary object of type %0">, 6776 InGroup<AddressOfTemporary>, DefaultError; 6777def err_typecheck_addrof_temporary : Error< 6778 "taking the address of a temporary object of type %0">; 6779def err_typecheck_addrof_dtor : Error< 6780 "taking the address of a destructor">; 6781def err_typecheck_unary_expr : Error< 6782 "invalid argument type %0 to unary expression">; 6783def err_typecheck_indirection_requires_pointer : Error< 6784 "indirection requires pointer operand (%0 invalid)">; 6785def ext_typecheck_indirection_through_void_pointer : ExtWarn< 6786 "ISO C++ does not allow indirection on operand of type %0">, 6787 InGroup<DiagGroup<"void-ptr-dereference">>; 6788def warn_indirection_through_null : Warning< 6789 "indirection of non-volatile null pointer will be deleted, not trap">, 6790 InGroup<NullDereference>; 6791def warn_binding_null_to_reference : Warning< 6792 "binding dereferenced null pointer to reference has undefined behavior">, 6793 InGroup<NullDereference>; 6794def note_indirection_through_null : Note< 6795 "consider using __builtin_trap() or qualifying pointer with 'volatile'">; 6796def warn_pointer_indirection_from_incompatible_type : Warning< 6797 "dereference of type %1 that was reinterpret_cast from type %0 has undefined " 6798 "behavior">, 6799 InGroup<UndefinedReinterpretCast>, DefaultIgnore; 6800def warn_taking_address_of_packed_member : Warning< 6801 "taking address of packed member %0 of class or structure %q1 may result in an unaligned pointer value">, 6802 InGroup<DiagGroup<"address-of-packed-member">>; 6803def warn_param_mismatched_alignment : Warning< 6804 "passing %0-byte aligned argument to %1-byte aligned parameter %2%select{| of %4}3 may result in an unaligned pointer access">, 6805 InGroup<DiagGroup<"align-mismatch">>; 6806 6807def err_objc_object_assignment : Error< 6808 "cannot assign to class object (%0 invalid)">; 6809def err_typecheck_invalid_operands : Error< 6810 "invalid operands to binary expression (%0 and %1)">, Deferrable; 6811def note_typecheck_invalid_operands_converted : Note< 6812 "%select{first|second}0 operand was implicitly converted to type %1">; 6813def err_typecheck_logical_vector_expr_gnu_cpp_restrict : Error< 6814 "logical expression with vector %select{type %1 and non-vector type %2|types" 6815 " %1 and %2}0 is only supported in C++">; 6816def err_typecheck_sub_ptr_compatible : Error< 6817 "%diff{$ and $ are not pointers to compatible types|" 6818 "pointers to incompatible types}0,1">; 6819def ext_typecheck_ordered_comparison_of_pointer_integer : ExtWarn< 6820 "ordered comparison between pointer and integer (%0 and %1)">; 6821def ext_typecheck_ordered_comparison_of_pointer_and_zero : Extension< 6822 "ordered comparison between pointer and zero (%0 and %1) is an extension">; 6823def err_typecheck_ordered_comparison_of_pointer_and_zero : Error< 6824 "ordered comparison between pointer and zero (%0 and %1)">; 6825def err_typecheck_three_way_comparison_of_pointer_and_zero : Error< 6826 "three-way comparison between pointer and zero">; 6827def ext_typecheck_compare_complete_incomplete_pointers : Extension< 6828 "pointer comparisons before C11 " 6829 "need to be between two complete or two incomplete types; " 6830 "%0 is %select{|in}2complete and " 6831 "%1 is %select{|in}3complete">, 6832 InGroup<C11>; 6833def warn_typecheck_ordered_comparison_of_function_pointers : Warning< 6834 "ordered comparison of function pointers (%0 and %1)">, 6835 InGroup<OrderedCompareFunctionPointers>; 6836def ext_typecheck_ordered_comparison_of_function_pointers : ExtWarn< 6837 "ordered comparison of function pointers (%0 and %1)">, 6838 InGroup<OrderedCompareFunctionPointers>; 6839def err_typecheck_ordered_comparison_of_function_pointers : Error< 6840 "ordered comparison of function pointers (%0 and %1)">; 6841def ext_typecheck_comparison_of_fptr_to_void : Extension< 6842 "equality comparison between function pointer and void pointer (%0 and %1)">; 6843def err_typecheck_comparison_of_fptr_to_void : Error< 6844 "equality comparison between function pointer and void pointer (%0 and %1)">; 6845def ext_typecheck_comparison_of_pointer_integer : ExtWarn< 6846 "comparison between pointer and integer (%0 and %1)">, 6847 InGroup<DiagGroup<"pointer-integer-compare">>; 6848def err_typecheck_comparison_of_pointer_integer : Error< 6849 "comparison between pointer and integer (%0 and %1)">; 6850def ext_typecheck_comparison_of_distinct_pointers : ExtWarn< 6851 "comparison of distinct pointer types%diff{ ($ and $)|}0,1">, 6852 InGroup<CompareDistinctPointerType>; 6853def ext_typecheck_cond_incompatible_operands : ExtWarn< 6854 "incompatible operand types (%0 and %1)">; 6855def err_cond_voidptr_arc : Error < 6856 "operands to conditional of types%diff{ $ and $|}0,1 are incompatible " 6857 "in ARC mode">; 6858def err_typecheck_comparison_of_distinct_pointers : Error< 6859 "comparison of distinct pointer types%diff{ ($ and $)|}0,1">; 6860def err_typecheck_op_on_nonoverlapping_address_space_pointers : Error< 6861 "%select{comparison between %diff{ ($ and $)|}0,1" 6862 "|arithmetic operation with operands of type %diff{ ($ and $)|}0,1" 6863 "|conditional operator with the second and third operands of type " 6864 "%diff{ ($ and $)|}0,1}2" 6865 " which are pointers to non-overlapping address spaces">; 6866 6867def select_arith_conv_kind : TextSubstitution< 6868 "%select{arithmetic between|bitwise operation between|comparison of|" 6869 "conditional expression between|compound assignment of}0">; 6870def warn_arith_conv_enum_float : Warning< 6871 "%sub{select_arith_conv_kind}0 " 6872 "%select{floating-point|enumeration}1 type %2 " 6873 "%plural{2:with|4:from|:and}0 " 6874 "%select{enumeration|floating-point}1 type %3">, 6875 InGroup<EnumFloatConversion>, DefaultIgnore; 6876def warn_arith_conv_enum_float_cxx20 : Warning< 6877 "%sub{select_arith_conv_kind}0 " 6878 "%select{floating-point|enumeration}1 type %2 " 6879 "%plural{2:with|4:from|:and}0 " 6880 "%select{enumeration|floating-point}1 type %3 is deprecated">, 6881 InGroup<DeprecatedEnumFloatConversion>; 6882def warn_arith_conv_mixed_enum_types : Warning< 6883 "%sub{select_arith_conv_kind}0 " 6884 "different enumeration types%diff{ ($ and $)|}1,2">, 6885 InGroup<EnumEnumConversion>, DefaultIgnore; 6886def warn_arith_conv_mixed_enum_types_cxx20 : Warning< 6887 "%sub{select_arith_conv_kind}0 " 6888 "different enumeration types%diff{ ($ and $)|}1,2 is deprecated">, 6889 InGroup<DeprecatedEnumEnumConversion>; 6890def warn_arith_conv_mixed_anon_enum_types : Warning< 6891 warn_arith_conv_mixed_enum_types.Text>, 6892 InGroup<AnonEnumEnumConversion>, DefaultIgnore; 6893def warn_arith_conv_mixed_anon_enum_types_cxx20 : Warning< 6894 warn_arith_conv_mixed_enum_types_cxx20.Text>, 6895 InGroup<DeprecatedAnonEnumEnumConversion>; 6896def warn_conditional_mixed_enum_types : Warning< 6897 warn_arith_conv_mixed_enum_types.Text>, 6898 InGroup<EnumCompareConditional>, DefaultIgnore; 6899def warn_conditional_mixed_enum_types_cxx20 : Warning< 6900 warn_arith_conv_mixed_enum_types_cxx20.Text>, 6901 InGroup<DeprecatedEnumCompareConditional>; 6902def warn_comparison_mixed_enum_types : Warning< 6903 warn_arith_conv_mixed_enum_types.Text>, 6904 InGroup<EnumCompare>; 6905def warn_comparison_mixed_enum_types_cxx20 : Warning< 6906 warn_arith_conv_mixed_enum_types_cxx20.Text>, 6907 InGroup<DeprecatedEnumCompare>; 6908def warn_comparison_of_mixed_enum_types_switch : Warning< 6909 "comparison of different enumeration types in switch statement" 6910 "%diff{ ($ and $)|}0,1">, 6911 InGroup<EnumCompareSwitch>; 6912 6913def err_typecheck_assign_const : Error< 6914 "%select{" 6915 "cannot assign to return value because function %1 returns a const value|" 6916 "cannot assign to variable %1 with const-qualified type %2|" 6917 "cannot assign to %select{non-|}1static data member %2 " 6918 "with const-qualified type %3|" 6919 "cannot assign to non-static data member within const member function %1|" 6920 "cannot assign to %select{variable %2|non-static data member %2|lvalue}1 " 6921 "with %select{|nested }3const-qualified data member %4|" 6922 "read-only variable is not assignable}0">; 6923 6924def note_typecheck_assign_const : Note< 6925 "%select{" 6926 "function %1 which returns const-qualified type %2 declared here|" 6927 "variable %1 declared const here|" 6928 "%select{non-|}1static data member %2 declared const here|" 6929 "member function %q1 is declared const here|" 6930 "%select{|nested }1data member %2 declared const here}0">; 6931 6932def warn_unsigned_always_true_comparison : Warning< 6933 "result of comparison of %select{%3|unsigned expression}0 %2 " 6934 "%select{unsigned expression|%3}0 is always %4">, 6935 InGroup<TautologicalUnsignedZeroCompare>, DefaultIgnore; 6936def warn_unsigned_char_always_true_comparison : Warning< 6937 "result of comparison of %select{%3|char expression}0 %2 " 6938 "%select{char expression|%3}0 is always %4, since char is interpreted as " 6939 "unsigned">, InGroup<TautologicalUnsignedCharZeroCompare>, DefaultIgnore; 6940def warn_unsigned_enum_always_true_comparison : Warning< 6941 "result of comparison of %select{%3|unsigned enum expression}0 %2 " 6942 "%select{unsigned enum expression|%3}0 is always %4">, 6943 InGroup<TautologicalUnsignedEnumZeroCompare>, DefaultIgnore; 6944def warn_tautological_constant_compare : Warning< 6945 "result of comparison %select{%3|%1}0 %2 " 6946 "%select{%1|%3}0 is always %4">, 6947 InGroup<TautologicalTypeLimitCompare>, DefaultIgnore; 6948def warn_tautological_compare_objc_bool : Warning< 6949 "result of comparison of constant %0 with expression of type 'BOOL'" 6950 " is always %1, as the only well defined values for 'BOOL' are YES and NO">, 6951 InGroup<TautologicalObjCBoolCompare>; 6952def subst_int_range : TextSubstitution<"%0-bit %select{signed|unsigned}1 value">; 6953def warn_tautological_compare_value_range : Warning< 6954 "result of comparison of " 6955 "%select{%4|%sub{subst_int_range}1,2}0 %3 " 6956 "%select{%sub{subst_int_range}1,2|%4}0 is always %5">, 6957 InGroup<TautologicalValueRangeCompare>, DefaultIgnore; 6958 6959def warn_mixed_sign_comparison : Warning< 6960 "comparison of integers of different signs: %0 and %1">, 6961 InGroup<SignCompare>, DefaultIgnore; 6962def warn_out_of_range_compare : Warning< 6963 "result of comparison of %select{constant %0|true|false}1 with " 6964 "%select{expression of type %2|boolean expression}3 is always %4">, 6965 InGroup<TautologicalOutOfRangeCompare>; 6966def warn_tautological_bool_compare : Warning<warn_out_of_range_compare.Text>, 6967 InGroup<TautologicalConstantCompare>; 6968def warn_integer_constants_in_conditional_always_true : Warning< 6969 "converting the result of '?:' with integer constants to a boolean always " 6970 "evaluates to 'true'">, 6971 InGroup<TautologicalConstantCompare>; 6972def warn_left_shift_always : Warning< 6973 "converting the result of '<<' to a boolean always evaluates " 6974 "to %select{false|true}0">, 6975 InGroup<TautologicalConstantCompare>; 6976def warn_null_in_arithmetic_operation : Warning< 6977 "use of NULL in arithmetic operation">, 6978 InGroup<NullArithmetic>; 6979def warn_null_in_comparison_operation : Warning< 6980 "comparison between NULL and non-pointer " 6981 "%select{(%1 and NULL)|(NULL and %1)}0">, 6982 InGroup<NullArithmetic>; 6983def err_shift_rhs_only_vector : Error< 6984 "requested shift is a vector of type %0 but the first operand is not a " 6985 "vector (%1)">; 6986 6987def warn_logical_not_on_lhs_of_check : Warning< 6988 "logical not is only applied to the left hand side of this " 6989 "%select{comparison|bitwise operator}0">, 6990 InGroup<LogicalNotParentheses>; 6991def note_logical_not_fix : Note< 6992 "add parentheses after the '!' to evaluate the " 6993 "%select{comparison|bitwise operator}0 first">; 6994def note_logical_not_silence_with_parens : Note< 6995 "add parentheses around left hand side expression to silence this warning">; 6996 6997def err_invalid_this_use : Error< 6998 "invalid use of 'this' outside of a non-static member function">; 6999def err_this_static_member_func : Error< 7000 "'this' cannot be%select{| implicitly}0 used in a static member function " 7001 "declaration">; 7002def err_invalid_member_use_in_static_method : Error< 7003 "invalid use of member %0 in static member function">; 7004def err_invalid_qualified_function_type : Error< 7005 "%select{non-member function|static member function|deduction guide}0 " 7006 "%select{of type %2 |}1cannot have '%3' qualifier">; 7007def err_compound_qualified_function_type : Error< 7008 "%select{block pointer|pointer|reference}0 to function type %select{%2 |}1" 7009 "cannot have '%3' qualifier">; 7010def err_qualified_function_typeid : Error< 7011 "type operand %0 of 'typeid' cannot have '%1' qualifier">; 7012 7013def err_ref_qualifier_overload : Error< 7014 "cannot overload a member function %select{without a ref-qualifier|with " 7015 "ref-qualifier '&'|with ref-qualifier '&&'}0 with a member function %select{" 7016 "without a ref-qualifier|with ref-qualifier '&'|with ref-qualifier '&&'}1">; 7017 7018def err_invalid_non_static_member_use : Error< 7019 "invalid use of non-static data member %0">; 7020def err_nested_non_static_member_use : Error< 7021 "%select{call to non-static member function|use of non-static data member}0 " 7022 "%2 of %1 from nested type %3">; 7023def warn_cxx98_compat_non_static_member_use : Warning< 7024 "use of non-static data member %0 in an unevaluated context is " 7025 "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore; 7026def err_invalid_incomplete_type_use : Error< 7027 "invalid use of incomplete type %0">; 7028def err_builtin_func_cast_more_than_one_arg : Error< 7029 "function-style cast to a builtin type can only take one argument">; 7030def err_value_init_for_array_type : Error< 7031 "array types cannot be value-initialized">; 7032def err_init_for_function_type : Error< 7033 "cannot create object of function type %0">; 7034def warn_format_nonliteral_noargs : Warning< 7035 "format string is not a string literal (potentially insecure)">, 7036 InGroup<FormatSecurity>; 7037def warn_format_nonliteral : Warning< 7038 "format string is not a string literal">, 7039 InGroup<FormatNonLiteral>, DefaultIgnore; 7040 7041def err_unexpected_interface : Error< 7042 "unexpected interface name %0: expected expression">; 7043def err_ref_non_value : Error<"%0 does not refer to a value">; 7044def err_ref_vm_type : Error< 7045 "cannot refer to declaration with a variably modified type inside block">; 7046def err_ref_flexarray_type : Error< 7047 "cannot refer to declaration of structure variable with flexible array member " 7048 "inside block">; 7049def err_ref_array_type : Error< 7050 "cannot refer to declaration with an array type inside block">; 7051def err_property_not_found : Error< 7052 "property %0 not found on object of type %1">; 7053def err_invalid_property_name : Error< 7054 "%0 is not a valid property name (accessing an object of type %1)">; 7055def err_getter_not_found : Error< 7056 "no getter method for read from property">; 7057def err_objc_subscript_method_not_found : Error< 7058 "expected method to %select{read|write}1 %select{dictionary|array}2 element not " 7059 "found on object of type %0">; 7060def err_objc_subscript_index_type : Error< 7061 "method index parameter type %0 is not integral type">; 7062def err_objc_subscript_key_type : Error< 7063 "method key parameter type %0 is not object type">; 7064def err_objc_subscript_dic_object_type : Error< 7065 "method object parameter type %0 is not object type">; 7066def err_objc_subscript_object_type : Error< 7067 "cannot assign to this %select{dictionary|array}1 because assigning method's " 7068 "2nd parameter of type %0 is not an Objective-C pointer type">; 7069def err_objc_subscript_base_type : Error< 7070 "%select{dictionary|array}1 subscript base type %0 is not an Objective-C object">; 7071def err_objc_multiple_subscript_type_conversion : Error< 7072 "indexing expression is invalid because subscript type %0 has " 7073 "multiple type conversion functions">; 7074def err_objc_subscript_type_conversion : Error< 7075 "indexing expression is invalid because subscript type %0 is not an integral" 7076 " or Objective-C pointer type">; 7077def err_objc_subscript_pointer : Error< 7078 "indexing expression is invalid because subscript type %0 is not an" 7079 " Objective-C pointer">; 7080def err_objc_indexing_method_result_type : Error< 7081 "method for accessing %select{dictionary|array}1 element must have Objective-C" 7082 " object return type instead of %0">; 7083def err_objc_index_incomplete_class_type : Error< 7084 "Objective-C index expression has incomplete class type %0">; 7085def err_illegal_container_subscripting_op : Error< 7086 "illegal operation on Objective-C container subscripting">; 7087def err_property_not_found_forward_class : Error< 7088 "property %0 cannot be found in forward class object %1">; 7089def err_property_not_as_forward_class : Error< 7090 "property %0 refers to an incomplete Objective-C class %1 " 7091 "(with no @interface available)">; 7092def note_forward_class : Note< 7093 "forward declaration of class here">; 7094def err_duplicate_property : Error< 7095 "property has a previous declaration">; 7096def ext_gnu_void_ptr : Extension< 7097 "arithmetic on%select{ a|}0 pointer%select{|s}0 to void is a GNU extension">, 7098 InGroup<PointerArith>; 7099def ext_gnu_ptr_func_arith : Extension< 7100 "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 function " 7101 "type%select{|s}2 %1%select{| and %3}2 is a GNU extension">, 7102 InGroup<PointerArith>; 7103def err_readonly_message_assignment : Error< 7104 "assigning to 'readonly' return result of an Objective-C message not allowed">; 7105def ext_integer_increment_complex : Extension< 7106 "ISO C does not support '++'/'--' on complex integer type %0">; 7107def ext_integer_complement_complex : Extension< 7108 "ISO C does not support '~' for complex conjugation of %0">; 7109def err_nosetter_property_assignment : Error< 7110 "%select{assignment to readonly property|" 7111 "no setter method %1 for assignment to property}0">; 7112def err_nosetter_property_incdec : Error< 7113 "%select{%select{increment|decrement}1 of readonly property|" 7114 "no setter method %2 for %select{increment|decrement}1 of property}0">; 7115def err_nogetter_property_compound_assignment : Error< 7116 "a getter method is needed to perform a compound assignment on a property">; 7117def err_nogetter_property_incdec : Error< 7118 "no getter method %1 for %select{increment|decrement}0 of property">; 7119def err_no_subobject_property_setting : Error< 7120 "expression is not assignable">; 7121def err_qualified_objc_access : Error< 7122 "%select{property|instance variable}0 access cannot be qualified with '%1'">; 7123 7124def ext_freestanding_complex : Extension< 7125 "complex numbers are an extension in a freestanding C99 implementation">; 7126 7127// FIXME: Remove when we support imaginary. 7128def err_imaginary_not_supported : Error<"imaginary types are not supported">; 7129 7130// Obj-c expressions 7131def warn_root_inst_method_not_found : Warning< 7132 "instance method %0 is being used on 'Class' which is not in the root class">, 7133 InGroup<MethodAccess>; 7134def warn_class_method_not_found : Warning< 7135 "class method %objcclass0 not found (return type defaults to 'id')">, 7136 InGroup<MethodAccess>; 7137def warn_instance_method_on_class_found : Warning< 7138 "instance method %0 found instead of class method %1">, 7139 InGroup<MethodAccess>; 7140def warn_inst_method_not_found : Warning< 7141 "instance method %objcinstance0 not found (return type defaults to 'id')">, 7142 InGroup<MethodAccess>; 7143def warn_instance_method_not_found_with_typo : Warning< 7144 "instance method %objcinstance0 not found (return type defaults to 'id')" 7145 "; did you mean %objcinstance2?">, InGroup<MethodAccess>; 7146def warn_class_method_not_found_with_typo : Warning< 7147 "class method %objcclass0 not found (return type defaults to 'id')" 7148 "; did you mean %objcclass2?">, InGroup<MethodAccess>; 7149def err_method_not_found_with_typo : Error< 7150 "%select{instance|class}1 method %0 not found " 7151 "; did you mean %2?">; 7152def err_no_super_class_message : Error< 7153 "no @interface declaration found in class messaging of %0">; 7154def err_root_class_cannot_use_super : Error< 7155 "%0 cannot use 'super' because it is a root class">; 7156def err_invalid_receiver_to_message_super : Error< 7157 "'super' is only valid in a method body">; 7158def err_invalid_receiver_class_message : Error< 7159 "receiver type %0 is not an Objective-C class">; 7160def err_missing_open_square_message_send : Error< 7161 "missing '[' at start of message send expression">; 7162def warn_bad_receiver_type : Warning< 7163 "receiver type %0 is not 'id' or interface pointer, consider " 7164 "casting it to 'id'">,InGroup<ObjCReceiver>; 7165def err_bad_receiver_type : Error<"bad receiver type %0">; 7166def err_incomplete_receiver_type : Error<"incomplete receiver type %0">; 7167def err_unknown_receiver_suggest : Error< 7168 "unknown receiver %0; did you mean %1?">; 7169def err_objc_throw_expects_object : Error< 7170 "@throw requires an Objective-C object type (%0 invalid)">; 7171def err_objc_synchronized_expects_object : Error< 7172 "@synchronized requires an Objective-C object type (%0 invalid)">; 7173def err_rethrow_used_outside_catch : Error< 7174 "@throw (rethrow) used outside of a @catch block">; 7175def err_attribute_multiple_objc_gc : Error< 7176 "multiple garbage collection attributes specified for type">; 7177def err_catch_param_not_objc_type : Error< 7178 "@catch parameter is not a pointer to an interface type">; 7179def err_illegal_qualifiers_on_catch_parm : Error< 7180 "illegal qualifiers on @catch parameter">; 7181def err_storage_spec_on_catch_parm : Error< 7182 "@catch parameter cannot have storage specifier '%0'">; 7183def warn_register_objc_catch_parm : Warning< 7184 "'register' storage specifier on @catch parameter will be ignored">; 7185def err_qualified_objc_catch_parm : Error< 7186 "@catch parameter declarator cannot be qualified">; 7187def warn_objc_pointer_cxx_catch_fragile : Warning< 7188 "cannot catch an exception thrown with @throw in C++ in the non-unified " 7189 "exception model">, InGroup<ObjCNonUnifiedException>; 7190def err_objc_object_catch : Error< 7191 "cannot catch an Objective-C object by value">; 7192def err_incomplete_type_objc_at_encode : Error< 7193 "'@encode' of incomplete type %0">; 7194def warn_objc_circular_container : Warning< 7195 "adding %0 to %1 might cause circular dependency in container">, 7196 InGroup<DiagGroup<"objc-circular-container">>; 7197def note_objc_circular_container_declared_here : Note<"%0 declared here">; 7198def warn_objc_unsafe_perform_selector : Warning< 7199 "%0 is incompatible with selectors that return a " 7200 "%select{struct|union|vector}1 type">, 7201 InGroup<DiagGroup<"objc-unsafe-perform-selector">>; 7202def note_objc_unsafe_perform_selector_method_declared_here : Note< 7203 "method %0 that returns %1 declared here">; 7204def err_attribute_arm_builtin_alias : Error< 7205 "'__clang_arm_builtin_alias' attribute can only be applied to an ARM builtin">; 7206def err_attribute_arm_mve_polymorphism : Error< 7207 "'__clang_arm_mve_strict_polymorphism' attribute can only be applied to an MVE/NEON vector type">; 7208 7209def warn_setter_getter_impl_required : Warning< 7210 "property %0 requires method %1 to be defined - " 7211 "use @synthesize, @dynamic or provide a method implementation " 7212 "in this class implementation">, 7213 InGroup<ObjCPropertyImpl>; 7214def warn_setter_getter_impl_required_in_category : Warning< 7215 "property %0 requires method %1 to be defined - " 7216 "use @dynamic or provide a method implementation in this category">, 7217 InGroup<ObjCPropertyImpl>; 7218def note_parameter_named_here : Note< 7219 "passing argument to parameter %0 here">; 7220def note_parameter_here : Note< 7221 "passing argument to parameter here">; 7222def note_method_return_type_change : Note< 7223 "compiler has implicitly changed method %0 return type">; 7224 7225def warn_impl_required_for_class_property : Warning< 7226 "class property %0 requires method %1 to be defined - " 7227 "use @dynamic or provide a method implementation " 7228 "in this class implementation">, 7229 InGroup<ObjCPropertyImpl>; 7230def warn_impl_required_in_category_for_class_property : Warning< 7231 "class property %0 requires method %1 to be defined - " 7232 "use @dynamic or provide a method implementation in this category">, 7233 InGroup<ObjCPropertyImpl>; 7234 7235// C++ casts 7236// These messages adhere to the TryCast pattern: %0 is an int specifying the 7237// cast type, %1 is the source type, %2 is the destination type. 7238def err_bad_reinterpret_cast_overload : Error< 7239 "reinterpret_cast cannot resolve overloaded function %0 to type %1">; 7240 7241def warn_reinterpret_different_from_static : Warning< 7242 "'reinterpret_cast' %select{from|to}3 class %0 %select{to|from}3 its " 7243 "%select{virtual base|base at non-zero offset}2 %1 behaves differently from " 7244 "'static_cast'">, InGroup<ReinterpretBaseClass>; 7245def note_reinterpret_updowncast_use_static: Note< 7246 "use 'static_cast' to adjust the pointer correctly while " 7247 "%select{upcasting|downcasting}0">; 7248 7249def err_bad_static_cast_overload : Error< 7250 "address of overloaded function %0 cannot be static_cast to type %1">; 7251 7252def err_bad_cstyle_cast_overload : Error< 7253 "address of overloaded function %0 cannot be cast to type %1">; 7254 7255 7256def err_bad_cxx_cast_generic : Error< 7257 "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|" 7258 "C-style cast|functional-style cast|addrspace_cast}0 from %1 to %2 is not allowed">; 7259def err_bad_cxx_cast_unrelated_class : Error< 7260 "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|" 7261 "functional-style cast|}0 from %1 to %2, which are not related by " 7262 "inheritance, is not allowed">; 7263def note_type_incomplete : Note<"%0 is incomplete">; 7264def err_bad_cxx_cast_rvalue : Error< 7265 "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|" 7266 "functional-style cast|addrspace_cast}0 from rvalue to reference type %2">; 7267def err_bad_cxx_cast_bitfield : Error< 7268 "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|" 7269 "functional-style cast|}0 from bit-field lvalue to reference type %2">; 7270def err_bad_cxx_cast_qualifiers_away : Error< 7271 "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|" 7272 "functional-style cast|}0 from %1 to %2 casts away qualifiers">; 7273def err_bad_cxx_cast_addr_space_mismatch : Error< 7274 "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|" 7275 "C-style cast|functional-style cast|addrspace_cast}0 from %1 to %2 converts between mismatching address" 7276 " spaces">; 7277def ext_bad_cxx_cast_qualifiers_away_incoherent : ExtWarn< 7278 "ISO C++ does not allow " 7279 "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|" 7280 "functional-style cast|}0 from %1 to %2 because it casts away qualifiers, " 7281 "even though the source and destination types are unrelated">, 7282 SFINAEFailure, InGroup<DiagGroup<"cast-qual-unrelated">>; 7283def err_bad_const_cast_dest : Error< 7284 "%select{const_cast||||C-style cast|functional-style cast|}0 to %2, " 7285 "which is not a reference, pointer-to-object, or pointer-to-data-member">; 7286def ext_cast_fn_obj : Extension< 7287 "cast between pointer-to-function and pointer-to-object is an extension">; 7288def ext_ms_cast_fn_obj : ExtWarn< 7289 "static_cast between pointer-to-function and pointer-to-object is a " 7290 "Microsoft extension">, InGroup<MicrosoftCast>; 7291def warn_cxx98_compat_cast_fn_obj : Warning< 7292 "cast between pointer-to-function and pointer-to-object is incompatible with C++98">, 7293 InGroup<CXX98CompatPedantic>, DefaultIgnore; 7294def err_bad_reinterpret_cast_small_int : Error< 7295 "cast from pointer to smaller type %2 loses information">; 7296def err_bad_cxx_cast_vector_to_scalar_different_size : Error< 7297 "%select{||reinterpret_cast||C-style cast||}0 from vector %1 " 7298 "to scalar %2 of different size">; 7299def err_bad_cxx_cast_scalar_to_vector_different_size : Error< 7300 "%select{||reinterpret_cast||C-style cast||}0 from scalar %1 " 7301 "to vector %2 of different size">; 7302def err_bad_cxx_cast_vector_to_vector_different_size : Error< 7303 "%select{||reinterpret_cast||C-style cast||}0 from vector %1 " 7304 "to vector %2 of different size">; 7305def warn_bad_cxx_cast_nested_pointer_addr_space : Warning< 7306 "%select{reinterpret_cast|C-style cast}0 from %1 to %2 " 7307 "changes address space of nested pointers">, 7308 InGroup<IncompatiblePointerTypesDiscardsQualifiers>; 7309def err_bad_lvalue_to_rvalue_cast : Error< 7310 "cannot cast from lvalue of type %1 to rvalue reference type %2; types are " 7311 "not compatible">; 7312def err_bad_rvalue_to_rvalue_cast : Error< 7313 "cannot cast from rvalue of type %1 to rvalue reference type %2; types are " 7314 "not compatible">; 7315def err_bad_static_cast_pointer_nonpointer : Error< 7316 "cannot cast from type %1 to pointer type %2">; 7317def err_bad_static_cast_member_pointer_nonmp : Error< 7318 "cannot cast from type %1 to member pointer type %2">; 7319def err_bad_cxx_cast_member_pointer_size : Error< 7320 "cannot %select{||reinterpret_cast||C-style cast||}0 from member pointer " 7321 "type %1 to member pointer type %2 of different size">; 7322def err_bad_reinterpret_cast_reference : Error< 7323 "reinterpret_cast of a %0 to %1 needs its address, which is not allowed">; 7324def warn_undefined_reinterpret_cast : Warning< 7325 "reinterpret_cast from %0 to %1 has undefined behavior">, 7326 InGroup<UndefinedReinterpretCast>, DefaultIgnore; 7327 7328// These messages don't adhere to the pattern. 7329// FIXME: Display the path somehow better. 7330def err_ambiguous_base_to_derived_cast : Error< 7331 "ambiguous cast from base %0 to derived %1:%2">; 7332def err_static_downcast_via_virtual : Error< 7333 "cannot cast %0 to %1 via virtual base %2">; 7334def err_downcast_from_inaccessible_base : Error< 7335 "cannot cast %select{private|protected}2 base class %1 to %0">; 7336def err_upcast_to_inaccessible_base : Error< 7337 "cannot cast %0 to its %select{private|protected}2 base class %1">; 7338def err_bad_dynamic_cast_not_ref_or_ptr : Error< 7339 "invalid target type %0 for dynamic_cast; target type must be a reference or pointer type to a defined class">; 7340def err_bad_dynamic_cast_not_class : Error<"%0 is not a class type">; 7341def err_bad_cast_incomplete : Error<"%0 is an incomplete type">; 7342def err_bad_dynamic_cast_not_ptr : Error<"cannot use dynamic_cast to convert from %0 to %1">; 7343def err_bad_dynamic_cast_not_polymorphic : Error<"%0 is not polymorphic">; 7344 7345// Other C++ expressions 7346def err_need_header_before_typeid : Error< 7347 "you need to include <typeinfo> before using the 'typeid' operator">; 7348def err_need_header_before_ms_uuidof : Error< 7349 "you need to include <guiddef.h> before using the '__uuidof' operator">; 7350def err_need_header_before_placement_new : Error< 7351 "no matching %0 function for non-allocating placement new expression; " 7352 "include <new>">; 7353def err_ms___leave_not_in___try : Error< 7354 "'__leave' statement not in __try block">; 7355def err_uuidof_without_guid : Error< 7356 "cannot call operator __uuidof on a type with no GUID">; 7357def err_uuidof_with_multiple_guids : Error< 7358 "cannot call operator __uuidof on a type with multiple GUIDs">; 7359def err_incomplete_typeid : Error<"'typeid' of incomplete type %0">; 7360def err_variably_modified_typeid : Error<"'typeid' of variably modified type %0">; 7361def err_static_illegal_in_new : Error< 7362 "the 'static' modifier for the array size is not legal in new expressions">; 7363def err_array_new_needs_size : Error< 7364 "array size must be specified in new expression with no initializer">; 7365def err_bad_new_type : Error< 7366 "cannot allocate %select{function|reference}1 type %0 with new">; 7367def err_new_incomplete_or_sizeless_type : Error< 7368 "allocation of %select{incomplete|sizeless}0 type %1">; 7369def err_new_array_nonconst : Error< 7370 "only the first dimension of an allocated array may have dynamic size">; 7371def err_new_array_size_unknown_from_init : Error< 7372 "cannot determine allocated array size from initializer">; 7373def err_new_array_init_args : Error< 7374 "array 'new' cannot have initialization arguments">; 7375def ext_new_paren_array_nonconst : ExtWarn< 7376 "when type is in parentheses, array cannot have dynamic size">; 7377def err_placement_new_non_placement_delete : Error< 7378 "'new' expression with placement arguments refers to non-placement " 7379 "'operator delete'">; 7380def err_array_size_not_integral : Error< 7381 "array size expression must have integral or %select{|unscoped }0" 7382 "enumeration type, not %1">; 7383def err_array_size_incomplete_type : Error< 7384 "array size expression has incomplete class type %0">; 7385def err_array_size_explicit_conversion : Error< 7386 "array size expression of type %0 requires explicit conversion to type %1">; 7387def note_array_size_conversion : Note< 7388 "conversion to %select{integral|enumeration}0 type %1 declared here">; 7389def err_array_size_ambiguous_conversion : Error< 7390 "ambiguous conversion of array size expression of type %0 to an integral or " 7391 "enumeration type">; 7392def ext_array_size_conversion : Extension< 7393 "implicit conversion from array size expression of type %0 to " 7394 "%select{integral|enumeration}1 type %2 is a C++11 extension">, 7395 InGroup<CXX11>; 7396def warn_cxx98_compat_array_size_conversion : Warning< 7397 "implicit conversion from array size expression of type %0 to " 7398 "%select{integral|enumeration}1 type %2 is incompatible with C++98">, 7399 InGroup<CXX98CompatPedantic>, DefaultIgnore; 7400def err_address_space_qualified_new : Error< 7401 "'new' cannot allocate objects of type %0 in address space '%1'">; 7402def err_address_space_qualified_delete : Error< 7403 "'delete' cannot delete objects of type %0 in address space '%1'">; 7404 7405def err_default_init_const : Error< 7406 "default initialization of an object of const type %0" 7407 "%select{| without a user-provided default constructor}1">; 7408def ext_default_init_const : ExtWarn< 7409 "default initialization of an object of const type %0" 7410 "%select{| without a user-provided default constructor}1 " 7411 "is a Microsoft extension">, 7412 InGroup<MicrosoftConstInit>; 7413def err_delete_operand : Error<"cannot delete expression of type %0">; 7414def ext_delete_void_ptr_operand : ExtWarn< 7415 "cannot delete expression with pointer-to-'void' type %0">, 7416 InGroup<DeleteIncomplete>; 7417def err_ambiguous_delete_operand : Error< 7418 "ambiguous conversion of delete expression of type %0 to a pointer">; 7419def warn_delete_incomplete : Warning< 7420 "deleting pointer to incomplete type %0 may cause undefined behavior">, 7421 InGroup<DeleteIncomplete>; 7422def err_delete_incomplete_class_type : Error< 7423 "deleting incomplete class type %0; no conversions to pointer type">; 7424def err_delete_explicit_conversion : Error< 7425 "converting delete expression from type %0 to type %1 invokes an explicit " 7426 "conversion function">; 7427def note_delete_conversion : Note<"conversion to pointer type %0">; 7428def warn_delete_array_type : Warning< 7429 "'delete' applied to a pointer-to-array type %0 treated as 'delete[]'">; 7430def warn_mismatched_delete_new : Warning< 7431 "'delete%select{|[]}0' applied to a pointer that was allocated with " 7432 "'new%select{[]|}0'; did you mean 'delete%select{[]|}0'?">, 7433 InGroup<DiagGroup<"mismatched-new-delete">>; 7434def note_allocated_here : Note<"allocated with 'new%select{[]|}0' here">; 7435def err_no_suitable_delete_member_function_found : Error< 7436 "no suitable member %0 in %1">; 7437def err_ambiguous_suitable_delete_member_function_found : Error< 7438 "multiple suitable %0 functions in %1">; 7439def warn_ambiguous_suitable_delete_function_found : Warning< 7440 "multiple suitable %0 functions for %1; no 'operator delete' function " 7441 "will be invoked if initialization throws an exception">, 7442 InGroup<DiagGroup<"ambiguous-delete">>; 7443def note_member_declared_here : Note< 7444 "member %0 declared here">; 7445def note_member_first_declared_here : Note< 7446 "member %0 first declared here">; 7447def warn_bitwise_instead_of_logical : Warning< 7448 "use of bitwise '%0' with boolean operands">, 7449 InGroup<BitwiseInsteadOfLogical>, DefaultIgnore; 7450def warn_bitwise_negation_bool : Warning< 7451 "bitwise negation of a boolean expression%select{;| always evaluates to 'true';}0 " 7452 "did you mean logical negation?">, 7453 InGroup<BoolOperation>, DefaultIgnore; 7454def err_decrement_bool : Error<"cannot decrement expression of type bool">; 7455def warn_increment_bool : Warning< 7456 "incrementing expression of type bool is deprecated and " 7457 "incompatible with C++17">, InGroup<DeprecatedIncrementBool>; 7458def ext_increment_bool : ExtWarn< 7459 "ISO C++17 does not allow incrementing expression of type bool">, 7460 DefaultError, InGroup<IncrementBool>; 7461def err_increment_decrement_enum : Error< 7462 "cannot %select{decrement|increment}0 expression of enum type %1">; 7463 7464def warn_deprecated_increment_decrement_volatile : Warning< 7465 "%select{decrement|increment}0 of object of volatile-qualified type %1 " 7466 "is deprecated">, InGroup<DeprecatedVolatile>; 7467def warn_deprecated_simple_assign_volatile : Warning< 7468 "use of result of assignment to object of volatile-qualified type %0 " 7469 "is deprecated">, InGroup<DeprecatedVolatile>; 7470def warn_deprecated_compound_assign_volatile : Warning< 7471 "compound assignment to object of volatile-qualified type %0 is deprecated">, 7472 InGroup<DeprecatedVolatile>; 7473def warn_deprecated_volatile_return : Warning< 7474 "volatile-qualified return type %0 is deprecated">, 7475 InGroup<DeprecatedVolatile>; 7476def warn_deprecated_volatile_param : Warning< 7477 "volatile-qualified parameter type %0 is deprecated">, 7478 InGroup<DeprecatedVolatile>; 7479def warn_deprecated_volatile_structured_binding : Warning< 7480 "volatile qualifier in structured binding declaration is deprecated">, 7481 InGroup<DeprecatedVolatile>; 7482 7483def warn_deprecated_altivec_src_compat : Warning< 7484 "Current handling of vector bool and vector pixel types in this context are " 7485 "deprecated. The default behaviour will soon change to that implied by the " 7486 "'-altivec-compat=xl' option">, 7487 InGroup<DiagGroup<"deprecated-altivec-src-compat">>; 7488 7489def err_catch_incomplete_ptr : Error< 7490 "cannot catch pointer to incomplete type %0">; 7491def err_catch_incomplete_ref : Error< 7492 "cannot catch reference to incomplete type %0">; 7493def err_catch_incomplete : Error<"cannot catch incomplete type %0">; 7494def err_catch_sizeless : Error< 7495 "cannot catch %select{|reference to }0sizeless type %1">; 7496def err_catch_rvalue_ref : Error<"cannot catch exceptions by rvalue reference">; 7497def err_catch_variably_modified : Error< 7498 "cannot catch variably modified type %0">; 7499def err_qualified_catch_declarator : Error< 7500 "exception declarator cannot be qualified">; 7501def err_early_catch_all : Error<"catch-all handler must come last">; 7502def err_bad_memptr_rhs : Error< 7503 "right hand operand to %0 has non-pointer-to-member type %1">; 7504def err_bad_memptr_lhs : Error< 7505 "left hand operand to %0 must be a %select{|pointer to }1class " 7506 "compatible with the right hand operand, but is %2">; 7507def err_memptr_incomplete : Error< 7508 "member pointer has incomplete base type %0">; 7509def warn_exception_caught_by_earlier_handler : Warning< 7510 "exception of type %0 will be caught by earlier handler">, 7511 InGroup<Exceptions>; 7512def note_previous_exception_handler : Note<"for type %0">; 7513def err_exceptions_disabled : Error< 7514 "cannot use '%0' with exceptions disabled">; 7515def err_objc_exceptions_disabled : Error< 7516 "cannot use '%0' with Objective-C exceptions disabled">; 7517def warn_throw_in_noexcept_func : Warning< 7518 "%0 has a non-throwing exception specification but can still throw">, 7519 InGroup<Exceptions>; 7520def note_throw_in_dtor : Note< 7521 "%select{destructor|deallocator}0 has a %select{non-throwing|implicit " 7522 "non-throwing}1 exception specification">; 7523def note_throw_in_function : Note<"function declared non-throwing here">; 7524def err_seh_try_outside_functions : Error< 7525 "cannot use SEH '__try' in blocks, captured regions, or Obj-C method decls">; 7526def err_mixing_cxx_try_seh_try : Error< 7527 "cannot use %select{C++ 'try'|Objective-C '@try'}0 " 7528 "in the same function as SEH '__try'">; 7529def err_seh_try_unsupported : Error< 7530 "SEH '__try' is not supported on this target">; 7531def note_conflicting_try_here : Note< 7532 "conflicting %0 here">; 7533def warn_jump_out_of_seh_finally : Warning< 7534 "jump out of __finally block has undefined behavior">, 7535 InGroup<DiagGroup<"jump-seh-finally">>; 7536def warn_non_virtual_dtor : Warning< 7537 "%0 has virtual functions but non-virtual destructor">, 7538 InGroup<NonVirtualDtor>, DefaultIgnore; 7539def warn_delete_non_virtual_dtor : Warning< 7540 "%select{delete|destructor}0 called on non-final %1 that has " 7541 "virtual functions but non-virtual destructor">, 7542 InGroup<DeleteNonAbstractNonVirtualDtor>, DefaultIgnore, ShowInSystemHeader; 7543def note_delete_non_virtual : Note< 7544 "qualify call to silence this warning">; 7545def warn_delete_abstract_non_virtual_dtor : Warning< 7546 "%select{delete|destructor}0 called on %1 that is abstract but has " 7547 "non-virtual destructor">, InGroup<DeleteAbstractNonVirtualDtor>, ShowInSystemHeader; 7548def warn_overloaded_virtual : Warning< 7549 "%q0 hides overloaded virtual %select{function|functions}1">, 7550 InGroup<OverloadedVirtual>, DefaultIgnore; 7551def note_hidden_overloaded_virtual_declared_here : Note< 7552 "hidden overloaded virtual function %q0 declared here" 7553 "%select{|: different classes%diff{ ($ vs $)|}2,3" 7554 "|: different number of parameters (%2 vs %3)" 7555 "|: type mismatch at %ordinal2 parameter%diff{ ($ vs $)|}3,4" 7556 "|: different return type%diff{ ($ vs $)|}2,3" 7557 "|: different qualifiers (%2 vs %3)" 7558 "|: different exception specifications}1">; 7559def warn_using_directive_in_header : Warning< 7560 "using namespace directive in global context in header">, 7561 InGroup<HeaderHygiene>, DefaultIgnore; 7562def warn_overaligned_type : Warning< 7563 "type %0 requires %1 bytes of alignment and the default allocator only " 7564 "guarantees %2 bytes">, 7565 InGroup<OveralignedType>, DefaultIgnore; 7566def err_aligned_allocation_unavailable : Error< 7567 "aligned %select{allocation|deallocation}0 function of type '%1' is " 7568 "%select{only|not}4 available on %2%select{ %3 or newer|}4">; 7569def note_silence_aligned_allocation_unavailable : Note< 7570 "if you supply your own aligned allocation functions, use " 7571 "-faligned-allocation to silence this diagnostic">; 7572 7573def err_conditional_void_nonvoid : Error< 7574 "%select{left|right}1 operand to ? is void, but %select{right|left}1 operand " 7575 "is of type %0">; 7576def err_conditional_ambiguous : Error< 7577 "conditional expression is ambiguous; " 7578 "%diff{$ can be converted to $ and vice versa|" 7579 "types can be convert to each other}0,1">; 7580def err_conditional_ambiguous_ovl : Error< 7581 "conditional expression is ambiguous; %diff{$ and $|types}0,1 " 7582 "can be converted to several common types">; 7583def err_conditional_vector_size : Error< 7584 "vector condition type %0 and result type %1 do not have the same number " 7585 "of elements">; 7586def err_conditional_vector_element_size : Error< 7587 "vector condition type %0 and result type %1 do not have elements of the " 7588 "same size">; 7589def err_conditional_vector_has_void : Error< 7590 "GNU vector conditional operand cannot be %select{void|a throw expression}0">; 7591def err_conditional_vector_operand_type 7592 : Error<"enumeration type %0 is not allowed in a vector conditional">; 7593def err_conditional_vector_cond_result_mismatch 7594 : Error<"cannot mix vectors and extended vectors in a vector conditional">; 7595def err_conditional_vector_mismatched 7596 : Error<"vector operands to the vector conditional must be the same type " 7597 "%diff{($ and $)|}0,1}">; 7598 7599def err_throw_incomplete : Error< 7600 "cannot throw object of incomplete type %0">; 7601def err_throw_incomplete_ptr : Error< 7602 "cannot throw pointer to object of incomplete type %0">; 7603def err_throw_sizeless : Error< 7604 "cannot throw object of sizeless type %0">; 7605def warn_throw_underaligned_obj : Warning< 7606 "underaligned exception object thrown">, 7607 InGroup<UnderalignedExceptionObject>; 7608def note_throw_underaligned_obj : Note< 7609 "required alignment of type %0 (%1 bytes) is larger than the supported " 7610 "alignment of C++ exception objects on this target (%2 bytes)">; 7611def err_return_in_constructor_handler : Error< 7612 "return in the catch of a function try block of a constructor is illegal">; 7613def warn_cdtor_function_try_handler_mem_expr : Warning< 7614 "cannot refer to a non-static member from the handler of a " 7615 "%select{constructor|destructor}0 function try block">, InGroup<Exceptions>; 7616 7617let CategoryName = "Lambda Issue" in { 7618 def err_capture_more_than_once : Error< 7619 "%0 can appear only once in a capture list">; 7620 def err_reference_capture_with_reference_default : Error< 7621 "'&' cannot precede a capture when the capture default is '&'">; 7622 def err_copy_capture_with_copy_default : Error< 7623 "'&' must precede a capture when the capture default is '='">; 7624 def err_capture_does_not_name_variable : Error< 7625 "%0 in capture list does not name a variable">; 7626 def err_capture_non_automatic_variable : Error< 7627 "%0 cannot be captured because it does not have automatic storage " 7628 "duration">; 7629 def err_this_capture : Error< 7630 "'this' cannot be %select{implicitly |}0captured in this context">; 7631 def note_lambda_this_capture_fixit : Note< 7632 "explicitly capture 'this'">; 7633 def err_lambda_capture_anonymous_var : Error< 7634 "unnamed variable cannot be implicitly captured in a lambda expression">; 7635 def err_lambda_capture_flexarray_type : Error< 7636 "variable %0 with flexible array member cannot be captured in " 7637 "a lambda expression">; 7638 def err_lambda_impcap : Error< 7639 "variable %0 cannot be implicitly captured in a lambda with no " 7640 "capture-default specified">; 7641 def note_lambda_variable_capture_fixit : Note< 7642 "capture %0 by %select{value|reference}1">; 7643 def note_lambda_default_capture_fixit : Note< 7644 "default capture by %select{value|reference}0">; 7645 def note_lambda_decl : Note<"lambda expression begins here">; 7646 def err_lambda_unevaluated_operand : Error< 7647 "lambda expression in an unevaluated operand">; 7648 def err_lambda_in_constant_expression : Error< 7649 "a lambda expression may not appear inside of a constant expression">; 7650 def err_lambda_in_invalid_context : Error< 7651 "a lambda expression cannot appear in this context">; 7652 def err_lambda_return_init_list : Error< 7653 "cannot deduce lambda return type from initializer list">; 7654 def err_lambda_capture_default_arg : Error< 7655 "lambda expression in default argument cannot capture any entity">; 7656 def err_lambda_incomplete_result : Error< 7657 "incomplete result type %0 in lambda expression">; 7658 def err_noreturn_lambda_has_return_expr : Error< 7659 "lambda declared 'noreturn' should not return">; 7660 def warn_maybe_falloff_nonvoid_lambda : Warning< 7661 "non-void lambda does not return a value in all control paths">, 7662 InGroup<ReturnType>; 7663 def warn_falloff_nonvoid_lambda : Warning< 7664 "non-void lambda does not return a value">, 7665 InGroup<ReturnType>; 7666 def err_access_lambda_capture : Error< 7667 // The ERRORs represent other special members that aren't constructors, in 7668 // hopes that someone will bother noticing and reporting if they appear 7669 "capture of variable '%0' as type %1 calls %select{private|protected}3 " 7670 "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}2constructor">, 7671 AccessControl; 7672 def note_lambda_to_block_conv : Note< 7673 "implicit capture of lambda object due to conversion to block pointer " 7674 "here">; 7675 def note_var_explicitly_captured_here : Note<"variable %0 is" 7676 "%select{| explicitly}1 captured here">; 7677 7678 // C++14 lambda init-captures. 7679 def warn_cxx11_compat_init_capture : Warning< 7680 "initialized lambda captures are incompatible with C++ standards " 7681 "before C++14">, InGroup<CXXPre14Compat>, DefaultIgnore; 7682 def ext_init_capture : ExtWarn< 7683 "initialized lambda captures are a C++14 extension">, InGroup<CXX14>; 7684 def err_init_capture_no_expression : Error< 7685 "initializer missing for lambda capture %0">; 7686 def err_init_capture_multiple_expressions : Error< 7687 "initializer for lambda capture %0 contains multiple expressions">; 7688 def err_init_capture_paren_braces : Error< 7689 "cannot deduce type for lambda capture %1 from " 7690 "%select{parenthesized|nested}0 initializer list">; 7691 def err_init_capture_deduction_failure : Error< 7692 "cannot deduce type for lambda capture %0 from initializer of type %2">; 7693 def err_init_capture_deduction_failure_from_init_list : Error< 7694 "cannot deduce type for lambda capture %0 from initializer list">; 7695 def warn_cxx17_compat_init_capture_pack : Warning< 7696 "initialized lambda capture packs are incompatible with C++ standards " 7697 "before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore; 7698 def ext_init_capture_pack : ExtWarn< 7699 "initialized lambda pack captures are a C++20 extension">, InGroup<CXX20>; 7700 7701 // C++14 generic lambdas. 7702 def warn_cxx11_compat_generic_lambda : Warning< 7703 "generic lambdas are incompatible with C++11">, 7704 InGroup<CXXPre14Compat>, DefaultIgnore; 7705 7706 // C++17 '*this' captures. 7707 def warn_cxx14_compat_star_this_lambda_capture : Warning< 7708 "by value capture of '*this' is incompatible with C++ standards before C++17">, 7709 InGroup<CXXPre17Compat>, DefaultIgnore; 7710 def ext_star_this_lambda_capture_cxx17 : ExtWarn< 7711 "capture of '*this' by copy is a C++17 extension">, InGroup<CXX17>; 7712 7713 // C++17 parameter shadows capture 7714 def err_parameter_shadow_capture : Error< 7715 "a lambda parameter cannot shadow an explicitly captured entity">; 7716 7717 // C++20 [=, this] captures. 7718 def warn_cxx17_compat_equals_this_lambda_capture : Warning< 7719 "explicit capture of 'this' with a capture default of '=' is incompatible " 7720 "with C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore; 7721 def ext_equals_this_lambda_capture_cxx20 : ExtWarn< 7722 "explicit capture of 'this' with a capture default of '=' " 7723 "is a C++20 extension">, InGroup<CXX20>; 7724 def warn_deprecated_this_capture : Warning< 7725 "implicit capture of 'this' with a capture default of '=' is deprecated">, 7726 InGroup<DeprecatedThisCapture>, DefaultIgnore; 7727 def note_deprecated_this_capture : Note< 7728 "add an explicit capture of 'this' to capture '*this' by reference">; 7729 7730 // C++20 default constructible / assignable lambdas. 7731 def warn_cxx17_compat_lambda_def_ctor_assign : Warning< 7732 "%select{default construction|assignment}0 of lambda is incompatible with " 7733 "C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore; 7734} 7735 7736def err_return_in_captured_stmt : Error< 7737 "cannot return from %0">; 7738def err_capture_block_variable : Error< 7739 "__block variable %0 cannot be captured in a " 7740 "%select{lambda expression|captured statement}1">; 7741 7742def err_operator_arrow_circular : Error< 7743 "circular pointer delegation detected">; 7744def err_operator_arrow_depth_exceeded : Error< 7745 "use of 'operator->' on type %0 would invoke a sequence of more than %1 " 7746 "'operator->' calls">; 7747def note_operator_arrow_here : Note< 7748 "'operator->' declared here produces an object of type %0">; 7749def note_operator_arrows_suppressed : Note< 7750 "(skipping %0 'operator->'%s0 in backtrace)">; 7751def note_operator_arrow_depth : Note< 7752 "use -foperator-arrow-depth=N to increase 'operator->' limit">; 7753 7754def err_pseudo_dtor_base_not_scalar : Error< 7755 "object expression of non-scalar type %0 cannot be used in a " 7756 "pseudo-destructor expression">; 7757def ext_pseudo_dtor_on_void : ExtWarn< 7758 "pseudo-destructors on type void are a Microsoft extension">, 7759 InGroup<MicrosoftVoidPseudoDtor>; 7760def err_pseudo_dtor_type_mismatch : Error< 7761 "the type of object expression " 7762 "%diff{($) does not match the type being destroyed ($)|" 7763 "does not match the type being destroyed}0,1 " 7764 "in pseudo-destructor expression">; 7765def err_pseudo_dtor_call_with_args : Error< 7766 "call to pseudo-destructor cannot have any arguments">; 7767def err_dtor_expr_without_call : Error< 7768 "reference to %select{destructor|pseudo-destructor}0 must be called" 7769 "%select{|; did you mean to call it with no arguments?}1">; 7770def err_pseudo_dtor_destructor_non_type : Error< 7771 "%0 does not refer to a type name in pseudo-destructor expression; expected " 7772 "the name of type %1">; 7773def err_invalid_use_of_function_type : Error< 7774 "a function type is not allowed here">; 7775def err_invalid_use_of_array_type : Error<"an array type is not allowed here">; 7776def err_typecheck_bool_condition : Error< 7777 "value of type %0 is not contextually convertible to 'bool'">; 7778def err_typecheck_ambiguous_condition : Error< 7779 "conversion %diff{from $ to $|between types}0,1 is ambiguous">; 7780def err_typecheck_nonviable_condition : Error< 7781 "no viable conversion%select{%diff{ from $ to $|}1,2|" 7782 "%diff{ from returned value of type $ to function return type $|}1,2}0">; 7783def err_typecheck_nonviable_condition_incomplete : Error< 7784 "no viable conversion%diff{ from $ to incomplete type $|}0,1">; 7785def err_typecheck_deleted_function : Error< 7786 "conversion function %diff{from $ to $|between types}0,1 " 7787 "invokes a deleted function">; 7788 7789def err_expected_class_or_namespace : Error<"%0 is not a class" 7790 "%select{ or namespace|, namespace, or enumeration}1">; 7791def err_invalid_declarator_scope : Error<"cannot define or redeclare %0 here " 7792 "because namespace %1 does not enclose namespace %2">; 7793def err_invalid_declarator_global_scope : Error< 7794 "definition or redeclaration of %0 cannot name the global scope">; 7795def err_invalid_declarator_in_function : Error< 7796 "definition or redeclaration of %0 not allowed inside a function">; 7797def err_invalid_declarator_in_block : Error< 7798 "definition or redeclaration of %0 not allowed inside a block">; 7799def err_not_tag_in_scope : Error< 7800 "no %select{struct|interface|union|class|enum}0 named %1 in %2">; 7801 7802def err_no_typeid_with_fno_rtti : Error< 7803 "use of typeid requires -frtti">; 7804def err_no_dynamic_cast_with_fno_rtti : Error< 7805 "use of dynamic_cast requires -frtti">; 7806def warn_no_dynamic_cast_with_rtti_disabled: Warning< 7807 "dynamic_cast will not work since RTTI data is disabled by " 7808 "%select{-fno-rtti-data|/GR-}0">, InGroup<RTTI>; 7809def warn_no_typeid_with_rtti_disabled: Warning< 7810 "typeid will not work since RTTI data is disabled by " 7811 "%select{-fno-rtti-data|/GR-}0">, InGroup<RTTI>; 7812 7813def err_cannot_form_pointer_to_member_of_reference_type : Error< 7814 "cannot form a pointer-to-member to member %0 of reference type %1">; 7815def err_incomplete_object_call : Error< 7816 "incomplete type in call to object of type %0">; 7817 7818def warn_condition_is_assignment : Warning<"using the result of an " 7819 "assignment as a condition without parentheses">, 7820 InGroup<Parentheses>; 7821def warn_free_nonheap_object 7822 : Warning<"attempt to call %0 on non-heap %select{object %2|object: block expression|object: lambda-to-function-pointer conversion}1">, 7823 InGroup<FreeNonHeapObject>; 7824 7825// Completely identical except off by default. 7826def warn_condition_is_idiomatic_assignment : Warning<"using the result " 7827 "of an assignment as a condition without parentheses">, 7828 InGroup<DiagGroup<"idiomatic-parentheses">>, DefaultIgnore; 7829def note_condition_assign_to_comparison : Note< 7830 "use '==' to turn this assignment into an equality comparison">; 7831def note_condition_or_assign_to_comparison : Note< 7832 "use '!=' to turn this compound assignment into an inequality comparison">; 7833def note_condition_assign_silence : Note< 7834 "place parentheses around the assignment to silence this warning">; 7835 7836def warn_equality_with_extra_parens : Warning<"equality comparison with " 7837 "extraneous parentheses">, InGroup<ParenthesesOnEquality>; 7838def note_equality_comparison_to_assign : Note< 7839 "use '=' to turn this equality comparison into an assignment">; 7840def note_equality_comparison_silence : Note< 7841 "remove extraneous parentheses around the comparison to silence this warning">; 7842 7843// assignment related diagnostics (also for argument passing, returning, etc). 7844// In most of these diagnostics the %2 is a value from the 7845// Sema::AssignmentAction enumeration 7846def err_typecheck_convert_incompatible : Error< 7847 "%select{%diff{assigning to $ from incompatible type $|" 7848 "assigning to type from incompatible type}0,1" 7849 "|%diff{passing $ to parameter of incompatible type $|" 7850 "passing type to parameter of incompatible type}0,1" 7851 "|%diff{returning $ from a function with incompatible result type $|" 7852 "returning type from a function with incompatible result type}0,1" 7853 "|%diff{converting $ to incompatible type $|" 7854 "converting type to incompatible type}0,1" 7855 "|%diff{initializing $ with an expression of incompatible type $|" 7856 "initializing type with an expression of incompatible type}0,1" 7857 "|%diff{sending $ to parameter of incompatible type $|" 7858 "sending type to parameter of incompatible type}0,1" 7859 "|%diff{casting $ to incompatible type $|" 7860 "casting type to incompatible type}0,1}2" 7861 "%select{|; dereference with *|" 7862 "; take the address with &|" 7863 "; remove *|" 7864 "; remove &}3" 7865 "%select{|: different classes%diff{ ($ vs $)|}5,6" 7866 "|: different number of parameters (%5 vs %6)" 7867 "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7" 7868 "|: different return type%diff{ ($ vs $)|}5,6" 7869 "|: different qualifiers (%5 vs %6)" 7870 "|: different exception specifications}4">; 7871def err_typecheck_missing_return_type_incompatible : Error< 7872 "%diff{return type $ must match previous return type $|" 7873 "return type must match previous return type}0,1 when %select{block " 7874 "literal|lambda expression}2 has unspecified explicit return type">; 7875 7876def note_incomplete_class_and_qualified_id : Note< 7877 "conformance of forward class %0 to protocol %1 can not be confirmed">; 7878def warn_incompatible_qualified_id : Warning< 7879 "%select{%diff{assigning to $ from incompatible type $|" 7880 "assigning to type from incompatible type}0,1" 7881 "|%diff{passing $ to parameter of incompatible type $|" 7882 "passing type to parameter of incompatible type}0,1" 7883 "|%diff{returning $ from a function with incompatible result type $|" 7884 "returning type from a function with incompatible result type}0,1" 7885 "|%diff{converting $ to incompatible type $|" 7886 "converting type to incompatible type}0,1" 7887 "|%diff{initializing $ with an expression of incompatible type $|" 7888 "initializing type with an expression of incompatible type}0,1" 7889 "|%diff{sending $ to parameter of incompatible type $|" 7890 "sending type to parameter of incompatible type}0,1" 7891 "|%diff{casting $ to incompatible type $|" 7892 "casting type to incompatible type}0,1}2">; 7893def err_incompatible_qualified_id : Error< 7894 "%select{%diff{assigning to $ from incompatible type $|" 7895 "assigning to type from incompatible type}0,1" 7896 "|%diff{passing $ to parameter of incompatible type $|" 7897 "passing type to parameter of incompatible type}0,1" 7898 "|%diff{returning $ from a function with incompatible result type $|" 7899 "returning type from a function with incompatible result type}0,1" 7900 "|%diff{converting $ to incompatible type $|" 7901 "converting type to incompatible type}0,1" 7902 "|%diff{initializing $ with an expression of incompatible type $|" 7903 "initializing type with an expression of incompatible type}0,1" 7904 "|%diff{sending $ to parameter of incompatible type $|" 7905 "sending type to parameter of incompatible type}0,1" 7906 "|%diff{casting $ to incompatible type $|" 7907 "casting type to incompatible type}0,1}2">; 7908def ext_typecheck_convert_pointer_int : ExtWarn< 7909 "incompatible pointer to integer conversion " 7910 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 7911 "|%diff{passing $ to parameter of type $|" 7912 "passing to parameter of different type}0,1" 7913 "|%diff{returning $ from a function with result type $|" 7914 "returning from function with different return type}0,1" 7915 "|%diff{converting $ to type $|converting between types}0,1" 7916 "|%diff{initializing $ with an expression of type $|" 7917 "initializing with expression of different type}0,1" 7918 "|%diff{sending $ to parameter of type $|" 7919 "sending to parameter of different type}0,1" 7920 "|%diff{casting $ to type $|casting between types}0,1}2" 7921 "%select{|; dereference with *|" 7922 "; take the address with &|" 7923 "; remove *|" 7924 "; remove &}3">, 7925 InGroup<IntConversion>; 7926def err_typecheck_convert_pointer_int : Error< 7927 "incompatible pointer to integer conversion " 7928 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 7929 "|%diff{passing $ to parameter of type $|" 7930 "passing to parameter of different type}0,1" 7931 "|%diff{returning $ from a function with result type $|" 7932 "returning from function with different return type}0,1" 7933 "|%diff{converting $ to type $|converting between types}0,1" 7934 "|%diff{initializing $ with an expression of type $|" 7935 "initializing with expression of different type}0,1" 7936 "|%diff{sending $ to parameter of type $|" 7937 "sending to parameter of different type}0,1" 7938 "|%diff{casting $ to type $|casting between types}0,1}2" 7939 "%select{|; dereference with *|" 7940 "; take the address with &|" 7941 "; remove *|" 7942 "; remove &}3">; 7943def ext_typecheck_convert_int_pointer : ExtWarn< 7944 "incompatible integer to pointer conversion " 7945 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 7946 "|%diff{passing $ to parameter of type $|" 7947 "passing to parameter of different type}0,1" 7948 "|%diff{returning $ from a function with result type $|" 7949 "returning from function with different return type}0,1" 7950 "|%diff{converting $ to type $|converting between types}0,1" 7951 "|%diff{initializing $ with an expression of type $|" 7952 "initializing with expression of different type}0,1" 7953 "|%diff{sending $ to parameter of type $|" 7954 "sending to parameter of different type}0,1" 7955 "|%diff{casting $ to type $|casting between types}0,1}2" 7956 "%select{|; dereference with *|" 7957 "; take the address with &|" 7958 "; remove *|" 7959 "; remove &}3">, 7960 InGroup<IntConversion>, SFINAEFailure; 7961def err_typecheck_convert_int_pointer : Error< 7962 "incompatible integer to pointer conversion " 7963 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 7964 "|%diff{passing $ to parameter of type $|" 7965 "passing to parameter of different type}0,1" 7966 "|%diff{returning $ from a function with result type $|" 7967 "returning from function with different return type}0,1" 7968 "|%diff{converting $ to type $|converting between types}0,1" 7969 "|%diff{initializing $ with an expression of type $|" 7970 "initializing with expression of different type}0,1" 7971 "|%diff{sending $ to parameter of type $|" 7972 "sending to parameter of different type}0,1" 7973 "|%diff{casting $ to type $|casting between types}0,1}2" 7974 "%select{|; dereference with *|" 7975 "; take the address with &|" 7976 "; remove *|" 7977 "; remove &}3">; 7978def ext_typecheck_convert_pointer_void_func : Extension< 7979 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 7980 "|%diff{passing $ to parameter of type $|" 7981 "passing to parameter of different type}0,1" 7982 "|%diff{returning $ from a function with result type $|" 7983 "returning from function with different return type}0,1" 7984 "|%diff{converting $ to type $|converting between types}0,1" 7985 "|%diff{initializing $ with an expression of type $|" 7986 "initializing with expression of different type}0,1" 7987 "|%diff{sending $ to parameter of type $|" 7988 "sending to parameter of different type}0,1" 7989 "|%diff{casting $ to type $|casting between types}0,1}2" 7990 " converts between void pointer and function pointer">; 7991def err_typecheck_convert_pointer_void_func : Error< 7992 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 7993 "|%diff{passing $ to parameter of type $|" 7994 "passing to parameter of different type}0,1" 7995 "|%diff{returning $ from a function with result type $|" 7996 "returning from function with different return type}0,1" 7997 "|%diff{converting $ to type $|converting between types}0,1" 7998 "|%diff{initializing $ with an expression of type $|" 7999 "initializing with expression of different type}0,1" 8000 "|%diff{sending $ to parameter of type $|" 8001 "sending to parameter of different type}0,1" 8002 "|%diff{casting $ to type $|casting between types}0,1}2" 8003 " converts between void pointer and function pointer">; 8004def ext_typecheck_convert_incompatible_pointer_sign : ExtWarn< 8005 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 8006 "|%diff{passing $ to parameter of type $|" 8007 "passing to parameter of different type}0,1" 8008 "|%diff{returning $ from a function with result type $|" 8009 "returning from function with different return type}0,1" 8010 "|%diff{converting $ to type $|converting between types}0,1" 8011 "|%diff{initializing $ with an expression of type $|" 8012 "initializing with expression of different type}0,1" 8013 "|%diff{sending $ to parameter of type $|" 8014 "sending to parameter of different type}0,1" 8015 "|%diff{casting $ to type $|casting between types}0,1}2" 8016 " converts between pointers to integer types %select{with different sign|" 8017 "where one is of the unique plain 'char' type and the other is not}3">, 8018 InGroup<DiagGroup<"pointer-sign">>; 8019def err_typecheck_convert_incompatible_pointer_sign : 8020 Error<ext_typecheck_convert_incompatible_pointer_sign.Text>; 8021def ext_typecheck_convert_incompatible_pointer : ExtWarn< 8022 "incompatible pointer types " 8023 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 8024 "|%diff{passing $ to parameter of type $|" 8025 "passing to parameter of different type}0,1" 8026 "|%diff{returning $ from a function with result type $|" 8027 "returning from function with different return type}0,1" 8028 "|%diff{converting $ to type $|converting between types}0,1" 8029 "|%diff{initializing $ with an expression of type $|" 8030 "initializing with expression of different type}0,1" 8031 "|%diff{sending $ to parameter of type $|" 8032 "sending to parameter of different type}0,1" 8033 "|%diff{casting $ to type $|casting between types}0,1}2" 8034 "%select{|; dereference with *|" 8035 "; take the address with &|" 8036 "; remove *|" 8037 "; remove &}3">, 8038 InGroup<IncompatiblePointerTypes>; 8039def err_typecheck_convert_incompatible_pointer : Error< 8040 "incompatible pointer types " 8041 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 8042 "|%diff{passing $ to parameter of type $|" 8043 "passing to parameter of different type}0,1" 8044 "|%diff{returning $ from a function with result type $|" 8045 "returning from function with different return type}0,1" 8046 "|%diff{converting $ to type $|converting between types}0,1" 8047 "|%diff{initializing $ with an expression of type $|" 8048 "initializing with expression of different type}0,1" 8049 "|%diff{sending $ to parameter of type $|" 8050 "sending to parameter of different type}0,1" 8051 "|%diff{casting $ to type $|casting between types}0,1}2" 8052 "%select{|; dereference with *|" 8053 "; take the address with &|" 8054 "; remove *|" 8055 "; remove &}3">; 8056def ext_typecheck_convert_incompatible_function_pointer : ExtWarn< 8057 "incompatible function pointer types " 8058 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 8059 "|%diff{passing $ to parameter of type $|" 8060 "passing to parameter of different type}0,1" 8061 "|%diff{returning $ from a function with result type $|" 8062 "returning from function with different return type}0,1" 8063 "|%diff{converting $ to type $|converting between types}0,1" 8064 "|%diff{initializing $ with an expression of type $|" 8065 "initializing with expression of different type}0,1" 8066 "|%diff{sending $ to parameter of type $|" 8067 "sending to parameter of different type}0,1" 8068 "|%diff{casting $ to type $|casting between types}0,1}2" 8069 "%select{|; dereference with *|" 8070 "; take the address with &|" 8071 "; remove *|" 8072 "; remove &}3">, 8073 InGroup<IncompatibleFunctionPointerTypes>; 8074def err_typecheck_convert_incompatible_function_pointer : Error< 8075 "incompatible function pointer types " 8076 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 8077 "|%diff{passing $ to parameter of type $|" 8078 "passing to parameter of different type}0,1" 8079 "|%diff{returning $ from a function with result type $|" 8080 "returning from function with different return type}0,1" 8081 "|%diff{converting $ to type $|converting between types}0,1" 8082 "|%diff{initializing $ with an expression of type $|" 8083 "initializing with expression of different type}0,1" 8084 "|%diff{sending $ to parameter of type $|" 8085 "sending to parameter of different type}0,1" 8086 "|%diff{casting $ to type $|casting between types}0,1}2" 8087 "%select{|; dereference with *|" 8088 "; take the address with &|" 8089 "; remove *|" 8090 "; remove &}3">; 8091def ext_typecheck_convert_discards_qualifiers : ExtWarn< 8092 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 8093 "|%diff{passing $ to parameter of type $|" 8094 "passing to parameter of different type}0,1" 8095 "|%diff{returning $ from a function with result type $|" 8096 "returning from function with different return type}0,1" 8097 "|%diff{converting $ to type $|converting between types}0,1" 8098 "|%diff{initializing $ with an expression of type $|" 8099 "initializing with expression of different type}0,1" 8100 "|%diff{sending $ to parameter of type $|" 8101 "sending to parameter of different type}0,1" 8102 "|%diff{casting $ to type $|casting between types}0,1}2" 8103 " discards qualifiers">, 8104 InGroup<IncompatiblePointerTypesDiscardsQualifiers>; 8105def err_typecheck_convert_discards_qualifiers : Error< 8106 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 8107 "|%diff{passing $ to parameter of type $|" 8108 "passing to parameter of different type}0,1" 8109 "|%diff{returning $ from a function with result type $|" 8110 "returning from function with different return type}0,1" 8111 "|%diff{converting $ to type $|converting between types}0,1" 8112 "|%diff{initializing $ with an expression of type $|" 8113 "initializing with expression of different type}0,1" 8114 "|%diff{sending $ to parameter of type $|" 8115 "sending to parameter of different type}0,1" 8116 "|%diff{casting $ to type $|casting between types}0,1}2" 8117 " discards qualifiers">; 8118def ext_nested_pointer_qualifier_mismatch : ExtWarn< 8119 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 8120 "|%diff{passing $ to parameter of type $|" 8121 "passing to parameter of different type}0,1" 8122 "|%diff{returning $ from a function with result type $|" 8123 "returning from function with different return type}0,1" 8124 "|%diff{converting $ to type $|converting between types}0,1" 8125 "|%diff{initializing $ with an expression of type $|" 8126 "initializing with expression of different type}0,1" 8127 "|%diff{sending $ to parameter of type $|" 8128 "sending to parameter of different type}0,1" 8129 "|%diff{casting $ to type $|casting between types}0,1}2" 8130 " discards qualifiers in nested pointer types">, 8131 InGroup<IncompatiblePointerTypesDiscardsQualifiers>; 8132def err_nested_pointer_qualifier_mismatch : Error< 8133 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 8134 "|%diff{passing $ to parameter of type $|" 8135 "passing to parameter of different type}0,1" 8136 "|%diff{returning $ from a function with result type $|" 8137 "returning from function with different return type}0,1" 8138 "|%diff{converting $ to type $|converting between types}0,1" 8139 "|%diff{initializing $ with an expression of type $|" 8140 "initializing with expression of different type}0,1" 8141 "|%diff{sending $ to parameter of type $|" 8142 "sending to parameter of different type}0,1" 8143 "|%diff{casting $ to type $|casting between types}0,1}2" 8144 " discards qualifiers in nested pointer types">; 8145def warn_incompatible_vectors : Warning< 8146 "incompatible vector types " 8147 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 8148 "|%diff{passing $ to parameter of type $|" 8149 "passing to parameter of different type}0,1" 8150 "|%diff{returning $ from a function with result type $|" 8151 "returning from function with different return type}0,1" 8152 "|%diff{converting $ to type $|converting between types}0,1" 8153 "|%diff{initializing $ with an expression of type $|" 8154 "initializing with expression of different type}0,1" 8155 "|%diff{sending $ to parameter of type $|" 8156 "sending to parameter of different type}0,1" 8157 "|%diff{casting $ to type $|casting between types}0,1}2">, 8158 InGroup<VectorConversion>, DefaultIgnore; 8159def err_incompatible_vectors : Error< 8160 "incompatible vector types " 8161 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 8162 "|%diff{passing $ to parameter of type $|" 8163 "passing to parameter of different type}0,1" 8164 "|%diff{returning $ from a function with result type $|" 8165 "returning from function with different return type}0,1" 8166 "|%diff{converting $ to type $|converting between types}0,1" 8167 "|%diff{initializing $ with an expression of type $|" 8168 "initializing with expression of different type}0,1" 8169 "|%diff{sending $ to parameter of type $|" 8170 "sending to parameter of different type}0,1" 8171 "|%diff{casting $ to type $|casting between types}0,1}2">; 8172def err_int_to_block_pointer : Error< 8173 "invalid block pointer conversion " 8174 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 8175 "|%diff{passing $ to parameter of type $|" 8176 "passing to parameter of different type}0,1" 8177 "|%diff{returning $ from a function with result type $|" 8178 "returning from function with different return type}0,1" 8179 "|%diff{converting $ to type $|converting between types}0,1" 8180 "|%diff{initializing $ with an expression of type $|" 8181 "initializing with expression of different type}0,1" 8182 "|%diff{sending $ to parameter of type $|" 8183 "sending to parameter of different type}0,1" 8184 "|%diff{casting $ to type $|casting between types}0,1}2">; 8185def err_typecheck_convert_incompatible_block_pointer : Error< 8186 "incompatible block pointer types " 8187 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 8188 "|%diff{passing $ to parameter of type $|" 8189 "passing to parameter of different type}0,1" 8190 "|%diff{returning $ from a function with result type $|" 8191 "returning from function with different return type}0,1" 8192 "|%diff{converting $ to type $|converting between types}0,1" 8193 "|%diff{initializing $ with an expression of type $|" 8194 "initializing with expression of different type}0,1" 8195 "|%diff{sending $ to parameter of type $|" 8196 "sending to parameter of different type}0,1" 8197 "|%diff{casting $ to type $|casting between types}0,1}2">; 8198def err_typecheck_incompatible_address_space : Error< 8199 "%select{%diff{assigning $ to $|assigning to different types}1,0" 8200 "|%diff{passing $ to parameter of type $|" 8201 "passing to parameter of different type}0,1" 8202 "|%diff{returning $ from a function with result type $|" 8203 "returning from function with different return type}0,1" 8204 "|%diff{converting $ to type $|converting between types}0,1" 8205 "|%diff{initializing $ with an expression of type $|" 8206 "initializing with expression of different type}0,1" 8207 "|%diff{sending $ to parameter of type $|" 8208 "sending to parameter of different type}0,1" 8209 "|%diff{casting $ to type $|casting between types}0,1}2" 8210 " changes address space of pointer">; 8211def err_typecheck_incompatible_nested_address_space : Error< 8212 "%select{%diff{assigning $ to $|assigning to different types}1,0" 8213 "|%diff{passing $ to parameter of type $|" 8214 "passing to parameter of different type}0,1" 8215 "|%diff{returning $ from a function with result type $|" 8216 "returning from function with different return type}0,1" 8217 "|%diff{converting $ to type $|converting between types}0,1" 8218 "|%diff{initializing $ with an expression of type $|" 8219 "initializing with expression of different type}0,1" 8220 "|%diff{sending $ to parameter of type $|" 8221 "sending to parameter of different type}0,1" 8222 "|%diff{casting $ to type $|casting between types}0,1}2" 8223 " changes address space of nested pointer">; 8224def err_typecheck_incompatible_ownership : Error< 8225 "%select{%diff{assigning $ to $|assigning to different types}1,0" 8226 "|%diff{passing $ to parameter of type $|" 8227 "passing to parameter of different type}0,1" 8228 "|%diff{returning $ from a function with result type $|" 8229 "returning from function with different return type}0,1" 8230 "|%diff{converting $ to type $|converting between types}0,1" 8231 "|%diff{initializing $ with an expression of type $|" 8232 "initializing with expression of different type}0,1" 8233 "|%diff{sending $ to parameter of type $|" 8234 "sending to parameter of different type}0,1" 8235 "|%diff{casting $ to type $|casting between types}0,1}2" 8236 " changes retain/release properties of pointer">; 8237def err_typecheck_comparison_of_distinct_blocks : Error< 8238 "comparison of distinct block types%diff{ ($ and $)|}0,1">; 8239 8240def err_typecheck_array_not_modifiable_lvalue : Error< 8241 "array type %0 is not assignable">; 8242def err_typecheck_non_object_not_modifiable_lvalue : Error< 8243 "non-object type %0 is not assignable">; 8244def err_typecheck_expression_not_modifiable_lvalue : Error< 8245 "expression is not assignable">; 8246def err_typecheck_incomplete_type_not_modifiable_lvalue : Error< 8247 "incomplete type %0 is not assignable">; 8248def err_typecheck_lvalue_casts_not_supported : Error< 8249 "assignment to cast is illegal, lvalue casts are not supported">; 8250 8251def err_typecheck_duplicate_vector_components_not_mlvalue : Error< 8252 "vector is not assignable (contains duplicate components)">; 8253def err_block_decl_ref_not_modifiable_lvalue : Error< 8254 "variable is not assignable (missing __block type specifier)">; 8255def err_lambda_decl_ref_not_modifiable_lvalue : Error< 8256 "cannot assign to a variable captured by copy in a non-mutable lambda">; 8257def err_typecheck_call_not_function : Error< 8258 "called object type %0 is not a function or function pointer">; 8259def err_call_incomplete_return : Error< 8260 "calling function with incomplete return type %0">; 8261def err_call_function_incomplete_return : Error< 8262 "calling %0 with incomplete return type %1">; 8263def err_call_incomplete_argument : Error< 8264 "argument type %0 is incomplete">; 8265def err_typecheck_call_too_few_args : Error< 8266 "too few %select{|||execution configuration }0arguments to " 8267 "%select{function|block|method|kernel function}0 call, " 8268 "expected %1, have %2">; 8269def err_typecheck_call_too_few_args_one : Error< 8270 "too few %select{|||execution configuration }0arguments to " 8271 "%select{function|block|method|kernel function}0 call, " 8272 "single argument %1 was not specified">; 8273def err_typecheck_call_too_few_args_at_least : Error< 8274 "too few %select{|||execution configuration }0arguments to " 8275 "%select{function|block|method|kernel function}0 call, " 8276 "expected at least %1, have %2">; 8277def err_typecheck_call_too_few_args_at_least_one : Error< 8278 "too few %select{|||execution configuration }0arguments to " 8279 "%select{function|block|method|kernel function}0 call, " 8280 "at least argument %1 must be specified">; 8281def err_typecheck_call_too_few_args_suggest : Error< 8282 "too few %select{|||execution configuration }0arguments to " 8283 "%select{function|block|method|kernel function}0 call, " 8284 "expected %1, have %2; did you mean %3?">; 8285def err_typecheck_call_too_few_args_at_least_suggest : Error< 8286 "too few %select{|||execution configuration }0arguments to " 8287 "%select{function|block|method|kernel function}0 call, " 8288 "expected at least %1, have %2; did you mean %3?">; 8289def err_typecheck_call_too_many_args : Error< 8290 "too many %select{|||execution configuration }0arguments to " 8291 "%select{function|block|method|kernel function}0 call, " 8292 "expected %1, have %2">; 8293def err_typecheck_call_too_many_args_one : Error< 8294 "too many %select{|||execution configuration }0arguments to " 8295 "%select{function|block|method|kernel function}0 call, " 8296 "expected single argument %1, have %2 arguments">; 8297def err_typecheck_call_too_many_args_at_most : Error< 8298 "too many %select{|||execution configuration }0arguments to " 8299 "%select{function|block|method|kernel function}0 call, " 8300 "expected at most %1, have %2">; 8301def err_typecheck_call_too_many_args_at_most_one : Error< 8302 "too many %select{|||execution configuration }0arguments to " 8303 "%select{function|block|method|kernel function}0 call, " 8304 "expected at most single argument %1, have %2 arguments">; 8305def err_typecheck_call_too_many_args_suggest : Error< 8306 "too many %select{|||execution configuration }0arguments to " 8307 "%select{function|block|method|kernel function}0 call, " 8308 "expected %1, have %2; did you mean %3?">; 8309def err_typecheck_call_too_many_args_at_most_suggest : Error< 8310 "too many %select{|||execution configuration }0arguments to " 8311 "%select{function|block|method|kernel function}0 call, " 8312 "expected at most %1, have %2; did you mean %3?">; 8313 8314def err_arc_typecheck_convert_incompatible_pointer : Error< 8315 "incompatible pointer types passing retainable parameter of type %0" 8316 "to a CF function expecting %1 type">; 8317 8318def err_builtin_fn_use : Error<"builtin functions must be directly called">; 8319 8320def warn_call_wrong_number_of_arguments : Warning< 8321 "too %select{few|many}0 arguments in call to %1">; 8322def err_atomic_builtin_must_be_pointer : Error< 8323 "address argument to atomic builtin must be a pointer (%0 invalid)">; 8324def err_atomic_builtin_must_be_pointer_intptr : Error< 8325 "address argument to atomic builtin must be a pointer to integer or pointer" 8326 " (%0 invalid)">; 8327def err_atomic_builtin_cannot_be_const : Error< 8328 "address argument to atomic builtin cannot be const-qualified (%0 invalid)">; 8329def err_atomic_builtin_must_be_pointer_intfltptr : Error< 8330 "address argument to atomic builtin must be a pointer to integer," 8331 " floating-point or pointer (%0 invalid)">; 8332def err_atomic_builtin_pointer_size : Error< 8333 "address argument to atomic builtin must be a pointer to 1,2,4,8 or 16 byte " 8334 "type (%0 invalid)">; 8335def err_atomic_exclusive_builtin_pointer_size : Error< 8336 "address argument to load or store exclusive builtin must be a pointer to" 8337 " 1,2,4 or 8 byte type (%0 invalid)">; 8338def err_atomic_builtin_ext_int_size : Error< 8339 "Atomic memory operand must have a power-of-two size">; 8340def err_atomic_builtin_ext_int_prohibit : Error< 8341 "argument to atomic builtin of type '_ExtInt' is not supported">; 8342def err_atomic_op_needs_atomic : Error< 8343 "address argument to atomic operation must be a pointer to _Atomic " 8344 "type (%0 invalid)">; 8345def err_atomic_op_needs_non_const_atomic : Error< 8346 "address argument to atomic operation must be a pointer to non-%select{const|constant}0 _Atomic " 8347 "type (%1 invalid)">; 8348def err_atomic_op_needs_non_const_pointer : Error< 8349 "address argument to atomic operation must be a pointer to non-const " 8350 "type (%0 invalid)">; 8351def err_atomic_op_needs_trivial_copy : Error< 8352 "address argument to atomic operation must be a pointer to a " 8353 "trivially-copyable type (%0 invalid)">; 8354def err_atomic_op_needs_atomic_int_ptr_or_fp : Error< 8355 "address argument to atomic operation must be a pointer to %select{|atomic }0" 8356 "integer, pointer or supported floating point type (%1 invalid)">; 8357def err_atomic_op_needs_atomic_int_or_ptr : Error< 8358 "address argument to atomic operation must be a pointer to %select{|atomic }0" 8359 "integer or pointer (%1 invalid)">; 8360def err_atomic_op_needs_atomic_int : Error< 8361 "address argument to atomic operation must be a pointer to " 8362 "%select{|atomic }0integer (%1 invalid)">; 8363def warn_atomic_op_has_invalid_memory_order : Warning< 8364 "memory order argument to atomic operation is invalid">, 8365 InGroup<DiagGroup<"atomic-memory-ordering">>; 8366def err_atomic_op_has_invalid_synch_scope : Error< 8367 "synchronization scope argument to atomic operation is invalid">; 8368def warn_atomic_implicit_seq_cst : Warning< 8369 "implicit use of sequentially-consistent atomic may incur stronger memory barriers than necessary">, 8370 InGroup<DiagGroup<"atomic-implicit-seq-cst">>, DefaultIgnore; 8371 8372def err_overflow_builtin_must_be_int : Error< 8373 "operand argument to overflow builtin must be an integer (%0 invalid)">; 8374def err_overflow_builtin_must_be_ptr_int : Error< 8375 "result argument to overflow builtin must be a pointer " 8376 "to a non-const integer (%0 invalid)">; 8377def err_overflow_builtin_ext_int_max_size : Error< 8378 "__builtin_mul_overflow does not support signed _ExtInt operands of more " 8379 "than %0 bits">; 8380 8381def err_atomic_load_store_uses_lib : Error< 8382 "atomic %select{load|store}0 requires runtime support that is not " 8383 "available for this target">; 8384 8385def err_nontemporal_builtin_must_be_pointer : Error< 8386 "address argument to nontemporal builtin must be a pointer (%0 invalid)">; 8387def err_nontemporal_builtin_must_be_pointer_intfltptr_or_vector : Error< 8388 "address argument to nontemporal builtin must be a pointer to integer, float, " 8389 "pointer, or a vector of such types (%0 invalid)">; 8390 8391def err_deleted_function_use : Error<"attempt to use a deleted function">; 8392def err_deleted_inherited_ctor_use : Error< 8393 "constructor inherited by %0 from base class %1 is implicitly deleted">; 8394 8395def note_called_by : Note<"called by %0">; 8396def err_kern_type_not_void_return : Error< 8397 "kernel function type %0 must have void return type">; 8398def err_kern_is_nonstatic_method : Error< 8399 "kernel function %0 must be a free function or static member function">; 8400def err_config_scalar_return : Error< 8401 "CUDA special function '%0' must have scalar return type">; 8402def err_kern_call_not_global_function : Error< 8403 "kernel call to non-global function %0">; 8404def err_global_call_not_config : Error< 8405 "call to global function %0 not configured">; 8406def err_ref_bad_target : Error< 8407 "reference to %select{__device__|__global__|__host__|__host__ __device__}0 " 8408 "%select{function|variable}1 %2 in %select{__device__|__global__|__host__|__host__ __device__}3 function">; 8409def note_cuda_const_var_unpromoted : Note< 8410 "const variable cannot be emitted on device side due to dynamic initialization">; 8411def note_cuda_host_var : Note< 8412 "host variable declared here">; 8413def err_ref_bad_target_global_initializer : Error< 8414 "reference to %select{__device__|__global__|__host__|__host__ __device__}0 " 8415 "function %1 in global initializer">; 8416def err_capture_bad_target : Error< 8417 "capture host variable %0 by reference in device or host device lambda function">; 8418def warn_maybe_capture_bad_target_this_ptr : Warning< 8419 "capture host side class data member by this pointer in device or host device lambda function " 8420 "may result in invalid memory access if this pointer is not accessible on device side">, 8421 InGroup<DiagGroup<"gpu-maybe-wrong-side">>; 8422def warn_kern_is_method : Extension< 8423 "kernel function %0 is a member function; this may not be accepted by nvcc">, 8424 InGroup<CudaCompat>; 8425def warn_kern_is_inline : Warning< 8426 "ignored 'inline' attribute on kernel function %0">, 8427 InGroup<CudaCompat>; 8428def err_variadic_device_fn : Error< 8429 "CUDA device code does not support variadic functions">; 8430def err_va_arg_in_device : Error< 8431 "CUDA device code does not support va_arg">; 8432def err_alias_not_supported_on_nvptx : Error<"CUDA does not support aliases">; 8433def err_cuda_unattributed_constexpr_cannot_overload_device : Error< 8434 "constexpr function %0 without __host__ or __device__ attributes cannot " 8435 "overload __device__ function with same signature. Add a __host__ " 8436 "attribute, or build with -fno-cuda-host-device-constexpr.">; 8437def note_cuda_conflicting_device_function_declared_here : Note< 8438 "conflicting __device__ function declared here">; 8439def err_cuda_device_exceptions : Error< 8440 "cannot use '%0' in " 8441 "%select{__device__|__global__|__host__|__host__ __device__}1 function">; 8442def err_dynamic_var_init : Error< 8443 "dynamic initialization is not supported for " 8444 "__device__, __constant__, __shared__, and __managed__ variables.">; 8445def err_shared_var_init : Error< 8446 "initialization is not supported for __shared__ variables.">; 8447def err_cuda_vla : Error< 8448 "cannot use variable-length arrays in " 8449 "%select{__device__|__global__|__host__|__host__ __device__}0 functions">; 8450def err_cuda_extern_shared : Error<"__shared__ variable %0 cannot be 'extern'">; 8451def err_cuda_host_shared : Error< 8452 "__shared__ local variables not allowed in " 8453 "%select{__device__|__global__|__host__|__host__ __device__}0 functions">; 8454def err_cuda_nonstatic_constdev: Error<"__constant__, __device__, and " 8455 "__managed__ are not allowed on non-static local variables">; 8456def err_cuda_ovl_target : Error< 8457 "%select{__device__|__global__|__host__|__host__ __device__}0 function %1 " 8458 "cannot overload %select{__device__|__global__|__host__|__host__ __device__}2 function %3">; 8459def note_cuda_ovl_candidate_target_mismatch : Note< 8460 "candidate template ignored: target attributes do not match">; 8461 8462def err_cuda_device_builtin_surftex_cls_template : Error< 8463 "illegal device builtin %select{surface|texture}0 reference " 8464 "class template %1 declared here">; 8465def note_cuda_device_builtin_surftex_cls_should_have_n_args : Note< 8466 "%0 needs to have exactly %1 template parameters">; 8467def note_cuda_device_builtin_surftex_cls_should_have_match_arg : Note< 8468 "the %select{1st|2nd|3rd}1 template parameter of %0 needs to be " 8469 "%select{a type|an integer or enum value}2">; 8470 8471def err_cuda_device_builtin_surftex_ref_decl : Error< 8472 "illegal device builtin %select{surface|texture}0 reference " 8473 "type %1 declared here">; 8474def note_cuda_device_builtin_surftex_should_be_template_class : Note< 8475 "%0 needs to be instantiated from a class template with proper " 8476 "template arguments">; 8477 8478def err_hip_invalid_args_builtin_mangled_name : Error< 8479 "invalid argument: symbol must be a device-side function or global variable">; 8480 8481def warn_non_pod_vararg_with_format_string : Warning< 8482 "cannot pass %select{non-POD|non-trivial}0 object of type %1 to variadic " 8483 "%select{function|block|method|constructor}2; expected type from format " 8484 "string was %3">, InGroup<NonPODVarargs>, DefaultError; 8485// The arguments to this diagnostic should match the warning above. 8486def err_cannot_pass_objc_interface_to_vararg_format : Error< 8487 "cannot pass object with interface type %1 by value to variadic " 8488 "%select{function|block|method|constructor}2; expected type from format " 8489 "string was %3">; 8490def err_cannot_pass_non_trivial_c_struct_to_vararg : Error< 8491 "cannot pass non-trivial C object of type %0 by value to variadic " 8492 "%select{function|block|method|constructor}1">; 8493 8494 8495def err_cannot_pass_objc_interface_to_vararg : Error< 8496 "cannot pass object with interface type %0 by value through variadic " 8497 "%select{function|block|method|constructor}1">; 8498def warn_cannot_pass_non_pod_arg_to_vararg : Warning< 8499 "cannot pass object of %select{non-POD|non-trivial}0 type %1 through variadic" 8500 " %select{function|block|method|constructor}2; call will abort at runtime">, 8501 InGroup<NonPODVarargs>, DefaultError; 8502def warn_cxx98_compat_pass_non_pod_arg_to_vararg : Warning< 8503 "passing object of trivial but non-POD type %0 through variadic" 8504 " %select{function|block|method|constructor}1 is incompatible with C++98">, 8505 InGroup<CXX98Compat>, DefaultIgnore; 8506def warn_pass_class_arg_to_vararg : Warning< 8507 "passing object of class type %0 through variadic " 8508 "%select{function|block|method|constructor}1" 8509 "%select{|; did you mean to call '%3'?}2">, 8510 InGroup<ClassVarargs>, DefaultIgnore; 8511def err_cannot_pass_to_vararg : Error< 8512 "cannot pass %select{expression of type %1|initializer list}0 to variadic " 8513 "%select{function|block|method|constructor}2">; 8514def err_cannot_pass_to_vararg_format : Error< 8515 "cannot pass %select{expression of type %1|initializer list}0 to variadic " 8516 "%select{function|block|method|constructor}2; expected type from format " 8517 "string was %3">; 8518 8519def err_typecheck_call_invalid_ordered_compare : Error< 8520 "ordered compare requires two args of floating point type" 8521 "%diff{ ($ and $)|}0,1">; 8522def err_typecheck_call_invalid_unary_fp : Error< 8523 "floating point classification requires argument of floating point type " 8524 "(passed in %0)">; 8525def err_typecheck_cond_expect_int_float : Error< 8526 "used type %0 where integer or floating point type is required">; 8527def err_typecheck_cond_expect_scalar : Error< 8528 "used type %0 where arithmetic or pointer type is required">; 8529def err_typecheck_cond_expect_nonfloat : Error< 8530 "used type %0 where floating point type is not allowed">; 8531def ext_typecheck_cond_one_void : Extension< 8532 "C99 forbids conditional expressions with only one void side">; 8533def err_typecheck_cast_to_incomplete : Error< 8534 "cast to incomplete type %0">; 8535def ext_typecheck_cast_nonscalar : Extension< 8536 "C99 forbids casting nonscalar type %0 to the same type">; 8537def ext_typecheck_cast_to_union : Extension< 8538 "cast to union type is a GNU extension">, 8539 InGroup<GNUUnionCast>; 8540def err_typecheck_cast_to_union_no_type : Error< 8541 "cast to union type from type %0 not present in union">; 8542def err_cast_pointer_from_non_pointer_int : Error< 8543 "operand of type %0 cannot be cast to a pointer type">; 8544def warn_cast_pointer_from_sel : Warning< 8545 "cast of type %0 to %1 is deprecated; use sel_getName instead">, 8546 InGroup<SelTypeCast>; 8547def warn_function_def_in_objc_container : Warning< 8548 "function definition inside an Objective-C container is deprecated">, 8549 InGroup<FunctionDefInObjCContainer>; 8550def err_typecheck_call_requires_real_fp : Error< 8551 "argument type %0 is not a real floating point type">; 8552def err_typecheck_call_different_arg_types : Error< 8553 "arguments are of different types%diff{ ($ vs $)|}0,1">; 8554 8555def warn_cast_calling_conv : Warning< 8556 "cast between incompatible calling conventions '%0' and '%1'; " 8557 "calls through this pointer may abort at runtime">, 8558 InGroup<DiagGroup<"cast-calling-convention">>; 8559def note_change_calling_conv_fixit : Note< 8560 "consider defining %0 with the '%1' calling convention">; 8561def warn_bad_function_cast : Warning< 8562 "cast from function call of type %0 to non-matching type %1">, 8563 InGroup<BadFunctionCast>, DefaultIgnore; 8564def warn_cast_function_type : Warning< 8565 "cast %diff{from $ to $ |}0,1converts to incompatible function type">, 8566 InGroup<CastFunctionType>, DefaultIgnore; 8567def err_cast_pointer_to_non_pointer_int : Error< 8568 "pointer cannot be cast to type %0">; 8569def err_cast_to_bfloat16 : Error<"cannot type-cast to __bf16">; 8570def err_cast_from_bfloat16 : Error<"cannot type-cast from __bf16">; 8571def err_typecheck_expect_scalar_operand : Error< 8572 "operand of type %0 where arithmetic or pointer type is required">; 8573def err_typecheck_cond_incompatible_operands : Error< 8574 "incompatible operand types%diff{ ($ and $)|}0,1">; 8575def err_typecheck_expect_flt_or_vector : Error< 8576 "invalid operand of type %0 where floating, complex or " 8577 "a vector of such types is required">; 8578def err_cast_selector_expr : Error< 8579 "cannot type cast @selector expression">; 8580def ext_typecheck_cond_incompatible_pointers : ExtWarn< 8581 "pointer type mismatch%diff{ ($ and $)|}0,1">, 8582 InGroup<DiagGroup<"pointer-type-mismatch">>; 8583def ext_typecheck_cond_pointer_integer_mismatch : ExtWarn< 8584 "pointer/integer type mismatch in conditional expression" 8585 "%diff{ ($ and $)|}0,1">, 8586 InGroup<DiagGroup<"conditional-type-mismatch">>; 8587def err_typecheck_choose_expr_requires_constant : Error< 8588 "'__builtin_choose_expr' requires a constant expression">; 8589def warn_unused_expr : Warning<"expression result unused">, 8590 InGroup<UnusedValue>; 8591def warn_unused_comma_left_operand : Warning< 8592 "left operand of comma operator has no effect">, 8593 InGroup<UnusedValue>; 8594def warn_unused_voidptr : Warning< 8595 "expression result unused; should this cast be to 'void'?">, 8596 InGroup<UnusedValue>; 8597def warn_unused_property_expr : Warning< 8598 "property access result unused - getters should not be used for side effects">, 8599 InGroup<UnusedGetterReturnValue>; 8600def warn_unused_container_subscript_expr : Warning< 8601 "container access result unused - container access should not be used for side effects">, 8602 InGroup<UnusedValue>; 8603def warn_unused_call : Warning< 8604 "ignoring return value of function declared with %0 attribute">, 8605 InGroup<UnusedValue>; 8606def warn_unused_constructor : Warning< 8607 "ignoring temporary created by a constructor declared with %0 attribute">, 8608 InGroup<UnusedValue>; 8609def warn_unused_constructor_msg : Warning< 8610 "ignoring temporary created by a constructor declared with %0 attribute: %1">, 8611 InGroup<UnusedValue>; 8612def warn_side_effects_unevaluated_context : Warning< 8613 "expression with side effects has no effect in an unevaluated context">, 8614 InGroup<UnevaluatedExpression>; 8615def warn_side_effects_typeid : Warning< 8616 "expression with side effects will be evaluated despite being used as an " 8617 "operand to 'typeid'">, InGroup<PotentiallyEvaluatedExpression>; 8618def warn_unused_result : Warning< 8619 "ignoring return value of function declared with %0 attribute">, 8620 InGroup<UnusedResult>; 8621def warn_unused_result_msg : Warning< 8622 "ignoring return value of function declared with %0 attribute: %1">, 8623 InGroup<UnusedResult>; 8624def warn_unused_volatile : Warning< 8625 "expression result unused; assign into a variable to force a volatile load">, 8626 InGroup<DiagGroup<"unused-volatile-lvalue">>; 8627 8628def ext_cxx14_attr : Extension< 8629 "use of the %0 attribute is a C++14 extension">, InGroup<CXX14>; 8630def ext_cxx17_attr : Extension< 8631 "use of the %0 attribute is a C++17 extension">, InGroup<CXX17>; 8632def ext_cxx20_attr : Extension< 8633 "use of the %0 attribute is a C++20 extension">, InGroup<CXX20>; 8634 8635def warn_unused_comparison : Warning< 8636 "%select{equality|inequality|relational|three-way}0 comparison result unused">, 8637 InGroup<UnusedComparison>; 8638def note_inequality_comparison_to_or_assign : Note< 8639 "use '|=' to turn this inequality comparison into an or-assignment">; 8640 8641def err_incomplete_type_used_in_type_trait_expr : Error< 8642 "incomplete type %0 used in type trait expression">; 8643 8644// C++20 constinit and require_constant_initialization attribute 8645def warn_cxx20_compat_constinit : Warning< 8646 "'constinit' specifier is incompatible with C++ standards before C++20">, 8647 InGroup<CXX20Compat>, DefaultIgnore; 8648def err_constinit_local_variable : Error< 8649 "local variable cannot be declared 'constinit'">; 8650def err_require_constant_init_failed : Error< 8651 "variable does not have a constant initializer">; 8652def note_declared_required_constant_init_here : Note< 8653 "required by %select{'require_constant_initialization' attribute|" 8654 "'constinit' specifier}0 here">; 8655def ext_constinit_missing : ExtWarn< 8656 "'constinit' specifier missing on initializing declaration of %0">, 8657 InGroup<DiagGroup<"missing-constinit">>; 8658def note_constinit_specified_here : Note<"variable declared constinit here">; 8659def err_constinit_added_too_late : Error< 8660 "'constinit' specifier added after initialization of variable">; 8661def warn_require_const_init_added_too_late : Warning< 8662 "'require_constant_initialization' attribute added after initialization " 8663 "of variable">, InGroup<IgnoredAttributes>; 8664def note_constinit_missing_here : Note< 8665 "add the " 8666 "%select{'require_constant_initialization' attribute|'constinit' specifier}0 " 8667 "to the initializing declaration here">; 8668 8669def err_dimension_expr_not_constant_integer : Error< 8670 "dimension expression does not evaluate to a constant unsigned int">; 8671 8672def err_typecheck_cond_incompatible_operands_null : Error< 8673 "non-pointer operand type %0 incompatible with %select{NULL|nullptr}1">; 8674def ext_empty_struct_union : Extension< 8675 "empty %select{struct|union}0 is a GNU extension">, InGroup<GNUEmptyStruct>; 8676def ext_no_named_members_in_struct_union : Extension< 8677 "%select{struct|union}0 without named members is a GNU extension">, InGroup<GNUEmptyStruct>; 8678def warn_zero_size_struct_union_compat : Warning<"%select{|empty }0" 8679 "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">, 8680 InGroup<CXXCompat>, DefaultIgnore; 8681def warn_zero_size_struct_union_in_extern_c : Warning<"%select{|empty }0" 8682 "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">, 8683 InGroup<ExternCCompat>; 8684def warn_cast_qual : Warning<"cast from %0 to %1 drops %select{const and " 8685 "volatile qualifiers|const qualifier|volatile qualifier}2">, 8686 InGroup<CastQual>, DefaultIgnore; 8687def warn_cast_qual2 : Warning<"cast from %0 to %1 must have all intermediate " 8688 "pointers const qualified to be safe">, InGroup<CastQual>, DefaultIgnore; 8689def warn_redefine_extname_not_applied : Warning< 8690 "#pragma redefine_extname is applicable to external C declarations only; " 8691 "not applied to %select{function|variable}0 %1">, 8692 InGroup<Pragmas>; 8693} // End of general sema category. 8694 8695// inline asm. 8696let CategoryName = "Inline Assembly Issue" in { 8697 def err_asm_invalid_lvalue_in_output : Error<"invalid lvalue in asm output">; 8698 def err_asm_invalid_output_constraint : Error< 8699 "invalid output constraint '%0' in asm">; 8700 def err_asm_invalid_lvalue_in_input : Error< 8701 "invalid lvalue in asm input for constraint '%0'">; 8702 def err_asm_invalid_input_constraint : Error< 8703 "invalid input constraint '%0' in asm">; 8704 def err_asm_tying_incompatible_types : Error< 8705 "unsupported inline asm: input with type " 8706 "%diff{$ matching output with type $|}0,1">; 8707 def err_asm_unexpected_constraint_alternatives : Error< 8708 "asm constraint has an unexpected number of alternatives: %0 vs %1">; 8709 def err_asm_incomplete_type : Error<"asm operand has incomplete type %0">; 8710 def err_asm_unknown_register_name : Error<"unknown register name '%0' in asm">; 8711 def err_asm_unwind_and_goto : Error<"unwind clobber can't be used with asm goto">; 8712 def err_asm_invalid_global_var_reg : Error<"register '%0' unsuitable for " 8713 "global register variables on this target">; 8714 def err_asm_register_size_mismatch : Error<"size of register '%0' does not " 8715 "match variable size">; 8716 def err_asm_bad_register_type : Error<"bad type for named register variable">; 8717 def err_asm_invalid_input_size : Error< 8718 "invalid input size for constraint '%0'">; 8719 def err_asm_invalid_output_size : Error< 8720 "invalid output size for constraint '%0'">; 8721 def err_invalid_asm_cast_lvalue : Error< 8722 "invalid use of a cast in a inline asm context requiring an lvalue: " 8723 "remove the cast or build with -fheinous-gnu-extensions">; 8724 def err_invalid_asm_value_for_constraint 8725 : Error <"value '%0' out of range for constraint '%1'">; 8726 def err_asm_non_addr_value_in_memory_constraint : Error < 8727 "reference to a %select{bit-field|vector element|global register variable}0" 8728 " in asm %select{input|output}1 with a memory constraint '%2'">; 8729 def err_asm_input_duplicate_match : Error< 8730 "more than one input constraint matches the same output '%0'">; 8731 8732 def warn_asm_label_on_auto_decl : Warning< 8733 "ignored asm label '%0' on automatic variable">; 8734 def warn_invalid_asm_cast_lvalue : Warning< 8735 "invalid use of a cast in an inline asm context requiring an lvalue: " 8736 "accepted due to -fheinous-gnu-extensions, but clang may remove support " 8737 "for this in the future">; 8738 def warn_asm_mismatched_size_modifier : Warning< 8739 "value size does not match register size specified by the constraint " 8740 "and modifier">, 8741 InGroup<ASMOperandWidths>; 8742 8743 def note_asm_missing_constraint_modifier : Note< 8744 "use constraint modifier \"%0\"">; 8745 def note_asm_input_duplicate_first : Note< 8746 "constraint '%0' is already present here">; 8747 def error_duplicate_asm_operand_name : Error< 8748 "duplicate use of asm operand name \"%0\"">; 8749 def note_duplicate_asm_operand_name : Note< 8750 "asm operand name \"%0\" first referenced here">; 8751} 8752 8753 def error_inoutput_conflict_with_clobber : Error< 8754 "asm-specifier for input or output variable conflicts with asm" 8755 " clobber list">; 8756 8757let CategoryName = "Semantic Issue" in { 8758 8759def err_invalid_conversion_between_matrixes : Error< 8760 "conversion between matrix types%diff{ $ and $|}0,1 of different size is not allowed">; 8761 8762def err_invalid_conversion_between_matrix_and_type : Error< 8763 "conversion between matrix type %0 and incompatible type %1 is not allowed">; 8764 8765def err_invalid_conversion_between_vectors : Error< 8766 "invalid conversion between vector type%diff{ $ and $|}0,1 of different " 8767 "size">; 8768def err_invalid_conversion_between_vector_and_integer : Error< 8769 "invalid conversion between vector type %0 and integer type %1 " 8770 "of different size">; 8771 8772def err_opencl_function_pointer : Error< 8773 "%select{pointers|references}0 to functions are not allowed">; 8774 8775def err_opencl_taking_address_capture : Error< 8776 "taking address of a capture is not allowed">; 8777 8778def err_invalid_conversion_between_vector_and_scalar : Error< 8779 "invalid conversion between vector type %0 and scalar type %1">; 8780 8781// C++ member initializers. 8782def err_only_constructors_take_base_inits : Error< 8783 "only constructors take base initializers">; 8784 8785def err_multiple_mem_initialization : Error < 8786 "multiple initializations given for non-static member %0">; 8787def err_multiple_mem_union_initialization : Error < 8788 "initializing multiple members of union">; 8789def err_multiple_base_initialization : Error < 8790 "multiple initializations given for base %0">; 8791 8792def err_mem_init_not_member_or_class : Error< 8793 "member initializer %0 does not name a non-static data member or base " 8794 "class">; 8795 8796def warn_initializer_out_of_order : Warning< 8797 "%select{field|base class}0 %1 will be initialized after " 8798 "%select{field|base}2 %3">, 8799 InGroup<ReorderCtor>, DefaultIgnore; 8800 8801def warn_some_initializers_out_of_order : Warning< 8802 "initializer order does not match the declaration order">, 8803 InGroup<ReorderCtor>, DefaultIgnore; 8804 8805def note_initializer_out_of_order : Note< 8806 "%select{field|base class}0 %1 will be initialized after " 8807 "%select{field|base}2 %3">; 8808 8809def warn_abstract_vbase_init_ignored : Warning< 8810 "initializer for virtual base class %0 of abstract class %1 " 8811 "will never be used">, 8812 InGroup<DiagGroup<"abstract-vbase-init">>, DefaultIgnore; 8813 8814def err_base_init_does_not_name_class : Error< 8815 "constructor initializer %0 does not name a class">; 8816def err_base_init_direct_and_virtual : Error< 8817 "base class initializer %0 names both a direct base class and an " 8818 "inherited virtual base class">; 8819def err_not_direct_base_or_virtual : Error< 8820 "type %0 is not a direct or virtual base of %1">; 8821 8822def err_in_class_initializer_non_const : Error< 8823 "non-const static data member must be initialized out of line">; 8824def err_in_class_initializer_volatile : Error< 8825 "static const volatile data member must be initialized out of line">; 8826def err_in_class_initializer_bad_type : Error< 8827 "static data member of type %0 must be initialized out of line">; 8828def ext_in_class_initializer_float_type : ExtWarn< 8829 "in-class initializer for static data member of type %0 is a GNU extension">, 8830 InGroup<GNUStaticFloatInit>; 8831def ext_in_class_initializer_float_type_cxx11 : ExtWarn< 8832 "in-class initializer for static data member of type %0 requires " 8833 "'constexpr' specifier">, InGroup<StaticFloatInit>, DefaultError; 8834def note_in_class_initializer_float_type_cxx11 : Note<"add 'constexpr'">; 8835def err_in_class_initializer_literal_type : Error< 8836 "in-class initializer for static data member of type %0 requires " 8837 "'constexpr' specifier">; 8838def err_in_class_initializer_non_constant : Error< 8839 "in-class initializer for static data member is not a constant expression">; 8840def err_default_member_initializer_not_yet_parsed : Error< 8841 "default member initializer for %1 needed within definition of enclosing " 8842 "class %0 outside of member functions">; 8843def note_default_member_initializer_not_yet_parsed : Note< 8844 "default member initializer declared here">; 8845def err_default_member_initializer_cycle 8846 : Error<"default member initializer for %0 uses itself">; 8847 8848def ext_in_class_initializer_non_constant : Extension< 8849 "in-class initializer for static data member is not a constant expression; " 8850 "folding it to a constant is a GNU extension">, InGroup<GNUFoldingConstant>; 8851 8852def err_thread_dynamic_init : Error< 8853 "initializer for thread-local variable must be a constant expression">; 8854def err_thread_nontrivial_dtor : Error< 8855 "type of thread-local variable has non-trivial destruction">; 8856def note_use_thread_local : Note< 8857 "use 'thread_local' to allow this">; 8858 8859// C++ anonymous unions and GNU anonymous structs/unions 8860def ext_anonymous_union : Extension< 8861 "anonymous unions are a C11 extension">, InGroup<C11>; 8862def ext_gnu_anonymous_struct : Extension< 8863 "anonymous structs are a GNU extension">, InGroup<GNUAnonymousStruct>; 8864def ext_c11_anonymous_struct : Extension< 8865 "anonymous structs are a C11 extension">, InGroup<C11>; 8866def err_anonymous_union_not_static : Error< 8867 "anonymous unions at namespace or global scope must be declared 'static'">; 8868def err_anonymous_union_with_storage_spec : Error< 8869 "anonymous union at class scope must not have a storage specifier">; 8870def err_anonymous_struct_not_member : Error< 8871 "anonymous %select{structs|structs and classes}0 must be " 8872 "%select{struct or union|class}0 members">; 8873def err_anonymous_record_member_redecl : Error< 8874 "member of anonymous %select{struct|union}0 redeclares %1">; 8875def err_anonymous_record_with_type : Error< 8876 "types cannot be declared in an anonymous %select{struct|union}0">; 8877def ext_anonymous_record_with_type : Extension< 8878 "types declared in an anonymous %select{struct|union}0 are a Microsoft " 8879 "extension">, InGroup<MicrosoftAnonTag>; 8880def ext_anonymous_record_with_anonymous_type : Extension< 8881 "anonymous types declared in an anonymous %select{struct|union}0 " 8882 "are an extension">, InGroup<DiagGroup<"nested-anon-types">>; 8883def err_anonymous_record_with_function : Error< 8884 "functions cannot be declared in an anonymous %select{struct|union}0">; 8885def err_anonymous_record_with_static : Error< 8886 "static members cannot be declared in an anonymous %select{struct|union}0">; 8887def err_anonymous_record_bad_member : Error< 8888 "anonymous %select{struct|union}0 can only contain non-static data members">; 8889def err_anonymous_record_nonpublic_member : Error< 8890 "anonymous %select{struct|union}0 cannot contain a " 8891 "%select{private|protected}1 data member">; 8892def ext_ms_anonymous_record : ExtWarn< 8893 "anonymous %select{structs|unions}0 are a Microsoft extension">, 8894 InGroup<MicrosoftAnonTag>; 8895 8896// C++ local classes 8897def err_reference_to_local_in_enclosing_context : Error< 8898 "reference to local %select{variable|binding}1 %0 declared in enclosing " 8899 "%select{%3|block literal|lambda expression|context}2">; 8900 8901def err_static_data_member_not_allowed_in_local_class : Error< 8902 "static data member %0 not allowed in local %sub{select_tag_type_kind}2 %1">; 8903 8904// C++ derived classes 8905def err_base_clause_on_union : Error<"unions cannot have base classes">; 8906def err_base_must_be_class : Error<"base specifier must name a class">; 8907def err_union_as_base_class : Error<"unions cannot be base classes">; 8908def err_circular_inheritance : Error< 8909 "circular inheritance between %0 and %1">; 8910def err_base_class_has_flexible_array_member : Error< 8911 "base class %0 has a flexible array member">; 8912def err_incomplete_base_class : Error<"base class has incomplete type">; 8913def err_duplicate_base_class : Error< 8914 "base class %0 specified more than once as a direct base class">; 8915def warn_inaccessible_base_class : Warning< 8916 "direct base %0 is inaccessible due to ambiguity:%1">, 8917 InGroup<DiagGroup<"inaccessible-base">>; 8918// FIXME: better way to display derivation? Pass entire thing into diagclient? 8919def err_ambiguous_derived_to_base_conv : Error< 8920 "ambiguous conversion from derived class %0 to base class %1:%2">; 8921def err_ambiguous_memptr_conv : Error< 8922 "ambiguous conversion from pointer to member of %select{base|derived}0 " 8923 "class %1 to pointer to member of %select{derived|base}0 class %2:%3">; 8924def ext_ms_ambiguous_direct_base : ExtWarn< 8925 "accessing inaccessible direct base %0 of %1 is a Microsoft extension">, 8926 InGroup<MicrosoftInaccessibleBase>; 8927 8928def err_memptr_conv_via_virtual : Error< 8929 "conversion from pointer to member of class %0 to pointer to member " 8930 "of class %1 via virtual base %2 is not allowed">; 8931 8932// C++ member name lookup 8933def err_ambiguous_member_multiple_subobjects : Error< 8934 "non-static member %0 found in multiple base-class subobjects of type %1:%2">; 8935def err_ambiguous_member_multiple_subobject_types : Error< 8936 "member %0 found in multiple base classes of different types">; 8937def note_ambiguous_member_found : Note<"member found by ambiguous name lookup">; 8938def note_ambiguous_member_type_found : Note< 8939 "member type %0 found by ambiguous name lookup">; 8940def err_ambiguous_reference : Error<"reference to %0 is ambiguous">; 8941def note_ambiguous_candidate : Note<"candidate found by name lookup is %q0">; 8942def err_ambiguous_tag_hiding : Error<"a type named %0 is hidden by a " 8943 "declaration in a different namespace">; 8944def note_hidden_tag : Note<"type declaration hidden">; 8945def note_hiding_object : Note<"declaration hides type">; 8946 8947// C++ operator overloading 8948def err_operator_overload_needs_class_or_enum : Error< 8949 "overloaded %0 must have at least one parameter of class " 8950 "or enumeration type">; 8951 8952def err_operator_overload_variadic : Error<"overloaded %0 cannot be variadic">; 8953def err_operator_overload_static : Error< 8954 "overloaded %0 cannot be a static member function">; 8955def err_operator_overload_default_arg : Error< 8956 "parameter of overloaded %0 cannot have a default argument">; 8957def err_operator_overload_must_be : Error< 8958 "overloaded %0 must be a %select{unary|binary|unary or binary}2 operator " 8959 "(has %1 parameter%s1)">; 8960 8961def err_operator_overload_must_be_member : Error< 8962 "overloaded %0 must be a non-static member function">; 8963def err_operator_overload_post_incdec_must_be_int : Error< 8964 "parameter of overloaded post-%select{increment|decrement}1 operator must " 8965 "have type 'int' (not %0)">; 8966 8967// C++ allocation and deallocation functions. 8968def err_operator_new_delete_declared_in_namespace : Error< 8969 "%0 cannot be declared inside a namespace">; 8970def err_operator_new_delete_declared_static : Error< 8971 "%0 cannot be declared static in global scope">; 8972def ext_operator_new_delete_declared_inline : ExtWarn< 8973 "replacement function %0 cannot be declared 'inline'">, 8974 InGroup<DiagGroup<"inline-new-delete">>; 8975def err_operator_new_delete_invalid_result_type : Error< 8976 "%0 must return type %1">; 8977def err_operator_new_delete_dependent_result_type : Error< 8978 "%0 cannot have a dependent return type; use %1 instead">; 8979def err_operator_new_delete_too_few_parameters : Error< 8980 "%0 must have at least one parameter">; 8981def err_operator_new_delete_template_too_few_parameters : Error< 8982 "%0 template must have at least two parameters">; 8983def warn_operator_new_returns_null : Warning< 8984 "%0 should not return a null pointer unless it is declared 'throw()'" 8985 "%select{| or 'noexcept'}1">, InGroup<OperatorNewReturnsNull>; 8986 8987def err_operator_new_dependent_param_type : Error< 8988 "%0 cannot take a dependent type as first parameter; " 8989 "use size_t (%1) instead">; 8990def err_operator_new_param_type : Error< 8991 "%0 takes type size_t (%1) as first parameter">; 8992def err_operator_new_default_arg: Error< 8993 "parameter of %0 cannot have a default argument">; 8994def err_operator_delete_dependent_param_type : Error< 8995 "%0 cannot take a dependent type as first parameter; use %1 instead">; 8996def err_operator_delete_param_type : Error< 8997 "first parameter of %0 must have type %1">; 8998def err_destroying_operator_delete_not_usual : Error< 8999 "destroying operator delete can have only an optional size and optional " 9000 "alignment parameter">; 9001def note_implicit_delete_this_in_destructor_here : Note< 9002 "while checking implicit 'delete this' for virtual destructor">; 9003def err_builtin_operator_new_delete_not_usual : Error< 9004 "call to '%select{__builtin_operator_new|__builtin_operator_delete}0' " 9005 "selects non-usual %select{allocation|deallocation}0 function">; 9006def note_non_usual_function_declared_here : Note< 9007 "non-usual %0 declared here">; 9008 9009// C++ literal operators 9010def err_literal_operator_outside_namespace : Error< 9011 "literal operator %0 must be in a namespace or global scope">; 9012def err_literal_operator_id_outside_namespace : Error< 9013 "non-namespace scope '%0' cannot have a literal operator member">; 9014def err_literal_operator_default_argument : Error< 9015 "literal operator cannot have a default argument">; 9016def err_literal_operator_bad_param_count : Error< 9017 "non-template literal operator must have one or two parameters">; 9018def err_literal_operator_invalid_param : Error< 9019 "parameter of literal operator must have type 'unsigned long long', 'long double', 'char', 'wchar_t', 'char16_t', 'char32_t', or 'const char *'">; 9020def err_literal_operator_param : Error< 9021 "invalid literal operator parameter type %0, did you mean %1?">; 9022def err_literal_operator_template_with_params : Error< 9023 "literal operator template cannot have any parameters">; 9024def err_literal_operator_template : Error< 9025 "template parameter list for literal operator must be either 'char...' or 'typename T, T...'">; 9026def err_literal_operator_extern_c : Error< 9027 "literal operator must have C++ linkage">; 9028def ext_string_literal_operator_template : ExtWarn< 9029 "string literal operator templates are a GNU extension">, 9030 InGroup<GNUStringLiteralOperatorTemplate>; 9031def warn_user_literal_reserved : Warning< 9032 "user-defined literal suffixes not starting with '_' are reserved" 9033 "%select{; no literal will invoke this operator|}0">, 9034 InGroup<UserDefinedLiterals>; 9035 9036// C++ conversion functions 9037def err_conv_function_not_member : Error< 9038 "conversion function must be a non-static member function">; 9039def err_conv_function_return_type : Error< 9040 "conversion function cannot have a return type">; 9041def err_conv_function_with_params : Error< 9042 "conversion function cannot have any parameters">; 9043def err_conv_function_variadic : Error< 9044 "conversion function cannot be variadic">; 9045def err_conv_function_to_array : Error< 9046 "conversion function cannot convert to an array type">; 9047def err_conv_function_to_function : Error< 9048 "conversion function cannot convert to a function type">; 9049def err_conv_function_with_complex_decl : Error< 9050 "cannot specify any part of a return type in the " 9051 "declaration of a conversion function" 9052 "%select{" 9053 "; put the complete type after 'operator'|" 9054 "; use a typedef to declare a conversion to %1|" 9055 "; use an alias template to declare a conversion to %1|" 9056 "}0">; 9057def err_conv_function_redeclared : Error< 9058 "conversion function cannot be redeclared">; 9059def warn_conv_to_self_not_used : Warning< 9060 "conversion function converting %0 to itself will never be used">, 9061 InGroup<ClassConversion>; 9062def warn_conv_to_base_not_used : Warning< 9063 "conversion function converting %0 to its base class %1 will never be used">, 9064 InGroup<ClassConversion>; 9065def warn_conv_to_void_not_used : Warning< 9066 "conversion function converting %0 to %1 will never be used">, 9067 InGroup<ClassConversion>; 9068 9069def warn_not_compound_assign : Warning< 9070 "use of unary operator that may be intended as compound assignment (%0=)">; 9071 9072// C++11 explicit conversion operators 9073def ext_explicit_conversion_functions : ExtWarn< 9074 "explicit conversion functions are a C++11 extension">, InGroup<CXX11>; 9075def warn_cxx98_compat_explicit_conversion_functions : Warning< 9076 "explicit conversion functions are incompatible with C++98">, 9077 InGroup<CXX98Compat>, DefaultIgnore; 9078 9079// C++11 defaulted functions 9080def err_defaulted_special_member_params : Error< 9081 "an explicitly-defaulted %select{|copy |move }0constructor cannot " 9082 "have default arguments">; 9083def err_defaulted_special_member_variadic : Error< 9084 "an explicitly-defaulted %select{|copy |move }0constructor cannot " 9085 "be variadic">; 9086def err_defaulted_special_member_return_type : Error< 9087 "explicitly-defaulted %select{copy|move}0 assignment operator must " 9088 "return %1">; 9089def err_defaulted_special_member_quals : Error< 9090 "an explicitly-defaulted %select{copy|move}0 assignment operator may not " 9091 "have 'const'%select{, 'constexpr'|}1 or 'volatile' qualifiers">; 9092def err_defaulted_special_member_volatile_param : Error< 9093 "the parameter for an explicitly-defaulted %sub{select_special_member_kind}0 " 9094 "may not be volatile">; 9095def err_defaulted_special_member_move_const_param : Error< 9096 "the parameter for an explicitly-defaulted move " 9097 "%select{constructor|assignment operator}0 may not be const">; 9098def err_defaulted_special_member_copy_const_param : Error< 9099 "the parameter for this explicitly-defaulted copy " 9100 "%select{constructor|assignment operator}0 is const, but a member or base " 9101 "requires it to be non-const">; 9102def err_defaulted_copy_assign_not_ref : Error< 9103 "the parameter for an explicitly-defaulted copy assignment operator must be an " 9104 "lvalue reference type">; 9105def err_incorrect_defaulted_constexpr : Error< 9106 "defaulted definition of %sub{select_special_member_kind}0 " 9107 "is not constexpr">; 9108def err_incorrect_defaulted_consteval : Error< 9109 "defaulted declaration of %sub{select_special_member_kind}0 " 9110 "cannot be consteval because implicit definition is not constexpr">; 9111def warn_defaulted_method_deleted : Warning< 9112 "explicitly defaulted %sub{select_special_member_kind}0 is implicitly " 9113 "deleted">, InGroup<DefaultedFunctionDeleted>; 9114def err_out_of_line_default_deletes : Error< 9115 "defaulting this %sub{select_special_member_kind}0 " 9116 "would delete it after its first declaration">; 9117def note_deleted_type_mismatch : Note< 9118 "function is implicitly deleted because its declared type does not match " 9119 "the type of an implicit %sub{select_special_member_kind}0">; 9120def warn_cxx17_compat_defaulted_method_type_mismatch : Warning< 9121 "explicitly defaulting this %sub{select_special_member_kind}0 with a type " 9122 "different from the implicit type is incompatible with C++ standards before " 9123 "C++20">, InGroup<CXXPre20Compat>, DefaultIgnore; 9124def warn_vbase_moved_multiple_times : Warning< 9125 "defaulted move assignment operator of %0 will move assign virtual base " 9126 "class %1 multiple times">, InGroup<DiagGroup<"multiple-move-vbase">>; 9127def note_vbase_moved_here : Note< 9128 "%select{%1 is a virtual base class of base class %2 declared here|" 9129 "virtual base class %1 declared here}0">; 9130 9131// C++20 defaulted comparisons 9132// This corresponds to values of Sema::DefaultedComparisonKind. 9133def select_defaulted_comparison_kind : TextSubstitution< 9134 "%select{<ERROR>|equality|three-way|equality|relational}0 comparison " 9135 "operator">; 9136def ext_defaulted_comparison : ExtWarn< 9137 "defaulted comparison operators are a C++20 extension">, InGroup<CXX20>; 9138def warn_cxx17_compat_defaulted_comparison : Warning< 9139 "defaulted comparison operators are incompatible with C++ standards " 9140 "before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore; 9141def err_defaulted_comparison_template : Error< 9142 "comparison operator template cannot be defaulted">; 9143def err_defaulted_comparison_out_of_class : Error< 9144 "%sub{select_defaulted_comparison_kind}0 can only be defaulted in a class " 9145 "definition">; 9146def err_defaulted_comparison_param : Error< 9147 "invalid parameter type for defaulted %sub{select_defaulted_comparison_kind}0" 9148 "; found %1, expected %2%select{| or %4}3">; 9149def err_defaulted_comparison_param_mismatch : Error< 9150 "parameters for defaulted %sub{select_defaulted_comparison_kind}0 " 9151 "must have the same type%diff{ (found $ vs $)|}1,2">; 9152def err_defaulted_comparison_non_const : Error< 9153 "defaulted member %sub{select_defaulted_comparison_kind}0 must be " 9154 "const-qualified">; 9155def err_defaulted_comparison_return_type_not_bool : Error< 9156 "return type for defaulted %sub{select_defaulted_comparison_kind}0 " 9157 "must be 'bool', not %1">; 9158def err_defaulted_comparison_deduced_return_type_not_auto : Error< 9159 "deduced return type for defaulted %sub{select_defaulted_comparison_kind}0 " 9160 "must be 'auto', not %1">; 9161def warn_defaulted_comparison_deleted : Warning< 9162 "explicitly defaulted %sub{select_defaulted_comparison_kind}0 is implicitly " 9163 "deleted">, InGroup<DefaultedFunctionDeleted>; 9164def err_non_first_default_compare_deletes : Error< 9165 "defaulting %select{this %sub{select_defaulted_comparison_kind}1|" 9166 "the corresponding implicit 'operator==' for this defaulted 'operator<=>'}0 " 9167 "would delete it after its first declaration">; 9168def note_defaulted_comparison_union : Note< 9169 "defaulted %0 is implicitly deleted because " 9170 "%2 is a %select{union-like class|union}1 with variant members">; 9171def note_defaulted_comparison_reference_member : Note< 9172 "defaulted %0 is implicitly deleted because " 9173 "class %1 has a reference member">; 9174def note_defaulted_comparison_ambiguous : Note< 9175 "defaulted %0 is implicitly deleted because implied %select{|'==' |'<' }1" 9176 "comparison %select{|for member %3 |for base class %3 }2is ambiguous">; 9177def note_defaulted_comparison_inaccessible : Note< 9178 "defaulted %0 is implicitly deleted because it would invoke a " 9179 "%select{private|protected}3 %4%select{ member of %6|" 9180 " member of %6 to compare member %2| to compare base class %2}1">; 9181def note_defaulted_comparison_calls_deleted : Note< 9182 "defaulted %0 is implicitly deleted because it would invoke a deleted " 9183 "comparison function%select{| for member %2| for base class %2}1">; 9184def note_defaulted_comparison_no_viable_function : Note< 9185 "defaulted %0 is implicitly deleted because there is no viable " 9186 "%select{three-way comparison function|'operator=='}1 for " 9187 "%select{|member |base class }2%3">; 9188def note_defaulted_comparison_no_viable_function_synthesized : Note< 9189 "three-way comparison cannot be synthesized because there is no viable " 9190 "function for %select{'=='|'<'}0 comparison">; 9191def note_defaulted_comparison_not_rewritten_callee : Note< 9192 "defaulted %0 is implicitly deleted because this non-rewritten comparison " 9193 "function would be the best match for the comparison">; 9194def note_defaulted_comparison_not_rewritten_conversion : Note< 9195 "defaulted %0 is implicitly deleted because a builtin comparison function " 9196 "using this conversion would be the best match for the comparison">; 9197def note_defaulted_comparison_cannot_deduce : Note< 9198 "return type of defaulted 'operator<=>' cannot be deduced because " 9199 "return type %2 of three-way comparison for %select{|member|base class}0 %1 " 9200 "is not a standard comparison category type">; 9201def err_defaulted_comparison_cannot_deduce_undeduced_auto : Error< 9202 "return type of defaulted 'operator<=>' cannot be deduced because " 9203 "three-way comparison for %select{|member|base class}0 %1 " 9204 "has a deduced return type and is not yet defined">; 9205def note_defaulted_comparison_cannot_deduce_undeduced_auto : Note< 9206 "%select{|member|base class}0 %1 declared here">; 9207def note_defaulted_comparison_cannot_deduce_callee : Note< 9208 "selected 'operator<=>' for %select{|member|base class}0 %1 declared here">; 9209def err_incorrect_defaulted_comparison_constexpr : Error< 9210 "defaulted definition of %select{%sub{select_defaulted_comparison_kind}1|" 9211 "three-way comparison operator}0 " 9212 "cannot be declared %select{constexpr|consteval}2 because " 9213 "%select{it|the corresponding implicit 'operator=='}0 " 9214 "invokes a non-constexpr comparison function">; 9215def note_defaulted_comparison_not_constexpr : Note< 9216 "non-constexpr comparison function would be used to compare " 9217 "%select{|member %1|base class %1}0">; 9218def note_defaulted_comparison_not_constexpr_here : Note< 9219 "non-constexpr comparison function declared here">; 9220def note_in_declaration_of_implicit_equality_comparison : Note< 9221 "while declaring the corresponding implicit 'operator==' " 9222 "for this defaulted 'operator<=>'">; 9223 9224def ext_implicit_exception_spec_mismatch : ExtWarn< 9225 "function previously declared with an %select{explicit|implicit}0 exception " 9226 "specification redeclared with an %select{implicit|explicit}0 exception " 9227 "specification">, InGroup<DiagGroup<"implicit-exception-spec-mismatch">>; 9228 9229def warn_ptr_arith_precedes_bounds : Warning< 9230 "the pointer decremented by %0 refers before the beginning of the array">, 9231 InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore; 9232def warn_ptr_arith_exceeds_bounds : Warning< 9233 "the pointer incremented by %0 refers past the end of the array (that " 9234 "contains %1 element%s2)">, 9235 InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore; 9236def warn_array_index_precedes_bounds : Warning< 9237 "array index %0 is before the beginning of the array">, 9238 InGroup<ArrayBounds>; 9239def warn_array_index_exceeds_bounds : Warning< 9240 "array index %0 is past the end of the array (which contains %1 " 9241 "element%s2)">, InGroup<ArrayBounds>; 9242def warn_ptr_arith_exceeds_max_addressable_bounds : Warning< 9243 "the pointer incremented by %0 refers past the last possible element for an array in %1-bit " 9244 "address space containing %2-bit (%3-byte) elements (max possible %4 element%s5)">, 9245 InGroup<ArrayBounds>; 9246def warn_array_index_exceeds_max_addressable_bounds : Warning< 9247 "array index %0 refers past the last possible element for an array in %1-bit " 9248 "address space containing %2-bit (%3-byte) elements (max possible %4 element%s5)">, 9249 InGroup<ArrayBounds>; 9250def note_array_declared_here : Note< 9251 "array %0 declared here">; 9252 9253def warn_printf_insufficient_data_args : Warning< 9254 "more '%%' conversions than data arguments">, InGroup<FormatInsufficientArgs>; 9255def warn_printf_data_arg_not_used : Warning< 9256 "data argument not used by format string">, InGroup<FormatExtraArgs>; 9257def warn_format_invalid_conversion : Warning< 9258 "invalid conversion specifier '%0'">, InGroup<FormatInvalidSpecifier>; 9259def warn_printf_incomplete_specifier : Warning< 9260 "incomplete format specifier">, InGroup<Format>; 9261def warn_missing_format_string : Warning< 9262 "format string missing">, InGroup<Format>; 9263def warn_scanf_nonzero_width : Warning< 9264 "zero field width in scanf format string is unused">, 9265 InGroup<Format>; 9266def warn_format_conversion_argument_type_mismatch : Warning< 9267 "format specifies type %0 but the argument has " 9268 "%select{type|underlying type}2 %1">, 9269 InGroup<Format>; 9270def warn_format_conversion_argument_type_mismatch_pedantic : Extension< 9271 warn_format_conversion_argument_type_mismatch.Text>, 9272 InGroup<FormatPedantic>; 9273def warn_format_conversion_argument_type_mismatch_confusion : Warning< 9274 warn_format_conversion_argument_type_mismatch.Text>, 9275 InGroup<FormatTypeConfusion>, DefaultIgnore; 9276def warn_format_argument_needs_cast : Warning< 9277 "%select{values of type|enum values with underlying type}2 '%0' should not " 9278 "be used as format arguments; add an explicit cast to %1 instead">, 9279 InGroup<Format>; 9280def warn_format_argument_needs_cast_pedantic : Warning< 9281 warn_format_argument_needs_cast.Text>, 9282 InGroup<FormatPedantic>, DefaultIgnore; 9283def warn_printf_positional_arg_exceeds_data_args : Warning < 9284 "data argument position '%0' exceeds the number of data arguments (%1)">, 9285 InGroup<Format>; 9286def warn_format_zero_positional_specifier : Warning< 9287 "position arguments in format strings start counting at 1 (not 0)">, 9288 InGroup<Format>; 9289def warn_format_invalid_positional_specifier : Warning< 9290 "invalid position specified for %select{field width|field precision}0">, 9291 InGroup<Format>; 9292def warn_format_mix_positional_nonpositional_args : Warning< 9293 "cannot mix positional and non-positional arguments in format string">, 9294 InGroup<Format>; 9295def warn_static_array_too_small : Warning< 9296 "array argument is too small; %select{contains %0 elements|is of size %0}2," 9297 " callee requires at least %1">, 9298 InGroup<ArrayBounds>; 9299def note_callee_static_array : Note< 9300 "callee declares array parameter as static here">; 9301def warn_empty_format_string : Warning< 9302 "format string is empty">, InGroup<FormatZeroLength>; 9303def warn_format_string_is_wide_literal : Warning< 9304 "format string should not be a wide string">, InGroup<Format>; 9305def warn_printf_format_string_contains_null_char : Warning< 9306 "format string contains '\\0' within the string body">, InGroup<Format>; 9307def warn_printf_format_string_not_null_terminated : Warning< 9308 "format string is not null-terminated">, InGroup<Format>; 9309def warn_printf_asterisk_missing_arg : Warning< 9310 "'%select{*|.*}0' specified field %select{width|precision}0 is missing a matching 'int' argument">, 9311 InGroup<Format>; 9312def warn_printf_asterisk_wrong_type : Warning< 9313 "field %select{width|precision}0 should have type %1, but argument has type %2">, 9314 InGroup<Format>; 9315def warn_printf_nonsensical_optional_amount: Warning< 9316 "%select{field width|precision}0 used with '%1' conversion specifier, resulting in undefined behavior">, 9317 InGroup<Format>; 9318def warn_printf_nonsensical_flag: Warning< 9319 "flag '%0' results in undefined behavior with '%1' conversion specifier">, 9320 InGroup<Format>; 9321def warn_format_nonsensical_length: Warning< 9322 "length modifier '%0' results in undefined behavior or no effect with '%1' conversion specifier">, 9323 InGroup<Format>; 9324def warn_format_non_standard_positional_arg: Warning< 9325 "positional arguments are not supported by ISO C">, InGroup<FormatNonStandard>, DefaultIgnore; 9326def warn_format_non_standard: Warning< 9327 "'%0' %select{length modifier|conversion specifier}1 is not supported by ISO C">, 9328 InGroup<FormatNonStandard>, DefaultIgnore; 9329def warn_format_non_standard_conversion_spec: Warning< 9330 "using length modifier '%0' with conversion specifier '%1' is not supported by ISO C">, 9331 InGroup<FormatNonStandard>, DefaultIgnore; 9332def err_invalid_mask_type_size : Error< 9333 "mask type size must be between 1-byte and 8-bytes">; 9334def warn_format_invalid_annotation : Warning< 9335 "using '%0' format specifier annotation outside of os_log()/os_trace()">, 9336 InGroup<Format>; 9337def warn_format_P_no_precision : Warning< 9338 "using '%%P' format specifier without precision">, 9339 InGroup<Format>; 9340def warn_printf_ignored_flag: Warning< 9341 "flag '%0' is ignored when flag '%1' is present">, 9342 InGroup<Format>; 9343def warn_printf_empty_objc_flag: Warning< 9344 "missing object format flag">, 9345 InGroup<Format>; 9346def warn_printf_ObjCflags_without_ObjCConversion: Warning< 9347 "object format flags cannot be used with '%0' conversion specifier">, 9348 InGroup<Format>; 9349def warn_printf_invalid_objc_flag: Warning< 9350 "'%0' is not a valid object format flag">, 9351 InGroup<Format>; 9352def warn_scanf_scanlist_incomplete : Warning< 9353 "no closing ']' for '%%[' in scanf format string">, 9354 InGroup<Format>; 9355def warn_format_bool_as_character : Warning< 9356 "using '%0' format specifier, but argument has boolean value">, 9357 InGroup<Format>; 9358def note_format_string_defined : Note<"format string is defined here">; 9359def note_format_fix_specifier : Note<"did you mean to use '%0'?">; 9360def note_printf_c_str: Note<"did you mean to call the %0 method?">; 9361def note_format_security_fixit: Note< 9362 "treat the string as an argument to avoid this">; 9363 9364def warn_null_arg : Warning< 9365 "null passed to a callee that requires a non-null argument">, 9366 InGroup<NonNull>; 9367def warn_null_ret : Warning< 9368 "null returned from %select{function|method}0 that requires a non-null return value">, 9369 InGroup<NonNull>; 9370 9371def err_lifetimebound_no_object_param : Error< 9372 "'lifetimebound' attribute cannot be applied; %select{static |non-}0member " 9373 "function has no implicit object parameter">; 9374def err_lifetimebound_ctor_dtor : Error< 9375 "'lifetimebound' attribute cannot be applied to a " 9376 "%select{constructor|destructor}0">; 9377 9378// CHECK: returning address/reference of stack memory 9379def warn_ret_stack_addr_ref : Warning< 9380 "%select{address of|reference to}0 stack memory associated with " 9381 "%select{local variable|parameter}2 %1 returned">, 9382 InGroup<ReturnStackAddress>; 9383def warn_ret_local_temp_addr_ref : Warning< 9384 "returning %select{address of|reference to}0 local temporary object">, 9385 InGroup<ReturnStackAddress>; 9386def warn_ret_addr_label : Warning< 9387 "returning address of label, which is local">, 9388 InGroup<ReturnStackAddress>; 9389def err_ret_local_block : Error< 9390 "returning block that lives on the local stack">; 9391def note_local_var_initializer : Note< 9392 "%select{via initialization of|binding reference}0 variable " 9393 "%select{%2 |}1here">; 9394def note_lambda_capture_initializer : Note< 9395 "%select{implicitly |}2captured%select{| by reference}3" 9396 "%select{%select{ due to use|}2 here|" 9397 " via initialization of lambda capture %0}1">; 9398def note_init_with_default_member_initalizer : Note< 9399 "initializing field %0 with default member initializer">; 9400 9401// Check for initializing a member variable with the address or a reference to 9402// a constructor parameter. 9403def warn_bind_ref_member_to_parameter : Warning< 9404 "binding reference member %0 to stack allocated " 9405 "%select{variable|parameter}2 %1">, InGroup<DanglingField>; 9406def warn_init_ptr_member_to_parameter_addr : Warning< 9407 "initializing pointer member %0 with the stack address of " 9408 "%select{variable|parameter}2 %1">, InGroup<DanglingField>; 9409def note_ref_or_ptr_member_declared_here : Note< 9410 "%select{reference|pointer}0 member declared here">; 9411 9412def err_dangling_member : Error< 9413 "%select{reference|backing array for 'std::initializer_list'}2 " 9414 "%select{|subobject of }1member %0 " 9415 "%select{binds to|is}2 a temporary object " 9416 "whose lifetime would be shorter than the lifetime of " 9417 "the constructed object">; 9418def warn_dangling_member : Warning< 9419 "%select{reference|backing array for 'std::initializer_list'}2 " 9420 "%select{|subobject of }1member %0 " 9421 "%select{binds to|is}2 a temporary object " 9422 "whose lifetime is shorter than the lifetime of the constructed object">, 9423 InGroup<DanglingField>; 9424def warn_dangling_lifetime_pointer_member : Warning< 9425 "initializing pointer member %0 to point to a temporary object " 9426 "whose lifetime is shorter than the lifetime of the constructed object">, 9427 InGroup<DanglingGsl>; 9428def note_lifetime_extending_member_declared_here : Note< 9429 "%select{%select{reference|'std::initializer_list'}0 member|" 9430 "member with %select{reference|'std::initializer_list'}0 subobject}1 " 9431 "declared here">; 9432def warn_dangling_variable : Warning< 9433 "%select{temporary %select{whose address is used as value of|" 9434 "%select{|implicitly }2bound to}4 " 9435 "%select{%select{|reference }4member of local variable|" 9436 "local %select{variable|reference}4}1|" 9437 "array backing " 9438 "%select{initializer list subobject of local variable|" 9439 "local initializer list}1}0 " 9440 "%select{%3 |}2will be destroyed at the end of the full-expression">, 9441 InGroup<Dangling>; 9442def warn_new_dangling_reference : Warning< 9443 "temporary bound to reference member of allocated object " 9444 "will be destroyed at the end of the full-expression">, 9445 InGroup<DanglingField>; 9446def warn_dangling_lifetime_pointer : Warning< 9447 "object backing the pointer " 9448 "will be destroyed at the end of the full-expression">, 9449 InGroup<DanglingGsl>; 9450def warn_new_dangling_initializer_list : Warning< 9451 "array backing " 9452 "%select{initializer list subobject of the allocated object|" 9453 "the allocated initializer list}0 " 9454 "will be destroyed at the end of the full-expression">, 9455 InGroup<DanglingInitializerList>; 9456def warn_unsupported_lifetime_extension : Warning< 9457 "sorry, lifetime extension of " 9458 "%select{temporary|backing array of initializer list}0 created " 9459 "by aggregate initialization using default member initializer " 9460 "is not supported; lifetime of %select{temporary|backing array}0 " 9461 "will end at the end of the full-expression">, InGroup<Dangling>; 9462 9463// For non-floating point, expressions of the form x == x or x != x 9464// should result in a warning, since these always evaluate to a constant. 9465// Array comparisons have similar warnings 9466def warn_comparison_always : Warning< 9467 "%select{self-|array }0comparison always evaluates to " 9468 "%select{a constant|true|false|'std::strong_ordering::equal'}1">, 9469 InGroup<TautologicalCompare>; 9470def warn_comparison_bitwise_always : Warning< 9471 "bitwise comparison always evaluates to %select{false|true}0">, 9472 InGroup<TautologicalBitwiseCompare>, DefaultIgnore; 9473def warn_comparison_bitwise_or : Warning< 9474 "bitwise or with non-zero value always evaluates to true">, 9475 InGroup<TautologicalBitwiseCompare>, DefaultIgnore; 9476def warn_tautological_overlap_comparison : Warning< 9477 "overlapping comparisons always evaluate to %select{false|true}0">, 9478 InGroup<TautologicalOverlapCompare>, DefaultIgnore; 9479def warn_depr_array_comparison : Warning< 9480 "comparison between two arrays is deprecated; " 9481 "to compare array addresses, use unary '+' to decay operands to pointers">, 9482 InGroup<DeprecatedArrayCompare>; 9483 9484def warn_stringcompare : Warning< 9485 "result of comparison against %select{a string literal|@encode}0 is " 9486 "unspecified (use an explicit string comparison function instead)">, 9487 InGroup<StringCompare>; 9488 9489def warn_identity_field_assign : Warning< 9490 "assigning %select{field|instance variable}0 to itself">, 9491 InGroup<SelfAssignmentField>; 9492 9493// Type safety attributes 9494def err_type_tag_for_datatype_not_ice : Error< 9495 "'type_tag_for_datatype' attribute requires the initializer to be " 9496 "an %select{integer|integral}0 constant expression">; 9497def err_type_tag_for_datatype_too_large : Error< 9498 "'type_tag_for_datatype' attribute requires the initializer to be " 9499 "an %select{integer|integral}0 constant expression " 9500 "that can be represented by a 64 bit integer">; 9501def err_tag_index_out_of_range : Error< 9502 "%select{type tag|argument}0 index %1 is greater than the number of arguments specified">; 9503def warn_type_tag_for_datatype_wrong_kind : Warning< 9504 "this type tag was not designed to be used with this function">, 9505 InGroup<TypeSafety>; 9506def warn_type_safety_type_mismatch : Warning< 9507 "argument type %0 doesn't match specified %1 type tag " 9508 "%select{that requires %3|}2">, InGroup<TypeSafety>; 9509def warn_type_safety_null_pointer_required : Warning< 9510 "specified %0 type tag requires a null pointer">, InGroup<TypeSafety>; 9511 9512// Generic selections. 9513def err_assoc_type_incomplete : Error< 9514 "type %0 in generic association incomplete">; 9515def err_assoc_type_nonobject : Error< 9516 "type %0 in generic association not an object type">; 9517def err_assoc_type_variably_modified : Error< 9518 "type %0 in generic association is a variably modified type">; 9519def err_assoc_compatible_types : Error< 9520 "type %0 in generic association compatible with previously specified type %1">; 9521def note_compat_assoc : Note< 9522 "compatible type %0 specified here">; 9523def err_generic_sel_no_match : Error< 9524 "controlling expression type %0 not compatible with any generic association type">; 9525def err_generic_sel_multi_match : Error< 9526 "controlling expression type %0 compatible with %1 generic association types">; 9527 9528 9529// Blocks 9530def err_blocks_disable : Error<"blocks support disabled - compile with -fblocks" 9531 " or %select{pick a deployment target that supports them|for OpenCL 2.0}0">; 9532def err_block_returning_array_function : Error< 9533 "block cannot return %select{array|function}0 type %1">; 9534 9535// Builtin annotation 9536def err_builtin_annotation_first_arg : Error< 9537 "first argument to __builtin_annotation must be an integer">; 9538def err_builtin_annotation_second_arg : Error< 9539 "second argument to __builtin_annotation must be a non-wide string constant">; 9540def err_msvc_annotation_wide_str : Error< 9541 "arguments to __annotation must be wide string constants">; 9542 9543// CFString checking 9544def err_cfstring_literal_not_string_constant : Error< 9545 "CFString literal is not a string constant">; 9546def warn_cfstring_truncated : Warning< 9547 "input conversion stopped due to an input byte that does not " 9548 "belong to the input codeset UTF-8">, 9549 InGroup<DiagGroup<"CFString-literal">>; 9550 9551// os_log checking 9552// TODO: separate diagnostic for os_trace() 9553def err_os_log_format_not_string_constant : Error< 9554 "os_log() format argument is not a string constant">; 9555def err_os_log_argument_too_big : Error< 9556 "os_log() argument %0 is too big (%1 bytes, max %2)">; 9557def warn_os_log_format_narg : Error< 9558 "os_log() '%%n' format specifier is not allowed">, DefaultError; 9559 9560// Statements. 9561def err_continue_not_in_loop : Error< 9562 "'continue' statement not in loop statement">; 9563def err_break_not_in_loop_or_switch : Error< 9564 "'break' statement not in loop or switch statement">; 9565def warn_loop_ctrl_binds_to_inner : Warning< 9566 "'%0' is bound to current loop, GCC binds it to the enclosing loop">, 9567 InGroup<GccCompat>; 9568def warn_break_binds_to_switch : Warning< 9569 "'break' is bound to loop, GCC binds it to switch">, 9570 InGroup<GccCompat>; 9571def err_default_not_in_switch : Error< 9572 "'default' statement not in switch statement">; 9573def err_case_not_in_switch : Error<"'case' statement not in switch statement">; 9574def warn_bool_switch_condition : Warning< 9575 "switch condition has boolean value">, InGroup<SwitchBool>; 9576def warn_case_value_overflow : Warning< 9577 "overflow converting case value to switch condition type (%0 to %1)">, 9578 InGroup<Switch>; 9579def err_duplicate_case : Error<"duplicate case value '%0'">; 9580def err_duplicate_case_differing_expr : Error< 9581 "duplicate case value: '%0' and '%1' both equal '%2'">; 9582def warn_case_empty_range : Warning<"empty case range specified">; 9583def warn_missing_case_for_condition : 9584 Warning<"no case matching constant switch condition '%0'">; 9585 9586def warn_def_missing_case : Warning<"%plural{" 9587 "1:enumeration value %1 not explicitly handled in switch|" 9588 "2:enumeration values %1 and %2 not explicitly handled in switch|" 9589 "3:enumeration values %1, %2, and %3 not explicitly handled in switch|" 9590 ":%0 enumeration values not explicitly handled in switch: %1, %2, %3...}0">, 9591 InGroup<SwitchEnum>, DefaultIgnore; 9592 9593def warn_missing_case : Warning<"%plural{" 9594 "1:enumeration value %1 not handled in switch|" 9595 "2:enumeration values %1 and %2 not handled in switch|" 9596 "3:enumeration values %1, %2, and %3 not handled in switch|" 9597 ":%0 enumeration values not handled in switch: %1, %2, %3...}0">, 9598 InGroup<Switch>; 9599 9600def warn_unannotated_fallthrough : Warning< 9601 "unannotated fall-through between switch labels">, 9602 InGroup<ImplicitFallthrough>, DefaultIgnore; 9603def warn_unannotated_fallthrough_per_function : Warning< 9604 "unannotated fall-through between switch labels in partly-annotated " 9605 "function">, InGroup<ImplicitFallthroughPerFunction>, DefaultIgnore; 9606def note_insert_fallthrough_fixit : Note< 9607 "insert '%0;' to silence this warning">; 9608def note_insert_break_fixit : Note< 9609 "insert 'break;' to avoid fall-through">; 9610def err_fallthrough_attr_wrong_target : Error< 9611 "%0 attribute is only allowed on empty statements">; 9612def note_fallthrough_insert_semi_fixit : Note<"did you forget ';'?">; 9613def err_fallthrough_attr_outside_switch : Error< 9614 "fallthrough annotation is outside switch statement">; 9615def err_fallthrough_attr_invalid_placement : Error< 9616 "fallthrough annotation does not directly precede switch label">; 9617 9618def warn_unreachable_default : Warning< 9619 "default label in switch which covers all enumeration values">, 9620 InGroup<CoveredSwitchDefault>, DefaultIgnore; 9621def warn_not_in_enum : Warning<"case value not in enumerated type %0">, 9622 InGroup<Switch>; 9623def warn_not_in_enum_assignment : Warning<"integer constant not in range " 9624 "of enumerated type %0">, InGroup<DiagGroup<"assign-enum">>, DefaultIgnore; 9625def err_typecheck_statement_requires_scalar : Error< 9626 "statement requires expression of scalar type (%0 invalid)">; 9627def err_typecheck_statement_requires_integer : Error< 9628 "statement requires expression of integer type (%0 invalid)">; 9629def err_multiple_default_labels_defined : Error< 9630 "multiple default labels in one switch">; 9631def err_switch_multiple_conversions : Error< 9632 "multiple conversions from switch condition type %0 to an integral or " 9633 "enumeration type">; 9634def note_switch_conversion : Note< 9635 "conversion to %select{integral|enumeration}0 type %1">; 9636def err_switch_explicit_conversion : Error< 9637 "switch condition type %0 requires explicit conversion to %1">; 9638def err_switch_incomplete_class_type : Error< 9639 "switch condition has incomplete class type %0">; 9640 9641def warn_empty_if_body : Warning< 9642 "if statement has empty body">, InGroup<EmptyBody>; 9643def warn_empty_for_body : Warning< 9644 "for loop has empty body">, InGroup<EmptyBody>; 9645def warn_empty_range_based_for_body : Warning< 9646 "range-based for loop has empty body">, InGroup<EmptyBody>; 9647def warn_empty_while_body : Warning< 9648 "while loop has empty body">, InGroup<EmptyBody>; 9649def warn_empty_switch_body : Warning< 9650 "switch statement has empty body">, InGroup<EmptyBody>; 9651def note_empty_body_on_separate_line : Note< 9652 "put the semicolon on a separate line to silence this warning">; 9653 9654def err_va_start_captured_stmt : Error< 9655 "'va_start' cannot be used in a captured statement">; 9656def err_va_start_outside_function : Error< 9657 "'va_start' cannot be used outside a function">; 9658def err_va_start_fixed_function : Error< 9659 "'va_start' used in function with fixed args">; 9660def err_va_start_used_in_wrong_abi_function : Error< 9661 "'va_start' used in %select{System V|Win64}0 ABI function">; 9662def err_ms_va_start_used_in_sysv_function : Error< 9663 "'__builtin_ms_va_start' used in System V ABI function">; 9664def warn_second_arg_of_va_start_not_last_named_param : Warning< 9665 "second argument to 'va_start' is not the last named parameter">, 9666 InGroup<Varargs>; 9667def warn_va_start_type_is_undefined : Warning< 9668 "passing %select{an object that undergoes default argument promotion|" 9669 "an object of reference type|a parameter declared with the 'register' " 9670 "keyword}0 to 'va_start' has undefined behavior">, InGroup<Varargs>; 9671def err_first_argument_to_va_arg_not_of_type_va_list : Error< 9672 "first argument to 'va_arg' is of type %0 and not 'va_list'">; 9673def err_second_parameter_to_va_arg_incomplete: Error< 9674 "second argument to 'va_arg' is of incomplete type %0">; 9675def err_second_parameter_to_va_arg_abstract: Error< 9676 "second argument to 'va_arg' is of abstract type %0">; 9677def warn_second_parameter_to_va_arg_not_pod : Warning< 9678 "second argument to 'va_arg' is of non-POD type %0">, 9679 InGroup<NonPODVarargs>, DefaultError; 9680def warn_second_parameter_to_va_arg_ownership_qualified : Warning< 9681 "second argument to 'va_arg' is of ARC ownership-qualified type %0">, 9682 InGroup<NonPODVarargs>, DefaultError; 9683def warn_second_parameter_to_va_arg_never_compatible : Warning< 9684 "second argument to 'va_arg' is of promotable type %0; this va_arg has " 9685 "undefined behavior because arguments will be promoted to %1">, InGroup<Varargs>; 9686 9687def warn_return_missing_expr : Warning< 9688 "non-void %select{function|method}1 %0 should return a value">, DefaultError, 9689 InGroup<ReturnType>; 9690def ext_return_missing_expr : ExtWarn< 9691 "non-void %select{function|method}1 %0 should return a value">, DefaultError, 9692 InGroup<ReturnType>; 9693def ext_return_has_expr : ExtWarn< 9694 "%select{void function|void method|constructor|destructor}1 %0 " 9695 "should not return a value">, 9696 DefaultError, InGroup<ReturnType>; 9697def ext_return_has_void_expr : Extension< 9698 "void %select{function|method|block}1 %0 should not return void expression">; 9699def err_return_init_list : Error< 9700 "%select{void function|void method|constructor|destructor}1 %0 " 9701 "must not return a value">; 9702def err_ctor_dtor_returns_void : Error< 9703 "%select{constructor|destructor}1 %0 must not return void expression">; 9704def warn_noreturn_function_has_return_expr : Warning< 9705 "function %0 declared 'noreturn' should not return">, 9706 InGroup<InvalidNoreturn>; 9707def warn_falloff_noreturn_function : Warning< 9708 "function declared 'noreturn' should not return">, 9709 InGroup<InvalidNoreturn>; 9710def err_noreturn_block_has_return_expr : Error< 9711 "block declared 'noreturn' should not return">; 9712def err_carries_dependency_missing_on_first_decl : Error< 9713 "%select{function|parameter}0 declared '[[carries_dependency]]' " 9714 "after its first declaration">; 9715def note_carries_dependency_missing_first_decl : Note< 9716 "declaration missing '[[carries_dependency]]' attribute is here">; 9717def err_carries_dependency_param_not_function_decl : Error< 9718 "'[[carries_dependency]]' attribute only allowed on parameter in a function " 9719 "declaration or lambda">; 9720def err_block_on_nonlocal : Error< 9721 "__block attribute not allowed, only allowed on local variables">; 9722def err_block_on_vm : Error< 9723 "__block attribute not allowed on declaration with a variably modified type">; 9724def err_sizeless_nonlocal : Error< 9725 "non-local variable with sizeless type %0">; 9726 9727def err_vec_builtin_non_vector : Error< 9728 "first two arguments to %0 must be vectors">; 9729def err_vec_builtin_incompatible_vector : Error< 9730 "first two arguments to %0 must have the same type">; 9731def err_vsx_builtin_nonconstant_argument : Error< 9732 "argument %0 to %1 must be a 2-bit unsigned literal (i.e. 0, 1, 2 or 3)">; 9733 9734def err_shufflevector_nonconstant_argument : Error< 9735 "index for __builtin_shufflevector must be a constant integer">; 9736def err_shufflevector_argument_too_large : Error< 9737 "index for __builtin_shufflevector must be less than the total number " 9738 "of vector elements">; 9739 9740def err_convertvector_non_vector : Error< 9741 "first argument to __builtin_convertvector must be a vector">; 9742def err_convertvector_non_vector_type : Error< 9743 "second argument to __builtin_convertvector must be a vector type">; 9744def err_convertvector_incompatible_vector : Error< 9745 "first two arguments to __builtin_convertvector must have the same number of elements">; 9746 9747def err_first_argument_to_cwsc_not_call : Error< 9748 "first argument to __builtin_call_with_static_chain must be a non-member call expression">; 9749def err_first_argument_to_cwsc_block_call : Error< 9750 "first argument to __builtin_call_with_static_chain must not be a block call">; 9751def err_first_argument_to_cwsc_builtin_call : Error< 9752 "first argument to __builtin_call_with_static_chain must not be a builtin call">; 9753def err_first_argument_to_cwsc_pdtor_call : Error< 9754 "first argument to __builtin_call_with_static_chain must not be a pseudo-destructor call">; 9755def err_second_argument_to_cwsc_not_pointer : Error< 9756 "second argument to __builtin_call_with_static_chain must be of pointer type">; 9757 9758def err_vector_incorrect_num_initializers : Error< 9759 "%select{too many|too few}0 elements in vector initialization (expected %1 elements, have %2)">; 9760def err_altivec_empty_initializer : Error<"expected initializer">; 9761 9762def err_invalid_neon_type_code : Error< 9763 "incompatible constant for this __builtin_neon function">; 9764def err_argument_invalid_range : Error< 9765 "argument value %0 is outside the valid range [%1, %2]">; 9766def warn_argument_invalid_range : Warning< 9767 "argument value %0 is outside the valid range [%1, %2]">, DefaultError, 9768 InGroup<DiagGroup<"argument-outside-range">>; 9769def warn_argument_undefined_behaviour : Warning< 9770 "argument value %0 will result in undefined behaviour">, 9771 InGroup<DiagGroup<"argument-undefined-behaviour">>; 9772def err_argument_not_multiple : Error< 9773 "argument should be a multiple of %0">; 9774def err_argument_not_power_of_2 : Error< 9775 "argument should be a power of 2">; 9776def err_argument_not_shifted_byte : Error< 9777 "argument should be an 8-bit value shifted by a multiple of 8 bits">; 9778def err_argument_not_shifted_byte_or_xxff : Error< 9779 "argument should be an 8-bit value shifted by a multiple of 8 bits, or in the form 0x??FF">; 9780def err_argument_not_contiguous_bit_field : Error< 9781 "argument %0 value should represent a contiguous bit field">; 9782def err_rotation_argument_to_cadd 9783 : Error<"argument should be the value 90 or 270">; 9784def err_rotation_argument_to_cmla 9785 : Error<"argument should be the value 0, 90, 180 or 270">; 9786def warn_neon_vector_initializer_non_portable : Warning< 9787 "vector initializers are not compatible with NEON intrinsics in big endian " 9788 "mode">, InGroup<DiagGroup<"nonportable-vector-initialization">>; 9789def note_neon_vector_initializer_non_portable : Note< 9790 "consider using vld1_%0%1() to initialize a vector from memory, or " 9791 "vcreate_%0%1() to initialize from an integer constant">; 9792def note_neon_vector_initializer_non_portable_q : Note< 9793 "consider using vld1q_%0%1() to initialize a vector from memory, or " 9794 "vcombine_%0%1(vcreate_%0%1(), vcreate_%0%1()) to initialize from integer " 9795 "constants">; 9796def err_systemz_invalid_tabort_code : Error< 9797 "invalid transaction abort code">; 9798def err_64_bit_builtin_32_bit_tgt : Error< 9799 "this builtin is only available on 64-bit targets">; 9800def err_32_bit_builtin_64_bit_tgt : Error< 9801 "this builtin is only available on 32-bit targets">; 9802def err_builtin_x64_aarch64_only : Error< 9803 "this builtin is only available on x86-64 and aarch64 targets">; 9804def err_mips_builtin_requires_dsp : Error< 9805 "this builtin requires 'dsp' ASE, please use -mdsp">; 9806def err_mips_builtin_requires_dspr2 : Error< 9807 "this builtin requires 'dsp r2' ASE, please use -mdspr2">; 9808def err_mips_builtin_requires_msa : Error< 9809 "this builtin requires 'msa' ASE, please use -mmsa">; 9810def err_ppc_builtin_only_on_arch : Error< 9811 "this builtin is only valid on POWER%0 or later CPUs">; 9812def err_ppc_builtin_requires_vsx : Error< 9813 "this builtin requires VSX to be enabled">; 9814def err_ppc_builtin_requires_abi : Error< 9815 "this builtin requires ABI -mabi=%0">; 9816def err_ppc_invalid_use_mma_type : Error< 9817 "invalid use of PPC MMA type">; 9818def err_ppc_invalid_test_data_class_type : Error< 9819 "expected a 'float' or 'double' for the first argument">; 9820def err_x86_builtin_invalid_rounding : Error< 9821 "invalid rounding argument">; 9822def err_x86_builtin_invalid_scale : Error< 9823 "scale argument must be 1, 2, 4, or 8">; 9824def err_x86_builtin_tile_arg_duplicate : Error< 9825 "tile arguments must refer to different tiles">; 9826 9827def err_builtin_target_unsupported : Error< 9828 "builtin is not supported on this target">; 9829def err_builtin_longjmp_unsupported : Error< 9830 "__builtin_longjmp is not supported for the current target">; 9831def err_builtin_setjmp_unsupported : Error< 9832 "__builtin_setjmp is not supported for the current target">; 9833 9834def err_builtin_longjmp_invalid_val : Error< 9835 "argument to __builtin_longjmp must be a constant 1">; 9836def err_builtin_requires_language : Error<"'%0' is only available in %1">; 9837 9838def err_constant_integer_arg_type : Error< 9839 "argument to %0 must be a constant integer">; 9840 9841def ext_mixed_decls_code : Extension< 9842 "ISO C90 forbids mixing declarations and code">, 9843 InGroup<DiagGroup<"declaration-after-statement">>; 9844 9845def err_non_local_variable_decl_in_for : Error< 9846 "declaration of non-local variable in 'for' loop">; 9847def err_non_variable_decl_in_for : Error< 9848 "non-variable declaration in 'for' loop">; 9849def err_toomany_element_decls : Error< 9850 "only one element declaration is allowed">; 9851def err_selector_element_not_lvalue : Error< 9852 "selector element is not a valid lvalue">; 9853def err_selector_element_type : Error< 9854 "selector element type %0 is not a valid object">; 9855def err_selector_element_const_type : Error< 9856 "selector element of type %0 cannot be a constant lvalue expression">; 9857def err_collection_expr_type : Error< 9858 "the type %0 is not a pointer to a fast-enumerable object">; 9859def warn_collection_expr_type : Warning< 9860 "collection expression type %0 may not respond to %1">; 9861 9862def err_invalid_conversion_between_ext_vectors : Error< 9863 "invalid conversion between ext-vector type %0 and %1">; 9864 9865def warn_duplicate_attribute_exact : Warning< 9866 "attribute %0 is already applied">, InGroup<IgnoredAttributes>; 9867 9868def warn_duplicate_attribute : Warning< 9869 "attribute %0 is already applied with different arguments">, 9870 InGroup<IgnoredAttributes>; 9871def err_disallowed_duplicate_attribute : Error< 9872 "attribute %0 cannot appear more than once on a declaration">; 9873 9874def warn_sync_fetch_and_nand_semantics_change : Warning< 9875 "the semantics of this intrinsic changed with GCC " 9876 "version 4.4 - the newer semantics are provided here">, 9877 InGroup<DiagGroup<"sync-fetch-and-nand-semantics-changed">>; 9878 9879// Type 9880def ext_wchar_t_sign_spec : ExtWarn<"'%0' cannot be signed or unsigned">, 9881 InGroup<DiagGroup<"signed-unsigned-wchar">>, DefaultError; 9882def warn_receiver_forward_class : Warning< 9883 "receiver %0 is a forward class and corresponding @interface may not exist">, 9884 InGroup<ForwardClassReceiver>; 9885def note_method_sent_forward_class : Note<"method %0 is used for the forward class">; 9886def ext_missing_declspec : ExtWarn< 9887 "declaration specifier missing, defaulting to 'int'">; 9888def ext_missing_type_specifier : ExtWarn< 9889 "type specifier missing, defaults to 'int'">, 9890 InGroup<ImplicitInt>; 9891def err_decimal_unsupported : Error< 9892 "GNU decimal type extension not supported">; 9893def err_missing_type_specifier : Error< 9894 "C++ requires a type specifier for all declarations">; 9895def err_objc_array_of_interfaces : Error< 9896 "array of interface %0 is invalid (probably should be an array of pointers)">; 9897def ext_c99_array_usage : Extension< 9898 "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 " 9899 "feature">, InGroup<C99>; 9900def err_c99_array_usage_cxx : Error< 9901 "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 " 9902 "feature, not permitted in C++">; 9903def err_type_unsupported : Error< 9904 "%0 is not supported on this target">; 9905def err_nsconsumed_attribute_mismatch : Error< 9906 "overriding method has mismatched ns_consumed attribute on its" 9907 " parameter">; 9908def err_nsreturns_retained_attribute_mismatch : Error< 9909 "overriding method has mismatched ns_returns_%select{not_retained|retained}0" 9910 " attributes">; 9911def err_nserrordomain_invalid_decl : Error< 9912 "domain argument %select{|%1 }0does not refer to global constant">; 9913def err_nserrordomain_wrong_type : Error< 9914 "domain argument %0 does not point to an NSString or CFString constant">; 9915 9916def warn_nsconsumed_attribute_mismatch : Warning< 9917 err_nsconsumed_attribute_mismatch.Text>, InGroup<NSConsumedMismatch>; 9918def warn_nsreturns_retained_attribute_mismatch : Warning< 9919 err_nsreturns_retained_attribute_mismatch.Text>, InGroup<NSReturnsMismatch>; 9920 9921def note_getter_unavailable : Note< 9922 "or because setter is declared here, but no getter method %0 is found">; 9923def err_invalid_protocol_qualifiers : Error< 9924 "invalid protocol qualifiers on non-ObjC type">; 9925def warn_ivar_use_hidden : Warning< 9926 "local declaration of %0 hides instance variable">, 9927 InGroup<ShadowIvar>; 9928def warn_direct_initialize_call : Warning< 9929 "explicit call to +initialize results in duplicate call to +initialize">, 9930 InGroup<ExplicitInitializeCall>; 9931def warn_direct_super_initialize_call : Warning< 9932 "explicit call to [super initialize] should only be in implementation " 9933 "of +initialize">, 9934 InGroup<ExplicitInitializeCall>; 9935def err_ivar_use_in_class_method : Error< 9936 "instance variable %0 accessed in class method">; 9937def err_private_ivar_access : Error<"instance variable %0 is private">, 9938 AccessControl; 9939def err_protected_ivar_access : Error<"instance variable %0 is protected">, 9940 AccessControl; 9941def warn_maynot_respond : Warning<"%0 may not respond to %1">; 9942def ext_typecheck_base_super : Warning< 9943 "method parameter type " 9944 "%diff{$ does not match super class method parameter type $|" 9945 "does not match super class method parameter type}0,1">, 9946 InGroup<SuperSubClassMismatch>, DefaultIgnore; 9947def warn_missing_method_return_type : Warning< 9948 "method has no return type specified; defaults to 'id'">, 9949 InGroup<MissingMethodReturnType>, DefaultIgnore; 9950def warn_direct_ivar_access : Warning<"instance variable %0 is being " 9951 "directly accessed">, InGroup<DiagGroup<"direct-ivar-access">>, DefaultIgnore; 9952 9953// Spell-checking diagnostics 9954def err_unknown_typename : Error< 9955 "unknown type name %0">; 9956def err_unknown_type_or_class_name_suggest : Error< 9957 "unknown %select{type|class}1 name %0; did you mean %2?">; 9958def err_unknown_typename_suggest : Error< 9959 "unknown type name %0; did you mean %1?">; 9960def err_unknown_nested_typename_suggest : Error< 9961 "no type named %0 in %1; did you mean %select{|simply }2%3?">; 9962def err_no_member_suggest : Error<"no member named %0 in %1; did you mean %select{|simply }2%3?">; 9963def err_undeclared_use_suggest : Error< 9964 "use of undeclared %0; did you mean %1?">; 9965def err_undeclared_var_use_suggest : Error< 9966 "use of undeclared identifier %0; did you mean %1?">; 9967def err_no_template : Error<"no template named %0">; 9968def err_no_template_suggest : Error<"no template named %0; did you mean %1?">; 9969def err_no_member_template : Error<"no template named %0 in %1">; 9970def err_no_member_template_suggest : Error< 9971 "no template named %0 in %1; did you mean %select{|simply }2%3?">; 9972def err_non_template_in_template_id : Error< 9973 "%0 does not name a template but is followed by template arguments">; 9974def err_non_template_in_template_id_suggest : Error< 9975 "%0 does not name a template but is followed by template arguments; " 9976 "did you mean %1?">; 9977def err_non_template_in_member_template_id_suggest : Error< 9978 "member %0 of %1 is not a template; did you mean %select{|simply }2%3?">; 9979def note_non_template_in_template_id_found : Note< 9980 "non-template declaration found by name lookup">; 9981def err_mem_init_not_member_or_class_suggest : Error< 9982 "initializer %0 does not name a non-static data member or base " 9983 "class; did you mean the %select{base class|member}1 %2?">; 9984def err_field_designator_unknown_suggest : Error< 9985 "field designator %0 does not refer to any field in type %1; did you mean " 9986 "%2?">; 9987def err_typecheck_member_reference_ivar_suggest : Error< 9988 "%0 does not have a member named %1; did you mean %2?">; 9989def err_property_not_found_suggest : Error< 9990 "property %0 not found on object of type %1; did you mean %2?">; 9991def err_class_property_found : Error< 9992 "property %0 is a class property; did you mean to access it with class '%1'?">; 9993def err_ivar_access_using_property_syntax_suggest : Error< 9994 "property %0 not found on object of type %1; did you mean to access instance variable %2?">; 9995def warn_property_access_suggest : Warning< 9996"property %0 not found on object of type %1; did you mean to access property %2?">, 9997InGroup<PropertyAccessDotSyntax>; 9998def err_property_found_suggest : Error< 9999 "property %0 found on object of type %1; did you mean to access " 10000 "it with the \".\" operator?">; 10001def err_undef_interface_suggest : Error< 10002 "cannot find interface declaration for %0; did you mean %1?">; 10003def warn_undef_interface_suggest : Warning< 10004 "cannot find interface declaration for %0; did you mean %1?">; 10005def err_undef_superclass_suggest : Error< 10006 "cannot find interface declaration for %0, superclass of %1; did you mean " 10007 "%2?">; 10008def err_undeclared_protocol_suggest : Error< 10009 "cannot find protocol declaration for %0; did you mean %1?">; 10010def note_base_class_specified_here : Note< 10011 "base class %0 specified here">; 10012def err_using_directive_suggest : Error< 10013 "no namespace named %0; did you mean %1?">; 10014def err_using_directive_member_suggest : Error< 10015 "no namespace named %0 in %1; did you mean %select{|simply }2%3?">; 10016def note_namespace_defined_here : Note<"namespace %0 defined here">; 10017def err_sizeof_pack_no_pack_name_suggest : Error< 10018 "%0 does not refer to the name of a parameter pack; did you mean %1?">; 10019def note_parameter_pack_here : Note<"parameter pack %0 declared here">; 10020 10021def err_uncasted_use_of_unknown_any : Error< 10022 "%0 has unknown type; cast it to its declared type to use it">; 10023def err_uncasted_call_of_unknown_any : Error< 10024 "%0 has unknown return type; cast the call to its declared return type">; 10025def err_uncasted_send_to_unknown_any_method : Error< 10026 "no known method %select{%objcinstance1|%objcclass1}0; cast the " 10027 "message send to the method's return type">; 10028def err_unsupported_unknown_any_decl : Error< 10029 "%0 has unknown type, which is not supported for this kind of declaration">; 10030def err_unsupported_unknown_any_expr : Error< 10031 "unsupported expression with unknown type">; 10032def err_unsupported_unknown_any_call : Error< 10033 "call to unsupported expression with unknown type">; 10034def err_unknown_any_addrof : Error< 10035 "the address of a declaration with unknown type " 10036 "can only be cast to a pointer type">; 10037def err_unknown_any_addrof_call : Error< 10038 "address-of operator cannot be applied to a call to a function with " 10039 "unknown return type">; 10040def err_unknown_any_var_function_type : Error< 10041 "variable %0 with unknown type cannot be given a function type">; 10042def err_unknown_any_function : Error< 10043 "function %0 with unknown type must be given a function type">; 10044 10045def err_filter_expression_integral : Error< 10046 "filter expression has non-integral type %0">; 10047 10048def err_non_asm_stmt_in_naked_function : Error< 10049 "non-ASM statement in naked function is not supported">; 10050def err_asm_naked_this_ref : Error< 10051 "'this' pointer references not allowed in naked functions">; 10052def err_asm_naked_parm_ref : Error< 10053 "parameter references not allowed in naked functions">; 10054 10055// OpenCL warnings and errors. 10056def err_invalid_astype_of_different_size : Error< 10057 "invalid reinterpretation: sizes of %0 and %1 must match">; 10058def err_static_kernel : Error< 10059 "kernel functions cannot be declared static">; 10060def err_method_kernel : Error< 10061 "kernel functions cannot be class members">; 10062def err_template_kernel : Error< 10063 "kernel functions cannot be used in a template declaration, instantiation or specialization">; 10064def err_opencl_ptrptr_kernel_param : Error< 10065 "kernel parameter cannot be declared as a pointer to a pointer">; 10066def err_kernel_arg_address_space : Error< 10067 "pointer arguments to kernel functions must reside in '__global', " 10068 "'__constant' or '__local' address space">; 10069def err_opencl_ext_vector_component_invalid_length : Error< 10070 "vector component access has invalid length %0. Supported: 1,2,3,4,8,16.">; 10071def err_opencl_function_variable : Error< 10072 "%select{non-kernel function|function scope}0 variable cannot be declared in %1 address space">; 10073def err_opencl_addrspace_scope : Error< 10074 "variables in the %0 address space can only be declared in the outermost " 10075 "scope of a kernel function">; 10076def err_static_function_scope : Error< 10077 "variables in function scope cannot be declared static">; 10078def err_opencl_bitfields : Error< 10079 "bit-fields are not supported in OpenCL">; 10080def err_opencl_vla : Error< 10081 "variable length arrays are not supported in OpenCL">; 10082def err_opencl_scalar_type_rank_greater_than_vector_type : Error< 10083 "scalar operand type has greater rank than the type of the vector " 10084 "element. (%0 and %1)">; 10085def err_bad_kernel_param_type : Error< 10086 "%0 cannot be used as the type of a kernel parameter">; 10087def err_opencl_implicit_function_decl : Error< 10088 "implicit declaration of function %0 is invalid in OpenCL">; 10089def err_record_with_pointers_kernel_param : Error< 10090 "%select{struct|union}0 kernel parameters may not contain pointers">; 10091def note_within_field_of_type : Note< 10092 "within field of type %0 declared here">; 10093def note_illegal_field_declared_here : Note< 10094 "field of illegal %select{type|pointer type}0 %1 declared here">; 10095def err_opencl_type_struct_or_union_field : Error< 10096 "the %0 type cannot be used to declare a structure or union field">; 10097def err_event_t_addr_space_qual : Error< 10098 "the event_t type can only be used with __private address space qualifier">; 10099def err_expected_kernel_void_return_type : Error< 10100 "kernel must have void return type">; 10101def err_sampler_initializer_not_integer : Error< 10102 "sampler_t initialization requires 32-bit integer, not %0">; 10103def warn_sampler_initializer_invalid_bits : Warning< 10104 "sampler initializer has invalid %0 bits">, InGroup<SpirCompat>, DefaultIgnore; 10105def err_sampler_argument_required : Error< 10106 "sampler_t variable required - got %0">; 10107def err_wrong_sampler_addressspace: Error< 10108 "sampler type cannot be used with the __local and __global address space qualifiers">; 10109def err_opencl_nonconst_global_sampler : Error< 10110 "global sampler requires a const or constant address space qualifier">; 10111def err_opencl_cast_non_zero_to_event_t : Error< 10112 "cannot cast non-zero value '%0' to 'event_t'">; 10113def err_opencl_global_invalid_addr_space : Error< 10114 "%select{program scope|static local|extern}0 variable must reside in %1 address space">; 10115def err_missing_actual_pipe_type : Error< 10116 "missing actual type specifier for pipe">; 10117def err_reference_pipe_type : Error < 10118 "pipes packet types cannot be of reference type">; 10119def err_opencl_no_main : Error<"%select{function|kernel}0 cannot be called 'main'">; 10120def err_opencl_kernel_attr : 10121 Error<"attribute %0 can only be applied to an OpenCL kernel function">; 10122def err_opencl_return_value_with_address_space : Error< 10123 "return value cannot be qualified with address space">; 10124def err_opencl_constant_no_init : Error< 10125 "variable in constant address space must be initialized">; 10126def err_opencl_atomic_init: Error< 10127 "atomic variable can be %select{assigned|initialized}0 to a variable only " 10128 "in global address space">; 10129def err_opencl_implicit_vector_conversion : Error< 10130 "implicit conversions between vector types (%0 and %1) are not permitted">; 10131def err_opencl_invalid_type_array : Error< 10132 "array of %0 type is invalid in OpenCL">; 10133def err_opencl_ternary_with_block : Error< 10134 "block type cannot be used as expression in ternary expression in OpenCL">; 10135def err_opencl_pointer_to_type : Error< 10136 "pointer to type %0 is invalid in OpenCL">; 10137def err_opencl_type_can_only_be_used_as_function_parameter : Error < 10138 "type %0 can only be used as a function parameter in OpenCL">; 10139def err_opencl_type_not_found : Error< 10140 "%0 type %1 not found; include the base header with -finclude-default-header">; 10141def warn_opencl_attr_deprecated_ignored : Warning < 10142 "%0 attribute is deprecated and ignored in %1">, InGroup<IgnoredAttributes>; 10143def err_opencl_variadic_function : Error< 10144 "invalid prototype, variadic arguments are not allowed in OpenCL">; 10145def err_opencl_requires_extension : Error< 10146 "use of %select{type|declaration}0 %1 requires %2 support">; 10147def ext_opencl_double_without_pragma : Extension< 10148 "Clang permits use of type 'double' regardless pragma if 'cl_khr_fp64' is" 10149 " supported">; 10150def warn_opencl_generic_address_space_arg : Warning< 10151 "passing non-generic address space pointer to %0" 10152 " may cause dynamic conversion affecting performance">, 10153 InGroup<Conversion>, DefaultIgnore; 10154 10155// OpenCL v2.0 s6.13.6 -- Builtin Pipe Functions 10156def err_opencl_builtin_pipe_first_arg : Error< 10157 "first argument to %0 must be a pipe type">; 10158def err_opencl_builtin_pipe_arg_num : Error< 10159 "invalid number of arguments to function: %0">; 10160def err_opencl_builtin_pipe_invalid_arg : Error< 10161 "invalid argument type to function %0 (expecting %1 having %2)">; 10162def err_opencl_builtin_pipe_invalid_access_modifier : Error< 10163 "invalid pipe access modifier (expecting %0)">; 10164 10165// OpenCL access qualifier 10166def err_opencl_invalid_access_qualifier : Error< 10167 "access qualifier can only be used for pipe and image type">; 10168def err_opencl_invalid_read_write : Error< 10169 "access qualifier %0 can not be used for %1 %select{|prior to OpenCL C version 2.0 or in version 3.0 " 10170 "and without __opencl_c_read_write_images feature}2">; 10171def err_opencl_multiple_access_qualifiers : Error< 10172 "multiple access qualifiers">; 10173def note_opencl_typedef_access_qualifier : Note< 10174 "previously declared '%0' here">; 10175 10176// OpenCL v2.0 s6.12.5 Blocks restrictions 10177def err_opencl_block_storage_type : Error< 10178 "the __block storage type is not permitted">; 10179def err_opencl_invalid_block_declaration : Error< 10180 "invalid block variable declaration - must be %select{const qualified|initialized}0">; 10181def err_opencl_extern_block_declaration : Error< 10182 "invalid block variable declaration - using 'extern' storage class is disallowed">; 10183def err_opencl_block_ref_block : Error< 10184 "cannot refer to a block inside block">; 10185 10186// OpenCL v2.0 s6.13.9 - Address space qualifier functions. 10187def err_opencl_builtin_to_addr_invalid_arg : Error< 10188 "invalid argument %0 to function: %1, expecting a generic pointer argument">; 10189 10190// OpenCL v2.0 s6.13.17 Enqueue kernel restrictions. 10191def err_opencl_enqueue_kernel_incorrect_args : Error< 10192 "illegal call to enqueue_kernel, incorrect argument types">; 10193def err_opencl_enqueue_kernel_local_size_args : Error< 10194 "mismatch in number of block parameters and local size arguments passed">; 10195def err_opencl_enqueue_kernel_invalid_local_size_type : Error< 10196 "illegal call to enqueue_kernel, parameter needs to be specified as integer type">; 10197def err_opencl_enqueue_kernel_blocks_non_local_void_args : Error< 10198 "blocks used in enqueue_kernel call are expected to have parameters of type 'local void*'">; 10199def err_opencl_enqueue_kernel_blocks_no_args : Error< 10200 "blocks with parameters are not accepted in this prototype of enqueue_kernel call">; 10201 10202def err_opencl_builtin_expected_type : Error< 10203 "illegal call to %0, expected %1 argument type">; 10204 10205// OpenCL v3.0 s6.3.7 - Vector Components 10206def ext_opencl_ext_vector_type_rgba_selector: ExtWarn< 10207 "vector component name '%0' is a feature from OpenCL version 3.0 onwards">, 10208 InGroup<OpenCLUnsupportedRGBA>; 10209 10210def err_openclcxx_placement_new : Error< 10211 "use of placement new requires explicit declaration">; 10212 10213// MIG routine annotations. 10214def warn_mig_server_routine_does_not_return_kern_return_t : Warning< 10215 "'mig_server_routine' attribute only applies to routines that return a kern_return_t">, 10216 InGroup<IgnoredAttributes>; 10217} // end of sema category 10218 10219let CategoryName = "OpenMP Issue" in { 10220// OpenMP support. 10221def err_omp_expected_var_arg : Error< 10222 "%0 is not a global variable, static local variable or static data member">; 10223def err_omp_expected_var_arg_suggest : Error< 10224 "%0 is not a global variable, static local variable or static data member; " 10225 "did you mean %1">; 10226def err_omp_global_var_arg : Error< 10227 "arguments of '#pragma omp %0' must have %select{global storage|static storage duration}1">; 10228def err_omp_ref_type_arg : Error< 10229 "arguments of '#pragma omp %0' cannot be of reference type %1">; 10230def err_omp_region_not_file_context : Error< 10231 "directive must be at file or namespace scope">; 10232def err_omp_var_scope : Error< 10233 "'#pragma omp %0' must appear in the scope of the %q1 variable declaration">; 10234def err_omp_var_used : Error< 10235 "'#pragma omp %0' must precede all references to variable %q1">; 10236def err_omp_var_thread_local : Error< 10237 "variable %0 cannot be threadprivate because it is %select{thread-local|a global named register variable}1">; 10238def err_omp_private_incomplete_type : Error< 10239 "a private variable with incomplete type %0">; 10240def err_omp_firstprivate_incomplete_type : Error< 10241 "a firstprivate variable with incomplete type %0">; 10242def err_omp_lastprivate_incomplete_type : Error< 10243 "a lastprivate variable with incomplete type %0">; 10244def err_omp_reduction_incomplete_type : Error< 10245 "a reduction list item with incomplete type %0">; 10246def err_omp_unexpected_clause_value : Error< 10247 "expected %0 in OpenMP clause '%1'">; 10248def err_omp_expected_var_name_member_expr : Error< 10249 "expected variable name%select{| or data member of current class}0">; 10250def err_omp_expected_var_name_member_expr_or_array_item : Error< 10251 "expected variable name%select{|, data member of current class}0, array element or array section">; 10252def err_omp_expected_addressable_lvalue_or_array_item : Error< 10253 "expected addressable lvalue expression, array element%select{ or array section|, array section or array shaping expression}0%select{| of non 'omp_depend_t' type}1">; 10254def err_omp_expected_named_var_member_or_array_expression: Error< 10255 "expected expression containing only member accesses and/or array sections based on named variables">; 10256def err_omp_bit_fields_forbidden_in_clause : Error< 10257 "bit fields cannot be used to specify storage in a '%0' clause">; 10258def err_array_section_does_not_specify_contiguous_storage : Error< 10259 "array section does not specify contiguous storage">; 10260def err_array_section_does_not_specify_length : Error< 10261 "array section does not specify length for outermost dimension">; 10262def err_omp_union_type_not_allowed : Error< 10263 "mapping of union members is not allowed">; 10264def err_omp_expected_access_to_data_field : Error< 10265 "expected access to data field">; 10266def err_omp_multiple_array_items_in_map_clause : Error< 10267 "multiple array elements associated with the same variable are not allowed in map clauses of the same construct">; 10268def err_omp_duplicate_map_type_modifier : Error< 10269 "same map type modifier has been specified more than once">; 10270def err_omp_duplicate_motion_modifier : Error< 10271 "same motion modifier has been specified more than once">; 10272def err_omp_pointer_mapped_along_with_derived_section : Error< 10273 "pointer cannot be mapped along with a section derived from itself">; 10274def err_omp_original_storage_is_shared_and_does_not_contain : Error< 10275 "original storage of expression in data environment is shared but data environment do not fully contain mapped expression storage">; 10276def err_omp_same_pointer_dereferenced : Error< 10277 "same pointer dereferenced in multiple different ways in map clause expressions">; 10278def note_omp_task_predetermined_firstprivate_here : Note< 10279 "predetermined as a firstprivate in a task construct here">; 10280def err_omp_threadprivate_incomplete_type : Error< 10281 "threadprivate variable with incomplete type %0">; 10282def err_omp_no_dsa_for_variable : Error< 10283 "variable %0 must have explicitly specified data sharing attributes">; 10284def err_omp_defaultmap_no_attr_for_variable : Error< 10285 "variable %0 must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause">; 10286def note_omp_default_dsa_none : Note< 10287 "explicit data sharing attribute requested here">; 10288def note_omp_defaultmap_attr_none : Note< 10289 "explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here">; 10290def err_omp_wrong_dsa : Error< 10291 "%0 variable cannot be %1">; 10292def err_omp_variably_modified_type_not_supported : Error< 10293 "arguments of OpenMP clause '%0' in '#pragma omp %2' directive cannot be of variably-modified type %1">; 10294def note_omp_explicit_dsa : Note< 10295 "defined as %0">; 10296def note_omp_predetermined_dsa : Note< 10297 "%select{static data member is predetermined as shared|" 10298 "variable with static storage duration is predetermined as shared|" 10299 "loop iteration variable is predetermined as private|" 10300 "loop iteration variable is predetermined as linear|" 10301 "loop iteration variable is predetermined as lastprivate|" 10302 "constant variable is predetermined as shared|" 10303 "global variable is predetermined as shared|" 10304 "non-shared variable in a task construct is predetermined as firstprivate|" 10305 "variable with automatic storage duration is predetermined as private}0" 10306 "%select{|; perhaps you forget to enclose 'omp %2' directive into a parallel or another task region?}1">; 10307def note_omp_implicit_dsa : Note< 10308 "implicitly determined as %0">; 10309def err_omp_loop_var_dsa : Error< 10310 "loop iteration variable in the associated loop of 'omp %1' directive may not be %0, predetermined as %2">; 10311def err_omp_not_for : Error< 10312 "%select{statement after '#pragma omp %1' must be a for loop|" 10313 "expected %2 for loops after '#pragma omp %1'%select{|, but found only %4}3}0">; 10314def note_omp_collapse_ordered_expr : Note< 10315 "as specified in %select{'collapse'|'ordered'|'collapse' and 'ordered'}0 clause%select{||s}0">; 10316def err_omp_negative_expression_in_clause : Error< 10317 "argument to '%0' clause must be a %select{non-negative|strictly positive}1 integer value">; 10318def err_omp_not_integral : Error< 10319 "expression must have integral or unscoped enumeration " 10320 "type, not %0">; 10321def err_omp_threadprivate_in_target : Error< 10322 "threadprivate variables cannot be used in target constructs">; 10323def err_omp_incomplete_type : Error< 10324 "expression has incomplete class type %0">; 10325def err_omp_explicit_conversion : Error< 10326 "expression requires explicit conversion from %0 to %1">; 10327def note_omp_conversion_here : Note< 10328 "conversion to %select{integral|enumeration}0 type %1 declared here">; 10329def err_omp_ambiguous_conversion : Error< 10330 "ambiguous conversion from type %0 to an integral or unscoped " 10331 "enumeration type">; 10332def err_omp_iterator_not_integral_or_pointer : Error< 10333 "expected integral or pointer type as the iterator-type, not %0">; 10334def err_omp_iterator_step_not_integral : Error< 10335 "iterator step expression %0 is not the integral expression">; 10336def err_omp_iterator_step_constant_zero : Error< 10337 "iterator step expression %0 evaluates to 0">; 10338def err_omp_required_access : Error< 10339 "%0 variable must be %1">; 10340def err_omp_const_variable : Error< 10341 "const-qualified variable cannot be %0">; 10342def err_omp_const_not_mutable_variable : Error< 10343 "const-qualified variable without mutable fields cannot be %0">; 10344def err_omp_const_list_item : Error< 10345 "const-qualified list item cannot be %0">; 10346def err_omp_linear_incomplete_type : Error< 10347 "a linear variable with incomplete type %0">; 10348def err_omp_linear_expected_int_or_ptr : Error< 10349 "argument of a linear clause should be of integral or pointer " 10350 "type, not %0">; 10351def warn_omp_linear_step_zero : Warning< 10352 "zero linear step (%0 %select{|and other variables in clause }1should probably be const)">, 10353 InGroup<OpenMPClauses>; 10354def warn_omp_alignment_not_power_of_two : Warning< 10355 "aligned clause will be ignored because the requested alignment is not a power of 2">, 10356 InGroup<OpenMPClauses>; 10357def err_omp_invalid_target_decl : Error< 10358 "%0 used in declare target directive is not a variable or a function name">; 10359def err_omp_declare_target_to_and_link : Error< 10360 "%0 must not appear in both clauses 'to' and 'link'">; 10361def warn_omp_not_in_target_context : Warning< 10362 "declaration is not declared in any declare target region">, 10363 InGroup<OpenMPTarget>; 10364def err_omp_function_in_link_clause : Error< 10365 "function name is not allowed in 'link' clause">; 10366def err_omp_aligned_expected_array_or_ptr : Error< 10367 "argument of aligned clause should be array" 10368 "%select{ or pointer|, pointer, reference to array or reference to pointer}1" 10369 ", not %0">; 10370def err_omp_used_in_clause_twice : Error< 10371 "%select{a variable|a parameter|'this'}0 cannot appear in more than one %1 clause">; 10372def err_omp_local_var_in_threadprivate_init : Error< 10373 "variable with local storage in initial value of threadprivate variable">; 10374def err_omp_loop_not_canonical_init : Error< 10375 "initialization clause of OpenMP for loop is not in canonical form " 10376 "('var = init' or 'T var = init')">; 10377def ext_omp_loop_not_canonical_init : ExtWarn< 10378 "initialization clause of OpenMP for loop is not in canonical form " 10379 "('var = init' or 'T var = init')">, InGroup<OpenMPLoopForm>; 10380def err_omp_loop_not_canonical_cond : Error< 10381 "condition of OpenMP for loop must be a relational comparison " 10382 "('<', '<=', '>', %select{or '>='|'>=', or '!='}0) of loop variable %1">; 10383def err_omp_loop_not_canonical_incr : Error< 10384 "increment clause of OpenMP for loop must perform simple addition " 10385 "or subtraction on loop variable %0">; 10386def err_omp_loop_variable_type : Error< 10387 "variable must be of integer or %select{pointer|random access iterator}0 type">; 10388def err_omp_loop_incr_not_compatible : Error< 10389 "increment expression must cause %0 to %select{decrease|increase}1 " 10390 "on each iteration of OpenMP for loop">; 10391def note_omp_loop_cond_requres_compatible_incr : Note< 10392 "loop step is expected to be %select{negative|positive}0 due to this condition">; 10393def err_omp_loop_diff_cxx : Error< 10394 "could not calculate number of iterations calling 'operator-' with " 10395 "upper and lower loop bounds">; 10396def err_omp_loop_cannot_use_stmt : Error< 10397 "'%0' statement cannot be used in OpenMP for loop">; 10398def err_omp_simd_region_cannot_use_stmt : Error< 10399 "'%0' statement cannot be used in OpenMP simd region">; 10400def warn_omp_loop_64_bit_var : Warning< 10401 "OpenMP loop iteration variable cannot have more than 64 bits size and will be narrowed">, 10402 InGroup<OpenMPLoopForm>; 10403def err_omp_unknown_reduction_identifier : Error< 10404 "incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', " 10405 "'&&', '||', 'min' or 'max' or declare reduction for type %0">; 10406def err_omp_not_resolved_reduction_identifier : Error< 10407 "unable to resolve declare reduction construct for type %0">; 10408def err_omp_reduction_ref_type_arg : Error< 10409 "argument of OpenMP clause '%0' must reference the same object in all threads">; 10410def err_omp_clause_not_arithmetic_type_arg : Error< 10411 "arguments of OpenMP clause '%0' for 'min' or 'max' must be of %select{scalar|arithmetic}1 type">; 10412def err_omp_clause_floating_type_arg : Error< 10413 "arguments of OpenMP clause '%0' with bitwise operators cannot be of floating type">; 10414def err_omp_once_referenced : Error< 10415 "variable can appear only once in OpenMP '%0' clause">; 10416def err_omp_once_referenced_in_target_update : Error< 10417 "variable can appear only once in OpenMP 'target update' construct">; 10418def note_omp_referenced : Note< 10419 "previously referenced here">; 10420def err_omp_reduction_in_task : Error< 10421 "reduction variables may not be accessed in an explicit task">; 10422def err_omp_reduction_id_not_compatible : Error< 10423 "list item of type %0 is not valid for specified reduction operation: unable to provide default initialization value">; 10424def err_omp_reduction_identifier_mismatch : Error< 10425 "in_reduction variable must have the same reduction operation as in a task_reduction clause">; 10426def note_omp_previous_reduction_identifier : Note< 10427 "previously marked as task_reduction with different reduction operation">; 10428def err_omp_prohibited_region : Error< 10429 "region cannot be%select{| closely}0 nested inside '%1' region" 10430 "%select{|; perhaps you forget to enclose 'omp %3' directive into a parallel region?|" 10431 "; perhaps you forget to enclose 'omp %3' directive into a for or a parallel for region with 'ordered' clause?|" 10432 "; perhaps you forget to enclose 'omp %3' directive into a target region?|" 10433 "; perhaps you forget to enclose 'omp %3' directive into a teams region?|" 10434 "; perhaps you forget to enclose 'omp %3' directive into a for, simd, for simd, parallel for, or parallel for simd region?}2">; 10435def err_omp_prohibited_region_simd : Error< 10436 "OpenMP constructs may not be nested inside a simd region%select{| except for ordered simd, simd, scan, or atomic directive}0">; 10437def err_omp_prohibited_region_atomic : Error< 10438 "OpenMP constructs may not be nested inside an atomic region">; 10439def err_omp_prohibited_region_critical_same_name : Error< 10440 "cannot nest 'critical' regions having the same name %0">; 10441def note_omp_previous_critical_region : Note< 10442 "previous 'critical' region starts here">; 10443def err_omp_several_directives_in_region : Error< 10444 "exactly one '%0' directive must appear in the loop body of an enclosing directive">; 10445def note_omp_previous_directive : Note< 10446 "previous '%0' directive used here">; 10447def err_omp_sections_not_compound_stmt : Error< 10448 "the statement for '#pragma omp sections' must be a compound statement">; 10449def err_omp_parallel_sections_not_compound_stmt : Error< 10450 "the statement for '#pragma omp parallel sections' must be a compound statement">; 10451def err_omp_orphaned_section_directive : Error< 10452 "%select{orphaned 'omp section' directives are prohibited, it|'omp section' directive}0" 10453 " must be closely nested to a sections region%select{|, not a %1 region}0">; 10454def err_omp_sections_substmt_not_section : Error< 10455 "statement in 'omp sections' directive must be enclosed into a section region">; 10456def err_omp_parallel_sections_substmt_not_section : Error< 10457 "statement in 'omp parallel sections' directive must be enclosed into a section region">; 10458def err_omp_parallel_reduction_in_task_firstprivate : Error< 10459 "argument of a reduction clause of a %0 construct must not appear in a firstprivate clause on a task construct">; 10460def err_omp_atomic_read_not_expression_statement : Error< 10461 "the statement for 'atomic read' must be an expression statement of form 'v = x;'," 10462 " where v and x are both lvalue expressions with scalar type">; 10463def note_omp_atomic_read_write: Note< 10464 "%select{expected an expression statement|expected built-in assignment operator|expected expression of scalar type|expected lvalue expression}0">; 10465def err_omp_atomic_write_not_expression_statement : Error< 10466 "the statement for 'atomic write' must be an expression statement of form 'x = expr;'," 10467 " where x is a lvalue expression with scalar type">; 10468def err_omp_atomic_update_not_expression_statement : Error< 10469 "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'," 10470 " where x is an lvalue expression with scalar type">; 10471def err_omp_atomic_not_expression_statement : Error< 10472 "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'," 10473 " where x is an lvalue expression with scalar type">; 10474def note_omp_atomic_update: Note< 10475 "%select{expected an expression statement|expected built-in binary or unary operator|expected unary decrement/increment operation|" 10476 "expected expression of scalar type|expected assignment expression|expected built-in binary operator|" 10477 "expected one of '+', '*', '-', '/', '&', '^', '%|', '<<', or '>>' built-in operations|expected in right hand side of expression}0">; 10478def err_omp_atomic_capture_not_expression_statement : Error< 10479 "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'," 10480 " where x and v are both lvalue expressions with scalar type">; 10481def err_omp_atomic_capture_not_compound_statement : Error< 10482 "the statement for 'atomic capture' must be a compound statement of form '{v = x; x binop= expr;}', '{x binop= expr; v = x;}'," 10483 " '{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;}'," 10484 " '{v = x; x++;}', '{v = x; ++x;}', '{++x; v = x;}', '{x++; v = x;}', '{v = x; x--;}', '{v = x; --x;}', '{--x; v = x;}', '{x--; v = x;}'" 10485 " where x is an lvalue expression with scalar type">; 10486def note_omp_atomic_capture: Note< 10487 "%select{expected assignment expression|expected compound statement|expected exactly two expression statements|expected in right hand side of the first expression}0">; 10488def err_omp_atomic_several_clauses : Error< 10489 "directive '#pragma omp atomic' cannot contain more than one 'read', 'write', 'update' or 'capture' clause">; 10490def err_omp_several_mem_order_clauses : Error< 10491 "directive '#pragma omp %0' cannot contain more than one %select{'seq_cst', 'relaxed', |}1'acq_rel', 'acquire' or 'release' clause">; 10492def err_omp_atomic_incompatible_mem_order_clause : Error< 10493 "directive '#pragma omp atomic%select{ %0|}1' cannot be used with '%2' clause">; 10494def note_omp_previous_mem_order_clause : Note< 10495 "'%0' clause used here">; 10496def err_omp_target_contains_not_only_teams : Error< 10497 "target construct with nested teams region contains statements outside of the teams construct">; 10498def note_omp_nested_teams_construct_here : Note< 10499 "nested teams construct here">; 10500def note_omp_nested_statement_here : Note< 10501 "%select{statement|directive}0 outside teams construct here">; 10502def err_omp_single_copyprivate_with_nowait : Error< 10503 "the 'copyprivate' clause must not be used with the 'nowait' clause">; 10504def note_omp_nowait_clause_here : Note< 10505 "'nowait' clause is here">; 10506def err_omp_single_decl_in_declare_simd_variant : Error< 10507 "single declaration is expected after 'declare %select{simd|variant}0' directive">; 10508def err_omp_function_expected : Error< 10509 "'#pragma omp declare %select{simd|variant}0' can only be applied to functions">; 10510def err_omp_wrong_cancel_region : Error< 10511 "one of 'for', 'parallel', 'sections' or 'taskgroup' is expected">; 10512def err_omp_parent_cancel_region_nowait : Error< 10513 "parent region for 'omp %select{cancellation point|cancel}0' construct cannot be nowait">; 10514def err_omp_parent_cancel_region_ordered : Error< 10515 "parent region for 'omp %select{cancellation point|cancel}0' construct cannot be ordered">; 10516def 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">; 10517def 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">; 10518def err_omp_declare_reduction_redefinition : Error<"redefinition of user-defined reduction for type %0">; 10519def err_omp_mapper_wrong_type : Error< 10520 "mapper type must be of struct, union or class type">; 10521def err_omp_declare_mapper_wrong_var : Error< 10522 "only variable %0 is allowed in map clauses of this 'omp declare mapper' directive">; 10523def err_omp_declare_mapper_redefinition : Error< 10524 "redefinition of user-defined mapper for type %0 with name %1">; 10525def err_omp_invalid_mapper: Error< 10526 "cannot find a valid user-defined mapper for type %0 with name %1">; 10527def err_omp_array_section_use : Error<"OpenMP array section is not allowed here">; 10528def err_omp_array_shaping_use : Error<"OpenMP array shaping operation is not allowed here">; 10529def err_omp_iterator_use : Error<"OpenMP iterator is not allowed here">; 10530def err_omp_typecheck_section_value : Error< 10531 "subscripted value is not an array or pointer">; 10532def err_omp_typecheck_section_not_integer : Error< 10533 "array section %select{lower bound|length}0 is not an integer">; 10534def err_omp_typecheck_shaping_not_integer : Error< 10535 "array shaping operation dimension is not an integer">; 10536def err_omp_shaping_dimension_not_positive : Error< 10537 "array shaping dimension is evaluated to a non-positive value %0">; 10538def err_omp_section_function_type : Error< 10539 "section of pointer to function type %0">; 10540def warn_omp_section_is_char : Warning<"array section %select{lower bound|length}0 is of type 'char'">, 10541 InGroup<CharSubscript>, DefaultIgnore; 10542def err_omp_section_incomplete_type : Error< 10543 "section of pointer to incomplete type %0">; 10544def err_omp_section_not_subset_of_array : Error< 10545 "array section must be a subset of the original array">; 10546def err_omp_section_length_negative : Error< 10547 "section length is evaluated to a negative value %0">; 10548def err_omp_section_stride_non_positive : Error< 10549 "section stride is evaluated to a non-positive value %0">; 10550def err_omp_section_length_undefined : Error< 10551 "section length is unspecified and cannot be inferred because subscripted value is %select{not an array|an array of unknown bound}0">; 10552def err_omp_wrong_linear_modifier : Error< 10553 "expected %select{'val' modifier|one of 'ref', val' or 'uval' modifiers}0">; 10554def err_omp_wrong_linear_modifier_non_reference : Error< 10555 "variable of non-reference type %0 can be used only with 'val' modifier, but used with '%1'">; 10556def err_omp_wrong_simdlen_safelen_values : Error< 10557 "the value of 'simdlen' parameter must be less than or equal to the value of the 'safelen' parameter">; 10558def err_omp_wrong_if_directive_name_modifier : Error< 10559 "directive name modifier '%0' is not allowed for '#pragma omp %1'">; 10560def err_omp_no_more_if_clause : Error< 10561 "no more 'if' clause is allowed">; 10562def err_omp_unnamed_if_clause : Error< 10563 "expected%select{| one of}0 %1 directive name modifier%select{|s}0">; 10564def note_omp_previous_named_if_clause : Note< 10565 "previous clause with directive name modifier specified here">; 10566def err_omp_ordered_directive_with_param : Error< 10567 "'ordered' directive %select{without any clauses|with 'threads' clause}0 cannot be closely nested inside ordered region with specified parameter">; 10568def err_omp_ordered_directive_without_param : Error< 10569 "'ordered' directive with 'depend' clause cannot be closely nested inside ordered region without specified parameter">; 10570def note_omp_ordered_param : Note< 10571 "'ordered' clause%select{| with specified parameter}0">; 10572def err_omp_expected_base_var_name : Error< 10573 "expected variable name as a base of the array %select{subscript|section}0">; 10574def err_omp_map_shared_storage : Error< 10575 "variable already marked as mapped in current construct">; 10576def err_omp_invalid_map_type_for_directive : Error< 10577 "%select{map type '%1' is not allowed|map type must be specified}0 for '#pragma omp %2'">; 10578def err_omp_invalid_map_type_modifier_for_directive : Error< 10579 "map type modifier '%0' is not allowed for '#pragma omp %1'">; 10580def err_omp_no_clause_for_directive : Error< 10581 "expected at least one %0 clause for '#pragma omp %1'">; 10582def err_omp_threadprivate_in_clause : Error< 10583 "threadprivate variables are not allowed in '%0' clause">; 10584def err_omp_wrong_ordered_loop_count : Error< 10585 "the parameter of the 'ordered' clause must be greater than or equal to the parameter of the 'collapse' clause">; 10586def note_collapse_loop_count : Note< 10587 "parameter of the 'collapse' clause">; 10588def err_omp_clauses_mutually_exclusive : Error< 10589 "'%0' and '%1' clause are mutually exclusive and may not appear on the same directive">; 10590def note_omp_previous_clause : Note< 10591 "'%0' clause is specified here">; 10592def err_omp_hint_clause_no_name : Error< 10593 "the name of the construct must be specified in presence of 'hint' clause">; 10594def err_omp_critical_with_hint : Error< 10595 "constructs with the same name must have a 'hint' clause with the same value">; 10596def note_omp_critical_hint_here : Note< 10597 "%select{|previous }0'hint' clause with value '%1'">; 10598def note_omp_critical_no_hint : Note< 10599 "%select{|previous }0directive with no 'hint' clause specified">; 10600def err_omp_depend_clause_thread_simd : Error< 10601 "'depend' clauses cannot be mixed with '%0' clause">; 10602def err_omp_depend_sink_expected_loop_iteration : Error< 10603 "expected%select{| %1}0 loop iteration variable">; 10604def err_omp_depend_sink_unexpected_expr : Error< 10605 "unexpected expression: number of expressions is larger than the number of associated loops">; 10606def err_omp_depend_sink_expected_plus_minus : Error< 10607 "expected '+' or '-' operation">; 10608def err_omp_taskwait_depend_mutexinoutset_not_allowed : Error< 10609 "'mutexinoutset' modifier not allowed in 'depend' clause on 'taskwait' directive">; 10610def err_omp_depend_sink_source_not_allowed : Error< 10611 "'depend(%select{source|sink:vec}0)' clause%select{|s}0 cannot be mixed with 'depend(%select{sink:vec|source}0)' clause%select{s|}0">; 10612def err_omp_depend_zero_length_array_section_not_allowed : Error< 10613 "zero-length array section is not allowed in 'depend' clause">; 10614def err_omp_depend_sink_source_with_modifier : Error< 10615 "depend modifier cannot be used with 'sink' or 'source' depend type">; 10616def err_omp_depend_modifier_not_iterator : Error< 10617 "expected iterator specification as depend modifier">; 10618def err_omp_linear_ordered : Error< 10619 "'linear' clause cannot be specified along with 'ordered' clause with a parameter">; 10620def err_omp_unexpected_schedule_modifier : Error< 10621 "modifier '%0' cannot be used along with modifier '%1'">; 10622def err_omp_schedule_nonmonotonic_static : Error< 10623 "'nonmonotonic' modifier can only be specified with 'dynamic' or 'guided' schedule kind">; 10624def err_omp_simple_clause_incompatible_with_ordered : Error< 10625 "'%0' clause with '%1' modifier cannot be specified if an 'ordered' clause is specified">; 10626def err_omp_ordered_simd : Error< 10627 "'ordered' clause with a parameter can not be specified in '#pragma omp %0' directive">; 10628def err_omp_variable_in_given_clause_and_dsa : Error< 10629 "%0 variable cannot be in a %1 clause in '#pragma omp %2' directive">; 10630def err_omp_param_or_this_in_clause : Error< 10631 "expected reference to one of the parameters of function %0%select{| or 'this'}1">; 10632def err_omp_expected_uniform_param : Error< 10633 "expected a reference to a parameter specified in a 'uniform' clause">; 10634def err_omp_expected_int_param : Error< 10635 "expected a reference to an integer-typed parameter">; 10636def err_omp_at_least_one_motion_clause_required : Error< 10637 "expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'">; 10638def err_omp_usedeviceptr_not_a_pointer : Error< 10639 "expected pointer or reference to pointer in 'use_device_ptr' clause">; 10640def err_omp_argument_type_isdeviceptr : Error < 10641 "expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'">; 10642def warn_omp_nesting_simd : Warning< 10643 "OpenMP only allows an ordered construct with the simd clause nested in a simd construct">, 10644 InGroup<SourceUsesOpenMP>; 10645def err_omp_orphaned_device_directive : Error< 10646 "orphaned 'omp %0' directives are prohibited" 10647 "; perhaps you forget to enclose the directive into a " 10648 "%select{|||target |teams|for, simd, for simd, parallel for, or parallel for simd }1region?">; 10649def err_omp_reduction_non_addressable_expression : Error< 10650 "expected addressable reduction item for the task-based directives">; 10651def err_omp_reduction_with_nogroup : Error< 10652 "'reduction' clause cannot be used with 'nogroup' clause">; 10653def err_omp_reduction_vla_unsupported : Error< 10654 "cannot generate code for reduction on %select{|array section, which requires a }0variable length array">; 10655def err_omp_linear_distribute_var_non_loop_iteration : Error< 10656 "only loop iteration variables are allowed in 'linear' clause in distribute directives">; 10657def warn_omp_non_trivial_type_mapped : Warning< 10658 "Type %0 is not trivially copyable and not guaranteed to be mapped correctly">, 10659 InGroup<OpenMPMapping>; 10660def err_omp_requires_clause_redeclaration : Error < 10661 "Only one %0 clause can appear on a requires directive in a single translation unit">; 10662def note_omp_requires_previous_clause : Note < 10663 "%0 clause previously used here">; 10664def err_omp_directive_before_requires : Error < 10665 "'%0' region encountered before requires directive with '%1' clause">; 10666def note_omp_requires_encountered_directive : Note < 10667 "'%0' previously encountered here">; 10668def err_omp_invalid_scope : Error < 10669 "'#pragma omp %0' directive must appear only in file scope">; 10670def note_omp_invalid_length_on_this_ptr_mapping : Note < 10671 "expected length on mapping of 'this' array section expression to be '1'">; 10672def note_omp_invalid_lower_bound_on_this_ptr_mapping : Note < 10673 "expected lower bound on mapping of 'this' array section expression to be '0' or not specified">; 10674def note_omp_invalid_subscript_on_this_ptr_map : Note < 10675 "expected 'this' subscript expression on map clause to be 'this[0]'">; 10676def err_omp_invalid_map_this_expr : Error < 10677 "invalid 'this' expression on 'map' clause">; 10678def err_omp_implied_type_not_found : Error< 10679 "'%0' type not found; include <omp.h>">; 10680def err_omp_expected_omp_depend_t_lvalue : Error< 10681 "expected lvalue expression%select{ of 'omp_depend_t' type, not %1|}0">; 10682def err_omp_depobj_expected : Error< 10683 "expected depobj expression">; 10684def err_omp_depobj_single_clause_expected : Error< 10685 "exactly one of 'depend', 'destroy', or 'update' clauses is expected">; 10686def err_omp_scan_single_clause_expected : Error< 10687 "exactly one of 'inclusive' or 'exclusive' clauses is expected">; 10688def err_omp_inclusive_exclusive_not_reduction : Error< 10689 "the list item must appear in 'reduction' clause with the 'inscan' modifier " 10690 "of the parent directive">; 10691def err_omp_reduction_not_inclusive_exclusive : Error< 10692 "the inscan reduction list item must appear as a list item in an 'inclusive' or" 10693 " 'exclusive' clause on an inner 'omp scan' directive">; 10694def err_omp_wrong_inscan_reduction : Error< 10695 "'inscan' modifier can be used only in 'omp for', 'omp simd', 'omp for simd'," 10696 " 'omp parallel for', or 'omp parallel for simd' directive">; 10697def err_omp_inscan_reduction_expected : Error< 10698 "expected 'reduction' clause with the 'inscan' modifier">; 10699def note_omp_previous_inscan_reduction : Note< 10700 "'reduction' clause with 'inscan' modifier is used here">; 10701def err_omp_expected_predefined_allocator : Error< 10702 "expected one of the predefined allocators for the variables with the static " 10703 "storage: 'omp_default_mem_alloc', 'omp_large_cap_mem_alloc', " 10704 "'omp_const_mem_alloc', 'omp_high_bw_mem_alloc', 'omp_low_lat_mem_alloc', " 10705 "'omp_cgroup_mem_alloc', 'omp_pteam_mem_alloc' or 'omp_thread_mem_alloc'">; 10706def warn_omp_used_different_allocator : Warning< 10707 "allocate directive specifies %select{default|'%1'}0 allocator while " 10708 "previously used %select{default|'%3'}2">, 10709 InGroup<OpenMPClauses>; 10710def note_omp_previous_allocator : Note< 10711 "previous allocator is specified here">; 10712def err_expected_allocator_clause : Error<"expected an 'allocator' clause " 10713 "inside of the target region; provide an 'allocator' clause or use 'requires'" 10714 " directive with the 'dynamic_allocators' clause">; 10715def err_expected_allocator_expression : Error<"expected an allocator expression " 10716 "inside of the target region; provide an allocator expression or use 'requires'" 10717 " directive with the 'dynamic_allocators' clause">; 10718def warn_omp_allocate_thread_on_task_target_directive : Warning< 10719 "allocator with the 'thread' trait access has unspecified behavior on '%0' directive">, 10720 InGroup<OpenMPClauses>; 10721def err_omp_expected_private_copy_for_allocate : Error< 10722 "the referenced item is not found in any private clause on the same directive">; 10723def err_omp_stmt_depends_on_loop_counter : Error< 10724 "the loop %select{initializer|condition}0 expression depends on the current loop control variable">; 10725def err_omp_invariant_dependency : Error< 10726 "expected loop invariant expression">; 10727def err_omp_invariant_or_linear_dependency : Error< 10728 "expected loop invariant expression or '<invariant1> * %0 + <invariant2>' kind of expression">; 10729def err_omp_wrong_dependency_iterator_type : Error< 10730 "expected an integer or a pointer type of the outer loop counter '%0' for non-rectangular nests">; 10731def err_target_unsupported_type 10732 : Error<"%0 requires %select{|%2 bit size}1 %3 %select{|return }4type support," 10733 " but target '%5' does not support it">; 10734def err_omp_lambda_capture_in_declare_target_not_to : Error< 10735 "variable captured in declare target region must appear in a to clause">; 10736def err_omp_device_type_mismatch : Error< 10737 "'device_type(%0)' does not match previously specified 'device_type(%1)' for the same declaration">; 10738def err_omp_wrong_device_function_call : Error< 10739 "function with 'device_type(%0)' is not available on %select{device|host}1">; 10740def note_omp_marked_device_type_here : Note<"marked as 'device_type(%0)' here">; 10741def warn_omp_declare_target_after_first_use : Warning< 10742 "declaration marked as declare target after first use, it may lead to incorrect results">, 10743 InGroup<OpenMPTarget>; 10744def err_omp_declare_variant_incompat_attributes : Error< 10745 "'#pragma omp declare variant' is not compatible with any target-specific attributes">; 10746def warn_omp_declare_variant_score_not_constant 10747 : Warning<"score expressions in the OpenMP context selector need to be " 10748 "constant; %0 is not and will be ignored">, 10749 InGroup<SourceUsesOpenMP>; 10750def err_omp_declare_variant_user_condition_not_constant 10751 : Error<"the user condition in the OpenMP context selector needs to be " 10752 "constant; %0 is not">; 10753def warn_omp_declare_variant_after_used : Warning< 10754 "'#pragma omp declare variant' cannot be applied for function after first " 10755 "usage; the original function might be used">, InGroup<SourceUsesOpenMP>; 10756def warn_omp_declare_variant_after_emitted : Warning< 10757 "'#pragma omp declare variant' cannot be applied to the function that was defined already;" 10758 " the original function might be used">, InGroup<SourceUsesOpenMP>; 10759def err_omp_declare_variant_doesnt_support : Error< 10760 "'#pragma omp declare variant' does not " 10761 "support %select{function templates|virtual functions|" 10762 "deduced return types|constructors|destructors|deleted functions|" 10763 "defaulted functions|constexpr functions|consteval function}0">; 10764def err_omp_declare_variant_diff : Error< 10765 "function with '#pragma omp declare variant' has a different %select{calling convention" 10766 "|return type|constexpr specification|inline specification|storage class|" 10767 "linkage}0">; 10768def err_omp_declare_variant_prototype_required : Error< 10769 "function with '#pragma omp declare variant' must have a prototype when " 10770 "'append_args' is used">; 10771def err_omp_interop_type_not_found : Error< 10772 "'omp_interop_t' must be defined when 'append_args' clause is used; include <omp.h>">; 10773def err_omp_declare_variant_incompat_types : Error< 10774 "variant in '#pragma omp declare variant' with type %0 is incompatible with" 10775 " type %1%select{| with appended arguments}2">; 10776def warn_omp_declare_variant_marked_as_declare_variant : Warning< 10777 "variant function in '#pragma omp declare variant' is itself marked as '#pragma omp declare variant'" 10778 >, InGroup<SourceUsesOpenMP>; 10779def note_omp_marked_declare_variant_here : Note<"marked as 'declare variant' here">; 10780def err_omp_one_defaultmap_each_category: Error< 10781 "at most one defaultmap clause for each variable-category can appear on the directive">; 10782def err_omp_lastprivate_conditional_non_scalar : Error< 10783 "expected list item of scalar type in 'lastprivate' clause with 'conditional' modifier" 10784 >; 10785def err_omp_flush_order_clause_and_list : Error< 10786 "'flush' directive with memory order clause '%0' cannot have the list">; 10787def note_omp_flush_order_clause_here : Note< 10788 "memory order clause '%0' is specified here">; 10789def err_omp_non_lvalue_in_map_or_motion_clauses: Error< 10790 "expected addressable lvalue in '%0' clause">; 10791def err_omp_var_expected : Error< 10792 "expected variable of the '%0' type%select{|, not %2}1">; 10793def warn_unknown_declare_variant_isa_trait 10794 : Warning<"isa trait '%0' is not known to the current target; verify the " 10795 "spelling or consider restricting the context selector with the " 10796 "'arch' selector further">, 10797 InGroup<SourceUsesOpenMP>; 10798def err_omp_non_pointer_type_array_shaping_base : Error< 10799 "expected expression with a pointer to a complete type as a base of an array " 10800 "shaping operation">; 10801def err_omp_reduction_task_not_parallel_or_worksharing : Error< 10802 "'reduction' clause with 'task' modifier allowed only on non-simd parallel or" 10803 " worksharing constructs">; 10804def err_omp_expected_array_alloctraits : Error< 10805 "expected constant sized array of 'omp_alloctrait_t' elements, not %0">; 10806def err_omp_predefined_allocator_with_traits : Error< 10807 "predefined allocator cannot have traits specified">; 10808def note_omp_predefined_allocator : Note< 10809 "predefined trait '%0' used here">; 10810def err_omp_nonpredefined_allocator_without_traits : Error< 10811 "non-predefined allocator must have traits specified">; 10812def err_omp_allocator_used_in_clauses : Error< 10813 "allocators used in 'uses_allocators' clause cannot appear in other " 10814 "data-sharing or data-mapping attribute clauses">; 10815def err_omp_allocator_not_in_uses_allocators : Error< 10816 "allocator must be specified in the 'uses_allocators' clause">; 10817def note_omp_protected_structured_block 10818 : Note<"jump bypasses OpenMP structured block">; 10819def note_omp_exits_structured_block 10820 : Note<"jump exits scope of OpenMP structured block">; 10821def err_omp_lastprivate_loop_var_non_loop_iteration : Error< 10822 "only loop iteration variables are allowed in 'lastprivate' clause in " 10823 "'omp loop' directives">; 10824def err_omp_interop_variable_expected : Error< 10825 "expected%select{| non-const}0 variable of type 'omp_interop_t'">; 10826def err_omp_interop_variable_wrong_type : Error< 10827 "interop variable must be of type 'omp_interop_t'">; 10828def err_omp_interop_prefer_type : Error< 10829 "prefer_list item must be a string literal or constant integral " 10830 "expression">; 10831def err_omp_interop_bad_depend_clause : Error< 10832 "'depend' clause requires the 'targetsync' interop type">; 10833def err_omp_interop_var_multiple_actions : Error< 10834 "interop variable %0 used in multiple action clauses">; 10835def err_omp_dispatch_statement_call 10836 : Error<"statement after '#pragma omp dispatch' must be a direct call" 10837 " to a target function or an assignment to one">; 10838def err_omp_unroll_full_variable_trip_count : Error< 10839 "loop to be fully unrolled must have a constant trip count">; 10840def note_omp_directive_here : Note<"'%0' directive found here">; 10841def err_omp_instantiation_not_supported 10842 : Error<"instantiation of '%0' not supported yet">; 10843def err_omp_adjust_arg_multiple_clauses : Error< 10844 "'adjust_arg' argument %0 used in multiple clauses">; 10845def err_omp_clause_requires_dispatch_construct : Error< 10846 "'%0' clause requires 'dispatch' context selector">; 10847def err_omp_append_args_with_varargs : Error< 10848 "'append_args' is not allowed with varargs functions">; 10849} // end of OpenMP category 10850 10851let CategoryName = "Related Result Type Issue" in { 10852// Objective-C related result type compatibility 10853def warn_related_result_type_compatibility_class : Warning< 10854 "method is expected to return an instance of its class type " 10855 "%diff{$, but is declared to return $|" 10856 ", but is declared to return different type}0,1">; 10857def warn_related_result_type_compatibility_protocol : Warning< 10858 "protocol method is expected to return an instance of the implementing " 10859 "class, but is declared to return %0">; 10860def note_related_result_type_family : Note< 10861 "%select{overridden|current}0 method is part of the '%select{|alloc|copy|init|" 10862 "mutableCopy|new|autorelease|dealloc|finalize|release|retain|retainCount|" 10863 "self}1' method family%select{| and is expected to return an instance of its " 10864 "class type}0">; 10865def note_related_result_type_overridden : Note< 10866 "overridden method returns an instance of its class type">; 10867def note_related_result_type_inferred : Note< 10868 "%select{class|instance}0 method %1 is assumed to return an instance of " 10869 "its receiver type (%2)">; 10870def note_related_result_type_explicit : Note< 10871 "%select{overridden|current}0 method is explicitly declared 'instancetype'" 10872 "%select{| and is expected to return an instance of its class type}0">; 10873def err_invalid_type_for_program_scope_var : Error< 10874 "the %0 type cannot be used to declare a program scope variable">; 10875 10876} 10877 10878let CategoryName = "Modules Issue" in { 10879def err_module_decl_in_module_map_module : Error< 10880 "'module' declaration found while building module from module map">; 10881def err_module_decl_in_header_module : Error< 10882 "'module' declaration found while building header unit">; 10883def err_module_interface_implementation_mismatch : Error< 10884 "missing 'export' specifier in module declaration while " 10885 "building module interface">; 10886def err_current_module_name_mismatch : Error< 10887 "module name '%0' specified on command line does not match name of module">; 10888def err_module_redefinition : Error< 10889 "redefinition of module '%0'">; 10890def note_prev_module_definition : Note<"previously defined here">; 10891def note_prev_module_definition_from_ast_file : Note<"module loaded from '%0'">; 10892def err_module_not_defined : Error< 10893 "definition of module '%0' is not available; use -fmodule-file= to specify " 10894 "path to precompiled module interface">; 10895def err_module_redeclaration : Error< 10896 "translation unit contains multiple module declarations">; 10897def note_prev_module_declaration : Note<"previous module declaration is here">; 10898def err_module_declaration_missing : Error< 10899 "missing 'export module' declaration in module interface unit">; 10900def err_module_declaration_missing_after_global_module_introducer : Error< 10901 "missing 'module' declaration at end of global module fragment " 10902 "introduced here">; 10903def err_module_private_specialization : Error< 10904 "%select{template|partial|member}0 specialization cannot be " 10905 "declared __module_private__">; 10906def err_module_private_local : Error< 10907 "%select{local variable|parameter|typedef}0 %1 cannot be declared " 10908 "__module_private__">; 10909def err_module_private_local_class : Error< 10910 "local %select{struct|interface|union|class|enum}0 cannot be declared " 10911 "__module_private__">; 10912def err_module_unimported_use : Error< 10913 "%select{declaration|definition|default argument|" 10914 "explicit specialization|partial specialization}0 of %1 must be imported " 10915 "from module '%2' before it is required">; 10916def err_module_unimported_use_header : Error< 10917 "%select{missing '#include'|missing '#include %3'}2; " 10918 "%select{||default argument of |explicit specialization of |" 10919 "partial specialization of }0%1 must be " 10920 "%select{declared|defined|defined|declared|declared}0 " 10921 "before it is used">; 10922def err_module_unimported_use_multiple : Error< 10923 "%select{declaration|definition|default argument|" 10924 "explicit specialization|partial specialization}0 of %1 must be imported " 10925 "from one of the following modules before it is required:%2">; 10926def note_unreachable_entity : Note< 10927 "%select{declaration|definition|default argument declared|" 10928 "explicit specialization declared|partial specialization declared}0 here " 10929 "is not %select{visible|reachable|reachable|reachable|reachable|reachable}0">; 10930def ext_module_import_in_extern_c : ExtWarn< 10931 "import of C++ module '%0' appears within extern \"C\" language linkage " 10932 "specification">, DefaultError, 10933 InGroup<DiagGroup<"module-import-in-extern-c">>; 10934def err_module_import_not_at_top_level_fatal : Error< 10935 "import of module '%0' appears within %1">, DefaultFatal; 10936def ext_module_import_not_at_top_level_noop : ExtWarn< 10937 "redundant #include of module '%0' appears within %1">, DefaultError, 10938 InGroup<DiagGroup<"modules-import-nested-redundant">>; 10939def note_module_import_not_at_top_level : Note<"%0 begins here">; 10940def err_module_self_import : Error< 10941 "import of module '%0' appears within same top-level module '%1'">; 10942def err_module_import_in_implementation : Error< 10943 "@import of module '%0' in implementation of '%1'; use #import">; 10944 10945// C++ Modules 10946def err_module_decl_not_at_start : Error< 10947 "module declaration must occur at the start of the translation unit">; 10948def note_global_module_introducer_missing : Note< 10949 "add 'module;' to the start of the file to introduce a " 10950 "global module fragment">; 10951def err_export_within_anonymous_namespace : Error< 10952 "export declaration appears within anonymous namespace">; 10953def note_anonymous_namespace : Note<"anonymous namespace begins here">; 10954def ext_export_no_name_block : ExtWarn< 10955 "ISO C++20 does not permit %select{an empty|a static_assert}0 declaration " 10956 "to appear in an export block">, InGroup<ExportUnnamed>; 10957def ext_export_no_names : ExtWarn< 10958 "ISO C++20 does not permit a declaration that does not introduce any names " 10959 "to be exported">, InGroup<ExportUnnamed>; 10960def note_export : Note<"export block begins here">; 10961def err_export_no_name : Error< 10962 "%select{empty|static_assert|asm}0 declaration cannot be exported">; 10963def ext_export_using_directive : ExtWarn< 10964 "ISO C++20 does not permit using directive to be exported">, 10965 InGroup<DiagGroup<"export-using-directive">>; 10966def err_export_within_export : Error< 10967 "export declaration appears within another export declaration">; 10968def err_export_internal : Error< 10969 "declaration of %0 with internal linkage cannot be exported">; 10970def err_export_using_internal : Error< 10971 "using declaration referring to %0 with internal linkage cannot be exported">; 10972def err_export_not_in_module_interface : Error< 10973 "export declaration can only be used within a module interface unit" 10974 "%select{ after the module declaration|}0">; 10975def err_export_in_private_module_fragment : Error< 10976 "export declaration cannot be used in a private module fragment">; 10977def note_private_module_fragment : Note< 10978 "private module fragment begins here">; 10979def err_private_module_fragment_not_module : Error< 10980 "private module fragment declaration with no preceding module declaration">; 10981def err_private_module_fragment_redefined : Error< 10982 "private module fragment redefined">; 10983def err_private_module_fragment_not_module_interface : Error< 10984 "private module fragment in module implementation unit">; 10985def note_not_module_interface_add_export : Note< 10986 "add 'export' here if this is intended to be a module interface unit">; 10987 10988def ext_equivalent_internal_linkage_decl_in_modules : ExtWarn< 10989 "ambiguous use of internal linkage declaration %0 defined in multiple modules">, 10990 InGroup<DiagGroup<"modules-ambiguous-internal-linkage">>; 10991def note_equivalent_internal_linkage_decl : Note< 10992 "declared here%select{ in module '%1'|}0">; 10993 10994def note_redefinition_modules_same_file : Note< 10995 "'%0' included multiple times, additional include site in header from module '%1'">; 10996def note_redefinition_include_same_file : Note< 10997 "'%0' included multiple times, additional include site here">; 10998} 10999 11000let CategoryName = "Coroutines Issue" in { 11001def err_return_in_coroutine : Error< 11002 "return statement not allowed in coroutine; did you mean 'co_return'?">; 11003def note_declared_coroutine_here : Note< 11004 "function is a coroutine due to use of '%0' here">; 11005def err_coroutine_objc_method : Error< 11006 "Objective-C methods as coroutines are not yet supported">; 11007def err_coroutine_unevaluated_context : Error< 11008 "'%0' cannot be used in an unevaluated context">; 11009def err_coroutine_within_handler : Error< 11010 "'%0' cannot be used in the handler of a try block">; 11011def err_coroutine_outside_function : Error< 11012 "'%0' cannot be used outside a function">; 11013def err_coroutine_invalid_func_context : Error< 11014 "'%1' cannot be used in %select{a constructor|a destructor" 11015 "|the 'main' function|a constexpr function" 11016 "|a function with a deduced return type|a varargs function" 11017 "|a consteval function}0">; 11018def err_implied_coroutine_type_not_found : Error< 11019 "%0 type was not found; include <coroutine> before defining " 11020 "a coroutine; include <experimental/coroutine> if your version " 11021 "of libcxx is less than 14.0">; 11022def warn_deprecated_coroutine_namespace : Warning< 11023 "Please move from std::experimental::%0 to std::%0. " 11024 "Support for std::experimental::%0 will be removed in LLVM 15.">, 11025 InGroup<DeprecatedExperimentalCoroutine>; 11026def err_mixed_use_std_and_experimental_namespace_for_coroutine : Error < 11027 "Found mixed use of std namespace and std::experimental namespace for " 11028 "coroutine, which is disallowed. The coroutine components in " 11029 "std::experimental namespace is deprecated. Please use coroutine components " 11030 "under std namespace.">; 11031def err_implicit_coroutine_std_nothrow_type_not_found : Error< 11032 "std::nothrow was not found; include <new> before defining a coroutine which " 11033 "uses get_return_object_on_allocation_failure()">; 11034def err_malformed_std_nothrow : Error< 11035 "std::nothrow must be a valid variable declaration">; 11036def err_malformed_std_coroutine_handle : Error< 11037 "std::coroutine_handle isn't a class template">; 11038def err_coroutine_handle_missing_member : Error< 11039 "std::coroutine_handle must have a member named '%0'">; 11040def err_malformed_std_coroutine_traits : Error< 11041 "std::coroutine_traits isn't a class template">; 11042def err_implied_std_coroutine_traits_promise_type_not_found : Error< 11043 "this function cannot be a coroutine: %q0 has no member named 'promise_type'">; 11044def err_implied_std_coroutine_traits_promise_type_not_class : Error< 11045 "this function cannot be a coroutine: %0 is not a class">; 11046def err_coroutine_promise_type_incomplete : Error< 11047 "this function cannot be a coroutine: %0 is an incomplete type">; 11048def err_coroutine_type_missing_specialization : Error< 11049 "this function cannot be a coroutine: missing definition of " 11050 "specialization %0">; 11051def err_coroutine_promise_incompatible_return_functions : Error< 11052 "the coroutine promise type %0 declares both 'return_value' and 'return_void'">; 11053def err_coroutine_promise_requires_return_function : Error< 11054 "the coroutine promise type %0 must declare either 'return_value' or 'return_void'">; 11055def note_coroutine_promise_implicit_await_transform_required_here : Note< 11056 "call to 'await_transform' implicitly required by 'co_await' here">; 11057def note_coroutine_promise_suspend_implicitly_required : Note< 11058 "call to '%select{initial_suspend|final_suspend}0' implicitly " 11059 "required by the %select{initial suspend point|final suspend point}0">; 11060def err_coroutine_promise_unhandled_exception_required : Error< 11061 "%0 is required to declare the member 'unhandled_exception()'">; 11062def warn_coroutine_promise_unhandled_exception_required_with_exceptions : Warning< 11063 "%0 is required to declare the member 'unhandled_exception()' when exceptions are enabled">, 11064 InGroup<CoroutineMissingUnhandledException>; 11065def err_coroutine_promise_get_return_object_on_allocation_failure : Error< 11066 "%0: 'get_return_object_on_allocation_failure()' must be a static member function">; 11067def err_seh_in_a_coroutine_with_cxx_exceptions : Error< 11068 "cannot use SEH '__try' in a coroutine when C++ exceptions are enabled">; 11069def err_coroutine_promise_new_requires_nothrow : Error< 11070 "%0 is required to have a non-throwing noexcept specification when the promise " 11071 "type declares 'get_return_object_on_allocation_failure()'">; 11072def note_coroutine_promise_call_implicitly_required : Note< 11073 "call to %0 implicitly required by coroutine function here">; 11074def err_await_suspend_invalid_return_type : Error< 11075 "return type of 'await_suspend' is required to be 'void' or 'bool' (have %0)" 11076>; 11077def note_await_ready_no_bool_conversion : Note< 11078 "return type of 'await_ready' is required to be contextually convertible to 'bool'" 11079>; 11080def warn_coroutine_handle_address_invalid_return_type : Warning < 11081 "return type of 'coroutine_handle<>::address should be 'void*' (have %0) in order to get capability with existing async C API.">, 11082 InGroup<Coroutine>; 11083def err_coroutine_promise_final_suspend_requires_nothrow : Error< 11084 "the expression 'co_await __promise.final_suspend()' is required to be non-throwing" 11085>; 11086def note_coroutine_function_declare_noexcept : Note< 11087 "must be declared with 'noexcept'" 11088>; 11089} // end of coroutines issue category 11090 11091let CategoryName = "Documentation Issue" in { 11092def warn_not_a_doxygen_trailing_member_comment : Warning< 11093 "not a Doxygen trailing comment">, InGroup<Documentation>, DefaultIgnore; 11094} // end of documentation issue category 11095 11096let CategoryName = "Nullability Issue" in { 11097 11098def warn_mismatched_nullability_attr : Warning< 11099 "nullability specifier %0 conflicts with existing specifier %1">, 11100 InGroup<Nullability>; 11101 11102def warn_nullability_declspec : Warning< 11103 "nullability specifier %0 cannot be applied " 11104 "to non-pointer type %1; did you mean to apply the specifier to the " 11105 "%select{pointer|block pointer|member pointer|function pointer|" 11106 "member function pointer}2?">, 11107 InGroup<NullabilityDeclSpec>, 11108 DefaultError; 11109 11110def note_nullability_here : Note<"%0 specified here">; 11111 11112def err_nullability_nonpointer : Error< 11113 "nullability specifier %0 cannot be applied to non-pointer type %1">; 11114 11115def warn_nullability_lost : Warning< 11116 "implicit conversion from nullable pointer %0 to non-nullable pointer " 11117 "type %1">, 11118 InGroup<NullableToNonNullConversion>, DefaultIgnore; 11119def warn_zero_as_null_pointer_constant : Warning< 11120 "zero as null pointer constant">, 11121 InGroup<DiagGroup<"zero-as-null-pointer-constant">>, DefaultIgnore; 11122 11123def err_nullability_cs_multilevel : Error< 11124 "nullability keyword %0 cannot be applied to multi-level pointer type %1">; 11125def note_nullability_type_specifier : Note< 11126 "use nullability type specifier %0 to affect the innermost " 11127 "pointer type of %1">; 11128 11129def warn_null_resettable_setter : Warning< 11130 "synthesized setter %0 for null_resettable property %1 does not handle nil">, 11131 InGroup<Nullability>; 11132 11133def warn_nullability_missing : Warning< 11134 "%select{pointer|block pointer|member pointer}0 is missing a nullability " 11135 "type specifier (_Nonnull, _Nullable, or _Null_unspecified)">, 11136 InGroup<NullabilityCompleteness>; 11137def warn_nullability_missing_array : Warning< 11138 "array parameter is missing a nullability type specifier (_Nonnull, " 11139 "_Nullable, or _Null_unspecified)">, 11140 InGroup<NullabilityCompletenessOnArrays>; 11141def note_nullability_fix_it : Note< 11142 "insert '%select{_Nonnull|_Nullable|_Null_unspecified}0' if the " 11143 "%select{pointer|block pointer|member pointer|array parameter}1 " 11144 "%select{should never be null|may be null|should not declare nullability}0">; 11145 11146def warn_nullability_inferred_on_nested_type : Warning< 11147 "inferring '_Nonnull' for pointer type within %select{array|reference}0 is " 11148 "deprecated">, 11149 InGroup<NullabilityInferredOnNestedType>; 11150 11151def err_objc_type_arg_explicit_nullability : Error< 11152 "type argument %0 cannot explicitly specify nullability">; 11153 11154def err_objc_type_param_bound_explicit_nullability : Error< 11155 "type parameter %0 bound %1 cannot explicitly specify nullability">; 11156 11157} 11158 11159let CategoryName = "Generics Issue" in { 11160 11161def err_objc_type_param_bound_nonobject : Error< 11162 "type bound %0 for type parameter %1 is not an Objective-C pointer type">; 11163 11164def err_objc_type_param_bound_missing_pointer : Error< 11165 "missing '*' in type bound %0 for type parameter %1">; 11166def err_objc_type_param_bound_qualified : Error< 11167 "type bound %1 for type parameter %0 cannot be qualified with '%2'">; 11168 11169def err_objc_type_param_redecl : Error< 11170 "redeclaration of type parameter %0">; 11171 11172def err_objc_type_param_arity_mismatch : Error< 11173 "%select{forward class declaration|class definition|category|extension}0 has " 11174 "too %select{few|many}1 type parameters (expected %2, have %3)">; 11175 11176def err_objc_type_param_bound_conflict : Error< 11177 "type bound %0 for type parameter %1 conflicts with " 11178 "%select{implicit|previous}2 bound %3%select{for type parameter %5|}4">; 11179 11180def err_objc_type_param_variance_conflict : Error< 11181 "%select{in|co|contra}0variant type parameter %1 conflicts with previous " 11182 "%select{in|co|contra}2variant type parameter %3">; 11183 11184def note_objc_type_param_here : Note<"type parameter %0 declared here">; 11185 11186def err_objc_type_param_bound_missing : Error< 11187 "missing type bound %0 for type parameter %1 in %select{@interface|@class}2">; 11188 11189def err_objc_parameterized_category_nonclass : Error< 11190 "%select{extension|category}0 of non-parameterized class %1 cannot have type " 11191 "parameters">; 11192 11193def err_objc_parameterized_forward_class : Error< 11194 "forward declaration of non-parameterized class %0 cannot have type " 11195 "parameters">; 11196 11197def err_objc_parameterized_forward_class_first : Error< 11198 "class %0 previously declared with type parameters">; 11199 11200def err_objc_type_arg_missing_star : Error< 11201 "type argument %0 must be a pointer (requires a '*')">; 11202def err_objc_type_arg_qualified : Error< 11203 "type argument %0 cannot be qualified with '%1'">; 11204 11205def err_objc_type_arg_missing : Error< 11206 "no type or protocol named %0">; 11207 11208def err_objc_type_args_and_protocols : Error< 11209 "angle brackets contain both a %select{type|protocol}0 (%1) and a " 11210 "%select{protocol|type}0 (%2)">; 11211 11212def err_objc_type_args_non_class : Error< 11213 "type arguments cannot be applied to non-class type %0">; 11214 11215def err_objc_type_args_non_parameterized_class : Error< 11216 "type arguments cannot be applied to non-parameterized class %0">; 11217 11218def err_objc_type_args_specialized_class : Error< 11219 "type arguments cannot be applied to already-specialized class type %0">; 11220 11221def err_objc_type_args_wrong_arity : Error< 11222 "too %select{many|few}0 type arguments for class %1 (have %2, expected %3)">; 11223} 11224 11225def err_objc_type_arg_not_id_compatible : Error< 11226 "type argument %0 is neither an Objective-C object nor a block type">; 11227 11228def err_objc_type_arg_does_not_match_bound : Error< 11229 "type argument %0 does not satisfy the bound (%1) of type parameter %2">; 11230 11231def warn_objc_redundant_qualified_class_type : Warning< 11232 "parameterized class %0 already conforms to the protocols listed; did you " 11233 "forget a '*'?">, InGroup<ObjCProtocolQualifiers>; 11234 11235def warn_block_literal_attributes_on_omitted_return_type : Warning< 11236 "attribute %0 ignored, because it cannot be applied to omitted return type">, 11237 InGroup<IgnoredAttributes>; 11238 11239def warn_block_literal_qualifiers_on_omitted_return_type : Warning< 11240 "'%0' qualifier on omitted return type %1 has no effect">, 11241 InGroup<IgnoredQualifiers>; 11242 11243def warn_shadow_field : Warning< 11244 "%select{parameter|non-static data member}3 %0 %select{|of %1 }3shadows " 11245 "member inherited from type %2">, InGroup<ShadowField>, DefaultIgnore; 11246def note_shadow_field : Note<"declared here">; 11247 11248def err_multiversion_required_in_redecl : Error< 11249 "function declaration is missing %select{'target'|'cpu_specific' or " 11250 "'cpu_dispatch'}0 attribute in a multiversioned function">; 11251def note_multiversioning_caused_here : Note< 11252 "function multiversioning caused by this declaration">; 11253def err_multiversion_after_used : Error< 11254 "function declaration cannot become a multiversioned function after first " 11255 "usage">; 11256def err_bad_multiversion_option : Error< 11257 "function multiversioning doesn't support %select{feature|architecture}0 " 11258 "'%1'">; 11259def err_multiversion_duplicate : Error< 11260 "multiversioned function redeclarations require identical target attributes">; 11261def err_multiversion_noproto : Error< 11262 "multiversioned function must have a prototype">; 11263def err_multiversion_disallowed_other_attr 11264 : Error<"attribute " 11265 "'%select{|target|cpu_specific|cpu_dispatch|target_clones}0' " 11266 "multiversioning cannot be combined" 11267 " with attribute %1">; 11268def err_multiversion_mismatched_attrs 11269 : Error<"attributes on multiversioned functions must all match, attribute " 11270 "%0 %select{is missing|has different arguments}1">; 11271def err_multiversion_diff : Error< 11272 "multiversioned function declaration has a different %select{calling convention" 11273 "|return type|constexpr specification|inline specification|linkage|" 11274 "language linkage}0">; 11275def err_multiversion_doesnt_support 11276 : Error<"attribute " 11277 "'%select{|target|cpu_specific|cpu_dispatch|target_clones}0' " 11278 "multiversioned functions do not " 11279 "yet support %select{function templates|virtual functions|" 11280 "deduced return types|constructors|destructors|deleted functions|" 11281 "defaulted functions|constexpr functions|consteval " 11282 "function|lambdas}1">; 11283def err_multiversion_not_allowed_on_main : Error< 11284 "'main' cannot be a multiversioned function">; 11285def err_multiversion_not_supported : Error< 11286 "function multiversioning is not supported on the current target">; 11287def err_multiversion_types_mixed : Error< 11288 "multiversioning attributes cannot be combined">; 11289def err_cpu_dispatch_mismatch : Error< 11290 "'cpu_dispatch' function redeclared with different CPUs">; 11291def err_cpu_specific_multiple_defs : Error< 11292 "multiple 'cpu_specific' functions cannot specify the same CPU: %0">; 11293def warn_multiversion_duplicate_entries : Warning< 11294 "CPU list contains duplicate entries; attribute ignored">, 11295 InGroup<FunctionMultiVersioning>; 11296def warn_dispatch_body_ignored : Warning< 11297 "body of cpu_dispatch function will be ignored">, 11298 InGroup<FunctionMultiVersioning>; 11299def err_target_clone_must_have_default 11300 : Error<"'target_clones' multiversioning requires a default target">; 11301def err_target_clone_doesnt_match 11302 : Error<"'target_clones' attribute does not match previous declaration">; 11303def warn_target_clone_mixed_values 11304 : ExtWarn< 11305 "mixing 'target_clones' specifier mechanisms is permitted for GCC " 11306 "compatibility; use a comma separated sequence of string literals, " 11307 "or a string literal containing a comma-separated list of versions">, 11308 InGroup<TargetClonesMixedSpecifiers>; 11309def warn_target_clone_duplicate_options 11310 : Warning<"version list contains duplicate entries">, 11311 InGroup<FunctionMultiVersioning>; 11312 11313// three-way comparison operator diagnostics 11314def err_implied_comparison_category_type_not_found : Error< 11315 "cannot %select{use builtin operator '<=>'|default 'operator<=>'}1 " 11316 "because type '%0' was not found; include <compare>">; 11317def err_spaceship_argument_narrowing : Error< 11318 "argument to 'operator<=>' " 11319 "%select{cannot be narrowed from type %1 to %2|" 11320 "evaluates to %1, which cannot be narrowed to type %2}0">; 11321def err_std_compare_type_not_supported : Error< 11322 "standard library implementation of %0 is not supported; " 11323 "%select{member '%2' does not have expected form|" 11324 "member '%2' is missing|" 11325 "the type is not trivially copyable|" 11326 "the type does not have the expected form}1">; 11327def note_rewriting_operator_as_spaceship : Note< 11328 "while rewriting comparison as call to 'operator<=>' declared here">; 11329def err_three_way_vector_comparison : Error< 11330 "three-way comparison between vectors is not supported">; 11331 11332// Memory Tagging Extensions (MTE) diagnostics 11333def err_memtag_arg_null_or_pointer : Error< 11334 "%0 argument of MTE builtin function must be a null or a pointer (%1 invalid)">; 11335def err_memtag_any2arg_pointer : Error< 11336 "at least one argument of MTE builtin function must be a pointer (%0, %1 invalid)">; 11337def err_memtag_arg_must_be_pointer : Error< 11338 "%0 argument of MTE builtin function must be a pointer (%1 invalid)">; 11339def err_memtag_arg_must_be_integer : Error< 11340 "%0 argument of MTE builtin function must be an integer type (%1 invalid)">; 11341 11342def warn_dereference_of_noderef_type : Warning< 11343 "dereferencing %0; was declared with a 'noderef' type">, InGroup<NoDeref>; 11344def warn_dereference_of_noderef_type_no_decl : Warning< 11345 "dereferencing expression marked as 'noderef'">, InGroup<NoDeref>; 11346def warn_noderef_on_non_pointer_or_array : Warning< 11347 "'noderef' can only be used on an array or pointer type">, InGroup<IgnoredAttributes>; 11348def warn_noderef_to_dereferenceable_pointer : Warning< 11349 "casting to dereferenceable pointer removes 'noderef' attribute">, InGroup<NoDeref>; 11350 11351def err_builtin_launder_invalid_arg : Error< 11352 "%select{non-pointer|function pointer|void pointer}0 argument to " 11353 "'__builtin_launder' is not allowed">; 11354 11355def err_builtin_invalid_arg_type: Error < 11356 "%ordinal0 argument must be a " 11357 "%select{vector, integer or floating point type|matrix|" 11358 "pointer to a valid matrix element type|" 11359 "signed integer or floating point type|vector type}1 (was %2)">; 11360 11361def err_builtin_matrix_disabled: Error< 11362 "matrix types extension is disabled. Pass -fenable-matrix to enable it">; 11363def err_matrix_index_not_integer: Error< 11364 "matrix %select{row|column}0 index is not an integer">; 11365def err_matrix_index_outside_range: Error< 11366 "matrix %select{row|column}0 index is outside the allowed range [0, %1)">; 11367def err_matrix_incomplete_index: Error< 11368 "single subscript expressions are not allowed for matrix values">; 11369def err_matrix_separate_incomplete_index: Error< 11370 "matrix row and column subscripts cannot be separated by any expression">; 11371def err_matrix_subscript_comma: Error< 11372 "comma expressions are not allowed as indices in matrix subscript expressions">; 11373def err_builtin_matrix_scalar_unsigned_arg: Error< 11374 "%0 argument must be a constant unsigned integer expression">; 11375def err_builtin_matrix_pointer_arg_mismatch: Error< 11376 "the pointee of the 2nd argument must match the element type of the 1st argument (%0 != %1)">; 11377def err_builtin_matrix_store_to_const: Error< 11378 "cannot store matrix to read-only pointer">; 11379def err_builtin_matrix_stride_too_small: Error< 11380 "stride must be greater or equal to the number of rows">; 11381def err_builtin_matrix_invalid_dimension: Error< 11382 "%0 dimension is outside the allowed range [1, %1]">; 11383 11384def warn_mismatched_import : Warning< 11385 "import %select{module|name}0 (%1) does not match the import %select{module|name}0 (%2) of the " 11386 "previous declaration">, 11387 InGroup<IgnoredAttributes>; 11388def warn_import_on_definition : Warning< 11389 "import %select{module|name}0 cannot be applied to a function with a definition">, 11390 InGroup<IgnoredAttributes>; 11391 11392def err_preserve_field_info_not_field : Error< 11393 "__builtin_preserve_field_info argument %0 not a field access">; 11394def err_preserve_field_info_not_const: Error< 11395 "__builtin_preserve_field_info argument %0 not a constant">; 11396def err_btf_type_id_not_const: Error< 11397 "__builtin_btf_type_id argument %0 not a constant">; 11398def err_preserve_type_info_invalid : Error< 11399 "__builtin_preserve_type_info argument %0 invalid">; 11400def err_preserve_type_info_not_const: Error< 11401 "__builtin_preserve_type_info argument %0 not a constant">; 11402def err_preserve_enum_value_invalid : Error< 11403 "__builtin_preserve_enum_value argument %0 invalid">; 11404def err_preserve_enum_value_not_const: Error< 11405 "__builtin_preserve_enum_value argument %0 not a constant">; 11406 11407def err_bit_cast_non_trivially_copyable : Error< 11408 "__builtin_bit_cast %select{source|destination}0 type must be trivially copyable">; 11409def err_bit_cast_type_size_mismatch : Error< 11410 "__builtin_bit_cast source size does not equal destination size (%0 vs %1)">; 11411 11412// SYCL-specific diagnostics 11413def warn_sycl_kernel_num_of_template_params : Warning< 11414 "'sycl_kernel' attribute only applies to a function template with at least" 11415 " two template parameters">, InGroup<IgnoredAttributes>; 11416def warn_sycl_kernel_invalid_template_param_type : Warning< 11417 "template parameter of a function template with the 'sycl_kernel' attribute" 11418 " cannot be a non-type template parameter">, InGroup<IgnoredAttributes>; 11419def warn_sycl_kernel_num_of_function_params : Warning< 11420 "function template with 'sycl_kernel' attribute must have a single parameter">, 11421 InGroup<IgnoredAttributes>; 11422def warn_sycl_kernel_return_type : Warning< 11423 "function template with 'sycl_kernel' attribute must have a 'void' return type">, 11424 InGroup<IgnoredAttributes>; 11425 11426def err_ext_int_bad_size : Error<"%select{signed|unsigned}0 _ExtInt must " 11427 "have a bit size of at least %select{2|1}0">; 11428def err_ext_int_max_size : Error<"%select{signed|unsigned}0 _ExtInt of bit " 11429 "sizes greater than %1 not supported">; 11430 11431// errors of expect.with.probability 11432def err_probability_not_constant_float : Error< 11433 "probability argument to __builtin_expect_with_probability must be constant " 11434 "floating-point expression">; 11435def err_probability_out_of_range : Error< 11436 "probability argument to __builtin_expect_with_probability is outside the " 11437 "range [0.0, 1.0]">; 11438 11439// TCB warnings 11440def err_tcb_conflicting_attributes : Error< 11441 "attributes '%0(\"%2\")' and '%1(\"%2\")' are mutually exclusive">; 11442def warn_tcb_enforcement_violation : Warning< 11443 "calling %0 is a violation of trusted computing base '%1'">, 11444 InGroup<DiagGroup<"tcb-enforcement">>; 11445 11446// RISC-V builtin required extension warning 11447def err_riscv_builtin_requires_extension : Error< 11448 "builtin requires '%0' extension support to be enabled">; 11449def err_riscv_builtin_invalid_lmul : Error< 11450 "LMUL argument must be in the range [0,3] or [5,7]">; 11451} // end of sema component. 11452