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_target_attribute 2983 : Warning<"%select{unsupported|duplicate|unknown}0%select{| architecture|" 2984 " tune CPU}1 '%2' in the 'target' attribute string; 'target' " 2985 "attribute ignored">, 2986 InGroup<IgnoredAttributes>; 2987def err_attribute_unsupported 2988 : Error<"%0 attribute is not supported on targets missing %1;" 2989 " specify an appropriate -march= or -mcpu=">; 2990// The err_*_attribute_argument_not_int are separate because they're used by 2991// VerifyIntegerConstantExpression. 2992def err_aligned_attribute_argument_not_int : Error< 2993 "'aligned' attribute requires integer constant">; 2994def err_align_value_attribute_argument_not_int : Error< 2995 "'align_value' attribute requires integer constant">; 2996def err_alignas_attribute_wrong_decl_type : Error< 2997 "%0 attribute cannot be applied to a %select{function parameter|" 2998 "variable with 'register' storage class|'catch' variable|bit-field}1">; 2999def err_alignas_missing_on_definition : Error< 3000 "%0 must be specified on definition if it is specified on any declaration">; 3001def note_alignas_on_declaration : Note<"declared with %0 attribute here">; 3002def err_alignas_mismatch : Error< 3003 "redeclaration has different alignment requirement (%1 vs %0)">; 3004def err_alignas_underaligned : Error< 3005 "requested alignment is less than minimum alignment of %1 for type %0">; 3006def warn_aligned_attr_underaligned : Warning<err_alignas_underaligned.Text>, 3007 InGroup<IgnoredAttributes>; 3008def err_attribute_sizeless_type : Error< 3009 "%0 attribute cannot be applied to sizeless type %1">; 3010def err_attribute_argument_n_type : Error< 3011 "%0 attribute requires parameter %1 to be %select{int or bool|an integer " 3012 "constant|a string|an identifier|a constant expression}2">; 3013def err_attribute_argument_type : Error< 3014 "%0 attribute requires %select{int or bool|an integer " 3015 "constant|a string|an identifier}1">; 3016def err_attribute_argument_out_of_range : Error< 3017 "%0 attribute requires integer constant between %1 and %2 inclusive">; 3018def err_init_priority_object_attr : Error< 3019 "can only use 'init_priority' attribute on file-scope definitions " 3020 "of objects of class type">; 3021def err_attribute_argument_out_of_bounds : Error< 3022 "%0 attribute parameter %1 is out of bounds">; 3023def err_attribute_only_once_per_parameter : Error< 3024 "%0 attribute can only be applied once per parameter">; 3025def err_mismatched_uuid : Error<"uuid does not match previous declaration">; 3026def note_previous_uuid : Note<"previous uuid specified here">; 3027def warn_attribute_pointers_only : Warning< 3028 "%0 attribute only applies to%select{| constant}1 pointer arguments">, 3029 InGroup<IgnoredAttributes>; 3030def err_attribute_pointers_only : Error<warn_attribute_pointers_only.Text>; 3031def err_attribute_integers_only : Error< 3032 "%0 attribute argument may only refer to a function parameter of integer " 3033 "type">; 3034def warn_attribute_return_pointers_only : Warning< 3035 "%0 attribute only applies to return values that are pointers">, 3036 InGroup<IgnoredAttributes>; 3037def warn_attribute_return_pointers_refs_only : Warning< 3038 "%0 attribute only applies to return values that are pointers or references">, 3039 InGroup<IgnoredAttributes>; 3040def warn_attribute_pointer_or_reference_only : Warning< 3041 "%0 attribute only applies to a pointer or reference (%1 is invalid)">, 3042 InGroup<IgnoredAttributes>; 3043def err_attribute_no_member_pointers : Error< 3044 "%0 attribute cannot be used with pointers to members">; 3045def err_attribute_invalid_implicit_this_argument : Error< 3046 "%0 attribute is invalid for the implicit this argument">; 3047def err_ownership_type : Error< 3048 "%0 attribute only applies to %select{pointer|integer}1 arguments">; 3049def err_ownership_returns_index_mismatch : Error< 3050 "'ownership_returns' attribute index does not match; here it is %0">; 3051def note_ownership_returns_index_mismatch : Note< 3052 "declared with index %0 here">; 3053def err_format_strftime_third_parameter : Error< 3054 "strftime format attribute requires 3rd parameter to be 0">; 3055def err_format_attribute_requires_variadic : Error< 3056 "format attribute requires variadic function">; 3057def err_format_attribute_not : Error<"format argument not %0">; 3058def err_format_attribute_result_not : Error<"function does not return %0">; 3059def err_format_attribute_implicit_this_format_string : Error< 3060 "format attribute cannot specify the implicit this argument as the format " 3061 "string">; 3062def err_callback_attribute_no_callee : Error< 3063 "'callback' attribute specifies no callback callee">; 3064def err_callback_attribute_invalid_callee : Error< 3065 "'callback' attribute specifies invalid callback callee">; 3066def err_callback_attribute_multiple : Error< 3067 "multiple 'callback' attributes specified">; 3068def err_callback_attribute_argument_unknown : Error< 3069 "'callback' attribute argument %0 is not a known function parameter">; 3070def err_callback_callee_no_function_type : Error< 3071 "'callback' attribute callee does not have function type">; 3072def err_callback_callee_is_variadic : Error< 3073 "'callback' attribute callee may not be variadic">; 3074def err_callback_implicit_this_not_available : Error< 3075 "'callback' argument at position %0 references unavailable implicit 'this'">; 3076def err_init_method_bad_return_type : Error< 3077 "init methods must return an object pointer type, not %0">; 3078def err_attribute_invalid_size : Error< 3079 "vector size not an integral multiple of component size">; 3080def err_attribute_zero_size : Error<"zero %0 size">; 3081def err_attribute_size_too_large : Error<"%0 size too large">; 3082def err_typecheck_sve_ambiguous : Error< 3083 "cannot combine fixed-length and sizeless SVE vectors in expression, result is ambiguous (%0 and %1)">; 3084def err_typecheck_sve_gnu_ambiguous : Error< 3085 "cannot combine GNU and SVE vectors in expression, result is ambiguous (%0 and %1)">; 3086def err_typecheck_vector_not_convertable_implict_truncation : Error< 3087 "cannot convert between %select{scalar|vector}0 type %1 and vector type" 3088 " %2 as implicit conversion would cause truncation">; 3089def err_typecheck_vector_not_convertable : Error< 3090 "cannot convert between vector values of different size (%0 and %1)">; 3091def err_typecheck_vector_not_convertable_non_scalar : Error< 3092 "cannot convert between vector and non-scalar values (%0 and %1)">; 3093def err_typecheck_vector_lengths_not_equal : Error< 3094 "vector operands do not have the same number of elements (%0 and %1)">; 3095def warn_typecheck_vector_element_sizes_not_equal : Warning< 3096 "vector operands do not have the same elements sizes (%0 and %1)">, 3097 InGroup<DiagGroup<"vec-elem-size">>, DefaultError; 3098def err_ext_vector_component_exceeds_length : Error< 3099 "vector component access exceeds type %0">; 3100def err_ext_vector_component_name_illegal : Error< 3101 "illegal vector component name '%0'">; 3102def err_attribute_address_space_negative : Error< 3103 "address space is negative">; 3104def err_attribute_address_space_too_high : Error< 3105 "address space is larger than the maximum supported (%0)">; 3106def err_attribute_address_multiple_qualifiers : Error< 3107 "multiple address spaces specified for type">; 3108def warn_attribute_address_multiple_identical_qualifiers : Warning< 3109 "multiple identical address spaces specified for type">, 3110 InGroup<DuplicateDeclSpecifier>; 3111def err_attribute_not_clinkage : Error< 3112 "function type with %0 attribute must have C linkage">; 3113def err_function_decl_cmse_ns_call : Error< 3114 "functions may not be declared with 'cmse_nonsecure_call' attribute">; 3115def err_attribute_address_function_type : Error< 3116 "function type may not be qualified with an address space">; 3117def err_as_qualified_auto_decl : Error< 3118 "automatic variable qualified with an%select{| invalid}0 address space">; 3119def err_arg_with_address_space : Error< 3120 "parameter may not be qualified with an address space">; 3121def err_field_with_address_space : Error< 3122 "field may not be qualified with an address space">; 3123def err_compound_literal_with_address_space : Error< 3124 "compound literal in function scope may not be qualified with an address space">; 3125def err_address_space_mismatch_templ_inst : Error< 3126 "conflicting address space qualifiers are provided between types %0 and %1">; 3127def err_attr_objc_ownership_redundant : Error< 3128 "the type %0 is already explicitly ownership-qualified">; 3129def err_invalid_nsnumber_type : Error< 3130 "%0 is not a valid literal type for NSNumber">; 3131def err_objc_illegal_boxed_expression_type : Error< 3132 "illegal type %0 used in a boxed expression">; 3133def err_objc_non_trivially_copyable_boxed_expression_type : Error< 3134 "non-trivially copyable type %0 cannot be used in a boxed expression">; 3135def err_objc_incomplete_boxed_expression_type : Error< 3136 "incomplete type %0 used in a boxed expression">; 3137def err_undeclared_objc_literal_class : Error< 3138 "definition of class %0 must be available to use Objective-C " 3139 "%select{array literals|dictionary literals|numeric literals|boxed expressions|" 3140 "string literals}1">; 3141def err_undeclared_boxing_method : Error< 3142 "declaration of %0 is missing in %1 class">; 3143def err_objc_literal_method_sig : Error< 3144 "literal construction method %0 has incompatible signature">; 3145def note_objc_literal_method_param : Note< 3146 "%select{first|second|third}0 parameter has unexpected type %1 " 3147 "(should be %2)">; 3148def note_objc_literal_method_return : Note< 3149 "method returns unexpected type %0 (should be an object type)">; 3150def err_invalid_collection_element : Error< 3151 "collection element of type %0 is not an Objective-C object">; 3152def err_box_literal_collection : Error< 3153 "%select{string|character|boolean|numeric}0 literal must be prefixed by '@' " 3154 "in a collection">; 3155def warn_objc_literal_comparison : Warning< 3156 "direct comparison of %select{an array literal|a dictionary literal|" 3157 "a numeric literal|a boxed expression|}0 has undefined behavior">, 3158 InGroup<ObjCLiteralComparison>; 3159def err_missing_atsign_prefix : Error< 3160 "%select{string|numeric}0 literal must be prefixed by '@'">; 3161def warn_objc_string_literal_comparison : Warning< 3162 "direct comparison of a string literal has undefined behavior">, 3163 InGroup<ObjCStringComparison>; 3164def warn_concatenated_literal_array_init : Warning< 3165 "suspicious concatenation of string literals in an array initialization; " 3166 "did you mean to separate the elements with a comma?">, 3167 InGroup<StringConcatation>, DefaultIgnore; 3168def warn_concatenated_nsarray_literal : Warning< 3169 "concatenated NSString literal for an NSArray expression - " 3170 "possibly missing a comma">, 3171 InGroup<ObjCStringConcatenation>; 3172def note_objc_literal_comparison_isequal : Note< 3173 "use 'isEqual:' instead">; 3174def warn_objc_collection_literal_element : Warning< 3175 "object of type %0 is not compatible with " 3176 "%select{array element type|dictionary key type|dictionary value type}1 %2">, 3177 InGroup<ObjCLiteralConversion>; 3178def warn_nsdictionary_duplicate_key : Warning< 3179 "duplicate key in dictionary literal">, 3180 InGroup<DiagGroup<"objc-dictionary-duplicate-keys">>; 3181def note_nsdictionary_duplicate_key_here : Note< 3182 "previous equal key is here">; 3183def err_swift_param_attr_not_swiftcall : Error< 3184 "'%0' parameter can only be used with swiftcall%select{ or swiftasynccall|}1 " 3185 "calling convention%select{|s}1">; 3186def err_swift_indirect_result_not_first : Error< 3187 "'swift_indirect_result' parameters must be first parameters of function">; 3188def err_swift_error_result_not_after_swift_context : Error< 3189 "'swift_error_result' parameter must follow 'swift_context' parameter">; 3190def err_swift_abi_parameter_wrong_type : Error< 3191 "'%0' parameter must have pointer%select{| to unqualified pointer}1 type; " 3192 "type here is %2">; 3193 3194def err_attribute_argument_invalid : Error< 3195 "%0 attribute argument is invalid: %select{max must be 0 since min is 0|" 3196 "min must not be greater than max}1">; 3197def err_attribute_argument_is_zero : Error< 3198 "%0 attribute must be greater than 0">; 3199def warn_attribute_argument_n_negative : Warning< 3200 "%0 attribute parameter %1 is negative and will be ignored">, 3201 InGroup<CudaCompat>; 3202def err_property_function_in_objc_container : Error< 3203 "use of Objective-C property in function nested in Objective-C " 3204 "container not supported, move function outside its container">; 3205 3206let CategoryName = "Cocoa API Issue" in { 3207def warn_objc_redundant_literal_use : Warning< 3208 "using %0 with a literal is redundant">, InGroup<ObjCRedundantLiteralUse>; 3209} 3210 3211def err_attr_tlsmodel_arg : Error<"tls_model must be \"global-dynamic\", " 3212 "\"local-dynamic\", \"initial-exec\" or \"local-exec\"">; 3213 3214def err_aix_attr_unsupported_tls_model : Error<"TLS model '%0' is not yet supported on AIX">; 3215 3216def err_tls_var_aligned_over_maximum : Error< 3217 "alignment (%0) of thread-local variable %1 is greater than the maximum supported " 3218 "alignment (%2) for a thread-local variable on this target">; 3219 3220def err_only_annotate_after_access_spec : Error< 3221 "access specifier can only have annotation attributes">; 3222 3223def err_attribute_section_invalid_for_target : Error< 3224 "argument to %select{'code_seg'|'section'}1 attribute is not valid for this target: %0">; 3225def err_pragma_section_invalid_for_target : Error< 3226 "argument to #pragma section is not valid for this target: %0">; 3227def warn_attribute_section_drectve : Warning< 3228 "#pragma %0(\".drectve\") has undefined behavior, " 3229 "use #pragma comment(linker, ...) instead">, InGroup<MicrosoftDrectveSection>; 3230def warn_mismatched_section : Warning< 3231 "%select{codeseg|section}0 does not match previous declaration">, InGroup<Section>; 3232def warn_attribute_section_on_redeclaration : Warning< 3233 "section attribute is specified on redeclared variable">, InGroup<Section>; 3234def err_mismatched_code_seg_base : Error< 3235 "derived class must specify the same code segment as its base classes">; 3236def err_mismatched_code_seg_override : Error< 3237 "overriding virtual function must specify the same code segment as its overridden function">; 3238def err_conflicting_codeseg_attribute : Error< 3239 "conflicting code segment specifiers">; 3240def warn_duplicate_codeseg_attribute : Warning< 3241 "duplicate code segment specifiers">, InGroup<Section>; 3242 3243def err_anonymous_property: Error< 3244 "anonymous property is not supported">; 3245def err_property_is_variably_modified : Error< 3246 "property %0 has a variably modified type">; 3247def err_no_accessor_for_property : Error< 3248 "no %select{getter|setter}0 defined for property %1">; 3249def err_cannot_find_suitable_accessor : Error< 3250 "cannot find suitable %select{getter|setter}0 for property %1">; 3251 3252def warn_alloca : Warning< 3253 "use of function %0 is discouraged; there is no way to check for failure but " 3254 "failure may still occur, resulting in a possibly exploitable security vulnerability">, 3255 InGroup<DiagGroup<"alloca">>, DefaultIgnore; 3256 3257def warn_alloca_align_alignof : Warning< 3258 "second argument to __builtin_alloca_with_align is supposed to be in bits">, 3259 InGroup<DiagGroup<"alloca-with-align-alignof">>; 3260 3261def err_alignment_too_small : Error< 3262 "requested alignment must be %0 or greater">; 3263def err_alignment_too_big : Error< 3264 "requested alignment must be %0 or smaller">; 3265def err_alignment_not_power_of_two : Error< 3266 "requested alignment is not a power of 2">; 3267def warn_alignment_not_power_of_two : Warning< 3268 err_alignment_not_power_of_two.Text>, 3269 InGroup<DiagGroup<"non-power-of-two-alignment">>; 3270def err_alignment_dependent_typedef_name : Error< 3271 "requested alignment is dependent but declaration is not dependent">; 3272 3273def warn_alignment_builtin_useless : Warning< 3274 "%select{aligning a value|the result of checking whether a value is aligned}0" 3275 " to 1 byte is %select{a no-op|always true}0">, InGroup<TautologicalCompare>; 3276def err_attribute_aligned_too_great : Error< 3277 "requested alignment must be %0 bytes or smaller">; 3278def warn_assume_aligned_too_great 3279 : Warning<"requested alignment must be %0 bytes or smaller; maximum " 3280 "alignment assumed">, 3281 InGroup<DiagGroup<"builtin-assume-aligned-alignment">>; 3282def warn_not_xl_compatible 3283 : Warning<"requesting an alignment of 16 bytes or greater for struct" 3284 " members is not binary compatible with IBM XL C/C++ for AIX" 3285 " 16.1.0 and older">, 3286 InGroup<AIXCompat>; 3287def warn_redeclaration_without_attribute_prev_attribute_ignored : Warning< 3288 "%q0 redeclared without %1 attribute: previous %1 ignored">, 3289 InGroup<MicrosoftInconsistentDllImport>; 3290def warn_redeclaration_without_import_attribute : Warning< 3291 "%q0 redeclared without 'dllimport' attribute: 'dllexport' attribute added">, 3292 InGroup<MicrosoftInconsistentDllImport>; 3293def warn_dllimport_dropped_from_inline_function : Warning< 3294 "%q0 redeclared inline; %1 attribute ignored">, 3295 InGroup<IgnoredAttributes>; 3296def warn_attribute_ignored : Warning<"%0 attribute ignored">, 3297 InGroup<IgnoredAttributes>; 3298def warn_nothrow_attribute_ignored : Warning<"'nothrow' attribute conflicts with" 3299 " exception specification; attribute ignored">, 3300 InGroup<IgnoredAttributes>; 3301def warn_attribute_ignored_on_non_definition : 3302 Warning<"%0 attribute ignored on a non-definition declaration">, 3303 InGroup<IgnoredAttributes>; 3304def warn_attribute_ignored_on_inline : 3305 Warning<"%0 attribute ignored on inline function">, 3306 InGroup<IgnoredAttributes>; 3307def warn_nocf_check_attribute_ignored : 3308 Warning<"'nocf_check' attribute ignored; use -fcf-protection to enable the attribute">, 3309 InGroup<IgnoredAttributes>; 3310def warn_attribute_after_definition_ignored : Warning< 3311 "attribute %0 after definition is ignored">, 3312 InGroup<IgnoredAttributes>; 3313def warn_attributes_likelihood_ifstmt_conflict 3314 : Warning<"conflicting attributes %0 are ignored">, 3315 InGroup<IgnoredAttributes>; 3316def warn_cxx11_gnu_attribute_on_type : Warning< 3317 "attribute %0 ignored, because it cannot be applied to a type">, 3318 InGroup<IgnoredAttributes>; 3319def warn_unhandled_ms_attribute_ignored : Warning< 3320 "__declspec attribute %0 is not supported">, 3321 InGroup<IgnoredAttributes>; 3322def warn_attribute_has_no_effect_on_infinite_loop : Warning< 3323 "attribute %0 has no effect when annotating an infinite loop">, 3324 InGroup<IgnoredAttributes>; 3325def note_attribute_has_no_effect_on_infinite_loop_here : Note< 3326 "annotating the infinite loop here">; 3327def warn_attribute_has_no_effect_on_compile_time_if : Warning< 3328 "attribute %0 has no effect when annotating an 'if %select{constexpr|consteval}1' statement">, 3329 InGroup<IgnoredAttributes>; 3330def note_attribute_has_no_effect_on_compile_time_if_here : Note< 3331 "annotating the 'if %select{constexpr|consteval}0' statement here">; 3332def err_decl_attribute_invalid_on_stmt : Error< 3333 "%0 attribute cannot be applied to a statement">; 3334def err_stmt_attribute_invalid_on_decl : Error< 3335 "%0 attribute cannot be applied to a declaration">; 3336def warn_declspec_attribute_ignored : Warning< 3337 "attribute %0 is ignored, place it after " 3338 "\"%select{class|struct|interface|union|enum}1\" to apply attribute to " 3339 "type declaration">, InGroup<IgnoredAttributes>; 3340def warn_attribute_precede_definition : Warning< 3341 "attribute declaration must precede definition">, 3342 InGroup<IgnoredAttributes>; 3343def warn_attribute_void_function_method : Warning< 3344 "attribute %0 cannot be applied to " 3345 "%select{functions|Objective-C method}1 without return value">, 3346 InGroup<IgnoredAttributes>; 3347def warn_attribute_weak_on_field : Warning< 3348 "__weak attribute cannot be specified on a field declaration">, 3349 InGroup<IgnoredAttributes>; 3350def warn_gc_attribute_weak_on_local : Warning< 3351 "Objective-C GC does not allow weak variables on the stack">, 3352 InGroup<IgnoredAttributes>; 3353def warn_nsobject_attribute : Warning< 3354 "'NSObject' attribute may be put on a typedef only; attribute is ignored">, 3355 InGroup<NSobjectAttribute>; 3356def warn_independentclass_attribute : Warning< 3357 "'objc_independent_class' attribute may be put on a typedef only; " 3358 "attribute is ignored">, 3359 InGroup<IndependentClassAttribute>; 3360def warn_ptr_independentclass_attribute : Warning< 3361 "'objc_independent_class' attribute may be put on Objective-C object " 3362 "pointer type only; attribute is ignored">, 3363 InGroup<IndependentClassAttribute>; 3364def warn_attribute_weak_on_local : Warning< 3365 "__weak attribute cannot be specified on an automatic variable when ARC " 3366 "is not enabled">, 3367 InGroup<IgnoredAttributes>; 3368def warn_weak_identifier_undeclared : Warning< 3369 "weak identifier %0 never declared">; 3370def warn_attribute_cmse_entry_static : Warning< 3371 "'cmse_nonsecure_entry' cannot be applied to functions with internal linkage">, 3372 InGroup<IgnoredAttributes>; 3373def warn_cmse_nonsecure_union : Warning< 3374 "passing union across security boundary via %select{parameter %1|return value}0 " 3375 "may leak information">, 3376 InGroup<DiagGroup<"cmse-union-leak">>; 3377def err_attribute_weak_static : Error< 3378 "weak declaration cannot have internal linkage">; 3379def err_attribute_selectany_non_extern_data : Error< 3380 "'selectany' can only be applied to data items with external linkage">; 3381def err_declspec_thread_on_thread_variable : Error< 3382 "'__declspec(thread)' applied to variable that already has a " 3383 "thread-local storage specifier">; 3384def err_attribute_dll_not_extern : Error< 3385 "%q0 must have external linkage when declared %q1">; 3386def err_attribute_dll_thread_local : Error< 3387 "%q0 cannot be thread local when declared %q1">; 3388def err_attribute_dll_lambda : Error< 3389 "lambda cannot be declared %0">; 3390def warn_attribute_invalid_on_definition : Warning< 3391 "'%0' attribute cannot be specified on a definition">, 3392 InGroup<IgnoredAttributes>; 3393def err_attribute_dll_redeclaration : Error< 3394 "redeclaration of %q0 cannot add %q1 attribute">; 3395def warn_attribute_dll_redeclaration : Warning< 3396 "redeclaration of %q0 should not add %q1 attribute">, 3397 InGroup<DiagGroup<"dll-attribute-on-redeclaration">>; 3398def err_attribute_dllimport_function_definition : Error< 3399 "dllimport cannot be applied to non-inline function definition">; 3400def err_attribute_dll_deleted : Error< 3401 "attribute %q0 cannot be applied to a deleted function">; 3402def err_attribute_dllimport_data_definition : Error< 3403 "definition of dllimport data">; 3404def err_attribute_dllimport_static_field_definition : Error< 3405 "definition of dllimport static field not allowed">; 3406def warn_attribute_dllimport_static_field_definition : Warning< 3407 "definition of dllimport static field">, 3408 InGroup<DiagGroup<"dllimport-static-field-def">>; 3409def warn_attribute_dllexport_explicit_instantiation_decl : Warning< 3410 "explicit instantiation declaration should not be 'dllexport'">, 3411 InGroup<DllexportExplicitInstantiationDecl>; 3412def warn_attribute_dllexport_explicit_instantiation_def : Warning< 3413 "'dllexport' attribute ignored on explicit instantiation definition">, 3414 InGroup<IgnoredAttributes>; 3415def warn_invalid_initializer_from_system_header : Warning< 3416 "invalid constructor from class in system header, should not be explicit">, 3417 InGroup<DiagGroup<"invalid-initializer-from-system-header">>; 3418def note_used_in_initialization_here : Note<"used in initialization here">; 3419def err_attribute_dll_member_of_dll_class : Error< 3420 "attribute %q0 cannot be applied to member of %q1 class">; 3421def warn_attribute_dll_instantiated_base_class : Warning< 3422 "propagating dll attribute to %select{already instantiated|explicitly specialized}0 " 3423 "base class template without dll attribute is not supported">, 3424 InGroup<DiagGroup<"unsupported-dll-base-class-template">>, DefaultIgnore; 3425def err_attribute_dll_ambiguous_default_ctor : Error< 3426 "'__declspec(dllexport)' cannot be applied to more than one default constructor in %0">; 3427def err_attribute_weakref_not_static : Error< 3428 "weakref declaration must have internal linkage">; 3429def err_attribute_weakref_not_global_context : Error< 3430 "weakref declaration of %0 must be in a global context">; 3431def err_attribute_weakref_without_alias : Error< 3432 "weakref declaration of %0 must also have an alias attribute">; 3433def err_alias_not_supported_on_darwin : Error < 3434 "aliases are not supported on darwin">; 3435def warn_attribute_wrong_decl_type_str : Warning< 3436 "%0 attribute only applies to %1">, InGroup<IgnoredAttributes>; 3437def err_attribute_wrong_decl_type_str : Error< 3438 warn_attribute_wrong_decl_type_str.Text>; 3439def warn_attribute_wrong_decl_type : Warning< 3440 "%0 attribute only applies to %select{" 3441 "functions" 3442 "|unions" 3443 "|variables and functions" 3444 "|functions and methods" 3445 "|functions, methods and blocks" 3446 "|functions, methods, and parameters" 3447 "|variables" 3448 "|variables and fields" 3449 "|variables, data members and tag types" 3450 "|types and namespaces" 3451 "|variables, functions and classes" 3452 "|kernel functions" 3453 "|non-K&R-style functions}1">, 3454 InGroup<IgnoredAttributes>; 3455def err_attribute_wrong_decl_type : Error<warn_attribute_wrong_decl_type.Text>; 3456def warn_type_attribute_wrong_type : Warning< 3457 "'%0' only applies to %select{function|pointer|" 3458 "Objective-C object or block pointer}1 types; type here is %2">, 3459 InGroup<IgnoredAttributes>; 3460def warn_incomplete_encoded_type : Warning< 3461 "encoding of %0 type is incomplete because %1 component has unknown encoding">, 3462 InGroup<DiagGroup<"encode-type">>; 3463def warn_gnu_inline_attribute_requires_inline : Warning< 3464 "'gnu_inline' attribute requires function to be marked 'inline'," 3465 " attribute ignored">, 3466 InGroup<IgnoredAttributes>; 3467def warn_gnu_inline_cplusplus_without_extern : Warning< 3468 "'gnu_inline' attribute without 'extern' in C++ treated as externally" 3469 " available, this changed in Clang 10">, 3470 InGroup<DiagGroup<"gnu-inline-cpp-without-extern">>; 3471def err_attribute_vecreturn_only_vector_member : Error< 3472 "the vecreturn attribute can only be used on a class or structure with one member, which must be a vector">; 3473def err_attribute_vecreturn_only_pod_record : Error< 3474 "the vecreturn attribute can only be used on a POD (plain old data) class or structure (i.e. no virtual functions)">; 3475def err_cconv_change : Error< 3476 "function declared '%0' here was previously declared " 3477 "%select{'%2'|without calling convention}1">; 3478def warn_cconv_unsupported : Warning< 3479 "%0 calling convention is not supported %select{" 3480 // Use CallingConventionIgnoredReason Enum to specify these. 3481 "for this target" 3482 "|on variadic function" 3483 "|on constructor/destructor" 3484 "|on builtin function" 3485 "}1">, 3486 InGroup<IgnoredAttributes>; 3487def error_cconv_unsupported : Error<warn_cconv_unsupported.Text>; 3488def err_cconv_knr : Error< 3489 "function with no prototype cannot use the %0 calling convention">; 3490def warn_cconv_knr : Warning< 3491 err_cconv_knr.Text>, 3492 InGroup<DiagGroup<"missing-prototype-for-cc">>; 3493def err_cconv_varargs : Error< 3494 "variadic function cannot use %0 calling convention">; 3495def err_regparm_mismatch : Error<"function declared with regparm(%0) " 3496 "attribute was previously declared " 3497 "%plural{0:without the regparm|:with the regparm(%1)}1 attribute">; 3498def err_function_attribute_mismatch : Error< 3499 "function declared with %0 attribute " 3500 "was previously declared without the %0 attribute">; 3501def err_objc_precise_lifetime_bad_type : Error< 3502 "objc_precise_lifetime only applies to retainable types; type here is %0">; 3503def warn_objc_precise_lifetime_meaningless : Error< 3504 "objc_precise_lifetime is not meaningful for " 3505 "%select{__unsafe_unretained|__autoreleasing}0 objects">; 3506def err_invalid_pcs : Error<"invalid PCS type">; 3507def warn_attribute_not_on_decl : Warning< 3508 "%0 attribute ignored when parsing type">, InGroup<IgnoredAttributes>; 3509def err_base_specifier_attribute : Error< 3510 "%0 attribute cannot be applied to a base specifier">; 3511def err_invalid_attribute_on_virtual_function : Error< 3512 "%0 attribute cannot be applied to virtual functions">; 3513def warn_declspec_allocator_nonpointer : Warning< 3514 "ignoring __declspec(allocator) because the function return type %0 is not " 3515 "a pointer or reference type">, InGroup<IgnoredAttributes>; 3516def err_cconv_incomplete_param_type : Error< 3517 "parameter %0 must have a complete type to use function %1 with the %2 " 3518 "calling convention">; 3519def err_attribute_output_parameter : Error< 3520 "attribute only applies to output parameters">; 3521 3522def ext_cannot_use_trivial_abi : ExtWarn< 3523 "'trivial_abi' cannot be applied to %0">, InGroup<IgnoredAttributes>; 3524def note_cannot_use_trivial_abi_reason : Note< 3525 "'trivial_abi' is disallowed on %0 because %select{" 3526 "its copy constructors and move constructors are all deleted|" 3527 "it is polymorphic|" 3528 "it has a base of a non-trivial class type|it has a virtual base|" 3529 "it has a __weak field|it has a field of a non-trivial class type}1">; 3530 3531// Availability attribute 3532def warn_availability_unknown_platform : Warning< 3533 "unknown platform %0 in availability macro">, InGroup<Availability>; 3534def warn_availability_version_ordering : Warning< 3535 "feature cannot be %select{introduced|deprecated|obsoleted}0 in %1 version " 3536 "%2 before it was %select{introduced|deprecated|obsoleted}3 in version %4; " 3537 "attribute ignored">, InGroup<Availability>; 3538def warn_mismatched_availability: Warning< 3539 "availability does not match previous declaration">, InGroup<Availability>; 3540def warn_mismatched_availability_override : Warning< 3541 "%select{|overriding }4method %select{introduced after|" 3542 "deprecated before|obsoleted before}0 " 3543 "%select{the protocol method it implements|overridden method}4 " 3544 "on %1 (%2 vs. %3)">, InGroup<Availability>; 3545def warn_mismatched_availability_override_unavail : Warning< 3546 "%select{|overriding }1method cannot be unavailable on %0 when " 3547 "%select{the protocol method it implements|its overridden method}1 is " 3548 "available">, 3549 InGroup<Availability>; 3550def warn_availability_on_static_initializer : Warning< 3551 "ignoring availability attribute %select{on '+load' method|" 3552 "with constructor attribute|with destructor attribute}0">, 3553 InGroup<Availability>; 3554def note_overridden_method : Note< 3555 "overridden method is here">; 3556def warn_availability_swift_unavailable_deprecated_only : Warning< 3557 "only 'unavailable' and 'deprecated' are supported for Swift availability">, 3558 InGroup<Availability>; 3559def note_protocol_method : Note< 3560 "protocol method is here">; 3561def warn_availability_fuchsia_unavailable_minor : Warning< 3562 "Fuchsia API Level prohibits specifying a minor or sub-minor version">, 3563 InGroup<Availability>; 3564 3565def warn_unguarded_availability : 3566 Warning<"%0 is only available on %1 %2 or newer">, 3567 InGroup<UnguardedAvailability>, DefaultIgnore; 3568def warn_unguarded_availability_new : 3569 Warning<warn_unguarded_availability.Text>, 3570 InGroup<UnguardedAvailabilityNew>; 3571def note_decl_unguarded_availability_silence : Note< 3572 "annotate %select{%1|anonymous %1}0 with an availability attribute to silence this warning">; 3573def note_unguarded_available_silence : Note< 3574 "enclose %0 in %select{an @available|a __builtin_available}1 check to silence" 3575 " this warning">; 3576def warn_at_available_unchecked_use : Warning< 3577 "%select{@available|__builtin_available}0 does not guard availability here; " 3578 "use if (%select{@available|__builtin_available}0) instead">, 3579 InGroup<DiagGroup<"unsupported-availability-guard">>; 3580 3581def warn_missing_sdksettings_for_availability_checking : Warning< 3582 "%0 availability is ignored without a valid 'SDKSettings.json' in the SDK">, 3583 InGroup<DiagGroup<"ignored-availability-without-sdk-settings">>; 3584 3585// Thread Safety Attributes 3586def warn_thread_attribute_ignored : Warning< 3587 "ignoring %0 attribute because its argument is invalid">, 3588 InGroup<ThreadSafetyAttributes>, DefaultIgnore; 3589def warn_thread_attribute_not_on_non_static_member : Warning< 3590 "%0 attribute without capability arguments can only be applied to non-static " 3591 "methods of a class">, 3592 InGroup<ThreadSafetyAttributes>, DefaultIgnore; 3593def warn_thread_attribute_not_on_capability_member : Warning< 3594 "%0 attribute without capability arguments refers to 'this', but %1 isn't " 3595 "annotated with 'capability' or 'scoped_lockable' attribute">, 3596 InGroup<ThreadSafetyAttributes>, DefaultIgnore; 3597def warn_thread_attribute_argument_not_lockable : Warning< 3598 "%0 attribute requires arguments whose type is annotated " 3599 "with 'capability' attribute; type here is %1">, 3600 InGroup<ThreadSafetyAttributes>, DefaultIgnore; 3601def warn_thread_attribute_decl_not_lockable : Warning< 3602 "%0 attribute can only be applied in a context annotated " 3603 "with 'capability' attribute">, 3604 InGroup<ThreadSafetyAttributes>, DefaultIgnore; 3605def warn_thread_attribute_decl_not_pointer : Warning< 3606 "%0 only applies to pointer types; type here is %1">, 3607 InGroup<ThreadSafetyAttributes>, DefaultIgnore; 3608def err_attribute_argument_out_of_bounds_extra_info : Error< 3609 "%0 attribute parameter %1 is out of bounds: " 3610 "%plural{0:no parameters to index into|" 3611 "1:can only be 1, since there is one parameter|" 3612 ":must be between 1 and %2}2">; 3613 3614// Thread Safety Analysis 3615def warn_unlock_but_no_lock : Warning<"releasing %0 '%1' that was not held">, 3616 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3617def warn_unlock_kind_mismatch : Warning< 3618 "releasing %0 '%1' using %select{shared|exclusive}2 access, expected " 3619 "%select{shared|exclusive}3 access">, 3620 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3621def warn_double_lock : Warning<"acquiring %0 '%1' that is already held">, 3622 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3623def warn_no_unlock : Warning< 3624 "%0 '%1' is still held at the end of function">, 3625 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3626def warn_expecting_locked : Warning< 3627 "expecting %0 '%1' to be held at the end of function">, 3628 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3629// FIXME: improve the error message about locks not in scope 3630def warn_lock_some_predecessors : Warning< 3631 "%0 '%1' is not held on every path through here">, 3632 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3633def warn_expecting_lock_held_on_loop : Warning< 3634 "expecting %0 '%1' to be held at start of each loop">, 3635 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3636def note_locked_here : Note<"%0 acquired here">; 3637def note_unlocked_here : Note<"%0 released here">; 3638def warn_lock_exclusive_and_shared : Warning< 3639 "%0 '%1' is acquired exclusively and shared in the same scope">, 3640 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3641def note_lock_exclusive_and_shared : Note< 3642 "the other acquisition of %0 '%1' is here">; 3643def warn_variable_requires_any_lock : Warning< 3644 "%select{reading|writing}1 variable %0 requires holding " 3645 "%select{any mutex|any mutex exclusively}1">, 3646 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3647def warn_var_deref_requires_any_lock : Warning< 3648 "%select{reading|writing}1 the value pointed to by %0 requires holding " 3649 "%select{any mutex|any mutex exclusively}1">, 3650 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3651def warn_fun_excludes_mutex : Warning< 3652 "cannot call function '%1' while %0 '%2' is held">, 3653 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3654def warn_cannot_resolve_lock : Warning< 3655 "cannot resolve lock expression">, 3656 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3657def warn_acquired_before : Warning< 3658 "%0 '%1' must be acquired before '%2'">, 3659 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3660def warn_acquired_before_after_cycle : Warning< 3661 "Cycle in acquired_before/after dependencies, starting with '%0'">, 3662 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3663 3664 3665// Thread safety warnings negative capabilities 3666def warn_acquire_requires_negative_cap : Warning< 3667 "acquiring %0 '%1' requires negative capability '%2'">, 3668 InGroup<ThreadSafetyNegative>, DefaultIgnore; 3669def warn_fun_requires_negative_cap : Warning< 3670 "calling function %0 requires negative capability '%1'">, 3671 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3672 3673// Thread safety warnings on pass by reference 3674def warn_guarded_pass_by_reference : Warning< 3675 "passing variable %1 by reference requires holding %0 " 3676 "%select{'%2'|'%2' exclusively}3">, 3677 InGroup<ThreadSafetyReference>, DefaultIgnore; 3678def warn_pt_guarded_pass_by_reference : Warning< 3679 "passing the value that %1 points to by reference requires holding %0 " 3680 "%select{'%2'|'%2' exclusively}3">, 3681 InGroup<ThreadSafetyReference>, DefaultIgnore; 3682 3683// Imprecise thread safety warnings 3684def warn_variable_requires_lock : Warning< 3685 "%select{reading|writing}3 variable %1 requires holding %0 " 3686 "%select{'%2'|'%2' exclusively}3">, 3687 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3688def warn_var_deref_requires_lock : Warning< 3689 "%select{reading|writing}3 the value pointed to by %1 requires " 3690 "holding %0 %select{'%2'|'%2' exclusively}3">, 3691 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3692def warn_fun_requires_lock : Warning< 3693 "calling function %1 requires holding %0 %select{'%2'|'%2' exclusively}3">, 3694 InGroup<ThreadSafetyAnalysis>, DefaultIgnore; 3695 3696// Precise thread safety warnings 3697def warn_variable_requires_lock_precise : 3698 Warning<warn_variable_requires_lock.Text>, 3699 InGroup<ThreadSafetyPrecise>, DefaultIgnore; 3700def warn_var_deref_requires_lock_precise : 3701 Warning<warn_var_deref_requires_lock.Text>, 3702 InGroup<ThreadSafetyPrecise>, DefaultIgnore; 3703def warn_fun_requires_lock_precise : 3704 Warning<warn_fun_requires_lock.Text>, 3705 InGroup<ThreadSafetyPrecise>, DefaultIgnore; 3706def note_found_mutex_near_match : Note<"found near match '%0'">; 3707 3708// Verbose thread safety warnings 3709def warn_thread_safety_verbose : Warning<"thread safety verbose warning">, 3710 InGroup<ThreadSafetyVerbose>, DefaultIgnore; 3711def note_thread_warning_in_fun : Note<"thread warning in function %0">; 3712def note_guarded_by_declared_here : Note<"guarded_by declared here">; 3713 3714// Dummy warning that will trigger "beta" warnings from the analysis if enabled. 3715def warn_thread_safety_beta : Warning<"thread safety beta warning">, 3716 InGroup<ThreadSafetyBeta>, DefaultIgnore; 3717 3718// Consumed warnings 3719def warn_use_in_invalid_state : Warning< 3720 "invalid invocation of method '%0' on object '%1' while it is in the '%2' " 3721 "state">, InGroup<Consumed>, DefaultIgnore; 3722def warn_use_of_temp_in_invalid_state : Warning< 3723 "invalid invocation of method '%0' on a temporary object while it is in the " 3724 "'%1' state">, InGroup<Consumed>, DefaultIgnore; 3725def warn_attr_on_unconsumable_class : Warning< 3726 "consumed analysis attribute is attached to member of class %0 which isn't " 3727 "marked as consumable">, InGroup<Consumed>, DefaultIgnore; 3728def warn_return_typestate_for_unconsumable_type : Warning< 3729 "return state set for an unconsumable type '%0'">, InGroup<Consumed>, 3730 DefaultIgnore; 3731def warn_return_typestate_mismatch : Warning< 3732 "return value not in expected state; expected '%0', observed '%1'">, 3733 InGroup<Consumed>, DefaultIgnore; 3734def warn_loop_state_mismatch : Warning< 3735 "state of variable '%0' must match at the entry and exit of loop">, 3736 InGroup<Consumed>, DefaultIgnore; 3737def warn_param_return_typestate_mismatch : Warning< 3738 "parameter '%0' not in expected state when the function returns: expected " 3739 "'%1', observed '%2'">, InGroup<Consumed>, DefaultIgnore; 3740def warn_param_typestate_mismatch : Warning< 3741 "argument not in expected state; expected '%0', observed '%1'">, 3742 InGroup<Consumed>, DefaultIgnore; 3743 3744// no_sanitize attribute 3745def warn_unknown_sanitizer_ignored : Warning< 3746 "unknown sanitizer '%0' ignored">, InGroup<UnknownSanitizers>; 3747 3748def warn_impcast_vector_scalar : Warning< 3749 "implicit conversion turns vector to scalar: %0 to %1">, 3750 InGroup<Conversion>, DefaultIgnore; 3751def warn_impcast_complex_scalar : Warning< 3752 "implicit conversion discards imaginary component: %0 to %1">, 3753 InGroup<Conversion>, DefaultIgnore; 3754def err_impcast_complex_scalar : Error< 3755 "implicit conversion from %0 to %1 is not permitted in C++">; 3756def warn_impcast_float_precision : Warning< 3757 "implicit conversion loses floating-point precision: %0 to %1">, 3758 InGroup<ImplicitFloatConversion>, DefaultIgnore; 3759def warn_impcast_float_result_precision : Warning< 3760 "implicit conversion when assigning computation result loses floating-point precision: %0 to %1">, 3761 InGroup<ImplicitFloatConversion>, DefaultIgnore; 3762def warn_impcast_double_promotion : Warning< 3763 "implicit conversion increases floating-point precision: %0 to %1">, 3764 InGroup<DoublePromotion>, DefaultIgnore; 3765def warn_impcast_integer_sign : Warning< 3766 "implicit conversion changes signedness: %0 to %1">, 3767 InGroup<SignConversion>, DefaultIgnore; 3768def warn_impcast_integer_sign_conditional : Warning< 3769 "operand of ? changes signedness: %0 to %1">, 3770 InGroup<SignConversion>, DefaultIgnore; 3771def warn_impcast_integer_precision : Warning< 3772 "implicit conversion loses integer precision: %0 to %1">, 3773 InGroup<ImplicitIntConversion>, DefaultIgnore; 3774def warn_impcast_high_order_zero_bits : Warning< 3775 "higher order bits are zeroes after implicit conversion">, 3776 InGroup<ImplicitIntConversion>, DefaultIgnore; 3777def warn_impcast_nonnegative_result : Warning< 3778 "the resulting value is always non-negative after implicit conversion">, 3779 InGroup<SignConversion>, DefaultIgnore; 3780def warn_impcast_integer_64_32 : Warning< 3781 "implicit conversion loses integer precision: %0 to %1">, 3782 InGroup<Shorten64To32>, DefaultIgnore; 3783def warn_impcast_integer_precision_constant : Warning< 3784 "implicit conversion from %2 to %3 changes value from %0 to %1">, 3785 InGroup<ConstantConversion>; 3786def warn_impcast_bitfield_precision_constant : Warning< 3787 "implicit truncation from %2 to bit-field changes value from %0 to %1">, 3788 InGroup<BitFieldConstantConversion>; 3789def warn_impcast_constant_value_to_objc_bool : Warning< 3790 "implicit conversion from constant value %0 to 'BOOL'; " 3791 "the only well defined values for 'BOOL' are YES and NO">, 3792 InGroup<ObjCBoolConstantConversion>; 3793 3794def warn_impcast_fixed_point_range : Warning< 3795 "implicit conversion from %0 cannot fit within the range of values for %1">, 3796 InGroup<ImplicitFixedPointConversion>; 3797 3798def warn_impcast_literal_float_to_integer : Warning< 3799 "implicit conversion from %0 to %1 changes value from %2 to %3">, 3800 InGroup<LiteralConversion>; 3801def warn_impcast_literal_float_to_integer_out_of_range : Warning< 3802 "implicit conversion of out of range value from %0 to %1 is undefined">, 3803 InGroup<LiteralConversion>; 3804def warn_impcast_float_integer : Warning< 3805 "implicit conversion turns floating-point number into integer: %0 to %1">, 3806 InGroup<FloatConversion>, DefaultIgnore; 3807def warn_impcast_float_to_objc_signed_char_bool : Warning< 3808 "implicit conversion from floating-point type %0 to 'BOOL'">, 3809 InGroup<ObjCSignedCharBoolImplicitFloatConversion>; 3810def warn_impcast_int_to_objc_signed_char_bool : Warning< 3811 "implicit conversion from integral type %0 to 'BOOL'">, 3812 InGroup<ObjCSignedCharBoolImplicitIntConversion>, DefaultIgnore; 3813 3814// Implicit int -> float conversion precision loss warnings. 3815def warn_impcast_integer_float_precision : Warning< 3816 "implicit conversion from %0 to %1 may lose precision">, 3817 InGroup<ImplicitIntFloatConversion>, DefaultIgnore; 3818def warn_impcast_integer_float_precision_constant : Warning< 3819 "implicit conversion from %2 to %3 changes value from %0 to %1">, 3820 InGroup<ImplicitConstIntFloatConversion>; 3821 3822def warn_impcast_float_to_integer : Warning< 3823 "implicit conversion from %0 to %1 changes value from %2 to %3">, 3824 InGroup<FloatOverflowConversion>, DefaultIgnore; 3825def warn_impcast_float_to_integer_out_of_range : Warning< 3826 "implicit conversion of out of range value from %0 to %1 is undefined">, 3827 InGroup<FloatOverflowConversion>, DefaultIgnore; 3828def warn_impcast_float_to_integer_zero : Warning< 3829 "implicit conversion from %0 to %1 changes non-zero value from %2 to %3">, 3830 InGroup<FloatZeroConversion>, DefaultIgnore; 3831 3832def warn_impcast_string_literal_to_bool : Warning< 3833 "implicit conversion turns string literal into bool: %0 to %1">, 3834 InGroup<StringConversion>, DefaultIgnore; 3835def warn_impcast_different_enum_types : Warning< 3836 "implicit conversion from enumeration type %0 to different enumeration type " 3837 "%1">, InGroup<EnumConversion>; 3838def warn_impcast_bool_to_null_pointer : Warning< 3839 "initialization of pointer of type %0 to null from a constant boolean " 3840 "expression">, InGroup<BoolConversion>; 3841def warn_non_literal_null_pointer : Warning< 3842 "expression which evaluates to zero treated as a null pointer constant of " 3843 "type %0">, InGroup<NonLiteralNullConversion>; 3844def warn_pointer_compare : Warning< 3845 "comparing a pointer to a null character constant; did you mean " 3846 "to compare to %select{NULL|(void *)0}0?">, 3847 InGroup<DiagGroup<"pointer-compare">>; 3848def warn_impcast_null_pointer_to_integer : Warning< 3849 "implicit conversion of %select{NULL|nullptr}0 constant to %1">, 3850 InGroup<NullConversion>; 3851def warn_impcast_floating_point_to_bool : Warning< 3852 "implicit conversion turns floating-point number into bool: %0 to %1">, 3853 InGroup<ImplicitConversionFloatingPointToBool>; 3854def ext_ms_impcast_fn_obj : ExtWarn< 3855 "implicit conversion between pointer-to-function and pointer-to-object is a " 3856 "Microsoft extension">, InGroup<MicrosoftCast>; 3857 3858def warn_impcast_pointer_to_bool : Warning< 3859 "address of%select{| function| array}0 '%1' will always evaluate to " 3860 "'true'">, 3861 InGroup<PointerBoolConversion>; 3862def warn_cast_nonnull_to_bool : Warning< 3863 "nonnull %select{function call|parameter}0 '%1' will evaluate to " 3864 "'true' on first encounter">, 3865 InGroup<PointerBoolConversion>; 3866def warn_this_bool_conversion : Warning< 3867 "'this' pointer cannot be null in well-defined C++ code; pointer may be " 3868 "assumed to always convert to true">, InGroup<UndefinedBoolConversion>; 3869def warn_address_of_reference_bool_conversion : Warning< 3870 "reference cannot be bound to dereferenced null pointer in well-defined C++ " 3871 "code; pointer may be assumed to always convert to true">, 3872 InGroup<UndefinedBoolConversion>; 3873 3874def warn_xor_used_as_pow : Warning< 3875 "result of '%0' is %1; did you mean exponentiation?">, 3876 InGroup<XorUsedAsPow>; 3877def warn_xor_used_as_pow_base_extra : Warning< 3878 "result of '%0' is %1; did you mean '%2' (%3)?">, 3879 InGroup<XorUsedAsPow>; 3880def warn_xor_used_as_pow_base : Warning< 3881 "result of '%0' is %1; did you mean '%2'?">, 3882 InGroup<XorUsedAsPow>; 3883def note_xor_used_as_pow_silence : Note< 3884 "replace expression with '%0' %select{|or use 'xor' instead of '^' }1to silence this warning">; 3885 3886def warn_null_pointer_compare : Warning< 3887 "comparison of %select{address of|function|array}0 '%1' %select{not |}2" 3888 "equal to a null pointer is always %select{true|false}2">, 3889 InGroup<TautologicalPointerCompare>; 3890def warn_nonnull_expr_compare : Warning< 3891 "comparison of nonnull %select{function call|parameter}0 '%1' " 3892 "%select{not |}2equal to a null pointer is '%select{true|false}2' on first " 3893 "encounter">, 3894 InGroup<TautologicalPointerCompare>; 3895def warn_this_null_compare : Warning< 3896 "'this' pointer cannot be null in well-defined C++ code; comparison may be " 3897 "assumed to always evaluate to %select{true|false}0">, 3898 InGroup<TautologicalUndefinedCompare>; 3899def warn_address_of_reference_null_compare : Warning< 3900 "reference cannot be bound to dereferenced null pointer in well-defined C++ " 3901 "code; comparison may be assumed to always evaluate to " 3902 "%select{true|false}0">, 3903 InGroup<TautologicalUndefinedCompare>; 3904def note_reference_is_return_value : Note<"%0 returns a reference">; 3905 3906def note_pointer_declared_here : Note< 3907 "pointer %0 declared here">; 3908def warn_division_sizeof_ptr : Warning< 3909 "'%0' will return the size of the pointer, not the array itself">, 3910 InGroup<DiagGroup<"sizeof-pointer-div">>; 3911def warn_division_sizeof_array : Warning< 3912 "expression does not compute the number of elements in this array; element " 3913 "type is %0, not %1">, 3914 InGroup<DiagGroup<"sizeof-array-div">>; 3915 3916def note_function_warning_silence : Note< 3917 "prefix with the address-of operator to silence this warning">; 3918def note_function_to_function_call : Note< 3919 "suffix with parentheses to turn this into a function call">; 3920def warn_impcast_objective_c_literal_to_bool : Warning< 3921 "implicit boolean conversion of Objective-C object literal always " 3922 "evaluates to true">, 3923 InGroup<ObjCLiteralConversion>; 3924 3925def warn_cast_align : Warning< 3926 "cast from %0 to %1 increases required alignment from %2 to %3">, 3927 InGroup<CastAlign>, DefaultIgnore; 3928def warn_old_style_cast : Warning< 3929 "use of old-style cast">, InGroup<OldStyleCast>, DefaultIgnore; 3930 3931// Separate between casts to void* and non-void* pointers. 3932// Some APIs use (abuse) void* for something like a user context, 3933// and often that value is an integer even if it isn't a pointer itself. 3934// Having a separate warning flag allows users to control the warning 3935// for their workflow. 3936def warn_int_to_pointer_cast : Warning< 3937 "cast to %1 from smaller integer type %0">, 3938 InGroup<IntToPointerCast>; 3939def warn_int_to_void_pointer_cast : Warning< 3940 "cast to %1 from smaller integer type %0">, 3941 InGroup<IntToVoidPointerCast>; 3942def warn_pointer_to_int_cast : Warning< 3943 "cast to smaller integer type %1 from %0">, 3944 InGroup<PointerToIntCast>; 3945def warn_pointer_to_enum_cast : Warning< 3946 warn_pointer_to_int_cast.Text>, 3947 InGroup<PointerToEnumCast>; 3948def warn_void_pointer_to_int_cast : Warning< 3949 "cast to smaller integer type %1 from %0">, 3950 InGroup<VoidPointerToIntCast>; 3951def warn_void_pointer_to_enum_cast : Warning< 3952 warn_void_pointer_to_int_cast.Text>, 3953 InGroup<VoidPointerToEnumCast>; 3954 3955def warn_attribute_ignored_for_field_of_type : Warning< 3956 "%0 attribute ignored for field of type %1">, 3957 InGroup<IgnoredAttributes>; 3958def warn_no_underlying_type_specified_for_enum_bitfield : Warning< 3959 "enums in the Microsoft ABI are signed integers by default; consider giving " 3960 "the enum %0 an unsigned underlying type to make this code portable">, 3961 InGroup<SignedEnumBitfield>, DefaultIgnore; 3962def warn_attribute_packed_for_bitfield : Warning< 3963 "'packed' attribute was ignored on bit-fields with single-byte alignment " 3964 "in older versions of GCC and Clang">, 3965 InGroup<DiagGroup<"attribute-packed-for-bitfield">>; 3966def warn_transparent_union_attribute_field_size_align : Warning< 3967 "%select{alignment|size}0 of field %1 (%2 bits) does not match the " 3968 "%select{alignment|size}0 of the first field in transparent union; " 3969 "transparent_union attribute ignored">, 3970 InGroup<IgnoredAttributes>; 3971def note_transparent_union_first_field_size_align : Note< 3972 "%select{alignment|size}0 of first field is %1 bits">; 3973def warn_transparent_union_attribute_not_definition : Warning< 3974 "transparent_union attribute can only be applied to a union definition; " 3975 "attribute ignored">, 3976 InGroup<IgnoredAttributes>; 3977def warn_transparent_union_attribute_floating : Warning< 3978 "first field of a transparent union cannot have %select{floating point|" 3979 "vector}0 type %1; transparent_union attribute ignored">, 3980 InGroup<IgnoredAttributes>; 3981def warn_transparent_union_attribute_zero_fields : Warning< 3982 "transparent union definition must contain at least one field; " 3983 "transparent_union attribute ignored">, 3984 InGroup<IgnoredAttributes>; 3985def warn_attribute_type_not_supported : Warning< 3986 "%0 attribute argument not supported: %1">, 3987 InGroup<IgnoredAttributes>; 3988def warn_attribute_unknown_visibility : Warning<"unknown visibility %0">, 3989 InGroup<IgnoredAttributes>; 3990def warn_attribute_protected_visibility : 3991 Warning<"target does not support 'protected' visibility; using 'default'">, 3992 InGroup<DiagGroup<"unsupported-visibility">>; 3993def err_mismatched_visibility: Error<"visibility does not match previous declaration">; 3994def note_previous_attribute : Note<"previous attribute is here">; 3995def note_conflicting_attribute : Note<"conflicting attribute is here">; 3996def note_attribute : Note<"attribute is here">; 3997def err_mismatched_ms_inheritance : Error< 3998 "inheritance model does not match %select{definition|previous declaration}0">; 3999def warn_ignored_ms_inheritance : Warning< 4000 "inheritance model ignored on %select{primary template|partial specialization}0">, 4001 InGroup<IgnoredAttributes>; 4002def note_previous_ms_inheritance : Note< 4003 "previous inheritance model specified here">; 4004def err_machine_mode : Error<"%select{unknown|unsupported}0 machine mode %1">; 4005def err_mode_not_primitive : Error< 4006 "mode attribute only supported for integer and floating-point types">; 4007def err_mode_wrong_type : Error< 4008 "type of machine mode does not match type of base type">; 4009def warn_vector_mode_deprecated : Warning< 4010 "specifying vector types with the 'mode' attribute is deprecated; " 4011 "use the 'vector_size' attribute instead">, 4012 InGroup<DeprecatedAttributes>; 4013def err_complex_mode_vector_type : Error< 4014 "type of machine mode does not support base vector types">; 4015def err_enum_mode_vector_type : Error< 4016 "mode %0 is not supported for enumeration types">; 4017def warn_attribute_nonnull_no_pointers : Warning< 4018 "'nonnull' attribute applied to function with no pointer arguments">, 4019 InGroup<IgnoredAttributes>; 4020def warn_attribute_nonnull_parm_no_args : Warning< 4021 "'nonnull' attribute when used on parameters takes no arguments">, 4022 InGroup<IgnoredAttributes>; 4023def note_declared_nonnull : Note< 4024 "declared %select{'returns_nonnull'|'nonnull'}0 here">; 4025def warn_attribute_sentinel_named_arguments : Warning< 4026 "'sentinel' attribute requires named arguments">, 4027 InGroup<IgnoredAttributes>; 4028def warn_attribute_sentinel_not_variadic : Warning< 4029 "'sentinel' attribute only supported for variadic %select{functions|blocks}0">, 4030 InGroup<IgnoredAttributes>; 4031def warn_deprecated_ignored_on_using : Warning< 4032 "%0 currently has no effect on a using declaration">, 4033 InGroup<IgnoredAttributes>; 4034def err_attribute_sentinel_less_than_zero : Error< 4035 "'sentinel' parameter 1 less than zero">; 4036def err_attribute_sentinel_not_zero_or_one : Error< 4037 "'sentinel' parameter 2 not 0 or 1">; 4038def warn_cleanup_ext : Warning< 4039 "GCC does not allow the 'cleanup' attribute argument to be anything other " 4040 "than a simple identifier">, 4041 InGroup<GccCompat>; 4042def err_attribute_cleanup_arg_not_function : Error< 4043 "'cleanup' argument %select{|%1 |%1 }0is not a %select{||single }0function">; 4044def err_attribute_cleanup_func_must_take_one_arg : Error< 4045 "'cleanup' function %0 must take 1 parameter">; 4046def err_attribute_cleanup_func_arg_incompatible_type : Error< 4047 "'cleanup' function %0 parameter has " 4048 "%diff{type $ which is incompatible with type $|incompatible type}1,2">; 4049def err_attribute_regparm_wrong_platform : Error< 4050 "'regparm' is not valid on this platform">; 4051def err_attribute_regparm_invalid_number : Error< 4052 "'regparm' parameter must be between 0 and %0 inclusive">; 4053def err_attribute_not_supported_in_lang : Error< 4054 "%0 attribute is not supported in %select{C|C++|Objective-C}1">; 4055def err_attribute_not_supported_on_arch 4056 : Error<"%0 attribute is not supported on '%1'">; 4057def warn_gcc_ignores_type_attr : Warning< 4058 "GCC does not allow the %0 attribute to be written on a type">, 4059 InGroup<GccCompat>; 4060 4061// Clang-Specific Attributes 4062def warn_attribute_iboutlet : Warning< 4063 "%0 attribute can only be applied to instance variables or properties">, 4064 InGroup<IgnoredAttributes>; 4065def err_iboutletcollection_type : Error< 4066 "invalid type %0 as argument of iboutletcollection attribute">; 4067def err_iboutletcollection_builtintype : Error< 4068 "type argument of iboutletcollection attribute cannot be a builtin type">; 4069def warn_iboutlet_object_type : Warning< 4070 "%select{instance variable|property}2 with %0 attribute must " 4071 "be an object type (invalid %1)">, InGroup<ObjCInvalidIBOutletProperty>; 4072def warn_iboutletcollection_property_assign : Warning< 4073 "IBOutletCollection properties should be copy/strong and not assign">, 4074 InGroup<ObjCInvalidIBOutletProperty>; 4075 4076def err_attribute_overloadable_mismatch : Error< 4077 "redeclaration of %0 must %select{not |}1have the 'overloadable' attribute">; 4078def note_attribute_overloadable_prev_overload : Note< 4079 "previous %select{unmarked |}0overload of function is here">; 4080def err_attribute_overloadable_no_prototype : Error< 4081 "'overloadable' function %0 must have a prototype">; 4082def err_attribute_overloadable_multiple_unmarked_overloads : Error< 4083 "at most one overload for a given name may lack the 'overloadable' " 4084 "attribute">; 4085def warn_attribute_no_builtin_invalid_builtin_name : Warning< 4086 "'%0' is not a valid builtin name for %1">, 4087 InGroup<DiagGroup<"invalid-no-builtin-names">>; 4088def err_attribute_no_builtin_wildcard_or_builtin_name : Error< 4089 "empty %0 cannot be composed with named ones">; 4090def err_attribute_no_builtin_on_non_definition : Error< 4091 "%0 attribute is permitted on definitions only">; 4092def err_attribute_no_builtin_on_defaulted_deleted_function : Error< 4093 "%0 attribute has no effect on defaulted or deleted functions">; 4094def warn_ns_attribute_wrong_return_type : Warning< 4095 "%0 attribute only applies to %select{functions|methods|properties}1 that " 4096 "return %select{an Objective-C object|a pointer|a non-retainable pointer}2">, 4097 InGroup<IgnoredAttributes>; 4098def err_ns_attribute_wrong_parameter_type : Error< 4099 "%0 attribute only applies to " 4100 "%select{Objective-C object|pointer|pointer-to-CF-pointer}1 parameters">; 4101def warn_ns_attribute_wrong_parameter_type : Warning< 4102 "%0 attribute only applies to " 4103 "%select{Objective-C object|pointer|pointer-to-CF-pointer|pointer/reference-to-OSObject-pointer}1 parameters">, 4104 InGroup<IgnoredAttributes>; 4105def warn_objc_requires_super_protocol : Warning< 4106 "%0 attribute cannot be applied to %select{methods in protocols|dealloc}1">, 4107 InGroup<DiagGroup<"requires-super-attribute">>; 4108def note_protocol_decl : Note< 4109 "protocol is declared here">; 4110def note_protocol_decl_undefined : Note< 4111 "protocol %0 has no definition">; 4112def err_attribute_preferred_name_arg_invalid : Error< 4113 "argument %0 to 'preferred_name' attribute is not a typedef for " 4114 "a specialization of %1">; 4115def err_attribute_builtin_alias : Error< 4116 "%0 attribute can only be applied to a ARM or RISC-V builtin">; 4117 4118// called-once attribute diagnostics. 4119def err_called_once_attribute_wrong_type : Error< 4120 "'called_once' attribute only applies to function-like parameters">; 4121 4122def warn_completion_handler_never_called : Warning< 4123 "%select{|captured }1completion handler is never called">, 4124 InGroup<CompletionHandler>, DefaultIgnore; 4125def warn_called_once_never_called : Warning< 4126 "%select{|captured }1%0 parameter marked 'called_once' is never called">, 4127 InGroup<CalledOnceParameter>; 4128 4129def warn_completion_handler_never_called_when : Warning< 4130 "completion handler is never %select{used|called}1 when " 4131 "%select{taking true branch|taking false branch|" 4132 "handling this case|none of the cases applies|" 4133 "entering the loop|skipping the loop|taking one of the branches}2">, 4134 InGroup<CompletionHandler>, DefaultIgnore; 4135def warn_called_once_never_called_when : Warning< 4136 "%0 parameter marked 'called_once' is never %select{used|called}1 when " 4137 "%select{taking true branch|taking false branch|" 4138 "handling this case|none of the cases applies|" 4139 "entering the loop|skipping the loop|taking one of the branches}2">, 4140 InGroup<CalledOnceParameter>; 4141 4142def warn_completion_handler_called_twice : Warning< 4143 "completion handler is called twice">, 4144 InGroup<CompletionHandler>, DefaultIgnore; 4145def warn_called_once_gets_called_twice : Warning< 4146 "%0 parameter marked 'called_once' is called twice">, 4147 InGroup<CalledOnceParameter>; 4148def note_called_once_gets_called_twice : Note< 4149 "previous call is here%select{; set to nil to indicate " 4150 "it cannot be called afterwards|}0">; 4151 4152// objc_designated_initializer attribute diagnostics. 4153def warn_objc_designated_init_missing_super_call : Warning< 4154 "designated initializer missing a 'super' call to a designated initializer of the super class">, 4155 InGroup<ObjCDesignatedInit>; 4156def note_objc_designated_init_marked_here : Note< 4157 "method marked as designated initializer of the class here">; 4158def warn_objc_designated_init_non_super_designated_init_call : Warning< 4159 "designated initializer should only invoke a designated initializer on 'super'">, 4160 InGroup<ObjCDesignatedInit>; 4161def warn_objc_designated_init_non_designated_init_call : Warning< 4162 "designated initializer invoked a non-designated initializer">, 4163 InGroup<ObjCDesignatedInit>; 4164def warn_objc_secondary_init_super_init_call : Warning< 4165 "convenience initializer should not invoke an initializer on 'super'">, 4166 InGroup<ObjCDesignatedInit>; 4167def warn_objc_secondary_init_missing_init_call : Warning< 4168 "convenience initializer missing a 'self' call to another initializer">, 4169 InGroup<ObjCDesignatedInit>; 4170def warn_objc_implementation_missing_designated_init_override : Warning< 4171 "method override for the designated initializer of the superclass %objcinstance0 not found">, 4172 InGroup<ObjCDesignatedInit>; 4173def err_designated_init_attr_non_init : Error< 4174 "'objc_designated_initializer' attribute only applies to init methods " 4175 "of interface or class extension declarations">; 4176 4177// objc_bridge attribute diagnostics. 4178def err_objc_attr_not_id : Error< 4179 "parameter of %0 attribute must be a single name of an Objective-C %select{class|protocol}1">; 4180def err_objc_attr_typedef_not_id : Error< 4181 "parameter of %0 attribute must be 'id' when used on a typedef">; 4182def err_objc_attr_typedef_not_void_pointer : Error< 4183 "'objc_bridge(id)' is only allowed on structs and typedefs of void pointers">; 4184def err_objc_cf_bridged_not_interface : Error< 4185 "CF object of type %0 is bridged to %1, which is not an Objective-C class">; 4186def err_objc_ns_bridged_invalid_cfobject : Error< 4187 "ObjectiveC object of type %0 is bridged to %1, which is not valid CF object">; 4188def warn_objc_invalid_bridge : Warning< 4189 "%0 bridges to %1, not %2">, InGroup<ObjCBridge>; 4190def warn_objc_invalid_bridge_to_cf : Warning< 4191 "%0 cannot bridge to %1">, InGroup<ObjCBridge>; 4192 4193// objc_bridge_related attribute diagnostics. 4194def err_objc_bridged_related_invalid_class : Error< 4195 "could not find Objective-C class %0 to convert %1 to %2">; 4196def err_objc_bridged_related_invalid_class_name : Error< 4197 "%0 must be name of an Objective-C class to be able to convert %1 to %2">; 4198def err_objc_bridged_related_known_method : Error< 4199 "%0 must be explicitly converted to %1; use %select{%objcclass2|%objcinstance2}3 " 4200 "method for this conversion">; 4201 4202def err_objc_attr_protocol_requires_definition : Error< 4203 "attribute %0 can only be applied to @protocol definitions, not forward declarations">; 4204 4205// Swift attributes. 4206def warn_attr_swift_name_function 4207 : Warning<"%0 attribute argument must be a string literal specifying a Swift function name">, 4208 InGroup<SwiftNameAttribute>; 4209def warn_attr_swift_name_invalid_identifier 4210 : Warning<"%0 attribute has invalid identifier for the %select{base|context|parameter}1 name">, 4211 InGroup<SwiftNameAttribute>; 4212def warn_attr_swift_name_decl_kind 4213 : Warning<"%0 attribute cannot be applied to this declaration">, 4214 InGroup<SwiftNameAttribute>; 4215def warn_attr_swift_name_subscript_invalid_parameter 4216 : Warning<"%0 attribute for 'subscript' must %select{be a getter or setter|" 4217 "have at least one parameter|" 4218 "have a 'self:' parameter}1">, 4219 InGroup<SwiftNameAttribute>; 4220def warn_attr_swift_name_missing_parameters 4221 : Warning<"%0 attribute is missing parameter label clause">, 4222 InGroup<SwiftNameAttribute>; 4223def warn_attr_swift_name_setter_parameters 4224 : Warning<"%0 attribute for setter must have one parameter for new value">, 4225 InGroup<SwiftNameAttribute>; 4226def warn_attr_swift_name_multiple_selfs 4227 : Warning<"%0 attribute cannot specify more than one 'self:' parameter">, 4228 InGroup<SwiftNameAttribute>; 4229def warn_attr_swift_name_getter_parameters 4230 : Warning<"%0 attribute for getter must not have any parameters besides 'self:'">, 4231 InGroup<SwiftNameAttribute>; 4232def warn_attr_swift_name_subscript_setter_no_newValue 4233 : Warning<"%0 attribute for 'subscript' setter must have a 'newValue:' parameter">, 4234 InGroup<SwiftNameAttribute>; 4235def warn_attr_swift_name_subscript_setter_multiple_newValues 4236 : Warning<"%0 attribute for 'subscript' setter cannot have multiple 'newValue:' parameters">, 4237 InGroup<SwiftNameAttribute>; 4238def warn_attr_swift_name_subscript_getter_newValue 4239 : Warning<"%0 attribute for 'subscript' getter cannot have a 'newValue:' parameter">, 4240 InGroup<SwiftNameAttribute>; 4241def warn_attr_swift_name_num_params 4242 : Warning<"too %select{few|many}0 parameters in the signature specified by " 4243 "the %1 attribute (expected %2; got %3)">, 4244 InGroup<SwiftNameAttribute>; 4245def warn_attr_swift_name_decl_missing_params 4246 : Warning<"%0 attribute cannot be applied to a %select{function|method}1 " 4247 "with no parameters">, 4248 InGroup<SwiftNameAttribute>; 4249 4250def err_attr_swift_error_no_error_parameter : Error< 4251 "%0 attribute can only be applied to a %select{function|method}1 with an " 4252 "error parameter">; 4253def err_attr_swift_error_return_type : Error< 4254 "%0 attribute with '%1' convention can only be applied to a " 4255 "%select{function|method}2 returning %select{an integral type|a pointer}3">; 4256 4257def err_swift_async_no_access : Error< 4258 "first argument to 'swift_async' must be either 'none', 'swift_private', or " 4259 "'not_swift_private'">; 4260def err_swift_async_bad_block_type : Error< 4261 "'swift_async' completion handler parameter must have block type returning" 4262 " 'void', type here is %0">; 4263 4264def err_swift_async_error_without_swift_async : Error< 4265 "%0 attribute must be applied to a %select{function|method}1 annotated " 4266 "with non-'none' attribute 'swift_async'">; 4267def err_swift_async_error_no_error_parameter : Error< 4268 "%0 attribute with 'nonnull_error' convention can only be applied to a " 4269 "%select{function|method}1 with a completion handler with an error " 4270 "parameter">; 4271def err_swift_async_error_non_integral : Error< 4272 "%0 attribute with '%1' convention must have an integral-typed parameter " 4273 "in completion handler at index %2, type here is %3">; 4274 4275def warn_ignored_objc_externally_retained : Warning< 4276 "'objc_externally_retained' can only be applied to local variables " 4277 "%select{of retainable type|with strong ownership}0">, 4278 InGroup<IgnoredAttributes>; 4279 4280// Function Parameter Semantic Analysis. 4281def err_param_with_void_type : Error<"argument may not have 'void' type">; 4282def err_void_only_param : Error< 4283 "'void' must be the first and only parameter if specified">; 4284def err_void_param_qualified : Error< 4285 "'void' as parameter must not have type qualifiers">; 4286def err_ident_list_in_fn_declaration : Error< 4287 "a parameter list without types is only allowed in a function definition">; 4288def ext_param_not_declared : Extension< 4289 "parameter %0 was not declared, defaulting to type 'int'">; 4290def err_param_default_argument : Error< 4291 "C does not support default arguments">; 4292def err_param_default_argument_redefinition : Error< 4293 "redefinition of default argument">; 4294def ext_param_default_argument_redefinition : ExtWarn< 4295 err_param_default_argument_redefinition.Text>, 4296 InGroup<MicrosoftDefaultArgRedefinition>; 4297def err_param_default_argument_missing : Error< 4298 "missing default argument on parameter">; 4299def err_param_default_argument_missing_name : Error< 4300 "missing default argument on parameter %0">; 4301def err_param_default_argument_references_param : Error< 4302 "default argument references parameter %0">; 4303def err_param_default_argument_references_local : Error< 4304 "default argument references local variable %0 of enclosing function">; 4305def err_param_default_argument_references_this : Error< 4306 "default argument references 'this'">; 4307def err_param_default_argument_nonfunc : Error< 4308 "default arguments can only be specified for parameters in a function " 4309 "declaration">; 4310def err_param_default_argument_template_redecl : Error< 4311 "default arguments cannot be added to a function template that has already " 4312 "been declared">; 4313def err_param_default_argument_member_template_redecl : Error< 4314 "default arguments cannot be added to an out-of-line definition of a member " 4315 "of a %select{class template|class template partial specialization|nested " 4316 "class in a template}0">; 4317def err_param_default_argument_on_parameter_pack : Error< 4318 "parameter pack cannot have a default argument">; 4319def err_uninitialized_member_for_assign : Error< 4320 "cannot define the implicit copy assignment operator for %0, because " 4321 "non-static %select{reference|const}1 member %2 cannot use copy " 4322 "assignment operator">; 4323def err_uninitialized_member_in_ctor : Error< 4324 "%select{constructor for %1|" 4325 "implicit default constructor for %1|" 4326 "cannot use constructor inherited from %1:}0 must explicitly " 4327 "initialize the %select{reference|const}2 member %3">; 4328def err_default_arg_makes_ctor_special : Error< 4329 "addition of default argument on redeclaration makes this constructor a " 4330 "%select{default|copy|move}0 constructor">; 4331 4332def err_use_of_default_argument_to_function_declared_later : Error< 4333 "use of default argument to function %0 that is declared later in class %1">; 4334def note_default_argument_declared_here : Note< 4335 "default argument declared here">; 4336def err_recursive_default_argument : Error<"recursive evaluation of default argument">; 4337def note_recursive_default_argument_used_here : Note< 4338 "default argument used here">; 4339 4340def ext_param_promoted_not_compatible_with_prototype : ExtWarn< 4341 "%diff{promoted type $ of K&R function parameter is not compatible with the " 4342 "parameter type $|promoted type of K&R function parameter is not compatible " 4343 "with parameter type}0,1 declared in a previous prototype">, 4344 InGroup<KNRPromotedParameter>; 4345 4346 4347// C++ Overloading Semantic Analysis. 4348def err_ovl_diff_return_type : Error< 4349 "functions that differ only in their return type cannot be overloaded">; 4350def err_ovl_static_nonstatic_member : Error< 4351 "static and non-static member functions with the same parameter types " 4352 "cannot be overloaded">; 4353 4354let Deferrable = 1 in { 4355 4356def err_ovl_no_viable_function_in_call : Error< 4357 "no matching function for call to %0">; 4358def err_ovl_no_viable_member_function_in_call : Error< 4359 "no matching member function for call to %0">; 4360def err_ovl_ambiguous_call : Error< 4361 "call to %0 is ambiguous">; 4362def err_ovl_deleted_call : Error<"call to deleted function %0">; 4363def err_ovl_ambiguous_member_call : Error< 4364 "call to member function %0 is ambiguous">; 4365def err_ovl_deleted_member_call : Error< 4366 "call to deleted member function %0">; 4367def note_ovl_too_many_candidates : Note< 4368 "remaining %0 candidate%s0 omitted; " 4369 "pass -fshow-overloads=all to show them">; 4370 4371def select_ovl_candidate_kind : TextSubstitution< 4372 "%select{function|function|function (with reversed parameter order)|" 4373 "constructor|" 4374 "constructor (the implicit default constructor)|" 4375 "constructor (the implicit copy constructor)|" 4376 "constructor (the implicit move constructor)|" 4377 "function (the implicit copy assignment operator)|" 4378 "function (the implicit move assignment operator)|" 4379 "function (the implicit 'operator==' for this 'operator<=>)'|" 4380 "inherited constructor}0%select{| template| %2}1">; 4381 4382def note_ovl_candidate : Note< 4383 "candidate %sub{select_ovl_candidate_kind}0,1,3" 4384 "%select{| has different class%diff{ (expected $ but has $)|}5,6" 4385 "| has different number of parameters (expected %5 but has %6)" 4386 "| has type mismatch at %ordinal5 parameter" 4387 "%diff{ (expected $ but has $)|}6,7" 4388 "| has different return type%diff{ ($ expected but has $)|}5,6" 4389 "| has different qualifiers (expected %5 but found %6)" 4390 "| has different exception specification}4">; 4391 4392def note_ovl_candidate_explicit : Note< 4393 "explicit %select{constructor|conversion function|deduction guide}0 " 4394 "is not a candidate%select{| (explicit specifier evaluates to true)}1">; 4395def note_ovl_candidate_inherited_constructor : Note< 4396 "constructor from base class %0 inherited here">; 4397def note_ovl_candidate_inherited_constructor_slice : Note< 4398 "candidate %select{constructor|template}0 ignored: " 4399 "inherited constructor cannot be used to %select{copy|move}1 object">; 4400def note_ovl_candidate_illegal_constructor : Note< 4401 "candidate %select{constructor|template}0 ignored: " 4402 "instantiation %select{takes|would take}0 its own class type by value">; 4403def note_ovl_candidate_illegal_constructor_adrspace_mismatch : Note< 4404 "candidate constructor ignored: cannot be used to construct an object " 4405 "in address space %0">; 4406def note_ovl_candidate_bad_deduction : Note< 4407 "candidate template ignored: failed template argument deduction">; 4408def note_ovl_candidate_incomplete_deduction : Note<"candidate template ignored: " 4409 "couldn't infer template argument %0">; 4410def note_ovl_candidate_incomplete_deduction_pack : Note< 4411 "candidate template ignored: " 4412 "deduced too few arguments for expanded pack %0; no argument for %ordinal1 " 4413 "expanded parameter in deduced argument pack %2">; 4414def note_ovl_candidate_inconsistent_deduction : Note< 4415 "candidate template ignored: deduced %select{conflicting types|" 4416 "conflicting values|conflicting templates|packs of different lengths}0 " 4417 "for parameter %1%diff{ ($ vs. $)|}2,3">; 4418def note_ovl_candidate_inconsistent_deduction_types : Note< 4419 "candidate template ignored: deduced values %diff{" 4420 "of conflicting types for parameter %0 (%1 of type $ vs. %3 of type $)|" 4421 "%1 and %3 of conflicting types for parameter %0}2,4">; 4422def note_ovl_candidate_explicit_arg_mismatch_named : Note< 4423 "candidate template ignored: invalid explicitly-specified argument " 4424 "for template parameter %0">; 4425def note_ovl_candidate_unsatisfied_constraints : Note< 4426 "candidate template ignored: constraints not satisfied%0">; 4427def note_ovl_candidate_explicit_arg_mismatch_unnamed : Note< 4428 "candidate template ignored: invalid explicitly-specified argument " 4429 "for %ordinal0 template parameter">; 4430def note_ovl_candidate_instantiation_depth : Note< 4431 "candidate template ignored: substitution exceeded maximum template " 4432 "instantiation depth">; 4433def note_ovl_candidate_underqualified : Note< 4434 "candidate template ignored: cannot deduce a type for %0 that would " 4435 "make %2 equal %1">; 4436def note_ovl_candidate_substitution_failure : Note< 4437 "candidate template ignored: substitution failure%0%1">; 4438def note_ovl_candidate_disabled_by_enable_if : Note< 4439 "candidate template ignored: disabled by %0%1">; 4440def note_ovl_candidate_disabled_by_requirement : Note< 4441 "candidate template ignored: requirement '%0' was not satisfied%1">; 4442def note_ovl_candidate_has_pass_object_size_params: Note< 4443 "candidate address cannot be taken because parameter %0 has " 4444 "pass_object_size attribute">; 4445def err_diagnose_if_succeeded : Error<"%0">; 4446def warn_diagnose_if_succeeded : Warning<"%0">, InGroup<UserDefinedWarnings>, 4447 ShowInSystemHeader; 4448def note_ovl_candidate_disabled_by_function_cond_attr : Note< 4449 "candidate disabled: %0">; 4450def err_addrof_function_disabled_by_enable_if_attr : Error< 4451 "cannot take address of function %0 because it has one or more " 4452 "non-tautological enable_if conditions">; 4453def err_addrof_function_constraints_not_satisfied : Error< 4454 "cannot take address of function %0 because its constraints are not " 4455 "satisfied">; 4456def note_addrof_ovl_candidate_disabled_by_enable_if_attr : Note< 4457 "candidate function made ineligible by enable_if">; 4458def note_ovl_candidate_deduced_mismatch : Note< 4459 "candidate template ignored: deduced type " 4460 "%diff{$ of %select{|element of }4%ordinal0 parameter does not match " 4461 "adjusted type $ of %select{|element of }4argument" 4462 "|of %select{|element of }4%ordinal0 parameter does not match " 4463 "adjusted type of %select{|element of }4argument}1,2%3">; 4464def note_ovl_candidate_non_deduced_mismatch : Note< 4465 "candidate template ignored: could not match %diff{$ against $|types}0,1">; 4466// This note is needed because the above note would sometimes print two 4467// different types with the same name. Remove this note when the above note 4468// can handle that case properly. 4469def note_ovl_candidate_non_deduced_mismatch_qualified : Note< 4470 "candidate template ignored: could not match %q0 against %q1">; 4471 4472// Note that we don't treat templates differently for this diagnostic. 4473def note_ovl_candidate_arity : Note<"candidate " 4474 "%sub{select_ovl_candidate_kind}0,1,2 not viable: " 4475 "requires%select{ at least| at most|}3 %4 argument%s4, but %5 " 4476 "%plural{1:was|:were}5 provided">; 4477 4478def note_ovl_candidate_arity_one : Note<"candidate " 4479 "%sub{select_ovl_candidate_kind}0,1,2 not viable: " 4480 "%select{requires at least|allows at most single|requires single}3 " 4481 "argument %4, but %plural{0:no|:%5}5 arguments were provided">; 4482 4483def note_ovl_candidate_deleted : Note< 4484 "candidate %sub{select_ovl_candidate_kind}0,1,2 has been " 4485 "%select{explicitly made unavailable|explicitly deleted|" 4486 "implicitly deleted}3">; 4487 4488// Giving the index of the bad argument really clutters this message, and 4489// it's relatively unimportant because 1) it's generally obvious which 4490// argument(s) are of the given object type and 2) the fix is usually 4491// to complete the type, which doesn't involve changes to the call line 4492// anyway. If people complain, we can change it. 4493def note_ovl_candidate_bad_conv_incomplete : Note< 4494 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " 4495 "cannot convert argument of incomplete type " 4496 "%diff{$ to $|to parameter type}3,4 for " 4497 "%select{%ordinal6 argument|object argument}5" 4498 "%select{|; dereference the argument with *|" 4499 "; take the address of the argument with &|" 4500 "; remove *|" 4501 "; remove &}7">; 4502def note_ovl_candidate_bad_list_argument : Note< 4503 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " 4504 "%select{cannot convert initializer list|too few initializers in list" 4505 "|too many initializers in list}7 argument to %4">; 4506def note_ovl_candidate_bad_overload : Note< 4507 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " 4508 "no overload of %4 matching %3 for %ordinal5 argument">; 4509def note_ovl_candidate_bad_conv : Note< 4510 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " 4511 "no known conversion " 4512 "%diff{from $ to $|from argument type to parameter type}3,4 for " 4513 "%select{%ordinal6 argument|object argument}5" 4514 "%select{|; dereference the argument with *|" 4515 "; take the address of the argument with &|" 4516 "; remove *|" 4517 "; remove &}7">; 4518def note_ovl_candidate_bad_arc_conv : Note< 4519 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " 4520 "cannot implicitly convert argument " 4521 "%diff{of type $ to $|type to parameter type}3,4 for " 4522 "%select{%ordinal6 argument|object argument}5 under ARC">; 4523def note_ovl_candidate_bad_value_category : Note< 4524 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " 4525 "expects an %select{lvalue|rvalue}5 for " 4526 "%select{%ordinal4 argument|object argument}3">; 4527def note_ovl_candidate_bad_addrspace : Note< 4528 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " 4529 "cannot %select{pass pointer to|bind reference in}5 %3 " 4530 "%select{as a pointer to|to object in}5 %4 in %ordinal6 " 4531 "argument">; 4532def note_ovl_candidate_bad_addrspace_this : Note< 4533 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " 4534 "'this' object is in %3, but method expects object in %4">; 4535def note_ovl_candidate_bad_gc : Note< 4536 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " 4537 "%select{%ordinal7|'this'}6 argument (%3) has %select{no|__weak|__strong}4 " 4538 "ownership, but parameter has %select{no|__weak|__strong}5 ownership">; 4539def note_ovl_candidate_bad_ownership : Note< 4540 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " 4541 "%select{%ordinal7|'this'}6 argument (%3) has " 4542 "%select{no|__unsafe_unretained|__strong|__weak|__autoreleasing}4 ownership," 4543 " but parameter has %select{no|__unsafe_unretained|__strong|__weak|" 4544 "__autoreleasing}5 ownership">; 4545def note_ovl_candidate_bad_cvr_this : Note< 4546 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " 4547 "'this' argument has type %3, but method is not marked " 4548 "%select{const|restrict|const or restrict|volatile|const or volatile|" 4549 "volatile or restrict|const, volatile, or restrict}4">; 4550def note_ovl_candidate_bad_cvr : Note< 4551 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " 4552 "%ordinal5 argument (%3) would lose " 4553 "%select{const|restrict|const and restrict|volatile|const and volatile|" 4554 "volatile and restrict|const, volatile, and restrict}4 qualifier" 4555 "%select{||s||s|s|s}4">; 4556def note_ovl_candidate_bad_unaligned : Note< 4557 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " 4558 "%ordinal5 argument (%3) would lose __unaligned qualifier">; 4559def note_ovl_candidate_bad_base_to_derived_conv : Note< 4560 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " 4561 "cannot %select{convert from|convert from|bind}3 " 4562 "%select{base class pointer|superclass|base class object of type}3 %4 to " 4563 "%select{derived class pointer|subclass|derived class reference}3 %5 for " 4564 "%ordinal6 argument">; 4565def note_ovl_candidate_bad_target : Note< 4566 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " 4567 "call to " 4568 "%select{__device__|__global__|__host__|__host__ __device__|invalid}3 function from" 4569 " %select{__device__|__global__|__host__|__host__ __device__|invalid}4 function">; 4570def note_ovl_candidate_constraints_not_satisfied : Note< 4571 "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: constraints " 4572 "not satisfied">; 4573def note_implicit_member_target_infer_collision : Note< 4574 "implicit %sub{select_special_member_kind}0 inferred target collision: call to both " 4575 "%select{__device__|__global__|__host__|__host__ __device__}1 and " 4576 "%select{__device__|__global__|__host__|__host__ __device__}2 members">; 4577 4578def note_ambiguous_type_conversion: Note< 4579 "because of ambiguity in conversion %diff{of $ to $|between types}0,1">; 4580def note_ovl_builtin_candidate : Note<"built-in candidate %0">; 4581def err_ovl_no_viable_function_in_init : Error< 4582 "no matching constructor for initialization of %0">; 4583def err_ovl_no_conversion_in_cast : Error< 4584 "cannot convert %1 to %2 without a conversion operator">; 4585def err_ovl_no_viable_conversion_in_cast : Error< 4586 "no matching conversion for %select{|static_cast|reinterpret_cast|" 4587 "dynamic_cast|C-style cast|functional-style cast|}0 from %1 to %2">; 4588def err_ovl_ambiguous_conversion_in_cast : Error< 4589 "ambiguous conversion for %select{|static_cast|reinterpret_cast|" 4590 "dynamic_cast|C-style cast|functional-style cast|}0 from %1 to %2">; 4591def err_ovl_deleted_conversion_in_cast : Error< 4592 "%select{|static_cast|reinterpret_cast|dynamic_cast|C-style cast|" 4593 "functional-style cast|}0 from %1 to %2 uses deleted function">; 4594def err_ovl_ambiguous_init : Error<"call to constructor of %0 is ambiguous">; 4595def err_ref_init_ambiguous : Error< 4596 "reference initialization of type %0 with initializer of type %1 is ambiguous">; 4597def err_ovl_deleted_init : Error< 4598 "call to deleted constructor of %0">; 4599def err_ovl_deleted_special_init : Error< 4600 "call to implicitly-deleted %select{default constructor|copy constructor|" 4601 "move constructor|copy assignment operator|move assignment operator|" 4602 "destructor|function}0 of %1">; 4603def err_ovl_ambiguous_oper_unary : Error< 4604 "use of overloaded operator '%0' is ambiguous (operand type %1)">; 4605def err_ovl_ambiguous_oper_binary : Error< 4606 "use of overloaded operator '%0' is ambiguous (with operand types %1 and %2)">; 4607def ext_ovl_ambiguous_oper_binary_reversed : ExtWarn< 4608 "ISO C++20 considers use of overloaded operator '%0' (with operand types %1 " 4609 "and %2) to be ambiguous despite there being a unique best viable function" 4610 "%select{ with non-reversed arguments|}3">, 4611 InGroup<DiagGroup<"ambiguous-reversed-operator">>, SFINAEFailure; 4612def note_ovl_ambiguous_oper_binary_reversed_self : Note< 4613 "ambiguity is between a regular call to this operator and a call with the " 4614 "argument order reversed">; 4615def note_ovl_ambiguous_oper_binary_selected_candidate : Note< 4616 "candidate function with non-reversed arguments">; 4617def note_ovl_ambiguous_oper_binary_reversed_candidate : Note< 4618 "ambiguous candidate function with reversed arguments">; 4619def err_ovl_no_viable_oper : Error<"no viable overloaded '%0'">; 4620def note_assign_lhs_incomplete : Note<"type %0 is incomplete">; 4621def err_ovl_deleted_oper : Error< 4622 "overload resolution selected deleted operator '%0'">; 4623def err_ovl_deleted_special_oper : Error< 4624 "object of type %0 cannot be %select{constructed|copied|moved|assigned|" 4625 "assigned|destroyed}1 because its %sub{select_special_member_kind}1 is " 4626 "implicitly deleted">; 4627def err_ovl_deleted_comparison : Error< 4628 "object of type %0 cannot be compared because its %1 is implicitly deleted">; 4629def err_ovl_rewrite_equalequal_not_bool : Error< 4630 "return type %0 of selected 'operator==' function for rewritten " 4631 "'%1' comparison is not 'bool'">; 4632def ext_ovl_rewrite_equalequal_not_bool : ExtWarn< 4633 "ISO C++20 requires return type of selected 'operator==' function for " 4634 "rewritten '%1' comparison to be 'bool', not %0">, 4635 InGroup<DiagGroup<"rewrite-not-bool">>, SFINAEFailure; 4636def err_ovl_no_viable_subscript : 4637 Error<"no viable overloaded operator[] for type %0">; 4638def err_ovl_no_oper : 4639 Error<"type %0 does not provide a %select{subscript|call}1 operator">; 4640def err_ovl_unresolvable : Error< 4641 "reference to %select{overloaded|multiversioned}1 function could not be " 4642 "resolved; did you mean to call it%select{| with no arguments}0?">; 4643def err_bound_member_function : Error< 4644 "reference to non-static member function must be called" 4645 "%select{|; did you mean to call it with no arguments?}0">; 4646def note_possible_target_of_call : Note<"possible target for call">; 4647 4648def err_ovl_no_viable_object_call : Error< 4649 "no matching function for call to object of type %0">; 4650def err_ovl_ambiguous_object_call : Error< 4651 "call to object of type %0 is ambiguous">; 4652def err_ovl_deleted_object_call : Error< 4653 "call to deleted function call operator in type %0">; 4654def note_ovl_surrogate_cand : Note<"conversion candidate of type %0">; 4655def err_member_call_without_object : Error< 4656 "call to non-static member function without an object argument">; 4657 4658// C++ Address of Overloaded Function 4659def err_addr_ovl_no_viable : Error< 4660 "address of overloaded function %0 does not match required type %1">; 4661def err_addr_ovl_ambiguous : Error< 4662 "address of overloaded function %0 is ambiguous">; 4663def err_addr_ovl_not_func_ptrref : Error< 4664 "address of overloaded function %0 cannot be converted to type %1">; 4665def err_addr_ovl_no_qualifier : Error< 4666 "cannot form member pointer of type %0 without '&' and class name">; 4667 4668} // let Deferrable 4669 4670// C++11 Literal Operators 4671def err_ovl_no_viable_literal_operator : Error< 4672 "no matching literal operator for call to %0" 4673 "%select{| with argument of type %2| with arguments of types %2 and %3}1" 4674 "%select{| or 'const char *'}4" 4675 "%select{|, and no matching literal operator template}5">; 4676 4677// C++ Template Declarations 4678def err_template_param_shadow : Error< 4679 "declaration of %0 shadows template parameter">; 4680def ext_template_param_shadow : ExtWarn< 4681 err_template_param_shadow.Text>, InGroup<MicrosoftTemplateShadow>; 4682def note_template_param_here : Note<"template parameter is declared here">; 4683def warn_template_export_unsupported : Warning< 4684 "exported templates are unsupported">; 4685def err_template_outside_namespace_or_class_scope : Error< 4686 "templates can only be declared in namespace or class scope">; 4687def err_template_inside_local_class : Error< 4688 "templates cannot be declared inside of a local class">; 4689def err_template_linkage : Error<"templates must have C++ linkage">; 4690def err_template_typedef : Error<"a typedef cannot be a template">; 4691def err_template_unnamed_class : Error< 4692 "cannot declare a class template with no name">; 4693def err_template_param_list_different_arity : Error< 4694 "%select{too few|too many}0 template parameters in template " 4695 "%select{|template parameter }1redeclaration">; 4696def note_template_param_list_different_arity : Note< 4697 "%select{too few|too many}0 template parameters in template template " 4698 "argument">; 4699def note_template_prev_declaration : Note< 4700 "previous template %select{declaration|template parameter}0 is here">; 4701def err_template_param_different_kind : Error< 4702 "template parameter has a different kind in template " 4703 "%select{|template parameter }0redeclaration">; 4704def note_template_param_different_kind : Note< 4705 "template parameter has a different kind in template argument">; 4706 4707def err_invalid_decl_specifier_in_nontype_parm : Error< 4708 "invalid declaration specifier in template non-type parameter">; 4709 4710def err_template_nontype_parm_different_type : Error< 4711 "template non-type parameter has a different type %0 in template " 4712 "%select{|template parameter }1redeclaration">; 4713 4714def note_template_nontype_parm_different_type : Note< 4715 "template non-type parameter has a different type %0 in template argument">; 4716def note_template_nontype_parm_prev_declaration : Note< 4717 "previous non-type template parameter with type %0 is here">; 4718def err_template_nontype_parm_bad_type : Error< 4719 "a non-type template parameter cannot have type %0">; 4720def err_template_nontype_parm_bad_structural_type : Error< 4721 "a non-type template parameter cannot have type %0 before C++20">; 4722def err_template_nontype_parm_incomplete : Error< 4723 "non-type template parameter has incomplete type %0">; 4724def err_template_nontype_parm_not_literal : Error< 4725 "non-type template parameter has non-literal type %0">; 4726def err_template_nontype_parm_rvalue_ref : Error< 4727 "non-type template parameter has rvalue reference type %0">; 4728def err_template_nontype_parm_not_structural : Error< 4729 "type %0 of non-type template parameter is not a structural type">; 4730def note_not_structural_non_public : Note< 4731 "%0 is not a structural type because it has a " 4732 "%select{non-static data member|base class}1 that is not public">; 4733def note_not_structural_mutable_field : Note< 4734 "%0 is not a structural type because it has a mutable " 4735 "non-static data member">; 4736def note_not_structural_rvalue_ref_field : Note< 4737 "%0 is not a structural type because it has a non-static data member " 4738 "of rvalue reference type">; 4739def note_not_structural_subobject : Note< 4740 "%0 is not a structural type because it has a " 4741 "%select{non-static data member|base class}1 of non-structural type %2">; 4742def warn_cxx17_compat_template_nontype_parm_type : Warning< 4743 "non-type template parameter of type %0 is incompatible with " 4744 "C++ standards before C++20">, 4745 DefaultIgnore, InGroup<CXXPre20Compat>; 4746def warn_cxx14_compat_template_nontype_parm_auto_type : Warning< 4747 "non-type template parameters declared with %0 are incompatible with C++ " 4748 "standards before C++17">, 4749 DefaultIgnore, InGroup<CXXPre17Compat>; 4750def err_template_param_default_arg_redefinition : Error< 4751 "template parameter redefines default argument">; 4752def note_template_param_prev_default_arg : Note< 4753 "previous default template argument defined here">; 4754def err_template_param_default_arg_missing : Error< 4755 "template parameter missing a default argument">; 4756def ext_template_parameter_default_in_function_template : ExtWarn< 4757 "default template arguments for a function template are a C++11 extension">, 4758 InGroup<CXX11>; 4759def warn_cxx98_compat_template_parameter_default_in_function_template : Warning< 4760 "default template arguments for a function template are incompatible with C++98">, 4761 InGroup<CXX98Compat>, DefaultIgnore; 4762def err_template_parameter_default_template_member : Error< 4763 "cannot add a default template argument to the definition of a member of a " 4764 "class template">; 4765def err_template_parameter_default_friend_template : Error< 4766 "default template argument not permitted on a friend template">; 4767def err_template_template_parm_no_parms : Error< 4768 "template template parameter must have its own template parameters">; 4769 4770def ext_variable_template : ExtWarn<"variable templates are a C++14 extension">, 4771 InGroup<CXX14>; 4772def warn_cxx11_compat_variable_template : Warning< 4773 "variable templates are incompatible with C++ standards before C++14">, 4774 InGroup<CXXPre14Compat>, DefaultIgnore; 4775def err_template_variable_noparams : Error< 4776 "extraneous 'template<>' in declaration of variable %0">; 4777def err_template_member : Error<"member %0 declared as a template">; 4778def err_template_member_noparams : Error< 4779 "extraneous 'template<>' in declaration of member %0">; 4780def err_template_tag_noparams : Error< 4781 "extraneous 'template<>' in declaration of %0 %1">; 4782 4783def warn_cxx17_compat_adl_only_template_id : Warning< 4784 "use of function template name with no prior function template " 4785 "declaration in function call with explicit template arguments " 4786 "is incompatible with C++ standards before C++20">, 4787 InGroup<CXXPre20Compat>, DefaultIgnore; 4788def ext_adl_only_template_id : ExtWarn< 4789 "use of function template name with no prior declaration in function call " 4790 "with explicit template arguments is a C++20 extension">, InGroup<CXX20>; 4791 4792// C++ Template Argument Lists 4793def err_template_missing_args : Error< 4794 "use of " 4795 "%select{class template|function template|variable template|alias template|" 4796 "template template parameter|concept|template}0 %1 requires template " 4797 "arguments">; 4798def err_template_arg_list_different_arity : Error< 4799 "%select{too few|too many}0 template arguments for " 4800 "%select{class template|function template|variable template|alias template|" 4801 "template template parameter|concept|template}1 %2">; 4802def note_template_decl_here : Note<"template is declared here">; 4803def err_template_arg_must_be_type : Error< 4804 "template argument for template type parameter must be a type">; 4805def err_template_arg_must_be_type_suggest : Error< 4806 "template argument for template type parameter must be a type; " 4807 "did you forget 'typename'?">; 4808def ext_ms_template_type_arg_missing_typename : ExtWarn< 4809 "template argument for template type parameter must be a type; " 4810 "omitted 'typename' is a Microsoft extension">, 4811 InGroup<MicrosoftTemplate>; 4812def err_template_arg_must_be_expr : Error< 4813 "template argument for non-type template parameter must be an expression">; 4814def err_template_arg_nontype_ambig : Error< 4815 "template argument for non-type template parameter is treated as function type %0">; 4816def err_template_arg_must_be_template : Error< 4817 "template argument for template template parameter must be a class template%select{| or type alias template}0">; 4818def ext_template_arg_local_type : ExtWarn< 4819 "template argument uses local type %0">, InGroup<LocalTypeTemplateArgs>; 4820def ext_template_arg_unnamed_type : ExtWarn< 4821 "template argument uses unnamed type">, InGroup<UnnamedTypeTemplateArgs>; 4822def warn_cxx98_compat_template_arg_local_type : Warning< 4823 "local type %0 as template argument is incompatible with C++98">, 4824 InGroup<CXX98CompatLocalTypeTemplateArgs>, DefaultIgnore; 4825def warn_cxx98_compat_template_arg_unnamed_type : Warning< 4826 "unnamed type as template argument is incompatible with C++98">, 4827 InGroup<CXX98CompatUnnamedTypeTemplateArgs>, DefaultIgnore; 4828def note_template_unnamed_type_here : Note< 4829 "unnamed type used in template argument was declared here">; 4830def err_template_arg_overload_type : Error< 4831 "template argument is the type of an unresolved overloaded function">; 4832def err_template_arg_not_valid_template : Error< 4833 "template argument does not refer to a class or alias template, or template " 4834 "template parameter">; 4835def note_template_arg_refers_here_func : Note< 4836 "template argument refers to function template %0, here">; 4837def err_template_arg_template_params_mismatch : Error< 4838 "template template argument has different template parameters than its " 4839 "corresponding template template parameter">; 4840def err_template_arg_not_integral_or_enumeral : Error< 4841 "non-type template argument of type %0 must have an integral or enumeration" 4842 " type">; 4843def err_template_arg_not_ice : Error< 4844 "non-type template argument of type %0 is not an integral constant " 4845 "expression">; 4846def err_template_arg_not_address_constant : Error< 4847 "non-type template argument of type %0 is not a constant expression">; 4848def warn_cxx98_compat_template_arg_null : Warning< 4849 "use of null pointer as non-type template argument is incompatible with " 4850 "C++98">, InGroup<CXX98Compat>, DefaultIgnore; 4851def err_template_arg_untyped_null_constant : Error< 4852 "null non-type template argument must be cast to template parameter type %0">; 4853def err_template_arg_wrongtype_null_constant : Error< 4854 "null non-type template argument of type %0 does not match template parameter " 4855 "of type %1">; 4856def err_non_type_template_parm_type_deduction_failure : Error< 4857 "non-type template parameter %0 with type %1 has incompatible initializer of type %2">; 4858def err_deduced_non_type_template_arg_type_mismatch : Error< 4859 "deduced non-type template argument does not have the same type as the " 4860 "corresponding template parameter%diff{ ($ vs $)|}0,1">; 4861def err_non_type_template_arg_subobject : Error< 4862 "non-type template argument refers to subobject '%0'">; 4863def err_non_type_template_arg_addr_label_diff : Error< 4864 "template argument / label address difference / what did you expect?">; 4865def err_non_type_template_arg_unsupported : Error< 4866 "sorry, non-type template argument of type %0 is not yet supported">; 4867def err_template_arg_not_convertible : Error< 4868 "non-type template argument of type %0 cannot be converted to a value " 4869 "of type %1">; 4870def warn_template_arg_negative : Warning< 4871 "non-type template argument with value '%0' converted to '%1' for unsigned " 4872 "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore; 4873def warn_template_arg_too_large : Warning< 4874 "non-type template argument value '%0' truncated to '%1' for " 4875 "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore; 4876def err_template_arg_no_ref_bind : Error< 4877 "non-type template parameter of reference type " 4878 "%diff{$ cannot bind to template argument of type $" 4879 "|cannot bind to template of incompatible argument type}0,1">; 4880def err_template_arg_ref_bind_ignores_quals : Error< 4881 "reference binding of non-type template parameter " 4882 "%diff{of type $ to template argument of type $|to template argument}0,1 " 4883 "ignores qualifiers">; 4884def err_template_arg_not_decl_ref : Error< 4885 "non-type template argument does not refer to any declaration">; 4886def err_template_arg_not_address_of : Error< 4887 "non-type template argument for template parameter of pointer type %0 must " 4888 "have its address taken">; 4889def err_template_arg_address_of_non_pointer : Error< 4890 "address taken in non-type template argument for template parameter of " 4891 "reference type %0">; 4892def err_template_arg_reference_var : Error< 4893 "non-type template argument of reference type %0 is not an object">; 4894def err_template_arg_field : Error< 4895 "non-type template argument refers to non-static data member %0">; 4896def err_template_arg_method : Error< 4897 "non-type template argument refers to non-static member function %0">; 4898def err_template_arg_object_no_linkage : Error< 4899 "non-type template argument refers to %select{function|object}0 %1 that " 4900 "does not have linkage">; 4901def warn_cxx98_compat_template_arg_object_internal : Warning< 4902 "non-type template argument referring to %select{function|object}0 %1 with " 4903 "internal linkage is incompatible with C++98">, 4904 InGroup<CXX98Compat>, DefaultIgnore; 4905def ext_template_arg_object_internal : ExtWarn< 4906 "non-type template argument referring to %select{function|object}0 %1 with " 4907 "internal linkage is a C++11 extension">, InGroup<CXX11>; 4908def err_template_arg_thread_local : Error< 4909 "non-type template argument refers to thread-local object">; 4910def note_template_arg_internal_object : Note< 4911 "non-type template argument refers to %select{function|object}0 here">; 4912def note_template_arg_refers_here : Note< 4913 "non-type template argument refers here">; 4914def err_template_arg_not_object_or_func : Error< 4915 "non-type template argument does not refer to an object or function">; 4916def err_template_arg_not_pointer_to_member_form : Error< 4917 "non-type template argument is not a pointer to member constant">; 4918def err_template_arg_member_ptr_base_derived_not_supported : Error< 4919 "sorry, non-type template argument of pointer-to-member type %1 that refers " 4920 "to member %q0 of a different class is not supported yet">; 4921def ext_template_arg_extra_parens : ExtWarn< 4922 "address non-type template argument cannot be surrounded by parentheses">; 4923def warn_cxx98_compat_template_arg_extra_parens : Warning< 4924 "redundant parentheses surrounding address non-type template argument are " 4925 "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore; 4926def err_pointer_to_member_type : Error< 4927 "invalid use of pointer to member type after %select{.*|->*}0">; 4928def err_pointer_to_member_call_drops_quals : Error< 4929 "call to pointer to member function of type %0 drops '%1' qualifier%s2">; 4930def err_pointer_to_member_oper_value_classify: Error< 4931 "pointer-to-member function type %0 can only be called on an " 4932 "%select{rvalue|lvalue}1">; 4933def ext_pointer_to_const_ref_member_on_rvalue : Extension< 4934 "invoking a pointer to a 'const &' member function on an rvalue is a C++20 extension">, 4935 InGroup<CXX20>, SFINAEFailure; 4936def warn_cxx17_compat_pointer_to_const_ref_member_on_rvalue : Warning< 4937 "invoking a pointer to a 'const &' member function on an rvalue is " 4938 "incompatible with C++ standards before C++20">, 4939 InGroup<CXXPre20CompatPedantic>, DefaultIgnore; 4940def ext_ms_deref_template_argument: ExtWarn< 4941 "non-type template argument containing a dereference operation is a " 4942 "Microsoft extension">, InGroup<MicrosoftTemplate>; 4943def ext_ms_delayed_template_argument: ExtWarn< 4944 "using the undeclared type %0 as a default template argument is a " 4945 "Microsoft extension">, InGroup<MicrosoftTemplate>; 4946def err_template_arg_deduced_incomplete_pack : Error< 4947 "deduced incomplete pack %0 for template parameter %1">; 4948 4949// C++ template specialization 4950def err_template_spec_unknown_kind : Error< 4951 "can only provide an explicit specialization for a class template, function " 4952 "template, variable template, or a member function, static data member, " 4953 "%select{or member class|member class, or member enumeration}0 of a " 4954 "class template">; 4955def note_specialized_entity : Note< 4956 "explicitly specialized declaration is here">; 4957def note_explicit_specialization_declared_here : Note< 4958 "explicit specialization declared here">; 4959def err_template_spec_decl_function_scope : Error< 4960 "explicit specialization of %0 in function scope">; 4961def err_template_spec_decl_friend : Error< 4962 "cannot declare an explicit specialization in a friend">; 4963def err_template_spec_redecl_out_of_scope : Error< 4964 "%select{class template|class template partial|variable template|" 4965 "variable template partial|function template|member " 4966 "function|static data member|member class|member enumeration}0 " 4967 "specialization of %1 not in %select{a namespace enclosing %2|" 4968 "class %2 or an enclosing namespace}3">; 4969def ext_ms_template_spec_redecl_out_of_scope: ExtWarn< 4970 "%select{class template|class template partial|variable template|" 4971 "variable template partial|function template|member " 4972 "function|static data member|member class|member enumeration}0 " 4973 "specialization of %1 not in %select{a namespace enclosing %2|" 4974 "class %2 or an enclosing namespace}3 " 4975 "is a Microsoft extension">, InGroup<MicrosoftTemplate>; 4976def err_template_spec_redecl_global_scope : Error< 4977 "%select{class template|class template partial|variable template|" 4978 "variable template partial|function template|member " 4979 "function|static data member|member class|member enumeration}0 " 4980 "specialization of %1 must occur at global scope">; 4981def err_spec_member_not_instantiated : Error< 4982 "specialization of member %q0 does not specialize an instantiated member">; 4983def note_specialized_decl : Note<"attempt to specialize declaration here">; 4984def err_specialization_after_instantiation : Error< 4985 "explicit specialization of %0 after instantiation">; 4986def note_instantiation_required_here : Note< 4987 "%select{implicit|explicit}0 instantiation first required here">; 4988def err_template_spec_friend : Error< 4989 "template specialization declaration cannot be a friend">; 4990def err_template_spec_default_arg : Error< 4991 "default argument not permitted on an explicit " 4992 "%select{instantiation|specialization}0 of function %1">; 4993def err_not_class_template_specialization : Error< 4994 "cannot specialize a %select{dependent template|template template " 4995 "parameter}0">; 4996def ext_explicit_specialization_storage_class : ExtWarn< 4997 "explicit specialization cannot have a storage class">; 4998def err_explicit_specialization_inconsistent_storage_class : Error< 4999 "explicit specialization has extraneous, inconsistent storage class " 5000 "'%select{none|extern|static|__private_extern__|auto|register}0'">; 5001def err_dependent_function_template_spec_no_match : Error< 5002 "no candidate function template was found for dependent" 5003 " friend function template specialization">; 5004def note_dependent_function_template_spec_discard_reason : Note< 5005 "candidate ignored: %select{not a function template" 5006 "|not a member of the enclosing namespace;" 5007 " did you mean to explicitly qualify the specialization?}0">; 5008 5009// C++ class template specializations and out-of-line definitions 5010def err_template_spec_needs_header : Error< 5011 "template specialization requires 'template<>'">; 5012def err_template_spec_needs_template_parameters : Error< 5013 "template specialization or definition requires a template parameter list " 5014 "corresponding to the nested type %0">; 5015def err_template_param_list_matches_nontemplate : Error< 5016 "template parameter list matching the non-templated nested type %0 should " 5017 "be empty ('template<>')">; 5018def err_alias_template_extra_headers : Error< 5019 "extraneous template parameter list in alias template declaration">; 5020def err_template_spec_extra_headers : Error< 5021 "extraneous template parameter list in template specialization or " 5022 "out-of-line template definition">; 5023def warn_template_spec_extra_headers : Warning< 5024 "extraneous template parameter list in template specialization">; 5025def note_explicit_template_spec_does_not_need_header : Note< 5026 "'template<>' header not required for explicitly-specialized class %0 " 5027 "declared here">; 5028def err_template_qualified_declarator_no_match : Error< 5029 "nested name specifier '%0' for declaration does not refer into a class, " 5030 "class template or class template partial specialization">; 5031def err_specialize_member_of_template : Error< 5032 "cannot specialize %select{|(with 'template<>') }0a member of an " 5033 "unspecialized template">; 5034 5035// C++ Class Template Partial Specialization 5036def err_default_arg_in_partial_spec : Error< 5037 "default template argument in a class template partial specialization">; 5038def err_dependent_non_type_arg_in_partial_spec : Error< 5039 "type of specialized non-type template argument depends on a template " 5040 "parameter of the partial specialization">; 5041def note_dependent_non_type_default_arg_in_partial_spec : Note< 5042 "template parameter is used in default argument declared here">; 5043def err_dependent_typed_non_type_arg_in_partial_spec : Error< 5044 "non-type template argument specializes a template parameter with " 5045 "dependent type %0">; 5046def err_partial_spec_args_match_primary_template : Error< 5047 "%select{class|variable}0 template partial specialization does not " 5048 "specialize any template argument; to %select{declare|define}1 the " 5049 "primary template, remove the template argument list">; 5050def ext_partial_spec_not_more_specialized_than_primary : ExtWarn< 5051 "%select{class|variable}0 template partial specialization is not " 5052 "more specialized than the primary template">, DefaultError, 5053 InGroup<DiagGroup<"invalid-partial-specialization">>; 5054def note_partial_spec_not_more_specialized_than_primary : Note<"%0">; 5055def ext_partial_specs_not_deducible : ExtWarn< 5056 "%select{class|variable}0 template partial specialization contains " 5057 "%select{a template parameter|template parameters}1 that cannot be " 5058 "deduced; this partial specialization will never be used">, 5059 DefaultError, InGroup<DiagGroup<"unusable-partial-specialization">>; 5060def note_non_deducible_parameter : Note< 5061 "non-deducible template parameter %0">; 5062def err_partial_spec_ordering_ambiguous : Error< 5063 "ambiguous partial specializations of %0">; 5064def note_partial_spec_match : Note<"partial specialization matches %0">; 5065def err_partial_spec_redeclared : Error< 5066 "class template partial specialization %0 cannot be redeclared">; 5067def note_partial_specialization_declared_here : Note< 5068 "explicit specialization declared here">; 5069def note_prev_partial_spec_here : Note< 5070 "previous declaration of class template partial specialization %0 is here">; 5071def err_partial_spec_fully_specialized : Error< 5072 "partial specialization of %0 does not use any of its template parameters">; 5073 5074// C++ Variable Template Partial Specialization 5075def err_var_partial_spec_redeclared : Error< 5076 "variable template partial specialization %0 cannot be redefined">; 5077def note_var_prev_partial_spec_here : Note< 5078 "previous declaration of variable template partial specialization is here">; 5079def err_var_spec_no_template : Error< 5080 "no variable template matches%select{| partial}0 specialization">; 5081def err_var_spec_no_template_but_method : Error< 5082 "no variable template matches specialization; " 5083 "did you mean to use %0 as function template instead?">; 5084 5085// C++ Function template specializations 5086def err_function_template_spec_no_match : Error< 5087 "no function template matches function template specialization %0">; 5088def err_function_template_spec_ambiguous : Error< 5089 "function template specialization %0 ambiguously refers to more than one " 5090 "function template; explicitly specify%select{| additional}1 template " 5091 "arguments to identify a particular function template">; 5092def note_function_template_spec_matched : Note< 5093 "function template %q0 matches specialization %1">; 5094def err_function_template_partial_spec : Error< 5095 "function template partial specialization is not allowed">; 5096 5097// C++ Template Instantiation 5098def err_template_recursion_depth_exceeded : Error< 5099 "recursive template instantiation exceeded maximum depth of %0">, 5100 DefaultFatal, NoSFINAE; 5101def note_template_recursion_depth : Note< 5102 "use -ftemplate-depth=N to increase recursive template instantiation depth">; 5103 5104def err_template_instantiate_within_definition : Error< 5105 "%select{implicit|explicit}0 instantiation of template %1 within its" 5106 " own definition">; 5107def err_template_instantiate_undefined : Error< 5108 "%select{implicit|explicit}0 instantiation of undefined template %1">; 5109def err_implicit_instantiate_member_undefined : Error< 5110 "implicit instantiation of undefined member %0">; 5111def note_template_class_instantiation_was_here : Note< 5112 "class template %0 was instantiated here">; 5113def note_template_class_explicit_specialization_was_here : Note< 5114 "class template %0 was explicitly specialized here">; 5115def note_template_class_instantiation_here : Note< 5116 "in instantiation of template class %q0 requested here">; 5117def note_template_member_class_here : Note< 5118 "in instantiation of member class %q0 requested here">; 5119def note_template_member_function_here : Note< 5120 "in instantiation of member function %q0 requested here">; 5121def note_function_template_spec_here : Note< 5122 "in instantiation of function template specialization %q0 requested here">; 5123def note_template_static_data_member_def_here : Note< 5124 "in instantiation of static data member %q0 requested here">; 5125def note_template_variable_def_here : Note< 5126 "in instantiation of variable template specialization %q0 requested here">; 5127def note_template_enum_def_here : Note< 5128 "in instantiation of enumeration %q0 requested here">; 5129def note_template_nsdmi_here : Note< 5130 "in instantiation of default member initializer %q0 requested here">; 5131def note_template_type_alias_instantiation_here : Note< 5132 "in instantiation of template type alias %0 requested here">; 5133def note_template_exception_spec_instantiation_here : Note< 5134 "in instantiation of exception specification for %0 requested here">; 5135def note_template_requirement_instantiation_here : Note< 5136 "in instantiation of requirement here">; 5137def warn_var_template_missing : Warning<"instantiation of variable %q0 " 5138 "required here, but no definition is available">, 5139 InGroup<UndefinedVarTemplate>; 5140def warn_func_template_missing : Warning<"instantiation of function %q0 " 5141 "required here, but no definition is available">, 5142 InGroup<UndefinedFuncTemplate>, DefaultIgnore; 5143def note_forward_template_decl : Note< 5144 "forward declaration of template entity is here">; 5145def note_inst_declaration_hint : Note<"add an explicit instantiation " 5146 "declaration to suppress this warning if %q0 is explicitly instantiated in " 5147 "another translation unit">; 5148def note_evaluating_exception_spec_here : Note< 5149 "in evaluation of exception specification for %q0 needed here">; 5150 5151def note_default_arg_instantiation_here : Note< 5152 "in instantiation of default argument for '%0' required here">; 5153def note_default_function_arg_instantiation_here : Note< 5154 "in instantiation of default function argument expression " 5155 "for '%0' required here">; 5156def note_explicit_template_arg_substitution_here : Note< 5157 "while substituting explicitly-specified template arguments into function " 5158 "template %0 %1">; 5159def note_function_template_deduction_instantiation_here : Note< 5160 "while substituting deduced template arguments into function template %0 " 5161 "%1">; 5162def note_deduced_template_arg_substitution_here : Note< 5163 "during template argument deduction for %select{class|variable}0 template " 5164 "%select{partial specialization |}1%2 %3">; 5165def note_prior_template_arg_substitution : Note< 5166 "while substituting prior template arguments into %select{non-type|template}0" 5167 " template parameter%1 %2">; 5168def note_template_default_arg_checking : Note< 5169 "while checking a default template argument used here">; 5170def note_concept_specialization_here : Note< 5171 "while checking the satisfaction of concept '%0' requested here">; 5172def note_nested_requirement_here : Note< 5173 "while checking the satisfaction of nested requirement requested here">; 5174def note_checking_constraints_for_template_id_here : Note< 5175 "while checking constraint satisfaction for template '%0' required here">; 5176def note_checking_constraints_for_var_spec_id_here : Note< 5177 "while checking constraint satisfaction for variable template " 5178 "partial specialization '%0' required here">; 5179def note_checking_constraints_for_class_spec_id_here : Note< 5180 "while checking constraint satisfaction for class template partial " 5181 "specialization '%0' required here">; 5182def note_checking_constraints_for_function_here : Note< 5183 "while checking constraint satisfaction for function '%0' required here">; 5184def note_constraint_substitution_here : Note< 5185 "while substituting template arguments into constraint expression here">; 5186def note_constraint_normalization_here : Note< 5187 "while calculating associated constraint of template '%0' here">; 5188def note_parameter_mapping_substitution_here : Note< 5189 "while substituting into concept arguments here; substitution failures not " 5190 "allowed in concept arguments">; 5191def note_instantiation_contexts_suppressed : Note< 5192 "(skipping %0 context%s0 in backtrace; use -ftemplate-backtrace-limit=0 to " 5193 "see all)">; 5194 5195def err_field_instantiates_to_function : Error< 5196 "data member instantiated with function type %0">; 5197def err_variable_instantiates_to_function : Error< 5198 "%select{variable|static data member}0 instantiated with function type %1">; 5199def err_nested_name_spec_non_tag : Error< 5200 "type %0 cannot be used prior to '::' because it has no members">; 5201 5202def err_using_pack_expansion_empty : Error< 5203 "%select{|member}0 using declaration %1 instantiates to an empty pack">; 5204 5205// C++ Explicit Instantiation 5206def err_explicit_instantiation_duplicate : Error< 5207 "duplicate explicit instantiation of %0">; 5208def ext_explicit_instantiation_duplicate : ExtWarn< 5209 "duplicate explicit instantiation of %0 ignored as a Microsoft extension">, 5210 InGroup<MicrosoftTemplate>; 5211def note_previous_explicit_instantiation : Note< 5212 "previous explicit instantiation is here">; 5213def warn_explicit_instantiation_after_specialization : Warning< 5214 "explicit instantiation of %0 that occurs after an explicit " 5215 "specialization has no effect">, 5216 InGroup<DiagGroup<"instantiation-after-specialization">>; 5217def note_previous_template_specialization : Note< 5218 "previous template specialization is here">; 5219def err_explicit_instantiation_nontemplate_type : Error< 5220 "explicit instantiation of non-templated type %0">; 5221def note_nontemplate_decl_here : Note< 5222 "non-templated declaration is here">; 5223def err_explicit_instantiation_in_class : Error< 5224 "explicit instantiation of %0 in class scope">; 5225def err_explicit_instantiation_out_of_scope : Error< 5226 "explicit instantiation of %0 not in a namespace enclosing %1">; 5227def err_explicit_instantiation_must_be_global : Error< 5228 "explicit instantiation of %0 must occur at global scope">; 5229def warn_explicit_instantiation_out_of_scope_0x : Warning< 5230 "explicit instantiation of %0 not in a namespace enclosing %1">, 5231 InGroup<CXX11Compat>, DefaultIgnore; 5232def warn_explicit_instantiation_must_be_global_0x : Warning< 5233 "explicit instantiation of %0 must occur at global scope">, 5234 InGroup<CXX11Compat>, DefaultIgnore; 5235 5236def err_explicit_instantiation_requires_name : Error< 5237 "explicit instantiation declaration requires a name">; 5238def err_explicit_instantiation_of_typedef : Error< 5239 "explicit instantiation of typedef %0">; 5240def err_explicit_instantiation_storage_class : Error< 5241 "explicit instantiation cannot have a storage class">; 5242def err_explicit_instantiation_internal_linkage : Error< 5243 "explicit instantiation declaration of %0 with internal linkage">; 5244def err_explicit_instantiation_not_known : Error< 5245 "explicit instantiation of %0 does not refer to a function template, " 5246 "variable template, member function, member class, or static data member">; 5247def note_explicit_instantiation_here : Note< 5248 "explicit instantiation refers here">; 5249def err_explicit_instantiation_data_member_not_instantiated : Error< 5250 "explicit instantiation refers to static data member %q0 that is not an " 5251 "instantiation">; 5252def err_explicit_instantiation_member_function_not_instantiated : Error< 5253 "explicit instantiation refers to member function %q0 that is not an " 5254 "instantiation">; 5255def err_explicit_instantiation_ambiguous : Error< 5256 "partial ordering for explicit instantiation of %0 is ambiguous">; 5257def note_explicit_instantiation_candidate : Note< 5258 "explicit instantiation candidate function %q0 template here %1">; 5259def err_explicit_instantiation_inline : Error< 5260 "explicit instantiation cannot be 'inline'">; 5261def warn_explicit_instantiation_inline_0x : Warning< 5262 "explicit instantiation cannot be 'inline'">, InGroup<CXX11Compat>, 5263 DefaultIgnore; 5264def err_explicit_instantiation_constexpr : Error< 5265 "explicit instantiation cannot be 'constexpr'">; 5266def ext_explicit_instantiation_without_qualified_id : Extension< 5267 "qualifier in explicit instantiation of %q0 requires a template-id " 5268 "(a typedef is not permitted)">; 5269def err_explicit_instantiation_without_template_id : Error< 5270 "explicit instantiation of %q0 must specify a template argument list">; 5271def err_explicit_instantiation_unqualified_wrong_namespace : Error< 5272 "explicit instantiation of %q0 must occur in namespace %1">; 5273def warn_explicit_instantiation_unqualified_wrong_namespace_0x : Warning< 5274 "explicit instantiation of %q0 must occur in namespace %1">, 5275 InGroup<CXX11Compat>, DefaultIgnore; 5276def err_explicit_instantiation_undefined_member : Error< 5277 "explicit instantiation of undefined %select{member class|member function|" 5278 "static data member}0 %1 of class template %2">; 5279def err_explicit_instantiation_undefined_func_template : Error< 5280 "explicit instantiation of undefined function template %0">; 5281def err_explicit_instantiation_undefined_var_template : Error< 5282 "explicit instantiation of undefined variable template %q0">; 5283def err_explicit_instantiation_declaration_after_definition : Error< 5284 "explicit instantiation declaration (with 'extern') follows explicit " 5285 "instantiation definition (without 'extern')">; 5286def note_explicit_instantiation_definition_here : Note< 5287 "explicit instantiation definition is here">; 5288def err_invalid_var_template_spec_type : Error<"type %2 " 5289 "of %select{explicit instantiation|explicit specialization|" 5290 "partial specialization|redeclaration}0 of %1 does not match" 5291 " expected type %3">; 5292def err_mismatched_exception_spec_explicit_instantiation : Error< 5293 "exception specification in explicit instantiation does not match " 5294 "instantiated one">; 5295def ext_mismatched_exception_spec_explicit_instantiation : ExtWarn< 5296 err_mismatched_exception_spec_explicit_instantiation.Text>, 5297 InGroup<MicrosoftExceptionSpec>; 5298def err_explicit_instantiation_dependent : Error< 5299 "explicit instantiation has dependent template arguments">; 5300 5301// C++ typename-specifiers 5302def err_typename_nested_not_found : Error<"no type named %0 in %1">; 5303def err_typename_nested_not_found_enable_if : Error< 5304 "no type named 'type' in %0; 'enable_if' cannot be used to disable " 5305 "this declaration">; 5306def err_typename_nested_not_found_requirement : Error< 5307 "failed requirement '%0'; 'enable_if' cannot be used to disable this " 5308 "declaration">; 5309def err_typename_nested_not_type : Error< 5310 "typename specifier refers to non-type member %0 in %1">; 5311def err_typename_not_type : Error< 5312 "typename specifier refers to non-type %0">; 5313def note_typename_member_refers_here : Note< 5314 "referenced member %0 is declared here">; 5315def note_typename_refers_here : Note< 5316 "referenced %0 is declared here">; 5317def err_typename_missing : Error< 5318 "missing 'typename' prior to dependent type name '%0%1'">; 5319def err_typename_missing_template : Error< 5320 "missing 'typename' prior to dependent type template name '%0%1'">; 5321def ext_typename_missing : ExtWarn< 5322 "missing 'typename' prior to dependent type name '%0%1'">, 5323 InGroup<DiagGroup<"typename-missing">>; 5324def ext_typename_outside_of_template : ExtWarn< 5325 "'typename' occurs outside of a template">, InGroup<CXX11>; 5326def warn_cxx98_compat_typename_outside_of_template : Warning< 5327 "use of 'typename' outside of a template is incompatible with C++98">, 5328 InGroup<CXX98Compat>, DefaultIgnore; 5329def err_typename_refers_to_using_value_decl : Error< 5330 "typename specifier refers to a dependent using declaration for a value " 5331 "%0 in %1">; 5332def note_using_value_decl_missing_typename : Note< 5333 "add 'typename' to treat this using declaration as a type">; 5334 5335def err_template_kw_refers_to_non_template : Error< 5336 "%0%select{| following the 'template' keyword}1 " 5337 "does not refer to a template">; 5338def note_template_kw_refers_to_non_template : Note< 5339 "declared as a non-template here">; 5340def err_template_kw_refers_to_dependent_non_template : Error< 5341 "%0%select{| following the 'template' keyword}1 " 5342 "cannot refer to a dependent template">; 5343def err_template_kw_refers_to_class_template : Error< 5344 "'%0%1' instantiated to a class template, not a function template">; 5345def note_referenced_class_template : Note< 5346 "class template declared here">; 5347def err_template_kw_missing : Error< 5348 "missing 'template' keyword prior to dependent template name '%0%1'">; 5349def ext_template_outside_of_template : ExtWarn< 5350 "'template' keyword outside of a template">, InGroup<CXX11>; 5351def warn_cxx98_compat_template_outside_of_template : Warning< 5352 "use of 'template' keyword outside of a template is incompatible with C++98">, 5353 InGroup<CXX98Compat>, DefaultIgnore; 5354 5355def err_non_type_template_in_nested_name_specifier : Error< 5356 "qualified name refers into a specialization of %select{function|variable}0 " 5357 "template %1">; 5358def err_template_id_not_a_type : Error< 5359 "template name refers to non-type template %0">; 5360def note_template_declared_here : Note< 5361 "%select{function template|class template|variable template" 5362 "|type alias template|template template parameter}0 " 5363 "%1 declared here">; 5364def err_template_expansion_into_fixed_list : Error< 5365 "pack expansion used as argument for non-pack parameter of %select{alias " 5366 "template|concept}0">; 5367def note_parameter_type : Note< 5368 "parameter of type %0 is declared here">; 5369 5370// C++11 Variadic Templates 5371def err_template_param_pack_default_arg : Error< 5372 "template parameter pack cannot have a default argument">; 5373def err_template_param_pack_must_be_last_template_parameter : Error< 5374 "template parameter pack must be the last template parameter">; 5375 5376def err_template_parameter_pack_non_pack : Error< 5377 "%select{template type|non-type template|template template}0 parameter" 5378 "%select{| pack}1 conflicts with previous %select{template type|" 5379 "non-type template|template template}0 parameter%select{ pack|}1">; 5380def note_template_parameter_pack_non_pack : Note< 5381 "%select{template type|non-type template|template template}0 parameter" 5382 "%select{| pack}1 does not match %select{template type|non-type template" 5383 "|template template}0 parameter%select{ pack|}1 in template argument">; 5384def note_template_parameter_pack_here : Note< 5385 "previous %select{template type|non-type template|template template}0 " 5386 "parameter%select{| pack}1 declared here">; 5387 5388def err_unexpanded_parameter_pack : Error< 5389 "%select{expression|base type|declaration type|data member type|bit-field " 5390 "size|static assertion|fixed underlying type|enumerator value|" 5391 "using declaration|friend declaration|qualifier|initializer|default argument|" 5392 "non-type template parameter type|exception type|partial specialization|" 5393 "__if_exists name|__if_not_exists name|lambda|block|type constraint|" 5394 "requirement|requires clause}0 " 5395 "contains%plural{0: an|:}1 unexpanded parameter pack" 5396 "%plural{0:|1: %2|2:s %2 and %3|:s %2, %3, ...}1">; 5397 5398def err_pack_expansion_without_parameter_packs : Error< 5399 "pack expansion does not contain any unexpanded parameter packs">; 5400def err_pack_expansion_length_conflict : Error< 5401 "pack expansion contains parameter packs %0 and %1 that have different " 5402 "lengths (%2 vs. %3)">; 5403def err_pack_expansion_length_conflict_multilevel : Error< 5404 "pack expansion contains parameter pack %0 that has a different " 5405 "length (%1 vs. %2) from outer parameter packs">; 5406def err_pack_expansion_length_conflict_partial : Error< 5407 "pack expansion contains parameter pack %0 that has a different " 5408 "length (at least %1 vs. %2) from outer parameter packs">; 5409def err_pack_expansion_member_init : Error< 5410 "pack expansion for initialization of member %0">; 5411 5412def err_function_parameter_pack_without_parameter_packs : Error< 5413 "type %0 of function parameter pack does not contain any unexpanded " 5414 "parameter packs">; 5415def err_ellipsis_in_declarator_not_parameter : Error< 5416 "only function and template parameters can be parameter packs">; 5417 5418def err_sizeof_pack_no_pack_name : Error< 5419 "%0 does not refer to the name of a parameter pack">; 5420 5421def err_fold_expression_packs_both_sides : Error< 5422 "binary fold expression has unexpanded parameter packs in both operands">; 5423def err_fold_expression_empty : Error< 5424 "unary fold expression has empty expansion for operator '%0' " 5425 "with no fallback value">; 5426def err_fold_expression_bad_operand : Error< 5427 "expression not permitted as operand of fold expression">; 5428def err_fold_expression_limit_exceeded: Error< 5429 "instantiating fold expression with %0 arguments exceeded expression nesting " 5430 "limit of %1">, DefaultFatal, NoSFINAE; 5431 5432def err_unexpected_typedef : Error< 5433 "unexpected type name %0: expected expression">; 5434def err_unexpected_namespace : Error< 5435 "unexpected namespace name %0: expected expression">; 5436def err_undeclared_var_use : Error<"use of undeclared identifier %0">; 5437def ext_undeclared_unqual_id_with_dependent_base : ExtWarn< 5438 "use of undeclared identifier %0; " 5439 "unqualified lookup into dependent bases of class template %1 is a Microsoft extension">, 5440 InGroup<MicrosoftTemplate>; 5441def err_found_in_dependent_base : Error< 5442 "explicit qualification required to use member %0 from dependent base class">; 5443def ext_found_in_dependent_base : ExtWarn<"use of member %0 " 5444 "found via unqualified lookup into dependent bases of class templates is a " 5445 "Microsoft extension">, InGroup<MicrosoftTemplate>; 5446def err_found_later_in_class : Error<"member %0 used before its declaration">; 5447def ext_found_later_in_class : ExtWarn< 5448 "use of member %0 before its declaration is a Microsoft extension">, 5449 InGroup<MicrosoftTemplate>; 5450def note_dependent_member_use : Note< 5451 "must qualify identifier to find this declaration in dependent base class">; 5452def err_not_found_by_two_phase_lookup : Error<"call to function %0 that is neither " 5453 "visible in the template definition nor found by argument-dependent lookup">; 5454def note_not_found_by_two_phase_lookup : Note<"%0 should be declared prior to the " 5455 "call site%select{| or in %2| or in an associated namespace of one of its arguments}1">; 5456def err_undeclared_use : Error<"use of undeclared %0">; 5457def warn_deprecated : Warning<"%0 is deprecated">, 5458 InGroup<DeprecatedDeclarations>; 5459def note_from_diagnose_if : Note<"from 'diagnose_if' attribute on %0:">; 5460def warn_property_method_deprecated : 5461 Warning<"property access is using %0 method which is deprecated">, 5462 InGroup<DeprecatedDeclarations>; 5463def warn_deprecated_message : Warning<"%0 is deprecated: %1">, 5464 InGroup<DeprecatedDeclarations>; 5465def warn_deprecated_anonymous_namespace : Warning< 5466 "'deprecated' attribute on anonymous namespace ignored">, 5467 InGroup<IgnoredAttributes>; 5468def warn_deprecated_fwdclass_message : Warning< 5469 "%0 may be deprecated because the receiver type is unknown">, 5470 InGroup<DeprecatedDeclarations>; 5471def warn_deprecated_def : Warning< 5472 "implementing deprecated %select{method|class|category}0">, 5473 InGroup<DeprecatedImplementations>, DefaultIgnore; 5474def warn_unavailable_def : Warning< 5475 "implementing unavailable method">, 5476 InGroup<DeprecatedImplementations>, DefaultIgnore; 5477def err_unavailable : Error<"%0 is unavailable">; 5478def err_property_method_unavailable : 5479 Error<"property access is using %0 method which is unavailable">; 5480def err_unavailable_message : Error<"%0 is unavailable: %1">; 5481def warn_unavailable_fwdclass_message : Warning< 5482 "%0 may be unavailable because the receiver type is unknown">, 5483 InGroup<UnavailableDeclarations>; 5484def note_availability_specified_here : Note< 5485 "%0 has been explicitly marked " 5486 "%select{unavailable|deleted|deprecated}1 here">; 5487def note_partial_availability_specified_here : Note< 5488 "%0 has been marked as being introduced in %1 %2 here, " 5489 "but the deployment target is %1 %3">; 5490def note_implicitly_deleted : Note< 5491 "explicitly defaulted function was implicitly deleted here">; 5492def warn_not_enough_argument : Warning< 5493 "not enough variable arguments in %0 declaration to fit a sentinel">, 5494 InGroup<Sentinel>; 5495def warn_missing_sentinel : Warning < 5496 "missing sentinel in %select{function call|method dispatch|block call}0">, 5497 InGroup<Sentinel>; 5498def note_sentinel_here : Note< 5499 "%select{function|method|block}0 has been explicitly marked sentinel here">; 5500def warn_missing_prototype : Warning< 5501 "no previous prototype for function %0">, 5502 InGroup<DiagGroup<"missing-prototypes">>, DefaultIgnore; 5503def note_declaration_not_a_prototype : Note< 5504 "this declaration is not a prototype; add %select{'void'|parameter declarations}0 " 5505 "to make it %select{a prototype for a zero-parameter function|one}0">; 5506def warn_strict_prototypes : Warning< 5507 "this %select{function declaration is not|block declaration is not|" 5508 "old-style function definition is not preceded by}0 a prototype">, 5509 InGroup<DiagGroup<"strict-prototypes">>, DefaultIgnore; 5510def warn_missing_variable_declarations : Warning< 5511 "no previous extern declaration for non-static variable %0">, 5512 InGroup<DiagGroup<"missing-variable-declarations">>, DefaultIgnore; 5513def note_static_for_internal_linkage : Note< 5514 "declare 'static' if the %select{variable|function}0 is not intended to be " 5515 "used outside of this translation unit">; 5516def err_static_data_member_reinitialization : 5517 Error<"static data member %0 already has an initializer">; 5518def err_redefinition : Error<"redefinition of %0">; 5519def err_alias_after_tentative : 5520 Error<"alias definition of %0 after tentative definition">; 5521def err_alias_is_definition : 5522 Error<"definition %0 cannot also be an %select{alias|ifunc}1">; 5523def err_definition_of_implicitly_declared_member : Error< 5524 "definition of implicitly declared %select{default constructor|copy " 5525 "constructor|move constructor|copy assignment operator|move assignment " 5526 "operator|destructor|function}1">; 5527def err_definition_of_explicitly_defaulted_member : Error< 5528 "definition of explicitly defaulted %select{default constructor|copy " 5529 "constructor|move constructor|copy assignment operator|move assignment " 5530 "operator|destructor|function}0">; 5531def err_redefinition_extern_inline : Error< 5532 "redefinition of a 'extern inline' function %0 is not supported in " 5533 "%select{C99 mode|C++}1">; 5534def warn_attr_abi_tag_namespace : Warning< 5535 "'abi_tag' attribute on %select{non-inline|anonymous}0 namespace ignored">, 5536 InGroup<IgnoredAttributes>; 5537def err_abi_tag_on_redeclaration : Error< 5538 "cannot add 'abi_tag' attribute in a redeclaration">; 5539def err_new_abi_tag_on_redeclaration : Error< 5540 "'abi_tag' %0 missing in original declaration">; 5541def note_use_ifdef_guards : Note< 5542 "unguarded header; consider using #ifdef guards or #pragma once">; 5543 5544def note_deleted_dtor_no_operator_delete : Note< 5545 "virtual destructor requires an unambiguous, accessible 'operator delete'">; 5546def note_deleted_special_member_class_subobject : Note< 5547 "%select{default constructor of|copy constructor of|move constructor of|" 5548 "copy assignment operator of|move assignment operator of|destructor of|" 5549 "constructor inherited by}0 " 5550 "%1 is implicitly deleted because " 5551 "%select{base class %3|%select{||||variant }4field %3}2 " 5552 "%select{has " 5553 "%select{no|a deleted|multiple|an inaccessible|a non-trivial}4 " 5554 "%select{%select{default constructor|copy constructor|move constructor|copy " 5555 "assignment operator|move assignment operator|destructor|" 5556 "%select{default|corresponding|default|default|default}4 constructor}0|" 5557 "destructor}5" 5558 "%select{||s||}4" 5559 "|is an ObjC pointer}6">; 5560def note_deleted_default_ctor_uninit_field : Note< 5561 "%select{default constructor of|constructor inherited by}0 " 5562 "%1 is implicitly deleted because field %2 of " 5563 "%select{reference|const-qualified}4 type %3 would not be initialized">; 5564def note_deleted_default_ctor_all_const : Note< 5565 "%select{default constructor of|constructor inherited by}0 " 5566 "%1 is implicitly deleted because all " 5567 "%select{data members|data members of an anonymous union member}2" 5568 " are const-qualified">; 5569def note_deleted_copy_ctor_rvalue_reference : Note< 5570 "copy constructor of %0 is implicitly deleted because field %1 is of " 5571 "rvalue reference type %2">; 5572def note_deleted_copy_user_declared_move : Note< 5573 "copy %select{constructor|assignment operator}0 is implicitly deleted because" 5574 " %1 has a user-declared move %select{constructor|assignment operator}2">; 5575def note_deleted_assign_field : Note< 5576 "%select{copy|move}0 assignment operator of %1 is implicitly deleted " 5577 "because field %2 is of %select{reference|const-qualified}4 type %3">; 5578 5579// These should be errors. 5580def warn_undefined_internal : Warning< 5581 "%select{function|variable}0 %q1 has internal linkage but is not defined">, 5582 InGroup<DiagGroup<"undefined-internal">>; 5583def err_undefined_internal_type : Error< 5584 "%select{function|variable}0 %q1 is used but not defined in this " 5585 "translation unit, and cannot be defined in any other translation unit " 5586 "because its type does not have linkage">; 5587def ext_undefined_internal_type : Extension< 5588 "ISO C++ requires a definition in this translation unit for " 5589 "%select{function|variable}0 %q1 because its type does not have linkage">, 5590 InGroup<DiagGroup<"undefined-internal-type">>; 5591def warn_undefined_inline : Warning<"inline function %q0 is not defined">, 5592 InGroup<DiagGroup<"undefined-inline">>; 5593def err_undefined_inline_var : Error<"inline variable %q0 is not defined">; 5594def note_used_here : Note<"used here">; 5595 5596def err_attribute_missing_on_first_decl : Error< 5597 "%0 attribute does not appear on the first declaration">; 5598def warn_internal_linkage_local_storage : Warning< 5599 "'internal_linkage' attribute on a non-static local variable is ignored">, 5600 InGroup<IgnoredAttributes>; 5601 5602def ext_internal_in_extern_inline : ExtWarn< 5603 "static %select{function|variable}0 %1 is used in an inline function with " 5604 "external linkage">, InGroup<StaticInInline>; 5605def ext_internal_in_extern_inline_quiet : Extension< 5606 "static %select{function|variable}0 %1 is used in an inline function with " 5607 "external linkage">, InGroup<StaticInInline>; 5608def warn_static_local_in_extern_inline : Warning< 5609 "non-constant static local variable in inline function may be different " 5610 "in different files">, InGroup<StaticLocalInInline>; 5611def note_convert_inline_to_static : Note< 5612 "use 'static' to give inline function %0 internal linkage">; 5613 5614def ext_redefinition_of_typedef : ExtWarn< 5615 "redefinition of typedef %0 is a C11 feature">, 5616 InGroup<DiagGroup<"typedef-redefinition"> >; 5617def err_redefinition_variably_modified_typedef : Error< 5618 "redefinition of %select{typedef|type alias}0 for variably-modified type %1">; 5619 5620def err_inline_decl_follows_def : Error< 5621 "inline declaration of %0 follows non-inline definition">; 5622def err_inline_declaration_block_scope : Error< 5623 "inline declaration of %0 not allowed in block scope">; 5624def err_static_non_static : Error< 5625 "static declaration of %0 follows non-static declaration">; 5626def err_different_language_linkage : Error< 5627 "declaration of %0 has a different language linkage">; 5628def ext_retained_language_linkage : Extension< 5629 "friend function %0 retaining previous language linkage is an extension">, 5630 InGroup<DiagGroup<"retained-language-linkage">>; 5631def err_extern_c_global_conflict : Error< 5632 "declaration of %1 %select{with C language linkage|in global scope}0 " 5633 "conflicts with declaration %select{in global scope|with C language linkage}0">; 5634def note_extern_c_global_conflict : Note< 5635 "declared %select{in global scope|with C language linkage}0 here">; 5636def note_extern_c_begins_here : Note< 5637 "extern \"C\" language linkage specification begins here">; 5638def warn_weak_import : Warning < 5639 "an already-declared variable is made a weak_import declaration %0">; 5640def ext_static_non_static : Extension< 5641 "redeclaring non-static %0 as static is a Microsoft extension">, 5642 InGroup<MicrosoftRedeclareStatic>; 5643def err_non_static_static : Error< 5644 "non-static declaration of %0 follows static declaration">; 5645def err_extern_non_extern : Error< 5646 "extern declaration of %0 follows non-extern declaration">; 5647def err_non_extern_extern : Error< 5648 "non-extern declaration of %0 follows extern declaration">; 5649def err_non_thread_thread : Error< 5650 "non-thread-local declaration of %0 follows thread-local declaration">; 5651def err_thread_non_thread : Error< 5652 "thread-local declaration of %0 follows non-thread-local declaration">; 5653def err_thread_thread_different_kind : Error< 5654 "thread-local declaration of %0 with %select{static|dynamic}1 initialization " 5655 "follows declaration with %select{dynamic|static}1 initialization">; 5656def err_mismatched_owning_module : Error< 5657 "declaration of %0 in %select{the global module|module %2}1 follows " 5658 "declaration in %select{the global module|module %4}3">; 5659def err_redefinition_different_type : Error< 5660 "redefinition of %0 with a different type%diff{: $ vs $|}1,2">; 5661def err_redefinition_different_kind : Error< 5662 "redefinition of %0 as different kind of symbol">; 5663def err_redefinition_different_namespace_alias : Error< 5664 "redefinition of %0 as an alias for a different namespace">; 5665def note_previous_namespace_alias : Note< 5666 "previously defined as an alias for %0">; 5667def warn_forward_class_redefinition : Warning< 5668 "redefinition of forward class %0 of a typedef name of an object type is ignored">, 5669 InGroup<DiagGroup<"objc-forward-class-redefinition">>; 5670def err_redefinition_different_typedef : Error< 5671 "%select{typedef|type alias|type alias template}0 " 5672 "redefinition with different types%diff{ ($ vs $)|}1,2">; 5673def err_tag_reference_non_tag : Error< 5674 "%select{non-struct type|non-class type|non-union type|non-enum " 5675 "type|typedef|type alias|template|type alias template|template " 5676 "template argument}1 %0 cannot be referenced with a " 5677 "%select{struct|interface|union|class|enum}2 specifier">; 5678def err_tag_reference_conflict : Error< 5679 "implicit declaration introduced by elaborated type conflicts with a " 5680 "%select{non-struct type|non-class type|non-union type|non-enum " 5681 "type|typedef|type alias|template|type alias template|template " 5682 "template argument}0 of the same name">; 5683def err_dependent_tag_decl : Error< 5684 "%select{declaration|definition}0 of " 5685 "%select{struct|interface|union|class|enum}1 in a dependent scope">; 5686def err_tag_definition_of_typedef : Error< 5687 "definition of type %0 conflicts with %select{typedef|type alias}1 of the same name">; 5688def err_conflicting_types : Error<"conflicting types for %0">; 5689def err_different_pass_object_size_params : Error< 5690 "conflicting pass_object_size attributes on parameters">; 5691def err_late_asm_label_name : Error< 5692 "cannot apply asm label to %select{variable|function}0 after its first use">; 5693def err_different_asm_label : Error<"conflicting asm label">; 5694def err_nested_redefinition : Error<"nested redefinition of %0">; 5695def err_use_with_wrong_tag : Error< 5696 "use of %0 with tag type that does not match previous declaration">; 5697def warn_struct_class_tag_mismatch : Warning< 5698 "%select{struct|interface|class}0%select{| template}1 %2 was previously " 5699 "declared as a %select{struct|interface|class}3%select{| template}1; " 5700 "this is valid, but may result in linker errors under the Microsoft C++ ABI">, 5701 InGroup<MismatchedTags>, DefaultIgnore; 5702def warn_struct_class_previous_tag_mismatch : Warning< 5703 "%2 defined as %select{a struct|an interface|a class}0%select{| template}1 " 5704 "here but previously declared as " 5705 "%select{a struct|an interface|a class}3%select{| template}1; " 5706 "this is valid, but may result in linker errors under the Microsoft C++ ABI">, 5707 InGroup<MismatchedTags>, DefaultIgnore; 5708def note_struct_class_suggestion : Note< 5709 "did you mean %select{struct|interface|class}0 here?">; 5710def ext_forward_ref_enum : Extension< 5711 "ISO C forbids forward references to 'enum' types">; 5712def err_forward_ref_enum : Error< 5713 "ISO C++ forbids forward references to 'enum' types">; 5714def ext_ms_forward_ref_enum : ExtWarn< 5715 "forward references to 'enum' types are a Microsoft extension">, 5716 InGroup<MicrosoftEnumForwardReference>; 5717def ext_forward_ref_enum_def : Extension< 5718 "redeclaration of already-defined enum %0 is a GNU extension">, 5719 InGroup<GNURedeclaredEnum>; 5720 5721def err_redefinition_of_enumerator : Error<"redefinition of enumerator %0">; 5722def err_duplicate_member : Error<"duplicate member %0">; 5723def err_misplaced_ivar : Error< 5724 "instance variables may not be placed in %select{categories|class extension}0">; 5725def warn_ivars_in_interface : Warning< 5726 "declaration of instance variables in the interface is deprecated">, 5727 InGroup<DiagGroup<"objc-interface-ivars">>, DefaultIgnore; 5728def ext_enum_value_not_int : Extension< 5729 "ISO C restricts enumerator values to range of 'int' (%0 is too " 5730 "%select{small|large}1)">; 5731def ext_enum_too_large : ExtWarn< 5732 "enumeration values exceed range of largest integer">, InGroup<EnumTooLarge>; 5733def ext_enumerator_increment_too_large : ExtWarn< 5734 "incremented enumerator value %0 is not representable in the " 5735 "largest integer type">, InGroup<EnumTooLarge>; 5736def warn_flag_enum_constant_out_of_range : Warning< 5737 "enumeration value %0 is out of range of flags in enumeration type %1">, 5738 InGroup<FlagEnum>; 5739 5740def err_vm_decl_in_file_scope : Error< 5741 "variably modified type declaration not allowed at file scope">; 5742def err_vm_decl_has_extern_linkage : Error< 5743 "variably modified type declaration cannot have 'extern' linkage">; 5744def err_typecheck_field_variable_size : Error< 5745 "fields must have a constant size: 'variable length array in structure' " 5746 "extension will never be supported">; 5747def err_vm_func_decl : Error< 5748 "function declaration cannot have variably modified type">; 5749def err_array_too_large : Error< 5750 "array is too large (%0 elements)">; 5751 5752def err_typecheck_negative_array_size : Error<"array size is negative">; 5753def warn_typecheck_function_qualifiers_ignored : Warning< 5754 "'%0' qualifier on function type %1 has no effect">, 5755 InGroup<IgnoredQualifiers>; 5756def warn_typecheck_function_qualifiers_unspecified : Warning< 5757 "'%0' qualifier on function type %1 has unspecified behavior">; 5758def warn_typecheck_reference_qualifiers : Warning< 5759 "'%0' qualifier on reference type %1 has no effect">, 5760 InGroup<IgnoredReferenceQualifiers>; 5761def err_typecheck_invalid_restrict_not_pointer : Error< 5762 "restrict requires a pointer or reference (%0 is invalid)">; 5763def err_typecheck_invalid_restrict_not_pointer_noarg : Error< 5764 "restrict requires a pointer or reference">; 5765def err_typecheck_invalid_restrict_invalid_pointee : Error< 5766 "pointer to function type %0 may not be 'restrict' qualified">; 5767def ext_typecheck_zero_array_size : Extension< 5768 "zero size arrays are an extension">, InGroup<ZeroLengthArray>; 5769def err_typecheck_zero_array_size : Error< 5770 "zero-length arrays are not permitted in C++">; 5771def err_array_size_non_int : Error<"size of array has non-integer type %0">; 5772def err_init_element_not_constant : Error< 5773 "initializer element is not a compile-time constant">; 5774def ext_aggregate_init_not_constant : Extension< 5775 "initializer for aggregate is not a compile-time constant">, InGroup<C99>; 5776def err_local_cant_init : Error< 5777 "'__local' variable cannot have an initializer">; 5778def err_loader_uninitialized_cant_init 5779 : Error<"variable with 'loader_uninitialized' attribute cannot have an " 5780 "initializer">; 5781def err_loader_uninitialized_trivial_ctor 5782 : Error<"variable with 'loader_uninitialized' attribute must have a " 5783 "trivial default constructor">; 5784def err_loader_uninitialized_redeclaration 5785 : Error<"redeclaration cannot add 'loader_uninitialized' attribute">; 5786def err_loader_uninitialized_extern_decl 5787 : Error<"variable %0 cannot be declared both 'extern' and with the " 5788 "'loader_uninitialized' attribute">; 5789def err_block_extern_cant_init : Error< 5790 "'extern' variable cannot have an initializer">; 5791def warn_extern_init : Warning<"'extern' variable has an initializer">, 5792 InGroup<DiagGroup<"extern-initializer">>; 5793def err_variable_object_no_init : Error< 5794 "variable-sized object may not be initialized">; 5795def err_excess_initializers : Error< 5796 "excess elements in %select{array|vector|scalar|union|struct}0 initializer">; 5797def ext_excess_initializers : ExtWarn< 5798 "excess elements in %select{array|vector|scalar|union|struct}0 initializer">, 5799 InGroup<ExcessInitializers>; 5800def err_excess_initializers_for_sizeless_type : Error< 5801 "excess elements in initializer for indivisible sizeless type %0">; 5802def ext_excess_initializers_for_sizeless_type : ExtWarn< 5803 "excess elements in initializer for indivisible sizeless type %0">, 5804 InGroup<ExcessInitializers>; 5805def err_excess_initializers_in_char_array_initializer : Error< 5806 "excess elements in char array initializer">; 5807def ext_excess_initializers_in_char_array_initializer : ExtWarn< 5808 "excess elements in char array initializer">, 5809 InGroup<ExcessInitializers>; 5810def err_initializer_string_for_char_array_too_long : Error< 5811 "initializer-string for char array is too long">; 5812def ext_initializer_string_for_char_array_too_long : ExtWarn< 5813 "initializer-string for char array is too long">, 5814 InGroup<ExcessInitializers>; 5815def warn_missing_field_initializers : Warning< 5816 "missing field %0 initializer">, 5817 InGroup<MissingFieldInitializers>, DefaultIgnore; 5818def warn_braces_around_init : Warning< 5819 "braces around %select{scalar |}0initializer">, 5820 InGroup<DiagGroup<"braced-scalar-init">>; 5821def ext_many_braces_around_init : ExtWarn< 5822 "too many braces around %select{scalar |}0initializer">, 5823 InGroup<DiagGroup<"many-braces-around-scalar-init">>, SFINAEFailure; 5824def ext_complex_component_init : Extension< 5825 "complex initialization specifying real and imaginary components " 5826 "is an extension">, InGroup<DiagGroup<"complex-component-init">>; 5827def err_empty_scalar_initializer : Error<"scalar initializer cannot be empty">; 5828def err_empty_sizeless_initializer : Error< 5829 "initializer for sizeless type %0 cannot be empty">; 5830def warn_cxx98_compat_empty_scalar_initializer : Warning< 5831 "scalar initialized from empty initializer list is incompatible with C++98">, 5832 InGroup<CXX98Compat>, DefaultIgnore; 5833def warn_cxx98_compat_empty_sizeless_initializer : Warning< 5834 "initializing %0 from an empty initializer list is incompatible with C++98">, 5835 InGroup<CXX98Compat>, DefaultIgnore; 5836def warn_cxx98_compat_reference_list_init : Warning< 5837 "reference initialized from initializer list is incompatible with C++98">, 5838 InGroup<CXX98Compat>, DefaultIgnore; 5839def warn_cxx98_compat_initializer_list_init : Warning< 5840 "initialization of initializer_list object is incompatible with C++98">, 5841 InGroup<CXX98Compat>, DefaultIgnore; 5842def warn_cxx98_compat_ctor_list_init : Warning< 5843 "constructor call from initializer list is incompatible with C++98">, 5844 InGroup<CXX98Compat>, DefaultIgnore; 5845def err_illegal_initializer : Error< 5846 "illegal initializer (only variables can be initialized)">; 5847def err_illegal_initializer_type : Error<"illegal initializer type %0">; 5848def ext_init_list_type_narrowing : ExtWarn< 5849 "type %0 cannot be narrowed to %1 in initializer list">, 5850 InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure; 5851def ext_init_list_variable_narrowing : ExtWarn< 5852 "non-constant-expression cannot be narrowed from type %0 to %1 in " 5853 "initializer list">, InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure; 5854def ext_init_list_constant_narrowing : ExtWarn< 5855 "constant expression evaluates to %0 which cannot be narrowed to type %1">, 5856 InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure; 5857def warn_init_list_type_narrowing : Warning< 5858 "type %0 cannot be narrowed to %1 in initializer list in C++11">, 5859 InGroup<CXX11Narrowing>, DefaultIgnore; 5860def warn_init_list_variable_narrowing : Warning< 5861 "non-constant-expression cannot be narrowed from type %0 to %1 in " 5862 "initializer list in C++11">, 5863 InGroup<CXX11Narrowing>, DefaultIgnore; 5864def warn_init_list_constant_narrowing : Warning< 5865 "constant expression evaluates to %0 which cannot be narrowed to type %1 in " 5866 "C++11">, 5867 InGroup<CXX11Narrowing>, DefaultIgnore; 5868def note_init_list_narrowing_silence : Note< 5869 "insert an explicit cast to silence this issue">; 5870def err_init_objc_class : Error< 5871 "cannot initialize Objective-C class type %0">; 5872def err_implicit_empty_initializer : Error< 5873 "initializer for aggregate with no elements requires explicit braces">; 5874def err_bitfield_has_negative_width : Error< 5875 "bit-field %0 has negative width (%1)">; 5876def err_anon_bitfield_has_negative_width : Error< 5877 "anonymous bit-field has negative width (%0)">; 5878def err_bitfield_has_zero_width : Error<"named bit-field %0 has zero width">; 5879def err_bitfield_width_exceeds_type_width : Error< 5880 "width of%select{ anonymous|}0 bit-field%select{| %1}0 (%2 bits) exceeds the " 5881 "%select{width|size}3 of its type (%4 bit%s4)">; 5882def err_incorrect_number_of_vector_initializers : Error< 5883 "number of elements must be either one or match the size of the vector">; 5884 5885// Used by C++ which allows bit-fields that are wider than the type. 5886def warn_bitfield_width_exceeds_type_width: Warning< 5887 "width of bit-field %0 (%1 bits) exceeds the width of its type; value will " 5888 "be truncated to %2 bit%s2">, InGroup<BitFieldWidth>; 5889def err_bitfield_too_wide : Error< 5890 "%select{bit-field %1|anonymous bit-field}0 is too wide (%2 bits)">; 5891def warn_bitfield_too_small_for_enum : Warning< 5892 "bit-field %0 is not wide enough to store all enumerators of %1">, 5893 InGroup<BitFieldEnumConversion>, DefaultIgnore; 5894def note_widen_bitfield : Note< 5895 "widen this field to %0 bits to store all values of %1">; 5896def warn_unsigned_bitfield_assigned_signed_enum : Warning< 5897 "assigning value of signed enum type %1 to unsigned bit-field %0; " 5898 "negative enumerators of enum %1 will be converted to positive values">, 5899 InGroup<BitFieldEnumConversion>, DefaultIgnore; 5900def warn_signed_bitfield_enum_conversion : Warning< 5901 "signed bit-field %0 needs an extra bit to represent the largest positive " 5902 "enumerators of %1">, 5903 InGroup<BitFieldEnumConversion>, DefaultIgnore; 5904def note_change_bitfield_sign : Note< 5905 "consider making the bitfield type %select{unsigned|signed}0">; 5906 5907def warn_missing_braces : Warning< 5908 "suggest braces around initialization of subobject">, 5909 InGroup<MissingBraces>, DefaultIgnore; 5910 5911def err_redefinition_of_label : Error<"redefinition of label %0">; 5912def err_undeclared_label_use : Error<"use of undeclared label %0">; 5913def err_goto_ms_asm_label : Error< 5914 "cannot jump from this goto statement to label %0 inside an inline assembly block">; 5915def note_goto_ms_asm_label : Note< 5916 "inline assembly label %0 declared here">; 5917def warn_unused_label : Warning<"unused label %0">, 5918 InGroup<UnusedLabel>, DefaultIgnore; 5919 5920def err_continue_from_cond_var_init : Error< 5921 "cannot jump from this continue statement to the loop increment; " 5922 "jump bypasses initialization of loop condition variable">; 5923def err_goto_into_protected_scope : Error< 5924 "cannot jump from this goto statement to its label">; 5925def ext_goto_into_protected_scope : ExtWarn< 5926 "jump from this goto statement to its label is a Microsoft extension">, 5927 InGroup<MicrosoftGoto>; 5928def warn_cxx98_compat_goto_into_protected_scope : Warning< 5929 "jump from this goto statement to its label is incompatible with C++98">, 5930 InGroup<CXX98Compat>, DefaultIgnore; 5931def err_switch_into_protected_scope : Error< 5932 "cannot jump from switch statement to this case label">; 5933def warn_cxx98_compat_switch_into_protected_scope : Warning< 5934 "jump from switch statement to this case label is incompatible with C++98">, 5935 InGroup<CXX98Compat>, DefaultIgnore; 5936def err_indirect_goto_without_addrlabel : Error< 5937 "indirect goto in function with no address-of-label expressions">; 5938def err_indirect_goto_in_protected_scope : Error< 5939 "cannot jump from this %select{indirect|asm}0 goto statement to one of its possible targets">; 5940def warn_cxx98_compat_indirect_goto_in_protected_scope : Warning< 5941 "jump from this %select{indirect|asm}0 goto statement to one of its possible targets " 5942 "is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore; 5943def note_indirect_goto_target : Note< 5944 "possible target of %select{indirect|asm}0 goto statement">; 5945def note_protected_by_variable_init : Note< 5946 "jump bypasses variable initialization">; 5947def note_protected_by_variable_nontriv_destructor : Note< 5948 "jump bypasses variable with a non-trivial destructor">; 5949def note_protected_by_variable_non_pod : Note< 5950 "jump bypasses initialization of non-POD variable">; 5951def note_protected_by_cleanup : Note< 5952 "jump bypasses initialization of variable with __attribute__((cleanup))">; 5953def note_protected_by_vla_typedef : Note< 5954 "jump bypasses initialization of VLA typedef">; 5955def note_protected_by_vla_type_alias : Note< 5956 "jump bypasses initialization of VLA type alias">; 5957def note_protected_by_constexpr_if : Note< 5958 "jump enters controlled statement of constexpr if">; 5959def note_protected_by_consteval_if : Note< 5960 "jump enters controlled statement of consteval if">; 5961def note_protected_by_if_available : Note< 5962 "jump enters controlled statement of if available">; 5963def note_protected_by_vla : Note< 5964 "jump bypasses initialization of variable length array">; 5965def note_protected_by_objc_fast_enumeration : Note< 5966 "jump enters Objective-C fast enumeration loop">; 5967def note_protected_by_objc_try : Note< 5968 "jump bypasses initialization of @try block">; 5969def note_protected_by_objc_catch : Note< 5970 "jump bypasses initialization of @catch block">; 5971def note_protected_by_objc_finally : Note< 5972 "jump bypasses initialization of @finally block">; 5973def note_protected_by_objc_synchronized : Note< 5974 "jump bypasses initialization of @synchronized block">; 5975def note_protected_by_objc_autoreleasepool : Note< 5976 "jump bypasses auto release push of @autoreleasepool block">; 5977def note_protected_by_cxx_try : Note< 5978 "jump bypasses initialization of try block">; 5979def note_protected_by_cxx_catch : Note< 5980 "jump bypasses initialization of catch block">; 5981def note_protected_by_seh_try : Note< 5982 "jump bypasses initialization of __try block">; 5983def note_protected_by_seh_except : Note< 5984 "jump bypasses initialization of __except block">; 5985def note_protected_by_seh_finally : Note< 5986 "jump bypasses initialization of __finally block">; 5987def note_protected_by___block : Note< 5988 "jump bypasses setup of __block variable">; 5989def note_protected_by_objc_strong_init : Note< 5990 "jump bypasses initialization of __strong variable">; 5991def note_protected_by_objc_weak_init : Note< 5992 "jump bypasses initialization of __weak variable">; 5993def note_protected_by_non_trivial_c_struct_init : Note< 5994 "jump bypasses initialization of variable of non-trivial C struct type">; 5995def note_enters_block_captures_cxx_obj : Note< 5996 "jump enters lifetime of block which captures a destructible C++ object">; 5997def note_enters_block_captures_strong : Note< 5998 "jump enters lifetime of block which strongly captures a variable">; 5999def note_enters_block_captures_weak : Note< 6000 "jump enters lifetime of block which weakly captures a variable">; 6001def note_enters_block_captures_non_trivial_c_struct : Note< 6002 "jump enters lifetime of block which captures a C struct that is non-trivial " 6003 "to destroy">; 6004def note_enters_compound_literal_scope : Note< 6005 "jump enters lifetime of a compound literal that is non-trivial to destruct">; 6006 6007def note_exits_cleanup : Note< 6008 "jump exits scope of variable with __attribute__((cleanup))">; 6009def note_exits_dtor : Note< 6010 "jump exits scope of variable with non-trivial destructor">; 6011def note_exits_temporary_dtor : Note< 6012 "jump exits scope of lifetime-extended temporary with non-trivial " 6013 "destructor">; 6014def note_exits___block : Note< 6015 "jump exits scope of __block variable">; 6016def note_exits_objc_try : Note< 6017 "jump exits @try block">; 6018def note_exits_objc_catch : Note< 6019 "jump exits @catch block">; 6020def note_exits_objc_finally : Note< 6021 "jump exits @finally block">; 6022def note_exits_objc_synchronized : Note< 6023 "jump exits @synchronized block">; 6024def note_exits_cxx_try : Note< 6025 "jump exits try block">; 6026def note_exits_cxx_catch : Note< 6027 "jump exits catch block">; 6028def note_exits_seh_try : Note< 6029 "jump exits __try block">; 6030def note_exits_seh_except : Note< 6031 "jump exits __except block">; 6032def note_exits_seh_finally : Note< 6033 "jump exits __finally block">; 6034def note_exits_objc_autoreleasepool : Note< 6035 "jump exits autoreleasepool block">; 6036def note_exits_objc_strong : Note< 6037 "jump exits scope of __strong variable">; 6038def note_exits_objc_weak : Note< 6039 "jump exits scope of __weak variable">; 6040def note_exits_block_captures_cxx_obj : Note< 6041 "jump exits lifetime of block which captures a destructible C++ object">; 6042def note_exits_block_captures_strong : Note< 6043 "jump exits lifetime of block which strongly captures a variable">; 6044def note_exits_block_captures_weak : Note< 6045 "jump exits lifetime of block which weakly captures a variable">; 6046def note_exits_block_captures_non_trivial_c_struct : Note< 6047 "jump exits lifetime of block which captures a C struct that is non-trivial " 6048 "to destroy">; 6049def note_exits_compound_literal_scope : Note< 6050 "jump exits lifetime of a compound literal that is non-trivial to destruct">; 6051 6052def err_func_returning_qualified_void : ExtWarn< 6053 "function cannot return qualified void type %0">, 6054 InGroup<DiagGroup<"qualified-void-return-type">>; 6055def err_func_returning_array_function : Error< 6056 "function cannot return %select{array|function}0 type %1">; 6057def err_field_declared_as_function : Error<"field %0 declared as a function">; 6058def err_field_incomplete_or_sizeless : Error< 6059 "field has %select{incomplete|sizeless}0 type %1">; 6060def ext_variable_sized_type_in_struct : ExtWarn< 6061 "field %0 with variable sized type %1 not at the end of a struct or class is" 6062 " a GNU extension">, InGroup<GNUVariableSizedTypeNotAtEnd>; 6063 6064def ext_c99_flexible_array_member : Extension< 6065 "flexible array members are a C99 feature">, InGroup<C99>; 6066def err_flexible_array_virtual_base : Error< 6067 "flexible array member %0 not allowed in " 6068 "%select{struct|interface|union|class|enum}1 which has a virtual base class">; 6069def err_flexible_array_empty_aggregate : Error< 6070 "flexible array member %0 not allowed in otherwise empty " 6071 "%select{struct|interface|union|class|enum}1">; 6072def err_flexible_array_has_nontrivial_dtor : Error< 6073 "flexible array member %0 of type %1 with non-trivial destruction">; 6074def ext_flexible_array_in_struct : Extension< 6075 "%0 may not be nested in a struct due to flexible array member">, 6076 InGroup<FlexibleArrayExtensions>; 6077def ext_flexible_array_in_array : Extension< 6078 "%0 may not be used as an array element due to flexible array member">, 6079 InGroup<FlexibleArrayExtensions>; 6080def err_flexible_array_init : Error< 6081 "initialization of flexible array member is not allowed">; 6082def ext_flexible_array_empty_aggregate_ms : Extension< 6083 "flexible array member %0 in otherwise empty " 6084 "%select{struct|interface|union|class|enum}1 is a Microsoft extension">, 6085 InGroup<MicrosoftFlexibleArray>; 6086def err_flexible_array_union : Error< 6087 "flexible array member %0 in a union is not allowed">; 6088def ext_flexible_array_union_ms : Extension< 6089 "flexible array member %0 in a union is a Microsoft extension">, 6090 InGroup<MicrosoftFlexibleArray>; 6091def ext_flexible_array_empty_aggregate_gnu : Extension< 6092 "flexible array member %0 in otherwise empty " 6093 "%select{struct|interface|union|class|enum}1 is a GNU extension">, 6094 InGroup<GNUEmptyStruct>; 6095def ext_flexible_array_union_gnu : Extension< 6096 "flexible array member %0 in a union is a GNU extension">, InGroup<GNUFlexibleArrayUnionMember>; 6097 6098def err_flexible_array_not_at_end : Error< 6099 "flexible array member %0 with type %1 is not at the end of" 6100 " %select{struct|interface|union|class|enum}2">; 6101def err_objc_variable_sized_type_not_at_end : Error< 6102 "field %0 with variable sized type %1 is not at the end of class">; 6103def note_next_field_declaration : Note< 6104 "next field declaration is here">; 6105def note_next_ivar_declaration : Note< 6106 "next %select{instance variable declaration|synthesized instance variable}0" 6107 " is here">; 6108def err_synthesize_variable_sized_ivar : Error< 6109 "synthesized property with variable size type %0" 6110 " requires an existing instance variable">; 6111def err_flexible_array_arc_retainable : Error< 6112 "ARC forbids flexible array members with retainable object type">; 6113def warn_variable_sized_ivar_visibility : Warning< 6114 "field %0 with variable sized type %1 is not visible to subclasses and" 6115 " can conflict with their instance variables">, InGroup<ObjCFlexibleArray>; 6116def warn_superclass_variable_sized_type_not_at_end : Warning< 6117 "field %0 can overwrite instance variable %1 with variable sized type %2" 6118 " in superclass %3">, InGroup<ObjCFlexibleArray>; 6119 6120let CategoryName = "ARC Semantic Issue" in { 6121 6122// ARC-mode diagnostics. 6123 6124let CategoryName = "ARC Weak References" in { 6125 6126def err_arc_weak_no_runtime : Error< 6127 "cannot create __weak reference because the current deployment target " 6128 "does not support weak references">; 6129def err_arc_weak_disabled : Error< 6130 "cannot create __weak reference in file using manual reference counting">; 6131def err_synthesizing_arc_weak_property_disabled : Error< 6132 "cannot synthesize weak property in file using manual reference counting">; 6133def err_synthesizing_arc_weak_property_no_runtime : Error< 6134 "cannot synthesize weak property because the current deployment target " 6135 "does not support weak references">; 6136def err_arc_unsupported_weak_class : Error< 6137 "class is incompatible with __weak references">; 6138def err_arc_weak_unavailable_assign : Error< 6139 "assignment of a weak-unavailable object to a __weak object">; 6140def err_arc_weak_unavailable_property : Error< 6141 "synthesizing __weak instance variable of type %0, which does not " 6142 "support weak references">; 6143def note_implemented_by_class : Note< 6144 "when implemented by class %0">; 6145def err_arc_convesion_of_weak_unavailable : Error< 6146 "%select{implicit conversion|cast}0 of weak-unavailable object of type %1 to" 6147 " a __weak object of type %2">; 6148 6149} // end "ARC Weak References" category 6150 6151let CategoryName = "ARC Restrictions" in { 6152 6153def err_unavailable_in_arc : Error< 6154 "%0 is unavailable in ARC">; 6155def note_arc_forbidden_type : Note< 6156 "declaration uses type that is ill-formed in ARC">; 6157def note_performs_forbidden_arc_conversion : Note< 6158 "inline function performs a conversion which is forbidden in ARC">; 6159def note_arc_init_returns_unrelated : Note< 6160 "init method must return a type related to its receiver type">; 6161def note_arc_weak_disabled : Note< 6162 "declaration uses __weak, but ARC is disabled">; 6163def note_arc_weak_no_runtime : Note<"declaration uses __weak, which " 6164 "the current deployment target does not support">; 6165def note_arc_field_with_ownership : Note< 6166 "field has non-trivial ownership qualification">; 6167 6168def err_arc_illegal_explicit_message : Error< 6169 "ARC forbids explicit message send of %0">; 6170def err_arc_unused_init_message : Error< 6171 "the result of a delegate init call must be immediately returned " 6172 "or assigned to 'self'">; 6173def err_arc_mismatched_cast : Error< 6174 "%select{implicit conversion|cast}0 of " 6175 "%select{%2|a non-Objective-C pointer type %2|a block pointer|" 6176 "an Objective-C pointer|an indirect pointer to an Objective-C pointer}1" 6177 " to %3 is disallowed with ARC">; 6178def err_arc_nolifetime_behavior : Error< 6179 "explicit ownership qualifier on cast result has no effect">; 6180def err_arc_objc_property_default_assign_on_object : Error< 6181 "ARC forbids synthesizing a property of an Objective-C object " 6182 "with unspecified ownership or storage attribute">; 6183def err_arc_illegal_selector : Error< 6184 "ARC forbids use of %0 in a @selector">; 6185def err_arc_illegal_method_def : Error< 6186 "ARC forbids %select{implementation|synthesis}0 of %1">; 6187def warn_arc_strong_pointer_objc_pointer : Warning< 6188 "method parameter of type %0 with no explicit ownership">, 6189 InGroup<DiagGroup<"explicit-ownership-type">>, DefaultIgnore; 6190 6191} // end "ARC Restrictions" category 6192 6193def err_arc_lost_method_convention : Error< 6194 "method was declared as %select{an 'alloc'|a 'copy'|an 'init'|a 'new'}0 " 6195 "method, but its implementation doesn't match because %select{" 6196 "its result type is not an object pointer|" 6197 "its result type is unrelated to its receiver type}1">; 6198def note_arc_lost_method_convention : Note<"declaration in interface">; 6199def err_arc_gained_method_convention : Error< 6200 "method implementation does not match its declaration">; 6201def note_arc_gained_method_convention : Note< 6202 "declaration in interface is not in the '%select{alloc|copy|init|new}0' " 6203 "family because %select{its result type is not an object pointer|" 6204 "its result type is unrelated to its receiver type}1">; 6205def err_typecheck_arc_assign_self : Error< 6206 "cannot assign to 'self' outside of a method in the init family">; 6207def err_typecheck_arc_assign_self_class_method : Error< 6208 "cannot assign to 'self' in a class method">; 6209def err_typecheck_arr_assign_enumeration : Error< 6210 "fast enumeration variables cannot be modified in ARC by default; " 6211 "declare the variable __strong to allow this">; 6212def err_typecheck_arc_assign_externally_retained : Error< 6213 "variable declared with 'objc_externally_retained' " 6214 "cannot be modified in ARC">; 6215def warn_arc_retained_assign : Warning< 6216 "assigning retained object to %select{weak|unsafe_unretained}0 " 6217 "%select{property|variable}1" 6218 "; object will be released after assignment">, 6219 InGroup<ARCUnsafeRetainedAssign>; 6220def warn_arc_retained_property_assign : Warning< 6221 "assigning retained object to unsafe property" 6222 "; object will be released after assignment">, 6223 InGroup<ARCUnsafeRetainedAssign>; 6224def warn_arc_literal_assign : Warning< 6225 "assigning %select{array literal|dictionary literal|numeric literal|boxed expression|<should not happen>|block literal}0" 6226 " to a weak %select{property|variable}1" 6227 "; object will be released after assignment">, 6228 InGroup<ARCUnsafeRetainedAssign>; 6229def err_arc_new_array_without_ownership : Error< 6230 "'new' cannot allocate an array of %0 with no explicit ownership">; 6231def err_arc_autoreleasing_var : Error< 6232 "%select{__block variables|global variables|fields|instance variables}0 cannot have " 6233 "__autoreleasing ownership">; 6234def err_arc_autoreleasing_capture : Error< 6235 "cannot capture __autoreleasing variable in a " 6236 "%select{block|lambda by copy}0">; 6237def err_arc_thread_ownership : Error< 6238 "thread-local variable has non-trivial ownership: type is %0">; 6239def err_arc_indirect_no_ownership : Error< 6240 "%select{pointer|reference}1 to non-const type %0 with no explicit ownership">; 6241def err_arc_array_param_no_ownership : Error< 6242 "must explicitly describe intended ownership of an object array parameter">; 6243def err_arc_pseudo_dtor_inconstant_quals : Error< 6244 "pseudo-destructor destroys object of type %0 with inconsistently-qualified " 6245 "type %1">; 6246def err_arc_init_method_unrelated_result_type : Error< 6247 "init methods must return a type related to the receiver type">; 6248def err_arc_nonlocal_writeback : Error< 6249 "passing address of %select{non-local|non-scalar}0 object to " 6250 "__autoreleasing parameter for write-back">; 6251def err_arc_method_not_found : Error< 6252 "no known %select{instance|class}1 method for selector %0">; 6253def err_arc_receiver_forward_class : Error< 6254 "receiver %0 for class message is a forward declaration">; 6255def err_arc_may_not_respond : Error< 6256 "no visible @interface for %0 declares the selector %1">; 6257def err_arc_receiver_forward_instance : Error< 6258 "receiver type %0 for instance message is a forward declaration">; 6259def warn_receiver_forward_instance : Warning< 6260 "receiver type %0 for instance message is a forward declaration">, 6261 InGroup<ForwardClassReceiver>, DefaultIgnore; 6262def err_arc_collection_forward : Error< 6263 "collection expression type %0 is a forward declaration">; 6264def err_arc_multiple_method_decl : Error< 6265 "multiple methods named %0 found with mismatched result, " 6266 "parameter type or attributes">; 6267def warn_arc_lifetime_result_type : Warning< 6268 "ARC %select{unused|__unsafe_unretained|__strong|__weak|__autoreleasing}0 " 6269 "lifetime qualifier on return type is ignored">, 6270 InGroup<IgnoredQualifiers>; 6271 6272let CategoryName = "ARC Retain Cycle" in { 6273 6274def warn_arc_retain_cycle : Warning< 6275 "capturing %0 strongly in this block is likely to lead to a retain cycle">, 6276 InGroup<ARCRetainCycles>; 6277def note_arc_retain_cycle_owner : Note< 6278 "block will be retained by %select{the captured object|an object strongly " 6279 "retained by the captured object}0">; 6280 6281} // end "ARC Retain Cycle" category 6282 6283def warn_arc_object_memaccess : Warning< 6284 "%select{destination for|source of}0 this %1 call is a pointer to " 6285 "ownership-qualified type %2">, InGroup<ARCNonPodMemAccess>; 6286 6287let CategoryName = "ARC and @properties" in { 6288 6289def err_arc_strong_property_ownership : Error< 6290 "existing instance variable %1 for strong property %0 may not be " 6291 "%select{|__unsafe_unretained||__weak}2">; 6292def err_arc_assign_property_ownership : Error< 6293 "existing instance variable %1 for property %0 with %select{unsafe_unretained|assign}2 " 6294 "attribute must be __unsafe_unretained">; 6295def err_arc_inconsistent_property_ownership : Error< 6296 "%select{|unsafe_unretained|strong|weak}1 property %0 may not also be " 6297 "declared %select{|__unsafe_unretained|__strong|__weak|__autoreleasing}2">; 6298 6299} // end "ARC and @properties" category 6300 6301def warn_block_capture_autoreleasing : Warning< 6302 "block captures an autoreleasing out-parameter, which may result in " 6303 "use-after-free bugs">, 6304 InGroup<BlockCaptureAutoReleasing>; 6305def note_declare_parameter_strong : Note< 6306 "declare the parameter __strong or capture a __block __strong variable to " 6307 "keep values alive across autorelease pools">; 6308 6309def err_arc_atomic_ownership : Error< 6310 "cannot perform atomic operation on a pointer to type %0: type has " 6311 "non-trivial ownership">; 6312 6313let CategoryName = "ARC Casting Rules" in { 6314 6315def err_arc_bridge_cast_incompatible : Error< 6316 "incompatible types casting %0 to %1 with a %select{__bridge|" 6317 "__bridge_transfer|__bridge_retained}2 cast">; 6318def err_arc_bridge_cast_wrong_kind : Error< 6319 "cast of %select{Objective-C|block|C}0 pointer type %1 to " 6320 "%select{Objective-C|block|C}2 pointer type %3 cannot use %select{__bridge|" 6321 "__bridge_transfer|__bridge_retained}4">; 6322def err_arc_cast_requires_bridge : Error< 6323 "%select{cast|implicit conversion}0 of %select{Objective-C|block|C}1 " 6324 "pointer type %2 to %select{Objective-C|block|C}3 pointer type %4 " 6325 "requires a bridged cast">; 6326def note_arc_bridge : Note< 6327 "use __bridge to convert directly (no change in ownership)">; 6328def note_arc_cstyle_bridge : Note< 6329 "use __bridge with C-style cast to convert directly (no change in ownership)">; 6330def note_arc_bridge_transfer : Note< 6331 "use %select{__bridge_transfer|CFBridgingRelease call}1 to transfer " 6332 "ownership of a +1 %0 into ARC">; 6333def note_arc_cstyle_bridge_transfer : Note< 6334 "use __bridge_transfer with C-style cast to transfer " 6335 "ownership of a +1 %0 into ARC">; 6336def note_arc_bridge_retained : Note< 6337 "use %select{__bridge_retained|CFBridgingRetain call}1 to make an " 6338 "ARC object available as a +1 %0">; 6339def note_arc_cstyle_bridge_retained : Note< 6340 "use __bridge_retained with C-style cast to make an " 6341 "ARC object available as a +1 %0">; 6342 6343} // ARC Casting category 6344 6345} // ARC category name 6346 6347def err_flexible_array_init_needs_braces : Error< 6348 "flexible array requires brace-enclosed initializer">; 6349def err_illegal_decl_array_of_functions : Error< 6350 "'%0' declared as array of functions of type %1">; 6351def err_array_incomplete_or_sizeless_type : Error< 6352 "array has %select{incomplete|sizeless}0 element type %1">; 6353def err_illegal_message_expr_incomplete_type : Error< 6354 "Objective-C message has incomplete result type %0">; 6355def err_illegal_decl_array_of_references : Error< 6356 "'%0' declared as array of references of type %1">; 6357def err_decl_negative_array_size : Error< 6358 "'%0' declared as an array with a negative size">; 6359def err_array_static_outside_prototype : Error< 6360 "%0 used in array declarator outside of function prototype">; 6361def err_array_static_not_outermost : Error< 6362 "%0 used in non-outermost array type derivation">; 6363def err_array_star_outside_prototype : Error< 6364 "star modifier used outside of function prototype">; 6365def err_illegal_decl_pointer_to_reference : Error< 6366 "'%0' declared as a pointer to a reference of type %1">; 6367def err_illegal_decl_mempointer_to_reference : Error< 6368 "'%0' declared as a member pointer to a reference of type %1">; 6369def err_illegal_decl_mempointer_to_void : Error< 6370 "'%0' declared as a member pointer to void">; 6371def err_illegal_decl_mempointer_in_nonclass : Error< 6372 "'%0' does not point into a class">; 6373def err_mempointer_in_nonclass_type : Error< 6374 "member pointer refers into non-class type %0">; 6375def err_reference_to_void : Error<"cannot form a reference to 'void'">; 6376def err_nonfunction_block_type : Error< 6377 "block pointer to non-function type is invalid">; 6378def err_return_block_has_expr : Error<"void block should not return a value">; 6379def err_block_return_missing_expr : Error< 6380 "non-void block should return a value">; 6381def err_func_def_incomplete_result : Error< 6382 "incomplete result type %0 in function definition">; 6383def err_atomic_specifier_bad_type 6384 : Error<"_Atomic cannot be applied to " 6385 "%select{incomplete |array |function |reference |atomic |qualified " 6386 "|sizeless ||integer }0type " 6387 "%1 %select{|||||||which is not trivially copyable|}0">; 6388 6389// Expressions. 6390def ext_sizeof_alignof_function_type : Extension< 6391 "invalid application of '%0' to a function type">, InGroup<PointerArith>; 6392def ext_sizeof_alignof_void_type : Extension< 6393 "invalid application of '%0' to a void type">, InGroup<PointerArith>; 6394def err_opencl_sizeof_alignof_type : Error< 6395 "invalid application of '%0' to a void type">; 6396def err_sizeof_alignof_incomplete_or_sizeless_type : Error< 6397 "invalid application of '%0' to %select{an incomplete|sizeless}1 type %2">; 6398def err_sizeof_alignof_function_type : Error< 6399 "invalid application of '%0' to a function type">; 6400def err_openmp_default_simd_align_expr : Error< 6401 "invalid application of '__builtin_omp_required_simd_align' to an expression, only type is allowed">; 6402def err_sizeof_alignof_typeof_bitfield : Error< 6403 "invalid application of '%select{sizeof|alignof|typeof}0' to bit-field">; 6404def err_alignof_member_of_incomplete_type : Error< 6405 "invalid application of 'alignof' to a field of a class still being defined">; 6406def err_vecstep_non_scalar_vector_type : Error< 6407 "'vec_step' requires built-in scalar or vector type, %0 invalid">; 6408def err_offsetof_incomplete_type : Error< 6409 "offsetof of incomplete type %0">; 6410def err_offsetof_record_type : Error< 6411 "offsetof requires struct, union, or class type, %0 invalid">; 6412def err_offsetof_array_type : Error<"offsetof requires array type, %0 invalid">; 6413def ext_offsetof_non_pod_type : ExtWarn<"offset of on non-POD type %0">, 6414 InGroup<InvalidOffsetof>; 6415def ext_offsetof_non_standardlayout_type : ExtWarn< 6416 "offset of on non-standard-layout type %0">, InGroup<InvalidOffsetof>; 6417def err_offsetof_bitfield : Error<"cannot compute offset of bit-field %0">; 6418def err_offsetof_field_of_virtual_base : Error< 6419 "invalid application of 'offsetof' to a field of a virtual base">; 6420def warn_sub_ptr_zero_size_types : Warning< 6421 "subtraction of pointers to type %0 of zero size has undefined behavior">, 6422 InGroup<PointerArith>; 6423def warn_pointer_arith_null_ptr : Warning< 6424 "performing pointer arithmetic on a null pointer has undefined behavior%select{| if the offset is nonzero}0">, 6425 InGroup<NullPointerArithmetic>, DefaultIgnore; 6426def warn_gnu_null_ptr_arith : Warning< 6427 "arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension">, 6428 InGroup<NullPointerArithmetic>, DefaultIgnore; 6429def warn_pointer_sub_null_ptr : Warning< 6430 "performing pointer subtraction with a null pointer %select{has|may have}0 undefined behavior">, 6431 InGroup<NullPointerSubtraction>, DefaultIgnore; 6432 6433def warn_floatingpoint_eq : Warning< 6434 "comparing floating point with == or != is unsafe">, 6435 InGroup<DiagGroup<"float-equal">>, DefaultIgnore; 6436 6437def warn_remainder_division_by_zero : Warning< 6438 "%select{remainder|division}0 by zero is undefined">, 6439 InGroup<DivZero>; 6440def warn_shift_lhs_negative : Warning<"shifting a negative signed value is undefined">, 6441 InGroup<DiagGroup<"shift-negative-value">>; 6442def warn_shift_negative : Warning<"shift count is negative">, 6443 InGroup<DiagGroup<"shift-count-negative">>; 6444def warn_shift_gt_typewidth : Warning<"shift count >= width of type">, 6445 InGroup<DiagGroup<"shift-count-overflow">>; 6446def warn_shift_result_gt_typewidth : Warning< 6447 "signed shift result (%0) requires %1 bits to represent, but %2 only has " 6448 "%3 bits">, InGroup<DiagGroup<"shift-overflow">>; 6449def warn_shift_result_sets_sign_bit : Warning< 6450 "signed shift result (%0) sets the sign bit of the shift expression's " 6451 "type (%1) and becomes negative">, 6452 InGroup<DiagGroup<"shift-sign-overflow">>, DefaultIgnore; 6453 6454def warn_precedence_bitwise_rel : Warning< 6455 "%0 has lower precedence than %1; %1 will be evaluated first">, 6456 InGroup<Parentheses>; 6457def note_precedence_bitwise_first : Note< 6458 "place parentheses around the %0 expression to evaluate it first">; 6459def note_precedence_silence : Note< 6460 "place parentheses around the '%0' expression to silence this warning">; 6461 6462def warn_precedence_conditional : Warning< 6463 "operator '?:' has lower precedence than '%0'; '%0' will be evaluated first">, 6464 InGroup<Parentheses>; 6465def warn_precedence_bitwise_conditional : Warning< 6466 "operator '?:' has lower precedence than '%0'; '%0' will be evaluated first">, 6467 InGroup<BitwiseConditionalParentheses>; 6468def note_precedence_conditional_first : Note< 6469 "place parentheses around the '?:' expression to evaluate it first">; 6470 6471def warn_enum_constant_in_bool_context : Warning< 6472 "converting the enum constant to a boolean">, 6473 InGroup<IntInBoolContext>, DefaultIgnore; 6474def warn_left_shift_in_bool_context : Warning< 6475 "converting the result of '<<' to a boolean; did you mean '(%0) != 0'?">, 6476 InGroup<IntInBoolContext>, DefaultIgnore; 6477def warn_logical_instead_of_bitwise : Warning< 6478 "use of logical '%0' with constant operand">, 6479 InGroup<DiagGroup<"constant-logical-operand">>; 6480def note_logical_instead_of_bitwise_change_operator : Note< 6481 "use '%0' for a bitwise operation">; 6482def note_logical_instead_of_bitwise_remove_constant : Note< 6483 "remove constant to silence this warning">; 6484 6485def warn_bitwise_op_in_bitwise_op : Warning< 6486 "'%0' within '%1'">, InGroup<BitwiseOpParentheses>, DefaultIgnore; 6487 6488def warn_logical_and_in_logical_or : Warning< 6489 "'&&' within '||'">, InGroup<LogicalOpParentheses>, DefaultIgnore; 6490 6491def warn_overloaded_shift_in_comparison :Warning< 6492 "overloaded operator %select{>>|<<}0 has higher precedence than " 6493 "comparison operator">, 6494 InGroup<OverloadedShiftOpParentheses>; 6495def note_evaluate_comparison_first :Note< 6496 "place parentheses around comparison expression to evaluate it first">; 6497 6498def note_concatenated_string_literal_silence :Note< 6499 "place parentheses around the string literal to silence warning">; 6500 6501def warn_addition_in_bitshift : Warning< 6502 "operator '%0' has lower precedence than '%1'; " 6503 "'%1' will be evaluated first">, InGroup<ShiftOpParentheses>; 6504 6505def warn_self_assignment_builtin : Warning< 6506 "explicitly assigning value of variable of type %0 to itself">, 6507 InGroup<SelfAssignment>, DefaultIgnore; 6508def warn_self_assignment_overloaded : Warning< 6509 "explicitly assigning value of variable of type %0 to itself">, 6510 InGroup<SelfAssignmentOverloaded>, DefaultIgnore; 6511def warn_self_move : Warning< 6512 "explicitly moving variable of type %0 to itself">, 6513 InGroup<SelfMove>, DefaultIgnore; 6514 6515def warn_redundant_move_on_return : Warning< 6516 "redundant move in return statement">, 6517 InGroup<RedundantMove>, DefaultIgnore; 6518def warn_pessimizing_move_on_return : Warning< 6519 "moving a local object in a return statement prevents copy elision">, 6520 InGroup<PessimizingMove>, DefaultIgnore; 6521def warn_pessimizing_move_on_initialization : Warning< 6522 "moving a temporary object prevents copy elision">, 6523 InGroup<PessimizingMove>, DefaultIgnore; 6524def note_remove_move : Note<"remove std::move call here">; 6525 6526def warn_string_plus_int : Warning< 6527 "adding %0 to a string does not append to the string">, 6528 InGroup<StringPlusInt>; 6529def warn_string_plus_char : Warning< 6530 "adding %0 to a string pointer does not append to the string">, 6531 InGroup<StringPlusChar>; 6532def note_string_plus_scalar_silence : Note< 6533 "use array indexing to silence this warning">; 6534 6535def warn_sizeof_array_param : Warning< 6536 "sizeof on array function parameter will return size of %0 instead of %1">, 6537 InGroup<SizeofArrayArgument>; 6538 6539def warn_sizeof_array_decay : Warning< 6540 "sizeof on pointer operation will return size of %0 instead of %1">, 6541 InGroup<SizeofArrayDecay>; 6542 6543def err_sizeof_nonfragile_interface : Error< 6544 "application of '%select{alignof|sizeof}1' to interface %0 is " 6545 "not supported on this architecture and platform">; 6546def err_atdef_nonfragile_interface : Error< 6547 "use of @defs is not supported on this architecture and platform">; 6548def err_subscript_nonfragile_interface : Error< 6549 "subscript requires size of interface %0, which is not constant for " 6550 "this architecture and platform">; 6551 6552def err_arithmetic_nonfragile_interface : Error< 6553 "arithmetic on pointer to interface %0, which is not a constant size for " 6554 "this architecture and platform">; 6555 6556def warn_deprecated_comma_subscript : Warning< 6557 "top-level comma expression in array subscript is deprecated">, 6558 InGroup<DeprecatedCommaSubscript>; 6559 6560def ext_subscript_non_lvalue : Extension< 6561 "ISO C90 does not allow subscripting non-lvalue array">; 6562def err_typecheck_subscript_value : Error< 6563 "subscripted value is not an array, pointer, or vector">; 6564def err_typecheck_subscript_not_integer : Error< 6565 "array subscript is not an integer">; 6566def err_subscript_function_type : Error< 6567 "subscript of pointer to function type %0">; 6568def err_subscript_incomplete_or_sizeless_type : Error< 6569 "subscript of pointer to %select{incomplete|sizeless}0 type %1">; 6570def err_dereference_incomplete_type : Error< 6571 "dereference of pointer to incomplete type %0">; 6572def ext_gnu_subscript_void_type : Extension< 6573 "subscript of a pointer to void is a GNU extension">, InGroup<PointerArith>; 6574def err_typecheck_member_reference_struct_union : Error< 6575 "member reference base type %0 is not a structure or union">; 6576def err_typecheck_member_reference_ivar : Error< 6577 "%0 does not have a member named %1">; 6578def err_arc_weak_ivar_access : Error< 6579 "dereferencing a __weak pointer is not allowed due to possible " 6580 "null value caused by race condition, assign it to strong variable first">; 6581def err_typecheck_member_reference_arrow : Error< 6582 "member reference type %0 is not a pointer">; 6583def err_typecheck_member_reference_suggestion : Error< 6584 "member reference type %0 is %select{a|not a}1 pointer; did you mean to use '%select{->|.}1'?">; 6585def note_typecheck_member_reference_suggestion : Note< 6586 "did you mean to use '.' instead?">; 6587def note_member_reference_arrow_from_operator_arrow : Note< 6588 "'->' applied to return value of the operator->() declared here">; 6589def err_typecheck_member_reference_type : Error< 6590 "cannot refer to type member %0 in %1 with '%select{.|->}2'">; 6591def err_typecheck_member_reference_unknown : Error< 6592 "cannot refer to member %0 in %1 with '%select{.|->}2'">; 6593def err_member_reference_needs_call : Error< 6594 "base of member reference is a function; perhaps you meant to call " 6595 "it%select{| with no arguments}0?">; 6596def warn_subscript_is_char : Warning<"array subscript is of type 'char'">, 6597 InGroup<CharSubscript>, DefaultIgnore; 6598 6599def err_typecheck_incomplete_tag : Error<"incomplete definition of type %0">; 6600def err_no_member : Error<"no member named %0 in %1">; 6601def err_no_member_overloaded_arrow : Error< 6602 "no member named %0 in %1; did you mean to use '->' instead of '.'?">; 6603 6604def err_member_not_yet_instantiated : Error< 6605 "no member %0 in %1; it has not yet been instantiated">; 6606def note_non_instantiated_member_here : Note< 6607 "not-yet-instantiated member is declared here">; 6608 6609def err_enumerator_does_not_exist : Error< 6610 "enumerator %0 does not exist in instantiation of %1">; 6611def note_enum_specialized_here : Note< 6612 "enum %0 was explicitly specialized here">; 6613 6614def err_specialization_not_primary_template : Error< 6615 "cannot reference member of primary template because deduced class " 6616 "template specialization %0 is %select{instantiated from a partial|" 6617 "an explicit}1 specialization">; 6618 6619def err_member_redeclared : Error<"class member cannot be redeclared">; 6620def ext_member_redeclared : ExtWarn<"class member cannot be redeclared">, 6621 InGroup<RedeclaredClassMember>; 6622def err_member_redeclared_in_instantiation : Error< 6623 "multiple overloads of %0 instantiate to the same signature %1">; 6624def err_member_name_of_class : Error<"member %0 has the same name as its class">; 6625def err_member_def_undefined_record : Error< 6626 "out-of-line definition of %0 from class %1 without definition">; 6627def err_member_decl_does_not_match : Error< 6628 "out-of-line %select{declaration|definition}2 of %0 " 6629 "does not match any declaration in %1">; 6630def err_friend_decl_with_def_arg_must_be_def : Error< 6631 "friend declaration specifying a default argument must be a definition">; 6632def err_friend_decl_with_def_arg_redeclared : Error< 6633 "friend declaration specifying a default argument must be the only declaration">; 6634def err_friend_decl_does_not_match : Error< 6635 "friend declaration of %0 does not match any declaration in %1">; 6636def err_member_decl_does_not_match_suggest : Error< 6637 "out-of-line %select{declaration|definition}2 of %0 " 6638 "does not match any declaration in %1; did you mean %3?">; 6639def err_member_def_does_not_match_ret_type : Error< 6640 "return type of out-of-line definition of %q0 differs from " 6641 "that in the declaration">; 6642def err_nonstatic_member_out_of_line : Error< 6643 "non-static data member defined out-of-line">; 6644def err_qualified_typedef_declarator : Error< 6645 "typedef declarator cannot be qualified">; 6646def err_qualified_param_declarator : Error< 6647 "parameter declarator cannot be qualified">; 6648def ext_out_of_line_declaration : ExtWarn< 6649 "out-of-line declaration of a member must be a definition">, 6650 InGroup<OutOfLineDeclaration>, DefaultError; 6651def err_member_extra_qualification : Error< 6652 "extra qualification on member %0">; 6653def warn_member_extra_qualification : Warning< 6654 err_member_extra_qualification.Text>, InGroup<MicrosoftExtraQualification>; 6655def warn_namespace_member_extra_qualification : Warning< 6656 "extra qualification on member %0">, 6657 InGroup<DiagGroup<"extra-qualification">>; 6658def err_member_qualification : Error< 6659 "non-friend class member %0 cannot have a qualified name">; 6660def note_member_def_close_match : Note<"member declaration nearly matches">; 6661def note_member_def_close_const_match : Note< 6662 "member declaration does not match because " 6663 "it %select{is|is not}0 const qualified">; 6664def note_member_def_close_param_match : Note< 6665 "type of %ordinal0 parameter of member declaration does not match definition" 6666 "%diff{ ($ vs $)|}1,2">; 6667def note_local_decl_close_match : Note<"local declaration nearly matches">; 6668def note_local_decl_close_param_match : Note< 6669 "type of %ordinal0 parameter of local declaration does not match definition" 6670 "%diff{ ($ vs $)|}1,2">; 6671def err_typecheck_ivar_variable_size : Error< 6672 "instance variables must have a constant size">; 6673def err_ivar_reference_type : Error< 6674 "instance variables cannot be of reference type">; 6675def err_typecheck_illegal_increment_decrement : Error< 6676 "cannot %select{decrement|increment}1 value of type %0">; 6677def err_typecheck_expect_int : Error< 6678 "used type %0 where integer is required">; 6679def err_typecheck_arithmetic_incomplete_or_sizeless_type : Error< 6680 "arithmetic on a pointer to %select{an incomplete|sizeless}0 type %1">; 6681def err_typecheck_pointer_arith_function_type : Error< 6682 "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 " 6683 "function type%select{|s}2 %1%select{| and %3}2">; 6684def err_typecheck_pointer_arith_void_type : Error< 6685 "arithmetic on%select{ a|}0 pointer%select{|s}0 to void">; 6686def err_typecheck_decl_incomplete_type : Error< 6687 "variable has incomplete type %0">; 6688def ext_typecheck_decl_incomplete_type : ExtWarn< 6689 "tentative definition of variable with internal linkage has incomplete non-array type %0">, 6690 InGroup<DiagGroup<"tentative-definition-incomplete-type">>; 6691def err_tentative_def_incomplete_type : Error< 6692 "tentative definition has type %0 that is never completed">; 6693def warn_tentative_incomplete_array : Warning< 6694 "tentative array definition assumed to have one element">; 6695def err_typecheck_incomplete_array_needs_initializer : Error< 6696 "definition of variable with array type needs an explicit size " 6697 "or an initializer">; 6698def err_array_init_not_init_list : Error< 6699 "array initializer must be an initializer " 6700 "list%select{| or string literal| or wide string literal}0">; 6701def err_array_init_narrow_string_into_wchar : Error< 6702 "initializing wide char array with non-wide string literal">; 6703def err_array_init_wide_string_into_char : Error< 6704 "initializing char array with wide string literal">; 6705def err_array_init_incompat_wide_string_into_wchar : Error< 6706 "initializing wide char array with incompatible wide string literal">; 6707def err_array_init_plain_string_into_char8_t : Error< 6708 "initializing 'char8_t' array with plain string literal">; 6709def note_array_init_plain_string_into_char8_t : Note< 6710 "add 'u8' prefix to form a 'char8_t' string literal">; 6711def err_array_init_utf8_string_into_char : Error< 6712 "%select{|ISO C++20 does not permit }0initialization of char array with " 6713 "UTF-8 string literal%select{ is not permitted by '-fchar8_t'|}0">; 6714def warn_cxx20_compat_utf8_string : Warning< 6715 "type of UTF-8 string literal will change from array of const char to " 6716 "array of const char8_t in C++20">, InGroup<CXX20Compat>, DefaultIgnore; 6717def note_cxx20_compat_utf8_string_remove_u8 : Note< 6718 "remove 'u8' prefix to avoid a change of behavior; " 6719 "Clang encodes unprefixed narrow string literals as UTF-8">; 6720def err_array_init_different_type : Error< 6721 "cannot initialize array %diff{of type $ with array of type $|" 6722 "with different type of array}0,1">; 6723def err_array_init_non_constant_array : Error< 6724 "cannot initialize array %diff{of type $ with non-constant array of type $|" 6725 "with different type of array}0,1">; 6726def ext_array_init_copy : Extension< 6727 "initialization of an array " 6728 "%diff{of type $ from a compound literal of type $|" 6729 "from a compound literal}0,1 is a GNU extension">, InGroup<GNUCompoundLiteralInitializer>; 6730// This is intentionally not disabled by -Wno-gnu. 6731def ext_array_init_parens : ExtWarn< 6732 "parenthesized initialization of a member array is a GNU extension">, 6733 InGroup<DiagGroup<"gnu-array-member-paren-init">>, DefaultError; 6734def warn_deprecated_string_literal_conversion : Warning< 6735 "conversion from string literal to %0 is deprecated">, 6736 InGroup<CXX11CompatDeprecatedWritableStr>; 6737def ext_deprecated_string_literal_conversion : ExtWarn< 6738 "ISO C++11 does not allow conversion from string literal to %0">, 6739 InGroup<WritableStrings>, SFINAEFailure; 6740def err_realimag_invalid_type : Error<"invalid type %0 to %1 operator">; 6741def err_typecheck_sclass_fscope : Error< 6742 "illegal storage class on file-scoped variable">; 6743def warn_standalone_specifier : Warning<"'%0' ignored on this declaration">, 6744 InGroup<MissingDeclarations>; 6745def ext_standalone_specifier : ExtWarn<"'%0' is not permitted on a declaration " 6746 "of a type">, InGroup<MissingDeclarations>; 6747def err_standalone_class_nested_name_specifier : Error< 6748 "forward declaration of %select{class|struct|interface|union|enum}0 cannot " 6749 "have a nested name specifier">; 6750def err_typecheck_sclass_func : Error<"illegal storage class on function">; 6751def err_static_block_func : Error< 6752 "function declared in block scope cannot have 'static' storage class">; 6753def err_typecheck_address_of : Error<"address of %select{bit-field" 6754 "|vector element|property expression|register variable|matrix element}0 requested">; 6755def ext_typecheck_addrof_void : Extension< 6756 "ISO C forbids taking the address of an expression of type 'void'">; 6757def err_unqualified_pointer_member_function : Error< 6758 "must explicitly qualify name of member function when taking its address">; 6759def err_invalid_form_pointer_member_function : Error< 6760 "cannot create a non-constant pointer to member function">; 6761def err_address_of_function_with_pass_object_size_params: Error< 6762 "cannot take address of function %0 because parameter %1 has " 6763 "pass_object_size attribute">; 6764def err_parens_pointer_member_function : Error< 6765 "cannot parenthesize the name of a method when forming a member pointer">; 6766def err_typecheck_invalid_lvalue_addrof_addrof_function : Error< 6767 "extra '&' taking address of overloaded function">; 6768def err_typecheck_invalid_lvalue_addrof : Error< 6769 "cannot take the address of an rvalue of type %0">; 6770def ext_typecheck_addrof_temporary : ExtWarn< 6771 "taking the address of a temporary object of type %0">, 6772 InGroup<AddressOfTemporary>, DefaultError; 6773def err_typecheck_addrof_temporary : Error< 6774 "taking the address of a temporary object of type %0">; 6775def err_typecheck_addrof_dtor : Error< 6776 "taking the address of a destructor">; 6777def err_typecheck_unary_expr : Error< 6778 "invalid argument type %0 to unary expression">; 6779def err_typecheck_indirection_requires_pointer : Error< 6780 "indirection requires pointer operand (%0 invalid)">; 6781def ext_typecheck_indirection_through_void_pointer : ExtWarn< 6782 "ISO C++ does not allow indirection on operand of type %0">, 6783 InGroup<DiagGroup<"void-ptr-dereference">>; 6784def warn_indirection_through_null : Warning< 6785 "indirection of non-volatile null pointer will be deleted, not trap">, 6786 InGroup<NullDereference>; 6787def warn_binding_null_to_reference : Warning< 6788 "binding dereferenced null pointer to reference has undefined behavior">, 6789 InGroup<NullDereference>; 6790def note_indirection_through_null : Note< 6791 "consider using __builtin_trap() or qualifying pointer with 'volatile'">; 6792def warn_pointer_indirection_from_incompatible_type : Warning< 6793 "dereference of type %1 that was reinterpret_cast from type %0 has undefined " 6794 "behavior">, 6795 InGroup<UndefinedReinterpretCast>, DefaultIgnore; 6796def warn_taking_address_of_packed_member : Warning< 6797 "taking address of packed member %0 of class or structure %q1 may result in an unaligned pointer value">, 6798 InGroup<DiagGroup<"address-of-packed-member">>; 6799def warn_param_mismatched_alignment : Warning< 6800 "passing %0-byte aligned argument to %1-byte aligned parameter %2%select{| of %4}3 may result in an unaligned pointer access">, 6801 InGroup<DiagGroup<"align-mismatch">>; 6802 6803def err_objc_object_assignment : Error< 6804 "cannot assign to class object (%0 invalid)">; 6805def err_typecheck_invalid_operands : Error< 6806 "invalid operands to binary expression (%0 and %1)">, Deferrable; 6807def note_typecheck_invalid_operands_converted : Note< 6808 "%select{first|second}0 operand was implicitly converted to type %1">; 6809def err_typecheck_logical_vector_expr_gnu_cpp_restrict : Error< 6810 "logical expression with vector %select{type %1 and non-vector type %2|types" 6811 " %1 and %2}0 is only supported in C++">; 6812def err_typecheck_sub_ptr_compatible : Error< 6813 "%diff{$ and $ are not pointers to compatible types|" 6814 "pointers to incompatible types}0,1">; 6815def ext_typecheck_ordered_comparison_of_pointer_integer : ExtWarn< 6816 "ordered comparison between pointer and integer (%0 and %1)">; 6817def ext_typecheck_ordered_comparison_of_pointer_and_zero : Extension< 6818 "ordered comparison between pointer and zero (%0 and %1) is an extension">; 6819def err_typecheck_ordered_comparison_of_pointer_and_zero : Error< 6820 "ordered comparison between pointer and zero (%0 and %1)">; 6821def err_typecheck_three_way_comparison_of_pointer_and_zero : Error< 6822 "three-way comparison between pointer and zero">; 6823def ext_typecheck_compare_complete_incomplete_pointers : Extension< 6824 "pointer comparisons before C11 " 6825 "need to be between two complete or two incomplete types; " 6826 "%0 is %select{|in}2complete and " 6827 "%1 is %select{|in}3complete">, 6828 InGroup<C11>; 6829def warn_typecheck_ordered_comparison_of_function_pointers : Warning< 6830 "ordered comparison of function pointers (%0 and %1)">, 6831 InGroup<OrderedCompareFunctionPointers>; 6832def ext_typecheck_ordered_comparison_of_function_pointers : ExtWarn< 6833 "ordered comparison of function pointers (%0 and %1)">, 6834 InGroup<OrderedCompareFunctionPointers>; 6835def err_typecheck_ordered_comparison_of_function_pointers : Error< 6836 "ordered comparison of function pointers (%0 and %1)">; 6837def ext_typecheck_comparison_of_fptr_to_void : Extension< 6838 "equality comparison between function pointer and void pointer (%0 and %1)">; 6839def err_typecheck_comparison_of_fptr_to_void : Error< 6840 "equality comparison between function pointer and void pointer (%0 and %1)">; 6841def ext_typecheck_comparison_of_pointer_integer : ExtWarn< 6842 "comparison between pointer and integer (%0 and %1)">, 6843 InGroup<DiagGroup<"pointer-integer-compare">>; 6844def err_typecheck_comparison_of_pointer_integer : Error< 6845 "comparison between pointer and integer (%0 and %1)">; 6846def ext_typecheck_comparison_of_distinct_pointers : ExtWarn< 6847 "comparison of distinct pointer types%diff{ ($ and $)|}0,1">, 6848 InGroup<CompareDistinctPointerType>; 6849def ext_typecheck_cond_incompatible_operands : ExtWarn< 6850 "incompatible operand types (%0 and %1)">; 6851def err_cond_voidptr_arc : Error < 6852 "operands to conditional of types%diff{ $ and $|}0,1 are incompatible " 6853 "in ARC mode">; 6854def err_typecheck_comparison_of_distinct_pointers : Error< 6855 "comparison of distinct pointer types%diff{ ($ and $)|}0,1">; 6856def err_typecheck_op_on_nonoverlapping_address_space_pointers : Error< 6857 "%select{comparison between %diff{ ($ and $)|}0,1" 6858 "|arithmetic operation with operands of type %diff{ ($ and $)|}0,1" 6859 "|conditional operator with the second and third operands of type " 6860 "%diff{ ($ and $)|}0,1}2" 6861 " which are pointers to non-overlapping address spaces">; 6862 6863def select_arith_conv_kind : TextSubstitution< 6864 "%select{arithmetic between|bitwise operation between|comparison of|" 6865 "conditional expression between|compound assignment of}0">; 6866def warn_arith_conv_enum_float : Warning< 6867 "%sub{select_arith_conv_kind}0 " 6868 "%select{floating-point|enumeration}1 type %2 " 6869 "%plural{2:with|4:from|:and}0 " 6870 "%select{enumeration|floating-point}1 type %3">, 6871 InGroup<EnumFloatConversion>, DefaultIgnore; 6872def warn_arith_conv_enum_float_cxx20 : Warning< 6873 "%sub{select_arith_conv_kind}0 " 6874 "%select{floating-point|enumeration}1 type %2 " 6875 "%plural{2:with|4:from|:and}0 " 6876 "%select{enumeration|floating-point}1 type %3 is deprecated">, 6877 InGroup<DeprecatedEnumFloatConversion>; 6878def warn_arith_conv_mixed_enum_types : Warning< 6879 "%sub{select_arith_conv_kind}0 " 6880 "different enumeration types%diff{ ($ and $)|}1,2">, 6881 InGroup<EnumEnumConversion>, DefaultIgnore; 6882def warn_arith_conv_mixed_enum_types_cxx20 : Warning< 6883 "%sub{select_arith_conv_kind}0 " 6884 "different enumeration types%diff{ ($ and $)|}1,2 is deprecated">, 6885 InGroup<DeprecatedEnumEnumConversion>; 6886def warn_arith_conv_mixed_anon_enum_types : Warning< 6887 warn_arith_conv_mixed_enum_types.Text>, 6888 InGroup<AnonEnumEnumConversion>, DefaultIgnore; 6889def warn_arith_conv_mixed_anon_enum_types_cxx20 : Warning< 6890 warn_arith_conv_mixed_enum_types_cxx20.Text>, 6891 InGroup<DeprecatedAnonEnumEnumConversion>; 6892def warn_conditional_mixed_enum_types : Warning< 6893 warn_arith_conv_mixed_enum_types.Text>, 6894 InGroup<EnumCompareConditional>, DefaultIgnore; 6895def warn_conditional_mixed_enum_types_cxx20 : Warning< 6896 warn_arith_conv_mixed_enum_types_cxx20.Text>, 6897 InGroup<DeprecatedEnumCompareConditional>; 6898def warn_comparison_mixed_enum_types : Warning< 6899 warn_arith_conv_mixed_enum_types.Text>, 6900 InGroup<EnumCompare>; 6901def warn_comparison_mixed_enum_types_cxx20 : Warning< 6902 warn_arith_conv_mixed_enum_types_cxx20.Text>, 6903 InGroup<DeprecatedEnumCompare>; 6904def warn_comparison_of_mixed_enum_types_switch : Warning< 6905 "comparison of different enumeration types in switch statement" 6906 "%diff{ ($ and $)|}0,1">, 6907 InGroup<EnumCompareSwitch>; 6908 6909def err_typecheck_assign_const : Error< 6910 "%select{" 6911 "cannot assign to return value because function %1 returns a const value|" 6912 "cannot assign to variable %1 with const-qualified type %2|" 6913 "cannot assign to %select{non-|}1static data member %2 " 6914 "with const-qualified type %3|" 6915 "cannot assign to non-static data member within const member function %1|" 6916 "cannot assign to %select{variable %2|non-static data member %2|lvalue}1 " 6917 "with %select{|nested }3const-qualified data member %4|" 6918 "read-only variable is not assignable}0">; 6919 6920def note_typecheck_assign_const : Note< 6921 "%select{" 6922 "function %1 which returns const-qualified type %2 declared here|" 6923 "variable %1 declared const here|" 6924 "%select{non-|}1static data member %2 declared const here|" 6925 "member function %q1 is declared const here|" 6926 "%select{|nested }1data member %2 declared const here}0">; 6927 6928def warn_unsigned_always_true_comparison : Warning< 6929 "result of comparison of %select{%3|unsigned expression}0 %2 " 6930 "%select{unsigned expression|%3}0 is always %4">, 6931 InGroup<TautologicalUnsignedZeroCompare>, DefaultIgnore; 6932def warn_unsigned_char_always_true_comparison : Warning< 6933 "result of comparison of %select{%3|char expression}0 %2 " 6934 "%select{char expression|%3}0 is always %4, since char is interpreted as " 6935 "unsigned">, InGroup<TautologicalUnsignedCharZeroCompare>, DefaultIgnore; 6936def warn_unsigned_enum_always_true_comparison : Warning< 6937 "result of comparison of %select{%3|unsigned enum expression}0 %2 " 6938 "%select{unsigned enum expression|%3}0 is always %4">, 6939 InGroup<TautologicalUnsignedEnumZeroCompare>, DefaultIgnore; 6940def warn_tautological_constant_compare : Warning< 6941 "result of comparison %select{%3|%1}0 %2 " 6942 "%select{%1|%3}0 is always %4">, 6943 InGroup<TautologicalTypeLimitCompare>, DefaultIgnore; 6944def warn_tautological_compare_objc_bool : Warning< 6945 "result of comparison of constant %0 with expression of type 'BOOL'" 6946 " is always %1, as the only well defined values for 'BOOL' are YES and NO">, 6947 InGroup<TautologicalObjCBoolCompare>; 6948def subst_int_range : TextSubstitution<"%0-bit %select{signed|unsigned}1 value">; 6949def warn_tautological_compare_value_range : Warning< 6950 "result of comparison of " 6951 "%select{%4|%sub{subst_int_range}1,2}0 %3 " 6952 "%select{%sub{subst_int_range}1,2|%4}0 is always %5">, 6953 InGroup<TautologicalValueRangeCompare>, DefaultIgnore; 6954 6955def warn_mixed_sign_comparison : Warning< 6956 "comparison of integers of different signs: %0 and %1">, 6957 InGroup<SignCompare>, DefaultIgnore; 6958def warn_out_of_range_compare : Warning< 6959 "result of comparison of %select{constant %0|true|false}1 with " 6960 "%select{expression of type %2|boolean expression}3 is always %4">, 6961 InGroup<TautologicalOutOfRangeCompare>; 6962def warn_tautological_bool_compare : Warning<warn_out_of_range_compare.Text>, 6963 InGroup<TautologicalConstantCompare>; 6964def warn_integer_constants_in_conditional_always_true : Warning< 6965 "converting the result of '?:' with integer constants to a boolean always " 6966 "evaluates to 'true'">, 6967 InGroup<TautologicalConstantCompare>; 6968def warn_left_shift_always : Warning< 6969 "converting the result of '<<' to a boolean always evaluates " 6970 "to %select{false|true}0">, 6971 InGroup<TautologicalConstantCompare>; 6972def warn_null_in_arithmetic_operation : Warning< 6973 "use of NULL in arithmetic operation">, 6974 InGroup<NullArithmetic>; 6975def warn_null_in_comparison_operation : Warning< 6976 "comparison between NULL and non-pointer " 6977 "%select{(%1 and NULL)|(NULL and %1)}0">, 6978 InGroup<NullArithmetic>; 6979def err_shift_rhs_only_vector : Error< 6980 "requested shift is a vector of type %0 but the first operand is not a " 6981 "vector (%1)">; 6982 6983def warn_logical_not_on_lhs_of_check : Warning< 6984 "logical not is only applied to the left hand side of this " 6985 "%select{comparison|bitwise operator}0">, 6986 InGroup<LogicalNotParentheses>; 6987def note_logical_not_fix : Note< 6988 "add parentheses after the '!' to evaluate the " 6989 "%select{comparison|bitwise operator}0 first">; 6990def note_logical_not_silence_with_parens : Note< 6991 "add parentheses around left hand side expression to silence this warning">; 6992 6993def err_invalid_this_use : Error< 6994 "invalid use of 'this' outside of a non-static member function">; 6995def err_this_static_member_func : Error< 6996 "'this' cannot be%select{| implicitly}0 used in a static member function " 6997 "declaration">; 6998def err_invalid_member_use_in_static_method : Error< 6999 "invalid use of member %0 in static member function">; 7000def err_invalid_qualified_function_type : Error< 7001 "%select{non-member function|static member function|deduction guide}0 " 7002 "%select{of type %2 |}1cannot have '%3' qualifier">; 7003def err_compound_qualified_function_type : Error< 7004 "%select{block pointer|pointer|reference}0 to function type %select{%2 |}1" 7005 "cannot have '%3' qualifier">; 7006def err_qualified_function_typeid : Error< 7007 "type operand %0 of 'typeid' cannot have '%1' qualifier">; 7008 7009def err_ref_qualifier_overload : Error< 7010 "cannot overload a member function %select{without a ref-qualifier|with " 7011 "ref-qualifier '&'|with ref-qualifier '&&'}0 with a member function %select{" 7012 "without a ref-qualifier|with ref-qualifier '&'|with ref-qualifier '&&'}1">; 7013 7014def err_invalid_non_static_member_use : Error< 7015 "invalid use of non-static data member %0">; 7016def err_nested_non_static_member_use : Error< 7017 "%select{call to non-static member function|use of non-static data member}0 " 7018 "%2 of %1 from nested type %3">; 7019def warn_cxx98_compat_non_static_member_use : Warning< 7020 "use of non-static data member %0 in an unevaluated context is " 7021 "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore; 7022def err_invalid_incomplete_type_use : Error< 7023 "invalid use of incomplete type %0">; 7024def err_builtin_func_cast_more_than_one_arg : Error< 7025 "function-style cast to a builtin type can only take one argument">; 7026def err_value_init_for_array_type : Error< 7027 "array types cannot be value-initialized">; 7028def err_init_for_function_type : Error< 7029 "cannot create object of function type %0">; 7030def warn_format_nonliteral_noargs : Warning< 7031 "format string is not a string literal (potentially insecure)">, 7032 InGroup<FormatSecurity>; 7033def warn_format_nonliteral : Warning< 7034 "format string is not a string literal">, 7035 InGroup<FormatNonLiteral>, DefaultIgnore; 7036 7037def err_unexpected_interface : Error< 7038 "unexpected interface name %0: expected expression">; 7039def err_ref_non_value : Error<"%0 does not refer to a value">; 7040def err_ref_vm_type : Error< 7041 "cannot refer to declaration with a variably modified type inside block">; 7042def err_ref_flexarray_type : Error< 7043 "cannot refer to declaration of structure variable with flexible array member " 7044 "inside block">; 7045def err_ref_array_type : Error< 7046 "cannot refer to declaration with an array type inside block">; 7047def err_property_not_found : Error< 7048 "property %0 not found on object of type %1">; 7049def err_invalid_property_name : Error< 7050 "%0 is not a valid property name (accessing an object of type %1)">; 7051def err_getter_not_found : Error< 7052 "no getter method for read from property">; 7053def err_objc_subscript_method_not_found : Error< 7054 "expected method to %select{read|write}1 %select{dictionary|array}2 element not " 7055 "found on object of type %0">; 7056def err_objc_subscript_index_type : Error< 7057 "method index parameter type %0 is not integral type">; 7058def err_objc_subscript_key_type : Error< 7059 "method key parameter type %0 is not object type">; 7060def err_objc_subscript_dic_object_type : Error< 7061 "method object parameter type %0 is not object type">; 7062def err_objc_subscript_object_type : Error< 7063 "cannot assign to this %select{dictionary|array}1 because assigning method's " 7064 "2nd parameter of type %0 is not an Objective-C pointer type">; 7065def err_objc_subscript_base_type : Error< 7066 "%select{dictionary|array}1 subscript base type %0 is not an Objective-C object">; 7067def err_objc_multiple_subscript_type_conversion : Error< 7068 "indexing expression is invalid because subscript type %0 has " 7069 "multiple type conversion functions">; 7070def err_objc_subscript_type_conversion : Error< 7071 "indexing expression is invalid because subscript type %0 is not an integral" 7072 " or Objective-C pointer type">; 7073def err_objc_subscript_pointer : Error< 7074 "indexing expression is invalid because subscript type %0 is not an" 7075 " Objective-C pointer">; 7076def err_objc_indexing_method_result_type : Error< 7077 "method for accessing %select{dictionary|array}1 element must have Objective-C" 7078 " object return type instead of %0">; 7079def err_objc_index_incomplete_class_type : Error< 7080 "Objective-C index expression has incomplete class type %0">; 7081def err_illegal_container_subscripting_op : Error< 7082 "illegal operation on Objective-C container subscripting">; 7083def err_property_not_found_forward_class : Error< 7084 "property %0 cannot be found in forward class object %1">; 7085def err_property_not_as_forward_class : Error< 7086 "property %0 refers to an incomplete Objective-C class %1 " 7087 "(with no @interface available)">; 7088def note_forward_class : Note< 7089 "forward declaration of class here">; 7090def err_duplicate_property : Error< 7091 "property has a previous declaration">; 7092def ext_gnu_void_ptr : Extension< 7093 "arithmetic on%select{ a|}0 pointer%select{|s}0 to void is a GNU extension">, 7094 InGroup<PointerArith>; 7095def ext_gnu_ptr_func_arith : Extension< 7096 "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 function " 7097 "type%select{|s}2 %1%select{| and %3}2 is a GNU extension">, 7098 InGroup<PointerArith>; 7099def err_readonly_message_assignment : Error< 7100 "assigning to 'readonly' return result of an Objective-C message not allowed">; 7101def ext_integer_increment_complex : Extension< 7102 "ISO C does not support '++'/'--' on complex integer type %0">; 7103def ext_integer_complement_complex : Extension< 7104 "ISO C does not support '~' for complex conjugation of %0">; 7105def err_nosetter_property_assignment : Error< 7106 "%select{assignment to readonly property|" 7107 "no setter method %1 for assignment to property}0">; 7108def err_nosetter_property_incdec : Error< 7109 "%select{%select{increment|decrement}1 of readonly property|" 7110 "no setter method %2 for %select{increment|decrement}1 of property}0">; 7111def err_nogetter_property_compound_assignment : Error< 7112 "a getter method is needed to perform a compound assignment on a property">; 7113def err_nogetter_property_incdec : Error< 7114 "no getter method %1 for %select{increment|decrement}0 of property">; 7115def err_no_subobject_property_setting : Error< 7116 "expression is not assignable">; 7117def err_qualified_objc_access : Error< 7118 "%select{property|instance variable}0 access cannot be qualified with '%1'">; 7119 7120def ext_freestanding_complex : Extension< 7121 "complex numbers are an extension in a freestanding C99 implementation">; 7122 7123// FIXME: Remove when we support imaginary. 7124def err_imaginary_not_supported : Error<"imaginary types are not supported">; 7125 7126// Obj-c expressions 7127def warn_root_inst_method_not_found : Warning< 7128 "instance method %0 is being used on 'Class' which is not in the root class">, 7129 InGroup<MethodAccess>; 7130def warn_class_method_not_found : Warning< 7131 "class method %objcclass0 not found (return type defaults to 'id')">, 7132 InGroup<MethodAccess>; 7133def warn_instance_method_on_class_found : Warning< 7134 "instance method %0 found instead of class method %1">, 7135 InGroup<MethodAccess>; 7136def warn_inst_method_not_found : Warning< 7137 "instance method %objcinstance0 not found (return type defaults to 'id')">, 7138 InGroup<MethodAccess>; 7139def warn_instance_method_not_found_with_typo : Warning< 7140 "instance method %objcinstance0 not found (return type defaults to 'id')" 7141 "; did you mean %objcinstance2?">, InGroup<MethodAccess>; 7142def warn_class_method_not_found_with_typo : Warning< 7143 "class method %objcclass0 not found (return type defaults to 'id')" 7144 "; did you mean %objcclass2?">, InGroup<MethodAccess>; 7145def err_method_not_found_with_typo : Error< 7146 "%select{instance|class}1 method %0 not found " 7147 "; did you mean %2?">; 7148def err_no_super_class_message : Error< 7149 "no @interface declaration found in class messaging of %0">; 7150def err_root_class_cannot_use_super : Error< 7151 "%0 cannot use 'super' because it is a root class">; 7152def err_invalid_receiver_to_message_super : Error< 7153 "'super' is only valid in a method body">; 7154def err_invalid_receiver_class_message : Error< 7155 "receiver type %0 is not an Objective-C class">; 7156def err_missing_open_square_message_send : Error< 7157 "missing '[' at start of message send expression">; 7158def warn_bad_receiver_type : Warning< 7159 "receiver type %0 is not 'id' or interface pointer, consider " 7160 "casting it to 'id'">,InGroup<ObjCReceiver>; 7161def err_bad_receiver_type : Error<"bad receiver type %0">; 7162def err_incomplete_receiver_type : Error<"incomplete receiver type %0">; 7163def err_unknown_receiver_suggest : Error< 7164 "unknown receiver %0; did you mean %1?">; 7165def err_objc_throw_expects_object : Error< 7166 "@throw requires an Objective-C object type (%0 invalid)">; 7167def err_objc_synchronized_expects_object : Error< 7168 "@synchronized requires an Objective-C object type (%0 invalid)">; 7169def err_rethrow_used_outside_catch : Error< 7170 "@throw (rethrow) used outside of a @catch block">; 7171def err_attribute_multiple_objc_gc : Error< 7172 "multiple garbage collection attributes specified for type">; 7173def err_catch_param_not_objc_type : Error< 7174 "@catch parameter is not a pointer to an interface type">; 7175def err_illegal_qualifiers_on_catch_parm : Error< 7176 "illegal qualifiers on @catch parameter">; 7177def err_storage_spec_on_catch_parm : Error< 7178 "@catch parameter cannot have storage specifier '%0'">; 7179def warn_register_objc_catch_parm : Warning< 7180 "'register' storage specifier on @catch parameter will be ignored">; 7181def err_qualified_objc_catch_parm : Error< 7182 "@catch parameter declarator cannot be qualified">; 7183def warn_objc_pointer_cxx_catch_fragile : Warning< 7184 "cannot catch an exception thrown with @throw in C++ in the non-unified " 7185 "exception model">, InGroup<ObjCNonUnifiedException>; 7186def err_objc_object_catch : Error< 7187 "cannot catch an Objective-C object by value">; 7188def err_incomplete_type_objc_at_encode : Error< 7189 "'@encode' of incomplete type %0">; 7190def warn_objc_circular_container : Warning< 7191 "adding %0 to %1 might cause circular dependency in container">, 7192 InGroup<DiagGroup<"objc-circular-container">>; 7193def note_objc_circular_container_declared_here : Note<"%0 declared here">; 7194def warn_objc_unsafe_perform_selector : Warning< 7195 "%0 is incompatible with selectors that return a " 7196 "%select{struct|union|vector}1 type">, 7197 InGroup<DiagGroup<"objc-unsafe-perform-selector">>; 7198def note_objc_unsafe_perform_selector_method_declared_here : Note< 7199 "method %0 that returns %1 declared here">; 7200def err_attribute_arm_builtin_alias : Error< 7201 "'__clang_arm_builtin_alias' attribute can only be applied to an ARM builtin">; 7202def err_attribute_arm_mve_polymorphism : Error< 7203 "'__clang_arm_mve_strict_polymorphism' attribute can only be applied to an MVE/NEON vector type">; 7204 7205def warn_setter_getter_impl_required : Warning< 7206 "property %0 requires method %1 to be defined - " 7207 "use @synthesize, @dynamic or provide a method implementation " 7208 "in this class implementation">, 7209 InGroup<ObjCPropertyImpl>; 7210def warn_setter_getter_impl_required_in_category : Warning< 7211 "property %0 requires method %1 to be defined - " 7212 "use @dynamic or provide a method implementation in this category">, 7213 InGroup<ObjCPropertyImpl>; 7214def note_parameter_named_here : Note< 7215 "passing argument to parameter %0 here">; 7216def note_parameter_here : Note< 7217 "passing argument to parameter here">; 7218def note_method_return_type_change : Note< 7219 "compiler has implicitly changed method %0 return type">; 7220 7221def warn_impl_required_for_class_property : Warning< 7222 "class property %0 requires method %1 to be defined - " 7223 "use @dynamic or provide a method implementation " 7224 "in this class implementation">, 7225 InGroup<ObjCPropertyImpl>; 7226def warn_impl_required_in_category_for_class_property : Warning< 7227 "class property %0 requires method %1 to be defined - " 7228 "use @dynamic or provide a method implementation in this category">, 7229 InGroup<ObjCPropertyImpl>; 7230 7231// C++ casts 7232// These messages adhere to the TryCast pattern: %0 is an int specifying the 7233// cast type, %1 is the source type, %2 is the destination type. 7234def err_bad_reinterpret_cast_overload : Error< 7235 "reinterpret_cast cannot resolve overloaded function %0 to type %1">; 7236 7237def warn_reinterpret_different_from_static : Warning< 7238 "'reinterpret_cast' %select{from|to}3 class %0 %select{to|from}3 its " 7239 "%select{virtual base|base at non-zero offset}2 %1 behaves differently from " 7240 "'static_cast'">, InGroup<ReinterpretBaseClass>; 7241def note_reinterpret_updowncast_use_static: Note< 7242 "use 'static_cast' to adjust the pointer correctly while " 7243 "%select{upcasting|downcasting}0">; 7244 7245def err_bad_static_cast_overload : Error< 7246 "address of overloaded function %0 cannot be static_cast to type %1">; 7247 7248def err_bad_cstyle_cast_overload : Error< 7249 "address of overloaded function %0 cannot be cast to type %1">; 7250 7251 7252def err_bad_cxx_cast_generic : Error< 7253 "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|" 7254 "C-style cast|functional-style cast|addrspace_cast}0 from %1 to %2 is not allowed">; 7255def err_bad_cxx_cast_unrelated_class : Error< 7256 "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|" 7257 "functional-style cast|}0 from %1 to %2, which are not related by " 7258 "inheritance, is not allowed">; 7259def note_type_incomplete : Note<"%0 is incomplete">; 7260def err_bad_cxx_cast_rvalue : Error< 7261 "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|" 7262 "functional-style cast|addrspace_cast}0 from rvalue to reference type %2">; 7263def err_bad_cxx_cast_bitfield : Error< 7264 "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|" 7265 "functional-style cast|}0 from bit-field lvalue to reference type %2">; 7266def err_bad_cxx_cast_qualifiers_away : Error< 7267 "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|" 7268 "functional-style cast|}0 from %1 to %2 casts away qualifiers">; 7269def err_bad_cxx_cast_addr_space_mismatch : Error< 7270 "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|" 7271 "C-style cast|functional-style cast|addrspace_cast}0 from %1 to %2 converts between mismatching address" 7272 " spaces">; 7273def ext_bad_cxx_cast_qualifiers_away_incoherent : ExtWarn< 7274 "ISO C++ does not allow " 7275 "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|" 7276 "functional-style cast|}0 from %1 to %2 because it casts away qualifiers, " 7277 "even though the source and destination types are unrelated">, 7278 SFINAEFailure, InGroup<DiagGroup<"cast-qual-unrelated">>; 7279def err_bad_const_cast_dest : Error< 7280 "%select{const_cast||||C-style cast|functional-style cast|}0 to %2, " 7281 "which is not a reference, pointer-to-object, or pointer-to-data-member">; 7282def ext_cast_fn_obj : Extension< 7283 "cast between pointer-to-function and pointer-to-object is an extension">; 7284def ext_ms_cast_fn_obj : ExtWarn< 7285 "static_cast between pointer-to-function and pointer-to-object is a " 7286 "Microsoft extension">, InGroup<MicrosoftCast>; 7287def warn_cxx98_compat_cast_fn_obj : Warning< 7288 "cast between pointer-to-function and pointer-to-object is incompatible with C++98">, 7289 InGroup<CXX98CompatPedantic>, DefaultIgnore; 7290def err_bad_reinterpret_cast_small_int : Error< 7291 "cast from pointer to smaller type %2 loses information">; 7292def err_bad_cxx_cast_vector_to_scalar_different_size : Error< 7293 "%select{||reinterpret_cast||C-style cast||}0 from vector %1 " 7294 "to scalar %2 of different size">; 7295def err_bad_cxx_cast_scalar_to_vector_different_size : Error< 7296 "%select{||reinterpret_cast||C-style cast||}0 from scalar %1 " 7297 "to vector %2 of different size">; 7298def err_bad_cxx_cast_vector_to_vector_different_size : Error< 7299 "%select{||reinterpret_cast||C-style cast||}0 from vector %1 " 7300 "to vector %2 of different size">; 7301def warn_bad_cxx_cast_nested_pointer_addr_space : Warning< 7302 "%select{reinterpret_cast|C-style cast}0 from %1 to %2 " 7303 "changes address space of nested pointers">, 7304 InGroup<IncompatiblePointerTypesDiscardsQualifiers>; 7305def err_bad_lvalue_to_rvalue_cast : Error< 7306 "cannot cast from lvalue of type %1 to rvalue reference type %2; types are " 7307 "not compatible">; 7308def err_bad_rvalue_to_rvalue_cast : Error< 7309 "cannot cast from rvalue of type %1 to rvalue reference type %2; types are " 7310 "not compatible">; 7311def err_bad_static_cast_pointer_nonpointer : Error< 7312 "cannot cast from type %1 to pointer type %2">; 7313def err_bad_static_cast_member_pointer_nonmp : Error< 7314 "cannot cast from type %1 to member pointer type %2">; 7315def err_bad_cxx_cast_member_pointer_size : Error< 7316 "cannot %select{||reinterpret_cast||C-style cast||}0 from member pointer " 7317 "type %1 to member pointer type %2 of different size">; 7318def err_bad_reinterpret_cast_reference : Error< 7319 "reinterpret_cast of a %0 to %1 needs its address, which is not allowed">; 7320def warn_undefined_reinterpret_cast : Warning< 7321 "reinterpret_cast from %0 to %1 has undefined behavior">, 7322 InGroup<UndefinedReinterpretCast>, DefaultIgnore; 7323 7324// These messages don't adhere to the pattern. 7325// FIXME: Display the path somehow better. 7326def err_ambiguous_base_to_derived_cast : Error< 7327 "ambiguous cast from base %0 to derived %1:%2">; 7328def err_static_downcast_via_virtual : Error< 7329 "cannot cast %0 to %1 via virtual base %2">; 7330def err_downcast_from_inaccessible_base : Error< 7331 "cannot cast %select{private|protected}2 base class %1 to %0">; 7332def err_upcast_to_inaccessible_base : Error< 7333 "cannot cast %0 to its %select{private|protected}2 base class %1">; 7334def err_bad_dynamic_cast_not_ref_or_ptr : Error< 7335 "invalid target type %0 for dynamic_cast; target type must be a reference or pointer type to a defined class">; 7336def err_bad_dynamic_cast_not_class : Error<"%0 is not a class type">; 7337def err_bad_cast_incomplete : Error<"%0 is an incomplete type">; 7338def err_bad_dynamic_cast_not_ptr : Error<"cannot use dynamic_cast to convert from %0 to %1">; 7339def err_bad_dynamic_cast_not_polymorphic : Error<"%0 is not polymorphic">; 7340 7341// Other C++ expressions 7342def err_need_header_before_typeid : Error< 7343 "you need to include <typeinfo> before using the 'typeid' operator">; 7344def err_need_header_before_ms_uuidof : Error< 7345 "you need to include <guiddef.h> before using the '__uuidof' operator">; 7346def err_need_header_before_placement_new : Error< 7347 "no matching %0 function for non-allocating placement new expression; " 7348 "include <new>">; 7349def err_ms___leave_not_in___try : Error< 7350 "'__leave' statement not in __try block">; 7351def err_uuidof_without_guid : Error< 7352 "cannot call operator __uuidof on a type with no GUID">; 7353def err_uuidof_with_multiple_guids : Error< 7354 "cannot call operator __uuidof on a type with multiple GUIDs">; 7355def err_incomplete_typeid : Error<"'typeid' of incomplete type %0">; 7356def err_variably_modified_typeid : Error<"'typeid' of variably modified type %0">; 7357def err_static_illegal_in_new : Error< 7358 "the 'static' modifier for the array size is not legal in new expressions">; 7359def err_array_new_needs_size : Error< 7360 "array size must be specified in new expression with no initializer">; 7361def err_bad_new_type : Error< 7362 "cannot allocate %select{function|reference}1 type %0 with new">; 7363def err_new_incomplete_or_sizeless_type : Error< 7364 "allocation of %select{incomplete|sizeless}0 type %1">; 7365def err_new_array_nonconst : Error< 7366 "only the first dimension of an allocated array may have dynamic size">; 7367def err_new_array_size_unknown_from_init : Error< 7368 "cannot determine allocated array size from initializer">; 7369def err_new_array_init_args : Error< 7370 "array 'new' cannot have initialization arguments">; 7371def ext_new_paren_array_nonconst : ExtWarn< 7372 "when type is in parentheses, array cannot have dynamic size">; 7373def err_placement_new_non_placement_delete : Error< 7374 "'new' expression with placement arguments refers to non-placement " 7375 "'operator delete'">; 7376def err_array_size_not_integral : Error< 7377 "array size expression must have integral or %select{|unscoped }0" 7378 "enumeration type, not %1">; 7379def err_array_size_incomplete_type : Error< 7380 "array size expression has incomplete class type %0">; 7381def err_array_size_explicit_conversion : Error< 7382 "array size expression of type %0 requires explicit conversion to type %1">; 7383def note_array_size_conversion : Note< 7384 "conversion to %select{integral|enumeration}0 type %1 declared here">; 7385def err_array_size_ambiguous_conversion : Error< 7386 "ambiguous conversion of array size expression of type %0 to an integral or " 7387 "enumeration type">; 7388def ext_array_size_conversion : Extension< 7389 "implicit conversion from array size expression of type %0 to " 7390 "%select{integral|enumeration}1 type %2 is a C++11 extension">, 7391 InGroup<CXX11>; 7392def warn_cxx98_compat_array_size_conversion : Warning< 7393 "implicit conversion from array size expression of type %0 to " 7394 "%select{integral|enumeration}1 type %2 is incompatible with C++98">, 7395 InGroup<CXX98CompatPedantic>, DefaultIgnore; 7396def err_address_space_qualified_new : Error< 7397 "'new' cannot allocate objects of type %0 in address space '%1'">; 7398def err_address_space_qualified_delete : Error< 7399 "'delete' cannot delete objects of type %0 in address space '%1'">; 7400 7401def err_default_init_const : Error< 7402 "default initialization of an object of const type %0" 7403 "%select{| without a user-provided default constructor}1">; 7404def ext_default_init_const : ExtWarn< 7405 "default initialization of an object of const type %0" 7406 "%select{| without a user-provided default constructor}1 " 7407 "is a Microsoft extension">, 7408 InGroup<MicrosoftConstInit>; 7409def err_delete_operand : Error<"cannot delete expression of type %0">; 7410def ext_delete_void_ptr_operand : ExtWarn< 7411 "cannot delete expression with pointer-to-'void' type %0">, 7412 InGroup<DeleteIncomplete>; 7413def err_ambiguous_delete_operand : Error< 7414 "ambiguous conversion of delete expression of type %0 to a pointer">; 7415def warn_delete_incomplete : Warning< 7416 "deleting pointer to incomplete type %0 may cause undefined behavior">, 7417 InGroup<DeleteIncomplete>; 7418def err_delete_incomplete_class_type : Error< 7419 "deleting incomplete class type %0; no conversions to pointer type">; 7420def err_delete_explicit_conversion : Error< 7421 "converting delete expression from type %0 to type %1 invokes an explicit " 7422 "conversion function">; 7423def note_delete_conversion : Note<"conversion to pointer type %0">; 7424def warn_delete_array_type : Warning< 7425 "'delete' applied to a pointer-to-array type %0 treated as 'delete[]'">; 7426def warn_mismatched_delete_new : Warning< 7427 "'delete%select{|[]}0' applied to a pointer that was allocated with " 7428 "'new%select{[]|}0'; did you mean 'delete%select{[]|}0'?">, 7429 InGroup<DiagGroup<"mismatched-new-delete">>; 7430def note_allocated_here : Note<"allocated with 'new%select{[]|}0' here">; 7431def err_no_suitable_delete_member_function_found : Error< 7432 "no suitable member %0 in %1">; 7433def err_ambiguous_suitable_delete_member_function_found : Error< 7434 "multiple suitable %0 functions in %1">; 7435def warn_ambiguous_suitable_delete_function_found : Warning< 7436 "multiple suitable %0 functions for %1; no 'operator delete' function " 7437 "will be invoked if initialization throws an exception">, 7438 InGroup<DiagGroup<"ambiguous-delete">>; 7439def note_member_declared_here : Note< 7440 "member %0 declared here">; 7441def note_member_first_declared_here : Note< 7442 "member %0 first declared here">; 7443def warn_bitwise_instead_of_logical : Warning< 7444 "use of bitwise '%0' with boolean operands">, 7445 InGroup<BitwiseInsteadOfLogical>, DefaultIgnore; 7446def warn_bitwise_negation_bool : Warning< 7447 "bitwise negation of a boolean expression%select{;| always evaluates to 'true';}0 " 7448 "did you mean logical negation?">, 7449 InGroup<BoolOperation>, DefaultIgnore; 7450def err_decrement_bool : Error<"cannot decrement expression of type bool">; 7451def warn_increment_bool : Warning< 7452 "incrementing expression of type bool is deprecated and " 7453 "incompatible with C++17">, InGroup<DeprecatedIncrementBool>; 7454def ext_increment_bool : ExtWarn< 7455 "ISO C++17 does not allow incrementing expression of type bool">, 7456 DefaultError, InGroup<IncrementBool>; 7457def err_increment_decrement_enum : Error< 7458 "cannot %select{decrement|increment}0 expression of enum type %1">; 7459 7460def warn_deprecated_increment_decrement_volatile : Warning< 7461 "%select{decrement|increment}0 of object of volatile-qualified type %1 " 7462 "is deprecated">, InGroup<DeprecatedVolatile>; 7463def warn_deprecated_simple_assign_volatile : Warning< 7464 "use of result of assignment to object of volatile-qualified type %0 " 7465 "is deprecated">, InGroup<DeprecatedVolatile>; 7466def warn_deprecated_compound_assign_volatile : Warning< 7467 "compound assignment to object of volatile-qualified type %0 is deprecated">, 7468 InGroup<DeprecatedVolatile>; 7469def warn_deprecated_volatile_return : Warning< 7470 "volatile-qualified return type %0 is deprecated">, 7471 InGroup<DeprecatedVolatile>; 7472def warn_deprecated_volatile_param : Warning< 7473 "volatile-qualified parameter type %0 is deprecated">, 7474 InGroup<DeprecatedVolatile>; 7475def warn_deprecated_volatile_structured_binding : Warning< 7476 "volatile qualifier in structured binding declaration is deprecated">, 7477 InGroup<DeprecatedVolatile>; 7478 7479def warn_deprecated_altivec_src_compat : Warning< 7480 "Current handling of vector bool and vector pixel types in this context are " 7481 "deprecated. The default behaviour will soon change to that implied by the " 7482 "'-altivec-compat=xl' option">, 7483 InGroup<DiagGroup<"deprecated-altivec-src-compat">>; 7484 7485def err_catch_incomplete_ptr : Error< 7486 "cannot catch pointer to incomplete type %0">; 7487def err_catch_incomplete_ref : Error< 7488 "cannot catch reference to incomplete type %0">; 7489def err_catch_incomplete : Error<"cannot catch incomplete type %0">; 7490def err_catch_sizeless : Error< 7491 "cannot catch %select{|reference to }0sizeless type %1">; 7492def err_catch_rvalue_ref : Error<"cannot catch exceptions by rvalue reference">; 7493def err_catch_variably_modified : Error< 7494 "cannot catch variably modified type %0">; 7495def err_qualified_catch_declarator : Error< 7496 "exception declarator cannot be qualified">; 7497def err_early_catch_all : Error<"catch-all handler must come last">; 7498def err_bad_memptr_rhs : Error< 7499 "right hand operand to %0 has non-pointer-to-member type %1">; 7500def err_bad_memptr_lhs : Error< 7501 "left hand operand to %0 must be a %select{|pointer to }1class " 7502 "compatible with the right hand operand, but is %2">; 7503def err_memptr_incomplete : Error< 7504 "member pointer has incomplete base type %0">; 7505def warn_exception_caught_by_earlier_handler : Warning< 7506 "exception of type %0 will be caught by earlier handler">, 7507 InGroup<Exceptions>; 7508def note_previous_exception_handler : Note<"for type %0">; 7509def err_exceptions_disabled : Error< 7510 "cannot use '%0' with exceptions disabled">; 7511def err_objc_exceptions_disabled : Error< 7512 "cannot use '%0' with Objective-C exceptions disabled">; 7513def warn_throw_in_noexcept_func : Warning< 7514 "%0 has a non-throwing exception specification but can still throw">, 7515 InGroup<Exceptions>; 7516def note_throw_in_dtor : Note< 7517 "%select{destructor|deallocator}0 has a %select{non-throwing|implicit " 7518 "non-throwing}1 exception specification">; 7519def note_throw_in_function : Note<"function declared non-throwing here">; 7520def err_seh_try_outside_functions : Error< 7521 "cannot use SEH '__try' in blocks, captured regions, or Obj-C method decls">; 7522def err_mixing_cxx_try_seh_try : Error< 7523 "cannot use %select{C++ 'try'|Objective-C '@try'}0 " 7524 "in the same function as SEH '__try'">; 7525def err_seh_try_unsupported : Error< 7526 "SEH '__try' is not supported on this target">; 7527def note_conflicting_try_here : Note< 7528 "conflicting %0 here">; 7529def warn_jump_out_of_seh_finally : Warning< 7530 "jump out of __finally block has undefined behavior">, 7531 InGroup<DiagGroup<"jump-seh-finally">>; 7532def warn_non_virtual_dtor : Warning< 7533 "%0 has virtual functions but non-virtual destructor">, 7534 InGroup<NonVirtualDtor>, DefaultIgnore; 7535def warn_delete_non_virtual_dtor : Warning< 7536 "%select{delete|destructor}0 called on non-final %1 that has " 7537 "virtual functions but non-virtual destructor">, 7538 InGroup<DeleteNonAbstractNonVirtualDtor>, DefaultIgnore, ShowInSystemHeader; 7539def note_delete_non_virtual : Note< 7540 "qualify call to silence this warning">; 7541def warn_delete_abstract_non_virtual_dtor : Warning< 7542 "%select{delete|destructor}0 called on %1 that is abstract but has " 7543 "non-virtual destructor">, InGroup<DeleteAbstractNonVirtualDtor>, ShowInSystemHeader; 7544def warn_overloaded_virtual : Warning< 7545 "%q0 hides overloaded virtual %select{function|functions}1">, 7546 InGroup<OverloadedVirtual>, DefaultIgnore; 7547def note_hidden_overloaded_virtual_declared_here : Note< 7548 "hidden overloaded virtual function %q0 declared here" 7549 "%select{|: different classes%diff{ ($ vs $)|}2,3" 7550 "|: different number of parameters (%2 vs %3)" 7551 "|: type mismatch at %ordinal2 parameter%diff{ ($ vs $)|}3,4" 7552 "|: different return type%diff{ ($ vs $)|}2,3" 7553 "|: different qualifiers (%2 vs %3)" 7554 "|: different exception specifications}1">; 7555def warn_using_directive_in_header : Warning< 7556 "using namespace directive in global context in header">, 7557 InGroup<HeaderHygiene>, DefaultIgnore; 7558def warn_overaligned_type : Warning< 7559 "type %0 requires %1 bytes of alignment and the default allocator only " 7560 "guarantees %2 bytes">, 7561 InGroup<OveralignedType>, DefaultIgnore; 7562def err_aligned_allocation_unavailable : Error< 7563 "aligned %select{allocation|deallocation}0 function of type '%1' is " 7564 "%select{only|not}4 available on %2%select{ %3 or newer|}4">; 7565def note_silence_aligned_allocation_unavailable : Note< 7566 "if you supply your own aligned allocation functions, use " 7567 "-faligned-allocation to silence this diagnostic">; 7568 7569def err_conditional_void_nonvoid : Error< 7570 "%select{left|right}1 operand to ? is void, but %select{right|left}1 operand " 7571 "is of type %0">; 7572def err_conditional_ambiguous : Error< 7573 "conditional expression is ambiguous; " 7574 "%diff{$ can be converted to $ and vice versa|" 7575 "types can be convert to each other}0,1">; 7576def err_conditional_ambiguous_ovl : Error< 7577 "conditional expression is ambiguous; %diff{$ and $|types}0,1 " 7578 "can be converted to several common types">; 7579def err_conditional_vector_size : Error< 7580 "vector condition type %0 and result type %1 do not have the same number " 7581 "of elements">; 7582def err_conditional_vector_element_size : Error< 7583 "vector condition type %0 and result type %1 do not have elements of the " 7584 "same size">; 7585def err_conditional_vector_has_void : Error< 7586 "GNU vector conditional operand cannot be %select{void|a throw expression}0">; 7587def err_conditional_vector_operand_type 7588 : Error<"enumeration type %0 is not allowed in a vector conditional">; 7589def err_conditional_vector_cond_result_mismatch 7590 : Error<"cannot mix vectors and extended vectors in a vector conditional">; 7591def err_conditional_vector_mismatched 7592 : Error<"vector operands to the vector conditional must be the same type " 7593 "%diff{($ and $)|}0,1}">; 7594 7595def err_throw_incomplete : Error< 7596 "cannot throw object of incomplete type %0">; 7597def err_throw_incomplete_ptr : Error< 7598 "cannot throw pointer to object of incomplete type %0">; 7599def err_throw_sizeless : Error< 7600 "cannot throw object of sizeless type %0">; 7601def warn_throw_underaligned_obj : Warning< 7602 "underaligned exception object thrown">, 7603 InGroup<UnderalignedExceptionObject>; 7604def note_throw_underaligned_obj : Note< 7605 "required alignment of type %0 (%1 bytes) is larger than the supported " 7606 "alignment of C++ exception objects on this target (%2 bytes)">; 7607def err_return_in_constructor_handler : Error< 7608 "return in the catch of a function try block of a constructor is illegal">; 7609def warn_cdtor_function_try_handler_mem_expr : Warning< 7610 "cannot refer to a non-static member from the handler of a " 7611 "%select{constructor|destructor}0 function try block">, InGroup<Exceptions>; 7612 7613let CategoryName = "Lambda Issue" in { 7614 def err_capture_more_than_once : Error< 7615 "%0 can appear only once in a capture list">; 7616 def err_reference_capture_with_reference_default : Error< 7617 "'&' cannot precede a capture when the capture default is '&'">; 7618 def err_copy_capture_with_copy_default : Error< 7619 "'&' must precede a capture when the capture default is '='">; 7620 def err_capture_does_not_name_variable : Error< 7621 "%0 in capture list does not name a variable">; 7622 def err_capture_non_automatic_variable : Error< 7623 "%0 cannot be captured because it does not have automatic storage " 7624 "duration">; 7625 def err_this_capture : Error< 7626 "'this' cannot be %select{implicitly |}0captured in this context">; 7627 def note_lambda_this_capture_fixit : Note< 7628 "explicitly capture 'this'">; 7629 def err_lambda_capture_anonymous_var : Error< 7630 "unnamed variable cannot be implicitly captured in a lambda expression">; 7631 def err_lambda_capture_flexarray_type : Error< 7632 "variable %0 with flexible array member cannot be captured in " 7633 "a lambda expression">; 7634 def err_lambda_impcap : Error< 7635 "variable %0 cannot be implicitly captured in a lambda with no " 7636 "capture-default specified">; 7637 def note_lambda_variable_capture_fixit : Note< 7638 "capture %0 by %select{value|reference}1">; 7639 def note_lambda_default_capture_fixit : Note< 7640 "default capture by %select{value|reference}0">; 7641 def note_lambda_decl : Note<"lambda expression begins here">; 7642 def err_lambda_unevaluated_operand : Error< 7643 "lambda expression in an unevaluated operand">; 7644 def err_lambda_in_constant_expression : Error< 7645 "a lambda expression may not appear inside of a constant expression">; 7646 def err_lambda_in_invalid_context : Error< 7647 "a lambda expression cannot appear in this context">; 7648 def err_lambda_return_init_list : Error< 7649 "cannot deduce lambda return type from initializer list">; 7650 def err_lambda_capture_default_arg : Error< 7651 "lambda expression in default argument cannot capture any entity">; 7652 def err_lambda_incomplete_result : Error< 7653 "incomplete result type %0 in lambda expression">; 7654 def err_noreturn_lambda_has_return_expr : Error< 7655 "lambda declared 'noreturn' should not return">; 7656 def warn_maybe_falloff_nonvoid_lambda : Warning< 7657 "non-void lambda does not return a value in all control paths">, 7658 InGroup<ReturnType>; 7659 def warn_falloff_nonvoid_lambda : Warning< 7660 "non-void lambda does not return a value">, 7661 InGroup<ReturnType>; 7662 def err_access_lambda_capture : Error< 7663 // The ERRORs represent other special members that aren't constructors, in 7664 // hopes that someone will bother noticing and reporting if they appear 7665 "capture of variable '%0' as type %1 calls %select{private|protected}3 " 7666 "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}2constructor">, 7667 AccessControl; 7668 def note_lambda_to_block_conv : Note< 7669 "implicit capture of lambda object due to conversion to block pointer " 7670 "here">; 7671 def note_var_explicitly_captured_here : Note<"variable %0 is" 7672 "%select{| explicitly}1 captured here">; 7673 7674 // C++14 lambda init-captures. 7675 def warn_cxx11_compat_init_capture : Warning< 7676 "initialized lambda captures are incompatible with C++ standards " 7677 "before C++14">, InGroup<CXXPre14Compat>, DefaultIgnore; 7678 def ext_init_capture : ExtWarn< 7679 "initialized lambda captures are a C++14 extension">, InGroup<CXX14>; 7680 def err_init_capture_no_expression : Error< 7681 "initializer missing for lambda capture %0">; 7682 def err_init_capture_multiple_expressions : Error< 7683 "initializer for lambda capture %0 contains multiple expressions">; 7684 def err_init_capture_paren_braces : Error< 7685 "cannot deduce type for lambda capture %1 from " 7686 "%select{parenthesized|nested}0 initializer list">; 7687 def err_init_capture_deduction_failure : Error< 7688 "cannot deduce type for lambda capture %0 from initializer of type %2">; 7689 def err_init_capture_deduction_failure_from_init_list : Error< 7690 "cannot deduce type for lambda capture %0 from initializer list">; 7691 def warn_cxx17_compat_init_capture_pack : Warning< 7692 "initialized lambda capture packs are incompatible with C++ standards " 7693 "before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore; 7694 def ext_init_capture_pack : ExtWarn< 7695 "initialized lambda pack captures are a C++20 extension">, InGroup<CXX20>; 7696 7697 // C++14 generic lambdas. 7698 def warn_cxx11_compat_generic_lambda : Warning< 7699 "generic lambdas are incompatible with C++11">, 7700 InGroup<CXXPre14Compat>, DefaultIgnore; 7701 7702 // C++17 '*this' captures. 7703 def warn_cxx14_compat_star_this_lambda_capture : Warning< 7704 "by value capture of '*this' is incompatible with C++ standards before C++17">, 7705 InGroup<CXXPre17Compat>, DefaultIgnore; 7706 def ext_star_this_lambda_capture_cxx17 : ExtWarn< 7707 "capture of '*this' by copy is a C++17 extension">, InGroup<CXX17>; 7708 7709 // C++17 parameter shadows capture 7710 def err_parameter_shadow_capture : Error< 7711 "a lambda parameter cannot shadow an explicitly captured entity">; 7712 7713 // C++20 [=, this] captures. 7714 def warn_cxx17_compat_equals_this_lambda_capture : Warning< 7715 "explicit capture of 'this' with a capture default of '=' is incompatible " 7716 "with C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore; 7717 def ext_equals_this_lambda_capture_cxx20 : ExtWarn< 7718 "explicit capture of 'this' with a capture default of '=' " 7719 "is a C++20 extension">, InGroup<CXX20>; 7720 def warn_deprecated_this_capture : Warning< 7721 "implicit capture of 'this' with a capture default of '=' is deprecated">, 7722 InGroup<DeprecatedThisCapture>, DefaultIgnore; 7723 def note_deprecated_this_capture : Note< 7724 "add an explicit capture of 'this' to capture '*this' by reference">; 7725 7726 // C++20 default constructible / assignable lambdas. 7727 def warn_cxx17_compat_lambda_def_ctor_assign : Warning< 7728 "%select{default construction|assignment}0 of lambda is incompatible with " 7729 "C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore; 7730} 7731 7732def err_return_in_captured_stmt : Error< 7733 "cannot return from %0">; 7734def err_capture_block_variable : Error< 7735 "__block variable %0 cannot be captured in a " 7736 "%select{lambda expression|captured statement}1">; 7737 7738def err_operator_arrow_circular : Error< 7739 "circular pointer delegation detected">; 7740def err_operator_arrow_depth_exceeded : Error< 7741 "use of 'operator->' on type %0 would invoke a sequence of more than %1 " 7742 "'operator->' calls">; 7743def note_operator_arrow_here : Note< 7744 "'operator->' declared here produces an object of type %0">; 7745def note_operator_arrows_suppressed : Note< 7746 "(skipping %0 'operator->'%s0 in backtrace)">; 7747def note_operator_arrow_depth : Note< 7748 "use -foperator-arrow-depth=N to increase 'operator->' limit">; 7749 7750def err_pseudo_dtor_base_not_scalar : Error< 7751 "object expression of non-scalar type %0 cannot be used in a " 7752 "pseudo-destructor expression">; 7753def ext_pseudo_dtor_on_void : ExtWarn< 7754 "pseudo-destructors on type void are a Microsoft extension">, 7755 InGroup<MicrosoftVoidPseudoDtor>; 7756def err_pseudo_dtor_type_mismatch : Error< 7757 "the type of object expression " 7758 "%diff{($) does not match the type being destroyed ($)|" 7759 "does not match the type being destroyed}0,1 " 7760 "in pseudo-destructor expression">; 7761def err_pseudo_dtor_call_with_args : Error< 7762 "call to pseudo-destructor cannot have any arguments">; 7763def err_dtor_expr_without_call : Error< 7764 "reference to %select{destructor|pseudo-destructor}0 must be called" 7765 "%select{|; did you mean to call it with no arguments?}1">; 7766def err_pseudo_dtor_destructor_non_type : Error< 7767 "%0 does not refer to a type name in pseudo-destructor expression; expected " 7768 "the name of type %1">; 7769def err_invalid_use_of_function_type : Error< 7770 "a function type is not allowed here">; 7771def err_invalid_use_of_array_type : Error<"an array type is not allowed here">; 7772def err_typecheck_bool_condition : Error< 7773 "value of type %0 is not contextually convertible to 'bool'">; 7774def err_typecheck_ambiguous_condition : Error< 7775 "conversion %diff{from $ to $|between types}0,1 is ambiguous">; 7776def err_typecheck_nonviable_condition : Error< 7777 "no viable conversion%select{%diff{ from $ to $|}1,2|" 7778 "%diff{ from returned value of type $ to function return type $|}1,2}0">; 7779def err_typecheck_nonviable_condition_incomplete : Error< 7780 "no viable conversion%diff{ from $ to incomplete type $|}0,1">; 7781def err_typecheck_deleted_function : Error< 7782 "conversion function %diff{from $ to $|between types}0,1 " 7783 "invokes a deleted function">; 7784 7785def err_expected_class_or_namespace : Error<"%0 is not a class" 7786 "%select{ or namespace|, namespace, or enumeration}1">; 7787def err_invalid_declarator_scope : Error<"cannot define or redeclare %0 here " 7788 "because namespace %1 does not enclose namespace %2">; 7789def err_invalid_declarator_global_scope : Error< 7790 "definition or redeclaration of %0 cannot name the global scope">; 7791def err_invalid_declarator_in_function : Error< 7792 "definition or redeclaration of %0 not allowed inside a function">; 7793def err_invalid_declarator_in_block : Error< 7794 "definition or redeclaration of %0 not allowed inside a block">; 7795def err_not_tag_in_scope : Error< 7796 "no %select{struct|interface|union|class|enum}0 named %1 in %2">; 7797 7798def err_no_typeid_with_fno_rtti : Error< 7799 "use of typeid requires -frtti">; 7800def err_no_dynamic_cast_with_fno_rtti : Error< 7801 "use of dynamic_cast requires -frtti">; 7802def warn_no_dynamic_cast_with_rtti_disabled: Warning< 7803 "dynamic_cast will not work since RTTI data is disabled by " 7804 "%select{-fno-rtti-data|/GR-}0">, InGroup<RTTI>; 7805def warn_no_typeid_with_rtti_disabled: Warning< 7806 "typeid will not work since RTTI data is disabled by " 7807 "%select{-fno-rtti-data|/GR-}0">, InGroup<RTTI>; 7808 7809def err_cannot_form_pointer_to_member_of_reference_type : Error< 7810 "cannot form a pointer-to-member to member %0 of reference type %1">; 7811def err_incomplete_object_call : Error< 7812 "incomplete type in call to object of type %0">; 7813 7814def warn_condition_is_assignment : Warning<"using the result of an " 7815 "assignment as a condition without parentheses">, 7816 InGroup<Parentheses>; 7817def warn_free_nonheap_object 7818 : Warning<"attempt to call %0 on non-heap %select{object %2|object: block expression|object: lambda-to-function-pointer conversion}1">, 7819 InGroup<FreeNonHeapObject>; 7820 7821// Completely identical except off by default. 7822def warn_condition_is_idiomatic_assignment : Warning<"using the result " 7823 "of an assignment as a condition without parentheses">, 7824 InGroup<DiagGroup<"idiomatic-parentheses">>, DefaultIgnore; 7825def note_condition_assign_to_comparison : Note< 7826 "use '==' to turn this assignment into an equality comparison">; 7827def note_condition_or_assign_to_comparison : Note< 7828 "use '!=' to turn this compound assignment into an inequality comparison">; 7829def note_condition_assign_silence : Note< 7830 "place parentheses around the assignment to silence this warning">; 7831 7832def warn_equality_with_extra_parens : Warning<"equality comparison with " 7833 "extraneous parentheses">, InGroup<ParenthesesOnEquality>; 7834def note_equality_comparison_to_assign : Note< 7835 "use '=' to turn this equality comparison into an assignment">; 7836def note_equality_comparison_silence : Note< 7837 "remove extraneous parentheses around the comparison to silence this warning">; 7838 7839// assignment related diagnostics (also for argument passing, returning, etc). 7840// In most of these diagnostics the %2 is a value from the 7841// Sema::AssignmentAction enumeration 7842def err_typecheck_convert_incompatible : Error< 7843 "%select{%diff{assigning to $ from incompatible type $|" 7844 "assigning to type from incompatible type}0,1" 7845 "|%diff{passing $ to parameter of incompatible type $|" 7846 "passing type to parameter of incompatible type}0,1" 7847 "|%diff{returning $ from a function with incompatible result type $|" 7848 "returning type from a function with incompatible result type}0,1" 7849 "|%diff{converting $ to incompatible type $|" 7850 "converting type to incompatible type}0,1" 7851 "|%diff{initializing $ with an expression of incompatible type $|" 7852 "initializing type with an expression of incompatible type}0,1" 7853 "|%diff{sending $ to parameter of incompatible type $|" 7854 "sending type to parameter of incompatible type}0,1" 7855 "|%diff{casting $ to incompatible type $|" 7856 "casting type to incompatible type}0,1}2" 7857 "%select{|; dereference with *|" 7858 "; take the address with &|" 7859 "; remove *|" 7860 "; remove &}3" 7861 "%select{|: different classes%diff{ ($ vs $)|}5,6" 7862 "|: different number of parameters (%5 vs %6)" 7863 "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7" 7864 "|: different return type%diff{ ($ vs $)|}5,6" 7865 "|: different qualifiers (%5 vs %6)" 7866 "|: different exception specifications}4">; 7867def err_typecheck_missing_return_type_incompatible : Error< 7868 "%diff{return type $ must match previous return type $|" 7869 "return type must match previous return type}0,1 when %select{block " 7870 "literal|lambda expression}2 has unspecified explicit return type">; 7871 7872def note_incomplete_class_and_qualified_id : Note< 7873 "conformance of forward class %0 to protocol %1 can not be confirmed">; 7874def warn_incompatible_qualified_id : Warning< 7875 "%select{%diff{assigning to $ from incompatible type $|" 7876 "assigning to type from incompatible type}0,1" 7877 "|%diff{passing $ to parameter of incompatible type $|" 7878 "passing type to parameter of incompatible type}0,1" 7879 "|%diff{returning $ from a function with incompatible result type $|" 7880 "returning type from a function with incompatible result type}0,1" 7881 "|%diff{converting $ to incompatible type $|" 7882 "converting type to incompatible type}0,1" 7883 "|%diff{initializing $ with an expression of incompatible type $|" 7884 "initializing type with an expression of incompatible type}0,1" 7885 "|%diff{sending $ to parameter of incompatible type $|" 7886 "sending type to parameter of incompatible type}0,1" 7887 "|%diff{casting $ to incompatible type $|" 7888 "casting type to incompatible type}0,1}2">; 7889def err_incompatible_qualified_id : Error< 7890 "%select{%diff{assigning to $ from incompatible type $|" 7891 "assigning to type from incompatible type}0,1" 7892 "|%diff{passing $ to parameter of incompatible type $|" 7893 "passing type to parameter of incompatible type}0,1" 7894 "|%diff{returning $ from a function with incompatible result type $|" 7895 "returning type from a function with incompatible result type}0,1" 7896 "|%diff{converting $ to incompatible type $|" 7897 "converting type to incompatible type}0,1" 7898 "|%diff{initializing $ with an expression of incompatible type $|" 7899 "initializing type with an expression of incompatible type}0,1" 7900 "|%diff{sending $ to parameter of incompatible type $|" 7901 "sending type to parameter of incompatible type}0,1" 7902 "|%diff{casting $ to incompatible type $|" 7903 "casting type to incompatible type}0,1}2">; 7904def ext_typecheck_convert_pointer_int : ExtWarn< 7905 "incompatible pointer to integer conversion " 7906 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 7907 "|%diff{passing $ to parameter of type $|" 7908 "passing to parameter of different type}0,1" 7909 "|%diff{returning $ from a function with result type $|" 7910 "returning from function with different return type}0,1" 7911 "|%diff{converting $ to type $|converting between types}0,1" 7912 "|%diff{initializing $ with an expression of type $|" 7913 "initializing with expression of different type}0,1" 7914 "|%diff{sending $ to parameter of type $|" 7915 "sending to parameter of different type}0,1" 7916 "|%diff{casting $ to type $|casting between types}0,1}2" 7917 "%select{|; dereference with *|" 7918 "; take the address with &|" 7919 "; remove *|" 7920 "; remove &}3">, 7921 InGroup<IntConversion>; 7922def err_typecheck_convert_pointer_int : Error< 7923 "incompatible pointer to integer conversion " 7924 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 7925 "|%diff{passing $ to parameter of type $|" 7926 "passing to parameter of different type}0,1" 7927 "|%diff{returning $ from a function with result type $|" 7928 "returning from function with different return type}0,1" 7929 "|%diff{converting $ to type $|converting between types}0,1" 7930 "|%diff{initializing $ with an expression of type $|" 7931 "initializing with expression of different type}0,1" 7932 "|%diff{sending $ to parameter of type $|" 7933 "sending to parameter of different type}0,1" 7934 "|%diff{casting $ to type $|casting between types}0,1}2" 7935 "%select{|; dereference with *|" 7936 "; take the address with &|" 7937 "; remove *|" 7938 "; remove &}3">; 7939def ext_typecheck_convert_int_pointer : ExtWarn< 7940 "incompatible integer to pointer conversion " 7941 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 7942 "|%diff{passing $ to parameter of type $|" 7943 "passing to parameter of different type}0,1" 7944 "|%diff{returning $ from a function with result type $|" 7945 "returning from function with different return type}0,1" 7946 "|%diff{converting $ to type $|converting between types}0,1" 7947 "|%diff{initializing $ with an expression of type $|" 7948 "initializing with expression of different type}0,1" 7949 "|%diff{sending $ to parameter of type $|" 7950 "sending to parameter of different type}0,1" 7951 "|%diff{casting $ to type $|casting between types}0,1}2" 7952 "%select{|; dereference with *|" 7953 "; take the address with &|" 7954 "; remove *|" 7955 "; remove &}3">, 7956 InGroup<IntConversion>, SFINAEFailure; 7957def err_typecheck_convert_int_pointer : Error< 7958 "incompatible integer to pointer conversion " 7959 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 7960 "|%diff{passing $ to parameter of type $|" 7961 "passing to parameter of different type}0,1" 7962 "|%diff{returning $ from a function with result type $|" 7963 "returning from function with different return type}0,1" 7964 "|%diff{converting $ to type $|converting between types}0,1" 7965 "|%diff{initializing $ with an expression of type $|" 7966 "initializing with expression of different type}0,1" 7967 "|%diff{sending $ to parameter of type $|" 7968 "sending to parameter of different type}0,1" 7969 "|%diff{casting $ to type $|casting between types}0,1}2" 7970 "%select{|; dereference with *|" 7971 "; take the address with &|" 7972 "; remove *|" 7973 "; remove &}3">; 7974def ext_typecheck_convert_pointer_void_func : Extension< 7975 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 7976 "|%diff{passing $ to parameter of type $|" 7977 "passing to parameter of different type}0,1" 7978 "|%diff{returning $ from a function with result type $|" 7979 "returning from function with different return type}0,1" 7980 "|%diff{converting $ to type $|converting between types}0,1" 7981 "|%diff{initializing $ with an expression of type $|" 7982 "initializing with expression of different type}0,1" 7983 "|%diff{sending $ to parameter of type $|" 7984 "sending to parameter of different type}0,1" 7985 "|%diff{casting $ to type $|casting between types}0,1}2" 7986 " converts between void pointer and function pointer">; 7987def err_typecheck_convert_pointer_void_func : Error< 7988 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 7989 "|%diff{passing $ to parameter of type $|" 7990 "passing to parameter of different type}0,1" 7991 "|%diff{returning $ from a function with result type $|" 7992 "returning from function with different return type}0,1" 7993 "|%diff{converting $ to type $|converting between types}0,1" 7994 "|%diff{initializing $ with an expression of type $|" 7995 "initializing with expression of different type}0,1" 7996 "|%diff{sending $ to parameter of type $|" 7997 "sending to parameter of different type}0,1" 7998 "|%diff{casting $ to type $|casting between types}0,1}2" 7999 " converts between void pointer and function pointer">; 8000def ext_typecheck_convert_incompatible_pointer_sign : ExtWarn< 8001 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 8002 "|%diff{passing $ to parameter of type $|" 8003 "passing to parameter of different type}0,1" 8004 "|%diff{returning $ from a function with result type $|" 8005 "returning from function with different return type}0,1" 8006 "|%diff{converting $ to type $|converting between types}0,1" 8007 "|%diff{initializing $ with an expression of type $|" 8008 "initializing with expression of different type}0,1" 8009 "|%diff{sending $ to parameter of type $|" 8010 "sending to parameter of different type}0,1" 8011 "|%diff{casting $ to type $|casting between types}0,1}2" 8012 " converts between pointers to integer types %select{with different sign|" 8013 "where one is of the unique plain 'char' type and the other is not}3">, 8014 InGroup<DiagGroup<"pointer-sign">>; 8015def err_typecheck_convert_incompatible_pointer_sign : 8016 Error<ext_typecheck_convert_incompatible_pointer_sign.Text>; 8017def ext_typecheck_convert_incompatible_pointer : ExtWarn< 8018 "incompatible pointer types " 8019 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 8020 "|%diff{passing $ to parameter of type $|" 8021 "passing to parameter of different type}0,1" 8022 "|%diff{returning $ from a function with result type $|" 8023 "returning from function with different return type}0,1" 8024 "|%diff{converting $ to type $|converting between types}0,1" 8025 "|%diff{initializing $ with an expression of type $|" 8026 "initializing with expression of different type}0,1" 8027 "|%diff{sending $ to parameter of type $|" 8028 "sending to parameter of different type}0,1" 8029 "|%diff{casting $ to type $|casting between types}0,1}2" 8030 "%select{|; dereference with *|" 8031 "; take the address with &|" 8032 "; remove *|" 8033 "; remove &}3">, 8034 InGroup<IncompatiblePointerTypes>; 8035def err_typecheck_convert_incompatible_pointer : Error< 8036 "incompatible pointer types " 8037 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 8038 "|%diff{passing $ to parameter of type $|" 8039 "passing to parameter of different type}0,1" 8040 "|%diff{returning $ from a function with result type $|" 8041 "returning from function with different return type}0,1" 8042 "|%diff{converting $ to type $|converting between types}0,1" 8043 "|%diff{initializing $ with an expression of type $|" 8044 "initializing with expression of different type}0,1" 8045 "|%diff{sending $ to parameter of type $|" 8046 "sending to parameter of different type}0,1" 8047 "|%diff{casting $ to type $|casting between types}0,1}2" 8048 "%select{|; dereference with *|" 8049 "; take the address with &|" 8050 "; remove *|" 8051 "; remove &}3">; 8052def ext_typecheck_convert_incompatible_function_pointer : ExtWarn< 8053 "incompatible function pointer types " 8054 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 8055 "|%diff{passing $ to parameter of type $|" 8056 "passing to parameter of different type}0,1" 8057 "|%diff{returning $ from a function with result type $|" 8058 "returning from function with different return type}0,1" 8059 "|%diff{converting $ to type $|converting between types}0,1" 8060 "|%diff{initializing $ with an expression of type $|" 8061 "initializing with expression of different type}0,1" 8062 "|%diff{sending $ to parameter of type $|" 8063 "sending to parameter of different type}0,1" 8064 "|%diff{casting $ to type $|casting between types}0,1}2" 8065 "%select{|; dereference with *|" 8066 "; take the address with &|" 8067 "; remove *|" 8068 "; remove &}3">, 8069 InGroup<IncompatibleFunctionPointerTypes>; 8070def err_typecheck_convert_incompatible_function_pointer : Error< 8071 "incompatible function pointer types " 8072 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 8073 "|%diff{passing $ to parameter of type $|" 8074 "passing to parameter of different type}0,1" 8075 "|%diff{returning $ from a function with result type $|" 8076 "returning from function with different return type}0,1" 8077 "|%diff{converting $ to type $|converting between types}0,1" 8078 "|%diff{initializing $ with an expression of type $|" 8079 "initializing with expression of different type}0,1" 8080 "|%diff{sending $ to parameter of type $|" 8081 "sending to parameter of different type}0,1" 8082 "|%diff{casting $ to type $|casting between types}0,1}2" 8083 "%select{|; dereference with *|" 8084 "; take the address with &|" 8085 "; remove *|" 8086 "; remove &}3">; 8087def ext_typecheck_convert_discards_qualifiers : ExtWarn< 8088 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 8089 "|%diff{passing $ to parameter of type $|" 8090 "passing to parameter of different type}0,1" 8091 "|%diff{returning $ from a function with result type $|" 8092 "returning from function with different return type}0,1" 8093 "|%diff{converting $ to type $|converting between types}0,1" 8094 "|%diff{initializing $ with an expression of type $|" 8095 "initializing with expression of different type}0,1" 8096 "|%diff{sending $ to parameter of type $|" 8097 "sending to parameter of different type}0,1" 8098 "|%diff{casting $ to type $|casting between types}0,1}2" 8099 " discards qualifiers">, 8100 InGroup<IncompatiblePointerTypesDiscardsQualifiers>; 8101def err_typecheck_convert_discards_qualifiers : Error< 8102 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 8103 "|%diff{passing $ to parameter of type $|" 8104 "passing to parameter of different type}0,1" 8105 "|%diff{returning $ from a function with result type $|" 8106 "returning from function with different return type}0,1" 8107 "|%diff{converting $ to type $|converting between types}0,1" 8108 "|%diff{initializing $ with an expression of type $|" 8109 "initializing with expression of different type}0,1" 8110 "|%diff{sending $ to parameter of type $|" 8111 "sending to parameter of different type}0,1" 8112 "|%diff{casting $ to type $|casting between types}0,1}2" 8113 " discards qualifiers">; 8114def ext_nested_pointer_qualifier_mismatch : ExtWarn< 8115 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 8116 "|%diff{passing $ to parameter of type $|" 8117 "passing to parameter of different type}0,1" 8118 "|%diff{returning $ from a function with result type $|" 8119 "returning from function with different return type}0,1" 8120 "|%diff{converting $ to type $|converting between types}0,1" 8121 "|%diff{initializing $ with an expression of type $|" 8122 "initializing with expression of different type}0,1" 8123 "|%diff{sending $ to parameter of type $|" 8124 "sending to parameter of different type}0,1" 8125 "|%diff{casting $ to type $|casting between types}0,1}2" 8126 " discards qualifiers in nested pointer types">, 8127 InGroup<IncompatiblePointerTypesDiscardsQualifiers>; 8128def err_nested_pointer_qualifier_mismatch : Error< 8129 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 8130 "|%diff{passing $ to parameter of type $|" 8131 "passing to parameter of different type}0,1" 8132 "|%diff{returning $ from a function with result type $|" 8133 "returning from function with different return type}0,1" 8134 "|%diff{converting $ to type $|converting between types}0,1" 8135 "|%diff{initializing $ with an expression of type $|" 8136 "initializing with expression of different type}0,1" 8137 "|%diff{sending $ to parameter of type $|" 8138 "sending to parameter of different type}0,1" 8139 "|%diff{casting $ to type $|casting between types}0,1}2" 8140 " discards qualifiers in nested pointer types">; 8141def warn_incompatible_vectors : Warning< 8142 "incompatible vector types " 8143 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 8144 "|%diff{passing $ to parameter of type $|" 8145 "passing to parameter of different type}0,1" 8146 "|%diff{returning $ from a function with result type $|" 8147 "returning from function with different return type}0,1" 8148 "|%diff{converting $ to type $|converting between types}0,1" 8149 "|%diff{initializing $ with an expression of type $|" 8150 "initializing with expression of different type}0,1" 8151 "|%diff{sending $ to parameter of type $|" 8152 "sending to parameter of different type}0,1" 8153 "|%diff{casting $ to type $|casting between types}0,1}2">, 8154 InGroup<VectorConversion>, DefaultIgnore; 8155def err_incompatible_vectors : Error< 8156 "incompatible vector types " 8157 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 8158 "|%diff{passing $ to parameter of type $|" 8159 "passing to parameter of different type}0,1" 8160 "|%diff{returning $ from a function with result type $|" 8161 "returning from function with different return type}0,1" 8162 "|%diff{converting $ to type $|converting between types}0,1" 8163 "|%diff{initializing $ with an expression of type $|" 8164 "initializing with expression of different type}0,1" 8165 "|%diff{sending $ to parameter of type $|" 8166 "sending to parameter of different type}0,1" 8167 "|%diff{casting $ to type $|casting between types}0,1}2">; 8168def err_int_to_block_pointer : Error< 8169 "invalid block pointer conversion " 8170 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 8171 "|%diff{passing $ to parameter of type $|" 8172 "passing to parameter of different type}0,1" 8173 "|%diff{returning $ from a function with result type $|" 8174 "returning from function with different return type}0,1" 8175 "|%diff{converting $ to type $|converting between types}0,1" 8176 "|%diff{initializing $ with an expression of type $|" 8177 "initializing with expression of different type}0,1" 8178 "|%diff{sending $ to parameter of type $|" 8179 "sending to parameter of different type}0,1" 8180 "|%diff{casting $ to type $|casting between types}0,1}2">; 8181def err_typecheck_convert_incompatible_block_pointer : Error< 8182 "incompatible block pointer types " 8183 "%select{%diff{assigning to $ from $|assigning to different types}0,1" 8184 "|%diff{passing $ to parameter of type $|" 8185 "passing to parameter of different type}0,1" 8186 "|%diff{returning $ from a function with result type $|" 8187 "returning from function with different return type}0,1" 8188 "|%diff{converting $ to type $|converting between types}0,1" 8189 "|%diff{initializing $ with an expression of type $|" 8190 "initializing with expression of different type}0,1" 8191 "|%diff{sending $ to parameter of type $|" 8192 "sending to parameter of different type}0,1" 8193 "|%diff{casting $ to type $|casting between types}0,1}2">; 8194def err_typecheck_incompatible_address_space : Error< 8195 "%select{%diff{assigning $ to $|assigning to different types}1,0" 8196 "|%diff{passing $ to parameter of type $|" 8197 "passing to parameter of different type}0,1" 8198 "|%diff{returning $ from a function with result type $|" 8199 "returning from function with different return type}0,1" 8200 "|%diff{converting $ to type $|converting between types}0,1" 8201 "|%diff{initializing $ with an expression of type $|" 8202 "initializing with expression of different type}0,1" 8203 "|%diff{sending $ to parameter of type $|" 8204 "sending to parameter of different type}0,1" 8205 "|%diff{casting $ to type $|casting between types}0,1}2" 8206 " changes address space of pointer">; 8207def err_typecheck_incompatible_nested_address_space : Error< 8208 "%select{%diff{assigning $ to $|assigning to different types}1,0" 8209 "|%diff{passing $ to parameter of type $|" 8210 "passing to parameter of different type}0,1" 8211 "|%diff{returning $ from a function with result type $|" 8212 "returning from function with different return type}0,1" 8213 "|%diff{converting $ to type $|converting between types}0,1" 8214 "|%diff{initializing $ with an expression of type $|" 8215 "initializing with expression of different type}0,1" 8216 "|%diff{sending $ to parameter of type $|" 8217 "sending to parameter of different type}0,1" 8218 "|%diff{casting $ to type $|casting between types}0,1}2" 8219 " changes address space of nested pointer">; 8220def err_typecheck_incompatible_ownership : Error< 8221 "%select{%diff{assigning $ to $|assigning to different types}1,0" 8222 "|%diff{passing $ to parameter of type $|" 8223 "passing to parameter of different type}0,1" 8224 "|%diff{returning $ from a function with result type $|" 8225 "returning from function with different return type}0,1" 8226 "|%diff{converting $ to type $|converting between types}0,1" 8227 "|%diff{initializing $ with an expression of type $|" 8228 "initializing with expression of different type}0,1" 8229 "|%diff{sending $ to parameter of type $|" 8230 "sending to parameter of different type}0,1" 8231 "|%diff{casting $ to type $|casting between types}0,1}2" 8232 " changes retain/release properties of pointer">; 8233def err_typecheck_comparison_of_distinct_blocks : Error< 8234 "comparison of distinct block types%diff{ ($ and $)|}0,1">; 8235 8236def err_typecheck_array_not_modifiable_lvalue : Error< 8237 "array type %0 is not assignable">; 8238def err_typecheck_non_object_not_modifiable_lvalue : Error< 8239 "non-object type %0 is not assignable">; 8240def err_typecheck_expression_not_modifiable_lvalue : Error< 8241 "expression is not assignable">; 8242def err_typecheck_incomplete_type_not_modifiable_lvalue : Error< 8243 "incomplete type %0 is not assignable">; 8244def err_typecheck_lvalue_casts_not_supported : Error< 8245 "assignment to cast is illegal, lvalue casts are not supported">; 8246 8247def err_typecheck_duplicate_vector_components_not_mlvalue : Error< 8248 "vector is not assignable (contains duplicate components)">; 8249def err_block_decl_ref_not_modifiable_lvalue : Error< 8250 "variable is not assignable (missing __block type specifier)">; 8251def err_lambda_decl_ref_not_modifiable_lvalue : Error< 8252 "cannot assign to a variable captured by copy in a non-mutable lambda">; 8253def err_typecheck_call_not_function : Error< 8254 "called object type %0 is not a function or function pointer">; 8255def err_call_incomplete_return : Error< 8256 "calling function with incomplete return type %0">; 8257def err_call_function_incomplete_return : Error< 8258 "calling %0 with incomplete return type %1">; 8259def err_call_incomplete_argument : Error< 8260 "argument type %0 is incomplete">; 8261def err_typecheck_call_too_few_args : Error< 8262 "too few %select{|||execution configuration }0arguments to " 8263 "%select{function|block|method|kernel function}0 call, " 8264 "expected %1, have %2">; 8265def err_typecheck_call_too_few_args_one : Error< 8266 "too few %select{|||execution configuration }0arguments to " 8267 "%select{function|block|method|kernel function}0 call, " 8268 "single argument %1 was not specified">; 8269def err_typecheck_call_too_few_args_at_least : Error< 8270 "too few %select{|||execution configuration }0arguments to " 8271 "%select{function|block|method|kernel function}0 call, " 8272 "expected at least %1, have %2">; 8273def err_typecheck_call_too_few_args_at_least_one : Error< 8274 "too few %select{|||execution configuration }0arguments to " 8275 "%select{function|block|method|kernel function}0 call, " 8276 "at least argument %1 must be specified">; 8277def err_typecheck_call_too_few_args_suggest : Error< 8278 "too few %select{|||execution configuration }0arguments to " 8279 "%select{function|block|method|kernel function}0 call, " 8280 "expected %1, have %2; did you mean %3?">; 8281def err_typecheck_call_too_few_args_at_least_suggest : Error< 8282 "too few %select{|||execution configuration }0arguments to " 8283 "%select{function|block|method|kernel function}0 call, " 8284 "expected at least %1, have %2; did you mean %3?">; 8285def err_typecheck_call_too_many_args : Error< 8286 "too many %select{|||execution configuration }0arguments to " 8287 "%select{function|block|method|kernel function}0 call, " 8288 "expected %1, have %2">; 8289def err_typecheck_call_too_many_args_one : Error< 8290 "too many %select{|||execution configuration }0arguments to " 8291 "%select{function|block|method|kernel function}0 call, " 8292 "expected single argument %1, have %2 arguments">; 8293def err_typecheck_call_too_many_args_at_most : Error< 8294 "too many %select{|||execution configuration }0arguments to " 8295 "%select{function|block|method|kernel function}0 call, " 8296 "expected at most %1, have %2">; 8297def err_typecheck_call_too_many_args_at_most_one : Error< 8298 "too many %select{|||execution configuration }0arguments to " 8299 "%select{function|block|method|kernel function}0 call, " 8300 "expected at most single argument %1, have %2 arguments">; 8301def err_typecheck_call_too_many_args_suggest : Error< 8302 "too many %select{|||execution configuration }0arguments to " 8303 "%select{function|block|method|kernel function}0 call, " 8304 "expected %1, have %2; did you mean %3?">; 8305def err_typecheck_call_too_many_args_at_most_suggest : Error< 8306 "too many %select{|||execution configuration }0arguments to " 8307 "%select{function|block|method|kernel function}0 call, " 8308 "expected at most %1, have %2; did you mean %3?">; 8309 8310def err_arc_typecheck_convert_incompatible_pointer : Error< 8311 "incompatible pointer types passing retainable parameter of type %0" 8312 "to a CF function expecting %1 type">; 8313 8314def err_builtin_fn_use : Error<"builtin functions must be directly called">; 8315 8316def warn_call_wrong_number_of_arguments : Warning< 8317 "too %select{few|many}0 arguments in call to %1">; 8318def err_atomic_builtin_must_be_pointer : Error< 8319 "address argument to atomic builtin must be a pointer (%0 invalid)">; 8320def err_atomic_builtin_must_be_pointer_intptr : Error< 8321 "address argument to atomic builtin must be a pointer to integer or pointer" 8322 " (%0 invalid)">; 8323def err_atomic_builtin_cannot_be_const : Error< 8324 "address argument to atomic builtin cannot be const-qualified (%0 invalid)">; 8325def err_atomic_builtin_must_be_pointer_intfltptr : Error< 8326 "address argument to atomic builtin must be a pointer to integer," 8327 " floating-point or pointer (%0 invalid)">; 8328def err_atomic_builtin_pointer_size : Error< 8329 "address argument to atomic builtin must be a pointer to 1,2,4,8 or 16 byte " 8330 "type (%0 invalid)">; 8331def err_atomic_exclusive_builtin_pointer_size : Error< 8332 "address argument to load or store exclusive builtin must be a pointer to" 8333 " 1,2,4 or 8 byte type (%0 invalid)">; 8334def err_atomic_builtin_ext_int_size : Error< 8335 "Atomic memory operand must have a power-of-two size">; 8336def err_atomic_builtin_ext_int_prohibit : Error< 8337 "argument to atomic builtin of type '_ExtInt' is not supported">; 8338def err_atomic_op_needs_atomic : Error< 8339 "address argument to atomic operation must be a pointer to _Atomic " 8340 "type (%0 invalid)">; 8341def err_atomic_op_needs_non_const_atomic : Error< 8342 "address argument to atomic operation must be a pointer to non-%select{const|constant}0 _Atomic " 8343 "type (%1 invalid)">; 8344def err_atomic_op_needs_non_const_pointer : Error< 8345 "address argument to atomic operation must be a pointer to non-const " 8346 "type (%0 invalid)">; 8347def err_atomic_op_needs_trivial_copy : Error< 8348 "address argument to atomic operation must be a pointer to a " 8349 "trivially-copyable type (%0 invalid)">; 8350def err_atomic_op_needs_atomic_int_ptr_or_fp : Error< 8351 "address argument to atomic operation must be a pointer to %select{|atomic }0" 8352 "integer, pointer or supported floating point type (%1 invalid)">; 8353def err_atomic_op_needs_atomic_int_or_ptr : Error< 8354 "address argument to atomic operation must be a pointer to %select{|atomic }0" 8355 "integer or pointer (%1 invalid)">; 8356def err_atomic_op_needs_atomic_int : Error< 8357 "address argument to atomic operation must be a pointer to " 8358 "%select{|atomic }0integer (%1 invalid)">; 8359def warn_atomic_op_has_invalid_memory_order : Warning< 8360 "memory order argument to atomic operation is invalid">, 8361 InGroup<DiagGroup<"atomic-memory-ordering">>; 8362def err_atomic_op_has_invalid_synch_scope : Error< 8363 "synchronization scope argument to atomic operation is invalid">; 8364def warn_atomic_implicit_seq_cst : Warning< 8365 "implicit use of sequentially-consistent atomic may incur stronger memory barriers than necessary">, 8366 InGroup<DiagGroup<"atomic-implicit-seq-cst">>, DefaultIgnore; 8367 8368def err_overflow_builtin_must_be_int : Error< 8369 "operand argument to overflow builtin must be an integer (%0 invalid)">; 8370def err_overflow_builtin_must_be_ptr_int : Error< 8371 "result argument to overflow builtin must be a pointer " 8372 "to a non-const integer (%0 invalid)">; 8373def err_overflow_builtin_ext_int_max_size : Error< 8374 "__builtin_mul_overflow does not support signed _ExtInt operands of more " 8375 "than %0 bits">; 8376 8377def err_atomic_load_store_uses_lib : Error< 8378 "atomic %select{load|store}0 requires runtime support that is not " 8379 "available for this target">; 8380 8381def err_nontemporal_builtin_must_be_pointer : Error< 8382 "address argument to nontemporal builtin must be a pointer (%0 invalid)">; 8383def err_nontemporal_builtin_must_be_pointer_intfltptr_or_vector : Error< 8384 "address argument to nontemporal builtin must be a pointer to integer, float, " 8385 "pointer, or a vector of such types (%0 invalid)">; 8386 8387def err_deleted_function_use : Error<"attempt to use a deleted function">; 8388def err_deleted_inherited_ctor_use : Error< 8389 "constructor inherited by %0 from base class %1 is implicitly deleted">; 8390 8391def note_called_by : Note<"called by %0">; 8392def err_kern_type_not_void_return : Error< 8393 "kernel function type %0 must have void return type">; 8394def err_kern_is_nonstatic_method : Error< 8395 "kernel function %0 must be a free function or static member function">; 8396def err_config_scalar_return : Error< 8397 "CUDA special function '%0' must have scalar return type">; 8398def err_kern_call_not_global_function : Error< 8399 "kernel call to non-global function %0">; 8400def err_global_call_not_config : Error< 8401 "call to global function %0 not configured">; 8402def err_ref_bad_target : Error< 8403 "reference to %select{__device__|__global__|__host__|__host__ __device__}0 " 8404 "%select{function|variable}1 %2 in %select{__device__|__global__|__host__|__host__ __device__}3 function">; 8405def note_cuda_const_var_unpromoted : Note< 8406 "const variable cannot be emitted on device side due to dynamic initialization">; 8407def note_cuda_host_var : Note< 8408 "host variable declared here">; 8409def err_ref_bad_target_global_initializer : Error< 8410 "reference to %select{__device__|__global__|__host__|__host__ __device__}0 " 8411 "function %1 in global initializer">; 8412def err_capture_bad_target : Error< 8413 "capture host variable %0 by reference in device or host device lambda function">; 8414def warn_maybe_capture_bad_target_this_ptr : Warning< 8415 "capture host side class data member by this pointer in device or host device lambda function " 8416 "may result in invalid memory access if this pointer is not accessible on device side">, 8417 InGroup<DiagGroup<"gpu-maybe-wrong-side">>; 8418def warn_kern_is_method : Extension< 8419 "kernel function %0 is a member function; this may not be accepted by nvcc">, 8420 InGroup<CudaCompat>; 8421def warn_kern_is_inline : Warning< 8422 "ignored 'inline' attribute on kernel function %0">, 8423 InGroup<CudaCompat>; 8424def err_variadic_device_fn : Error< 8425 "CUDA device code does not support variadic functions">; 8426def err_va_arg_in_device : Error< 8427 "CUDA device code does not support va_arg">; 8428def err_alias_not_supported_on_nvptx : Error<"CUDA does not support aliases">; 8429def err_cuda_unattributed_constexpr_cannot_overload_device : Error< 8430 "constexpr function %0 without __host__ or __device__ attributes cannot " 8431 "overload __device__ function with same signature. Add a __host__ " 8432 "attribute, or build with -fno-cuda-host-device-constexpr.">; 8433def note_cuda_conflicting_device_function_declared_here : Note< 8434 "conflicting __device__ function declared here">; 8435def err_cuda_device_exceptions : Error< 8436 "cannot use '%0' in " 8437 "%select{__device__|__global__|__host__|__host__ __device__}1 function">; 8438def err_dynamic_var_init : Error< 8439 "dynamic initialization is not supported for " 8440 "__device__, __constant__, __shared__, and __managed__ variables.">; 8441def err_shared_var_init : Error< 8442 "initialization is not supported for __shared__ variables.">; 8443def err_cuda_vla : Error< 8444 "cannot use variable-length arrays in " 8445 "%select{__device__|__global__|__host__|__host__ __device__}0 functions">; 8446def err_cuda_extern_shared : Error<"__shared__ variable %0 cannot be 'extern'">; 8447def err_cuda_host_shared : Error< 8448 "__shared__ local variables not allowed in " 8449 "%select{__device__|__global__|__host__|__host__ __device__}0 functions">; 8450def err_cuda_nonstatic_constdev: Error<"__constant__, __device__, and " 8451 "__managed__ are not allowed on non-static local variables">; 8452def err_cuda_ovl_target : Error< 8453 "%select{__device__|__global__|__host__|__host__ __device__}0 function %1 " 8454 "cannot overload %select{__device__|__global__|__host__|__host__ __device__}2 function %3">; 8455def note_cuda_ovl_candidate_target_mismatch : Note< 8456 "candidate template ignored: target attributes do not match">; 8457 8458def err_cuda_device_builtin_surftex_cls_template : Error< 8459 "illegal device builtin %select{surface|texture}0 reference " 8460 "class template %1 declared here">; 8461def note_cuda_device_builtin_surftex_cls_should_have_n_args : Note< 8462 "%0 needs to have exactly %1 template parameters">; 8463def note_cuda_device_builtin_surftex_cls_should_have_match_arg : Note< 8464 "the %select{1st|2nd|3rd}1 template parameter of %0 needs to be " 8465 "%select{a type|an integer or enum value}2">; 8466 8467def err_cuda_device_builtin_surftex_ref_decl : Error< 8468 "illegal device builtin %select{surface|texture}0 reference " 8469 "type %1 declared here">; 8470def note_cuda_device_builtin_surftex_should_be_template_class : Note< 8471 "%0 needs to be instantiated from a class template with proper " 8472 "template arguments">; 8473 8474def err_hip_invalid_args_builtin_mangled_name : Error< 8475 "invalid argument: symbol must be a device-side function or global variable">; 8476 8477def warn_non_pod_vararg_with_format_string : Warning< 8478 "cannot pass %select{non-POD|non-trivial}0 object of type %1 to variadic " 8479 "%select{function|block|method|constructor}2; expected type from format " 8480 "string was %3">, InGroup<NonPODVarargs>, DefaultError; 8481// The arguments to this diagnostic should match the warning above. 8482def err_cannot_pass_objc_interface_to_vararg_format : Error< 8483 "cannot pass object with interface type %1 by value to variadic " 8484 "%select{function|block|method|constructor}2; expected type from format " 8485 "string was %3">; 8486def err_cannot_pass_non_trivial_c_struct_to_vararg : Error< 8487 "cannot pass non-trivial C object of type %0 by value to variadic " 8488 "%select{function|block|method|constructor}1">; 8489 8490 8491def err_cannot_pass_objc_interface_to_vararg : Error< 8492 "cannot pass object with interface type %0 by value through variadic " 8493 "%select{function|block|method|constructor}1">; 8494def warn_cannot_pass_non_pod_arg_to_vararg : Warning< 8495 "cannot pass object of %select{non-POD|non-trivial}0 type %1 through variadic" 8496 " %select{function|block|method|constructor}2; call will abort at runtime">, 8497 InGroup<NonPODVarargs>, DefaultError; 8498def warn_cxx98_compat_pass_non_pod_arg_to_vararg : Warning< 8499 "passing object of trivial but non-POD type %0 through variadic" 8500 " %select{function|block|method|constructor}1 is incompatible with C++98">, 8501 InGroup<CXX98Compat>, DefaultIgnore; 8502def warn_pass_class_arg_to_vararg : Warning< 8503 "passing object of class type %0 through variadic " 8504 "%select{function|block|method|constructor}1" 8505 "%select{|; did you mean to call '%3'?}2">, 8506 InGroup<ClassVarargs>, DefaultIgnore; 8507def err_cannot_pass_to_vararg : Error< 8508 "cannot pass %select{expression of type %1|initializer list}0 to variadic " 8509 "%select{function|block|method|constructor}2">; 8510def err_cannot_pass_to_vararg_format : Error< 8511 "cannot pass %select{expression of type %1|initializer list}0 to variadic " 8512 "%select{function|block|method|constructor}2; expected type from format " 8513 "string was %3">; 8514 8515def err_typecheck_call_invalid_ordered_compare : Error< 8516 "ordered compare requires two args of floating point type" 8517 "%diff{ ($ and $)|}0,1">; 8518def err_typecheck_call_invalid_unary_fp : Error< 8519 "floating point classification requires argument of floating point type " 8520 "(passed in %0)">; 8521def err_typecheck_cond_expect_int_float : Error< 8522 "used type %0 where integer or floating point type is required">; 8523def err_typecheck_cond_expect_scalar : Error< 8524 "used type %0 where arithmetic or pointer type is required">; 8525def err_typecheck_cond_expect_nonfloat : Error< 8526 "used type %0 where floating point type is not allowed">; 8527def ext_typecheck_cond_one_void : Extension< 8528 "C99 forbids conditional expressions with only one void side">; 8529def err_typecheck_cast_to_incomplete : Error< 8530 "cast to incomplete type %0">; 8531def ext_typecheck_cast_nonscalar : Extension< 8532 "C99 forbids casting nonscalar type %0 to the same type">; 8533def ext_typecheck_cast_to_union : Extension< 8534 "cast to union type is a GNU extension">, 8535 InGroup<GNUUnionCast>; 8536def err_typecheck_cast_to_union_no_type : Error< 8537 "cast to union type from type %0 not present in union">; 8538def err_cast_pointer_from_non_pointer_int : Error< 8539 "operand of type %0 cannot be cast to a pointer type">; 8540def warn_cast_pointer_from_sel : Warning< 8541 "cast of type %0 to %1 is deprecated; use sel_getName instead">, 8542 InGroup<SelTypeCast>; 8543def warn_function_def_in_objc_container : Warning< 8544 "function definition inside an Objective-C container is deprecated">, 8545 InGroup<FunctionDefInObjCContainer>; 8546def err_typecheck_call_requires_real_fp : Error< 8547 "argument type %0 is not a real floating point type">; 8548def err_typecheck_call_different_arg_types : Error< 8549 "arguments are of different types%diff{ ($ vs $)|}0,1">; 8550 8551def warn_cast_calling_conv : Warning< 8552 "cast between incompatible calling conventions '%0' and '%1'; " 8553 "calls through this pointer may abort at runtime">, 8554 InGroup<DiagGroup<"cast-calling-convention">>; 8555def note_change_calling_conv_fixit : Note< 8556 "consider defining %0 with the '%1' calling convention">; 8557def warn_bad_function_cast : Warning< 8558 "cast from function call of type %0 to non-matching type %1">, 8559 InGroup<BadFunctionCast>, DefaultIgnore; 8560def warn_cast_function_type : Warning< 8561 "cast %diff{from $ to $ |}0,1converts to incompatible function type">, 8562 InGroup<CastFunctionType>, DefaultIgnore; 8563def err_cast_pointer_to_non_pointer_int : Error< 8564 "pointer cannot be cast to type %0">; 8565def err_cast_to_bfloat16 : Error<"cannot type-cast to __bf16">; 8566def err_cast_from_bfloat16 : Error<"cannot type-cast from __bf16">; 8567def err_typecheck_expect_scalar_operand : Error< 8568 "operand of type %0 where arithmetic or pointer type is required">; 8569def err_typecheck_cond_incompatible_operands : Error< 8570 "incompatible operand types%diff{ ($ and $)|}0,1">; 8571def err_typecheck_expect_flt_or_vector : Error< 8572 "invalid operand of type %0 where floating, complex or " 8573 "a vector of such types is required">; 8574def err_cast_selector_expr : Error< 8575 "cannot type cast @selector expression">; 8576def ext_typecheck_cond_incompatible_pointers : ExtWarn< 8577 "pointer type mismatch%diff{ ($ and $)|}0,1">, 8578 InGroup<DiagGroup<"pointer-type-mismatch">>; 8579def ext_typecheck_cond_pointer_integer_mismatch : ExtWarn< 8580 "pointer/integer type mismatch in conditional expression" 8581 "%diff{ ($ and $)|}0,1">, 8582 InGroup<DiagGroup<"conditional-type-mismatch">>; 8583def err_typecheck_choose_expr_requires_constant : Error< 8584 "'__builtin_choose_expr' requires a constant expression">; 8585def warn_unused_expr : Warning<"expression result unused">, 8586 InGroup<UnusedValue>; 8587def warn_unused_comma_left_operand : Warning< 8588 "left operand of comma operator has no effect">, 8589 InGroup<UnusedValue>; 8590def warn_unused_voidptr : Warning< 8591 "expression result unused; should this cast be to 'void'?">, 8592 InGroup<UnusedValue>; 8593def warn_unused_property_expr : Warning< 8594 "property access result unused - getters should not be used for side effects">, 8595 InGroup<UnusedGetterReturnValue>; 8596def warn_unused_container_subscript_expr : Warning< 8597 "container access result unused - container access should not be used for side effects">, 8598 InGroup<UnusedValue>; 8599def warn_unused_call : Warning< 8600 "ignoring return value of function declared with %0 attribute">, 8601 InGroup<UnusedValue>; 8602def warn_unused_constructor : Warning< 8603 "ignoring temporary created by a constructor declared with %0 attribute">, 8604 InGroup<UnusedValue>; 8605def warn_unused_constructor_msg : Warning< 8606 "ignoring temporary created by a constructor declared with %0 attribute: %1">, 8607 InGroup<UnusedValue>; 8608def warn_side_effects_unevaluated_context : Warning< 8609 "expression with side effects has no effect in an unevaluated context">, 8610 InGroup<UnevaluatedExpression>; 8611def warn_side_effects_typeid : Warning< 8612 "expression with side effects will be evaluated despite being used as an " 8613 "operand to 'typeid'">, InGroup<PotentiallyEvaluatedExpression>; 8614def warn_unused_result : Warning< 8615 "ignoring return value of function declared with %0 attribute">, 8616 InGroup<UnusedResult>; 8617def warn_unused_result_msg : Warning< 8618 "ignoring return value of function declared with %0 attribute: %1">, 8619 InGroup<UnusedResult>; 8620def warn_unused_volatile : Warning< 8621 "expression result unused; assign into a variable to force a volatile load">, 8622 InGroup<DiagGroup<"unused-volatile-lvalue">>; 8623 8624def ext_cxx14_attr : Extension< 8625 "use of the %0 attribute is a C++14 extension">, InGroup<CXX14>; 8626def ext_cxx17_attr : Extension< 8627 "use of the %0 attribute is a C++17 extension">, InGroup<CXX17>; 8628def ext_cxx20_attr : Extension< 8629 "use of the %0 attribute is a C++20 extension">, InGroup<CXX20>; 8630 8631def warn_unused_comparison : Warning< 8632 "%select{equality|inequality|relational|three-way}0 comparison result unused">, 8633 InGroup<UnusedComparison>; 8634def note_inequality_comparison_to_or_assign : Note< 8635 "use '|=' to turn this inequality comparison into an or-assignment">; 8636 8637def err_incomplete_type_used_in_type_trait_expr : Error< 8638 "incomplete type %0 used in type trait expression">; 8639 8640// C++20 constinit and require_constant_initialization attribute 8641def warn_cxx20_compat_constinit : Warning< 8642 "'constinit' specifier is incompatible with C++ standards before C++20">, 8643 InGroup<CXX20Compat>, DefaultIgnore; 8644def err_constinit_local_variable : Error< 8645 "local variable cannot be declared 'constinit'">; 8646def err_require_constant_init_failed : Error< 8647 "variable does not have a constant initializer">; 8648def note_declared_required_constant_init_here : Note< 8649 "required by %select{'require_constant_initialization' attribute|" 8650 "'constinit' specifier}0 here">; 8651def ext_constinit_missing : ExtWarn< 8652 "'constinit' specifier missing on initializing declaration of %0">, 8653 InGroup<DiagGroup<"missing-constinit">>; 8654def note_constinit_specified_here : Note<"variable declared constinit here">; 8655def err_constinit_added_too_late : Error< 8656 "'constinit' specifier added after initialization of variable">; 8657def warn_require_const_init_added_too_late : Warning< 8658 "'require_constant_initialization' attribute added after initialization " 8659 "of variable">, InGroup<IgnoredAttributes>; 8660def note_constinit_missing_here : Note< 8661 "add the " 8662 "%select{'require_constant_initialization' attribute|'constinit' specifier}0 " 8663 "to the initializing declaration here">; 8664 8665def err_dimension_expr_not_constant_integer : Error< 8666 "dimension expression does not evaluate to a constant unsigned int">; 8667 8668def err_typecheck_cond_incompatible_operands_null : Error< 8669 "non-pointer operand type %0 incompatible with %select{NULL|nullptr}1">; 8670def ext_empty_struct_union : Extension< 8671 "empty %select{struct|union}0 is a GNU extension">, InGroup<GNUEmptyStruct>; 8672def ext_no_named_members_in_struct_union : Extension< 8673 "%select{struct|union}0 without named members is a GNU extension">, InGroup<GNUEmptyStruct>; 8674def warn_zero_size_struct_union_compat : Warning<"%select{|empty }0" 8675 "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">, 8676 InGroup<CXXCompat>, DefaultIgnore; 8677def warn_zero_size_struct_union_in_extern_c : Warning<"%select{|empty }0" 8678 "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">, 8679 InGroup<ExternCCompat>; 8680def warn_cast_qual : Warning<"cast from %0 to %1 drops %select{const and " 8681 "volatile qualifiers|const qualifier|volatile qualifier}2">, 8682 InGroup<CastQual>, DefaultIgnore; 8683def warn_cast_qual2 : Warning<"cast from %0 to %1 must have all intermediate " 8684 "pointers const qualified to be safe">, InGroup<CastQual>, DefaultIgnore; 8685def warn_redefine_extname_not_applied : Warning< 8686 "#pragma redefine_extname is applicable to external C declarations only; " 8687 "not applied to %select{function|variable}0 %1">, 8688 InGroup<Pragmas>; 8689} // End of general sema category. 8690 8691// inline asm. 8692let CategoryName = "Inline Assembly Issue" in { 8693 def err_asm_invalid_lvalue_in_output : Error<"invalid lvalue in asm output">; 8694 def err_asm_invalid_output_constraint : Error< 8695 "invalid output constraint '%0' in asm">; 8696 def err_asm_invalid_lvalue_in_input : Error< 8697 "invalid lvalue in asm input for constraint '%0'">; 8698 def err_asm_invalid_input_constraint : Error< 8699 "invalid input constraint '%0' in asm">; 8700 def err_asm_tying_incompatible_types : Error< 8701 "unsupported inline asm: input with type " 8702 "%diff{$ matching output with type $|}0,1">; 8703 def err_asm_unexpected_constraint_alternatives : Error< 8704 "asm constraint has an unexpected number of alternatives: %0 vs %1">; 8705 def err_asm_incomplete_type : Error<"asm operand has incomplete type %0">; 8706 def err_asm_unknown_register_name : Error<"unknown register name '%0' in asm">; 8707 def err_asm_unwind_and_goto : Error<"unwind clobber can't be used with asm goto">; 8708 def err_asm_invalid_global_var_reg : Error<"register '%0' unsuitable for " 8709 "global register variables on this target">; 8710 def err_asm_register_size_mismatch : Error<"size of register '%0' does not " 8711 "match variable size">; 8712 def err_asm_bad_register_type : Error<"bad type for named register variable">; 8713 def err_asm_invalid_input_size : Error< 8714 "invalid input size for constraint '%0'">; 8715 def err_asm_invalid_output_size : Error< 8716 "invalid output size for constraint '%0'">; 8717 def err_invalid_asm_cast_lvalue : Error< 8718 "invalid use of a cast in a inline asm context requiring an lvalue: " 8719 "remove the cast or build with -fheinous-gnu-extensions">; 8720 def err_invalid_asm_value_for_constraint 8721 : Error <"value '%0' out of range for constraint '%1'">; 8722 def err_asm_non_addr_value_in_memory_constraint : Error < 8723 "reference to a %select{bit-field|vector element|global register variable}0" 8724 " in asm %select{input|output}1 with a memory constraint '%2'">; 8725 def err_asm_input_duplicate_match : Error< 8726 "more than one input constraint matches the same output '%0'">; 8727 8728 def warn_asm_label_on_auto_decl : Warning< 8729 "ignored asm label '%0' on automatic variable">; 8730 def warn_invalid_asm_cast_lvalue : Warning< 8731 "invalid use of a cast in an inline asm context requiring an lvalue: " 8732 "accepted due to -fheinous-gnu-extensions, but clang may remove support " 8733 "for this in the future">; 8734 def warn_asm_mismatched_size_modifier : Warning< 8735 "value size does not match register size specified by the constraint " 8736 "and modifier">, 8737 InGroup<ASMOperandWidths>; 8738 8739 def note_asm_missing_constraint_modifier : Note< 8740 "use constraint modifier \"%0\"">; 8741 def note_asm_input_duplicate_first : Note< 8742 "constraint '%0' is already present here">; 8743 def error_duplicate_asm_operand_name : Error< 8744 "duplicate use of asm operand name \"%0\"">; 8745 def note_duplicate_asm_operand_name : Note< 8746 "asm operand name \"%0\" first referenced here">; 8747} 8748 8749 def error_inoutput_conflict_with_clobber : Error< 8750 "asm-specifier for input or output variable conflicts with asm" 8751 " clobber list">; 8752 8753let CategoryName = "Semantic Issue" in { 8754 8755def err_invalid_conversion_between_matrixes : Error< 8756 "conversion between matrix types%diff{ $ and $|}0,1 of different size is not allowed">; 8757 8758def err_invalid_conversion_between_matrix_and_type : Error< 8759 "conversion between matrix type %0 and incompatible type %1 is not allowed">; 8760 8761def err_invalid_conversion_between_vectors : Error< 8762 "invalid conversion between vector type%diff{ $ and $|}0,1 of different " 8763 "size">; 8764def err_invalid_conversion_between_vector_and_integer : Error< 8765 "invalid conversion between vector type %0 and integer type %1 " 8766 "of different size">; 8767 8768def err_opencl_function_pointer : Error< 8769 "%select{pointers|references}0 to functions are not allowed">; 8770 8771def err_opencl_taking_address_capture : Error< 8772 "taking address of a capture is not allowed">; 8773 8774def err_invalid_conversion_between_vector_and_scalar : Error< 8775 "invalid conversion between vector type %0 and scalar type %1">; 8776 8777// C++ member initializers. 8778def err_only_constructors_take_base_inits : Error< 8779 "only constructors take base initializers">; 8780 8781def err_multiple_mem_initialization : Error < 8782 "multiple initializations given for non-static member %0">; 8783def err_multiple_mem_union_initialization : Error < 8784 "initializing multiple members of union">; 8785def err_multiple_base_initialization : Error < 8786 "multiple initializations given for base %0">; 8787 8788def err_mem_init_not_member_or_class : Error< 8789 "member initializer %0 does not name a non-static data member or base " 8790 "class">; 8791 8792def warn_initializer_out_of_order : Warning< 8793 "%select{field|base class}0 %1 will be initialized after " 8794 "%select{field|base}2 %3">, 8795 InGroup<ReorderCtor>, DefaultIgnore; 8796 8797def warn_some_initializers_out_of_order : Warning< 8798 "initializer order does not match the declaration order">, 8799 InGroup<ReorderCtor>, DefaultIgnore; 8800 8801def note_initializer_out_of_order : Note< 8802 "%select{field|base class}0 %1 will be initialized after " 8803 "%select{field|base}2 %3">; 8804 8805def warn_abstract_vbase_init_ignored : Warning< 8806 "initializer for virtual base class %0 of abstract class %1 " 8807 "will never be used">, 8808 InGroup<DiagGroup<"abstract-vbase-init">>, DefaultIgnore; 8809 8810def err_base_init_does_not_name_class : Error< 8811 "constructor initializer %0 does not name a class">; 8812def err_base_init_direct_and_virtual : Error< 8813 "base class initializer %0 names both a direct base class and an " 8814 "inherited virtual base class">; 8815def err_not_direct_base_or_virtual : Error< 8816 "type %0 is not a direct or virtual base of %1">; 8817 8818def err_in_class_initializer_non_const : Error< 8819 "non-const static data member must be initialized out of line">; 8820def err_in_class_initializer_volatile : Error< 8821 "static const volatile data member must be initialized out of line">; 8822def err_in_class_initializer_bad_type : Error< 8823 "static data member of type %0 must be initialized out of line">; 8824def ext_in_class_initializer_float_type : ExtWarn< 8825 "in-class initializer for static data member of type %0 is a GNU extension">, 8826 InGroup<GNUStaticFloatInit>; 8827def ext_in_class_initializer_float_type_cxx11 : ExtWarn< 8828 "in-class initializer for static data member of type %0 requires " 8829 "'constexpr' specifier">, InGroup<StaticFloatInit>, DefaultError; 8830def note_in_class_initializer_float_type_cxx11 : Note<"add 'constexpr'">; 8831def err_in_class_initializer_literal_type : Error< 8832 "in-class initializer for static data member of type %0 requires " 8833 "'constexpr' specifier">; 8834def err_in_class_initializer_non_constant : Error< 8835 "in-class initializer for static data member is not a constant expression">; 8836def err_default_member_initializer_not_yet_parsed : Error< 8837 "default member initializer for %1 needed within definition of enclosing " 8838 "class %0 outside of member functions">; 8839def note_default_member_initializer_not_yet_parsed : Note< 8840 "default member initializer declared here">; 8841def err_default_member_initializer_cycle 8842 : Error<"default member initializer for %0 uses itself">; 8843 8844def ext_in_class_initializer_non_constant : Extension< 8845 "in-class initializer for static data member is not a constant expression; " 8846 "folding it to a constant is a GNU extension">, InGroup<GNUFoldingConstant>; 8847 8848def err_thread_dynamic_init : Error< 8849 "initializer for thread-local variable must be a constant expression">; 8850def err_thread_nontrivial_dtor : Error< 8851 "type of thread-local variable has non-trivial destruction">; 8852def note_use_thread_local : Note< 8853 "use 'thread_local' to allow this">; 8854 8855// C++ anonymous unions and GNU anonymous structs/unions 8856def ext_anonymous_union : Extension< 8857 "anonymous unions are a C11 extension">, InGroup<C11>; 8858def ext_gnu_anonymous_struct : Extension< 8859 "anonymous structs are a GNU extension">, InGroup<GNUAnonymousStruct>; 8860def ext_c11_anonymous_struct : Extension< 8861 "anonymous structs are a C11 extension">, InGroup<C11>; 8862def err_anonymous_union_not_static : Error< 8863 "anonymous unions at namespace or global scope must be declared 'static'">; 8864def err_anonymous_union_with_storage_spec : Error< 8865 "anonymous union at class scope must not have a storage specifier">; 8866def err_anonymous_struct_not_member : Error< 8867 "anonymous %select{structs|structs and classes}0 must be " 8868 "%select{struct or union|class}0 members">; 8869def err_anonymous_record_member_redecl : Error< 8870 "member of anonymous %select{struct|union}0 redeclares %1">; 8871def err_anonymous_record_with_type : Error< 8872 "types cannot be declared in an anonymous %select{struct|union}0">; 8873def ext_anonymous_record_with_type : Extension< 8874 "types declared in an anonymous %select{struct|union}0 are a Microsoft " 8875 "extension">, InGroup<MicrosoftAnonTag>; 8876def ext_anonymous_record_with_anonymous_type : Extension< 8877 "anonymous types declared in an anonymous %select{struct|union}0 " 8878 "are an extension">, InGroup<DiagGroup<"nested-anon-types">>; 8879def err_anonymous_record_with_function : Error< 8880 "functions cannot be declared in an anonymous %select{struct|union}0">; 8881def err_anonymous_record_with_static : Error< 8882 "static members cannot be declared in an anonymous %select{struct|union}0">; 8883def err_anonymous_record_bad_member : Error< 8884 "anonymous %select{struct|union}0 can only contain non-static data members">; 8885def err_anonymous_record_nonpublic_member : Error< 8886 "anonymous %select{struct|union}0 cannot contain a " 8887 "%select{private|protected}1 data member">; 8888def ext_ms_anonymous_record : ExtWarn< 8889 "anonymous %select{structs|unions}0 are a Microsoft extension">, 8890 InGroup<MicrosoftAnonTag>; 8891 8892// C++ local classes 8893def err_reference_to_local_in_enclosing_context : Error< 8894 "reference to local %select{variable|binding}1 %0 declared in enclosing " 8895 "%select{%3|block literal|lambda expression|context}2">; 8896 8897def err_static_data_member_not_allowed_in_local_class : Error< 8898 "static data member %0 not allowed in local %sub{select_tag_type_kind}2 %1">; 8899 8900// C++ derived classes 8901def err_base_clause_on_union : Error<"unions cannot have base classes">; 8902def err_base_must_be_class : Error<"base specifier must name a class">; 8903def err_union_as_base_class : Error<"unions cannot be base classes">; 8904def err_circular_inheritance : Error< 8905 "circular inheritance between %0 and %1">; 8906def err_base_class_has_flexible_array_member : Error< 8907 "base class %0 has a flexible array member">; 8908def err_incomplete_base_class : Error<"base class has incomplete type">; 8909def err_duplicate_base_class : Error< 8910 "base class %0 specified more than once as a direct base class">; 8911def warn_inaccessible_base_class : Warning< 8912 "direct base %0 is inaccessible due to ambiguity:%1">, 8913 InGroup<DiagGroup<"inaccessible-base">>; 8914// FIXME: better way to display derivation? Pass entire thing into diagclient? 8915def err_ambiguous_derived_to_base_conv : Error< 8916 "ambiguous conversion from derived class %0 to base class %1:%2">; 8917def err_ambiguous_memptr_conv : Error< 8918 "ambiguous conversion from pointer to member of %select{base|derived}0 " 8919 "class %1 to pointer to member of %select{derived|base}0 class %2:%3">; 8920def ext_ms_ambiguous_direct_base : ExtWarn< 8921 "accessing inaccessible direct base %0 of %1 is a Microsoft extension">, 8922 InGroup<MicrosoftInaccessibleBase>; 8923 8924def err_memptr_conv_via_virtual : Error< 8925 "conversion from pointer to member of class %0 to pointer to member " 8926 "of class %1 via virtual base %2 is not allowed">; 8927 8928// C++ member name lookup 8929def err_ambiguous_member_multiple_subobjects : Error< 8930 "non-static member %0 found in multiple base-class subobjects of type %1:%2">; 8931def err_ambiguous_member_multiple_subobject_types : Error< 8932 "member %0 found in multiple base classes of different types">; 8933def note_ambiguous_member_found : Note<"member found by ambiguous name lookup">; 8934def note_ambiguous_member_type_found : Note< 8935 "member type %0 found by ambiguous name lookup">; 8936def err_ambiguous_reference : Error<"reference to %0 is ambiguous">; 8937def note_ambiguous_candidate : Note<"candidate found by name lookup is %q0">; 8938def err_ambiguous_tag_hiding : Error<"a type named %0 is hidden by a " 8939 "declaration in a different namespace">; 8940def note_hidden_tag : Note<"type declaration hidden">; 8941def note_hiding_object : Note<"declaration hides type">; 8942 8943// C++ operator overloading 8944def err_operator_overload_needs_class_or_enum : Error< 8945 "overloaded %0 must have at least one parameter of class " 8946 "or enumeration type">; 8947 8948def err_operator_overload_variadic : Error<"overloaded %0 cannot be variadic">; 8949def err_operator_overload_static : Error< 8950 "overloaded %0 cannot be a static member function">; 8951def err_operator_overload_default_arg : Error< 8952 "parameter of overloaded %0 cannot have a default argument">; 8953def err_operator_overload_must_be : Error< 8954 "overloaded %0 must be a %select{unary|binary|unary or binary}2 operator " 8955 "(has %1 parameter%s1)">; 8956 8957def err_operator_overload_must_be_member : Error< 8958 "overloaded %0 must be a non-static member function">; 8959def err_operator_overload_post_incdec_must_be_int : Error< 8960 "parameter of overloaded post-%select{increment|decrement}1 operator must " 8961 "have type 'int' (not %0)">; 8962 8963// C++ allocation and deallocation functions. 8964def err_operator_new_delete_declared_in_namespace : Error< 8965 "%0 cannot be declared inside a namespace">; 8966def err_operator_new_delete_declared_static : Error< 8967 "%0 cannot be declared static in global scope">; 8968def ext_operator_new_delete_declared_inline : ExtWarn< 8969 "replacement function %0 cannot be declared 'inline'">, 8970 InGroup<DiagGroup<"inline-new-delete">>; 8971def err_operator_new_delete_invalid_result_type : Error< 8972 "%0 must return type %1">; 8973def err_operator_new_delete_dependent_result_type : Error< 8974 "%0 cannot have a dependent return type; use %1 instead">; 8975def err_operator_new_delete_too_few_parameters : Error< 8976 "%0 must have at least one parameter">; 8977def err_operator_new_delete_template_too_few_parameters : Error< 8978 "%0 template must have at least two parameters">; 8979def warn_operator_new_returns_null : Warning< 8980 "%0 should not return a null pointer unless it is declared 'throw()'" 8981 "%select{| or 'noexcept'}1">, InGroup<OperatorNewReturnsNull>; 8982 8983def err_operator_new_dependent_param_type : Error< 8984 "%0 cannot take a dependent type as first parameter; " 8985 "use size_t (%1) instead">; 8986def err_operator_new_param_type : Error< 8987 "%0 takes type size_t (%1) as first parameter">; 8988def err_operator_new_default_arg: Error< 8989 "parameter of %0 cannot have a default argument">; 8990def err_operator_delete_dependent_param_type : Error< 8991 "%0 cannot take a dependent type as first parameter; use %1 instead">; 8992def err_operator_delete_param_type : Error< 8993 "first parameter of %0 must have type %1">; 8994def err_destroying_operator_delete_not_usual : Error< 8995 "destroying operator delete can have only an optional size and optional " 8996 "alignment parameter">; 8997def note_implicit_delete_this_in_destructor_here : Note< 8998 "while checking implicit 'delete this' for virtual destructor">; 8999def err_builtin_operator_new_delete_not_usual : Error< 9000 "call to '%select{__builtin_operator_new|__builtin_operator_delete}0' " 9001 "selects non-usual %select{allocation|deallocation}0 function">; 9002def note_non_usual_function_declared_here : Note< 9003 "non-usual %0 declared here">; 9004 9005// C++ literal operators 9006def err_literal_operator_outside_namespace : Error< 9007 "literal operator %0 must be in a namespace or global scope">; 9008def err_literal_operator_id_outside_namespace : Error< 9009 "non-namespace scope '%0' cannot have a literal operator member">; 9010def err_literal_operator_default_argument : Error< 9011 "literal operator cannot have a default argument">; 9012def err_literal_operator_bad_param_count : Error< 9013 "non-template literal operator must have one or two parameters">; 9014def err_literal_operator_invalid_param : Error< 9015 "parameter of literal operator must have type 'unsigned long long', 'long double', 'char', 'wchar_t', 'char16_t', 'char32_t', or 'const char *'">; 9016def err_literal_operator_param : Error< 9017 "invalid literal operator parameter type %0, did you mean %1?">; 9018def err_literal_operator_template_with_params : Error< 9019 "literal operator template cannot have any parameters">; 9020def err_literal_operator_template : Error< 9021 "template parameter list for literal operator must be either 'char...' or 'typename T, T...'">; 9022def err_literal_operator_extern_c : Error< 9023 "literal operator must have C++ linkage">; 9024def ext_string_literal_operator_template : ExtWarn< 9025 "string literal operator templates are a GNU extension">, 9026 InGroup<GNUStringLiteralOperatorTemplate>; 9027def warn_user_literal_reserved : Warning< 9028 "user-defined literal suffixes not starting with '_' are reserved" 9029 "%select{; no literal will invoke this operator|}0">, 9030 InGroup<UserDefinedLiterals>; 9031 9032// C++ conversion functions 9033def err_conv_function_not_member : Error< 9034 "conversion function must be a non-static member function">; 9035def err_conv_function_return_type : Error< 9036 "conversion function cannot have a return type">; 9037def err_conv_function_with_params : Error< 9038 "conversion function cannot have any parameters">; 9039def err_conv_function_variadic : Error< 9040 "conversion function cannot be variadic">; 9041def err_conv_function_to_array : Error< 9042 "conversion function cannot convert to an array type">; 9043def err_conv_function_to_function : Error< 9044 "conversion function cannot convert to a function type">; 9045def err_conv_function_with_complex_decl : Error< 9046 "cannot specify any part of a return type in the " 9047 "declaration of a conversion function" 9048 "%select{" 9049 "; put the complete type after 'operator'|" 9050 "; use a typedef to declare a conversion to %1|" 9051 "; use an alias template to declare a conversion to %1|" 9052 "}0">; 9053def err_conv_function_redeclared : Error< 9054 "conversion function cannot be redeclared">; 9055def warn_conv_to_self_not_used : Warning< 9056 "conversion function converting %0 to itself will never be used">, 9057 InGroup<ClassConversion>; 9058def warn_conv_to_base_not_used : Warning< 9059 "conversion function converting %0 to its base class %1 will never be used">, 9060 InGroup<ClassConversion>; 9061def warn_conv_to_void_not_used : Warning< 9062 "conversion function converting %0 to %1 will never be used">, 9063 InGroup<ClassConversion>; 9064 9065def warn_not_compound_assign : Warning< 9066 "use of unary operator that may be intended as compound assignment (%0=)">; 9067 9068// C++11 explicit conversion operators 9069def ext_explicit_conversion_functions : ExtWarn< 9070 "explicit conversion functions are a C++11 extension">, InGroup<CXX11>; 9071def warn_cxx98_compat_explicit_conversion_functions : Warning< 9072 "explicit conversion functions are incompatible with C++98">, 9073 InGroup<CXX98Compat>, DefaultIgnore; 9074 9075// C++11 defaulted functions 9076def err_defaulted_special_member_params : Error< 9077 "an explicitly-defaulted %select{|copy |move }0constructor cannot " 9078 "have default arguments">; 9079def err_defaulted_special_member_variadic : Error< 9080 "an explicitly-defaulted %select{|copy |move }0constructor cannot " 9081 "be variadic">; 9082def err_defaulted_special_member_return_type : Error< 9083 "explicitly-defaulted %select{copy|move}0 assignment operator must " 9084 "return %1">; 9085def err_defaulted_special_member_quals : Error< 9086 "an explicitly-defaulted %select{copy|move}0 assignment operator may not " 9087 "have 'const'%select{, 'constexpr'|}1 or 'volatile' qualifiers">; 9088def err_defaulted_special_member_volatile_param : Error< 9089 "the parameter for an explicitly-defaulted %sub{select_special_member_kind}0 " 9090 "may not be volatile">; 9091def err_defaulted_special_member_move_const_param : Error< 9092 "the parameter for an explicitly-defaulted move " 9093 "%select{constructor|assignment operator}0 may not be const">; 9094def err_defaulted_special_member_copy_const_param : Error< 9095 "the parameter for this explicitly-defaulted copy " 9096 "%select{constructor|assignment operator}0 is const, but a member or base " 9097 "requires it to be non-const">; 9098def err_defaulted_copy_assign_not_ref : Error< 9099 "the parameter for an explicitly-defaulted copy assignment operator must be an " 9100 "lvalue reference type">; 9101def err_incorrect_defaulted_constexpr : Error< 9102 "defaulted definition of %sub{select_special_member_kind}0 " 9103 "is not constexpr">; 9104def err_incorrect_defaulted_consteval : Error< 9105 "defaulted declaration of %sub{select_special_member_kind}0 " 9106 "cannot be consteval because implicit definition is not constexpr">; 9107def warn_defaulted_method_deleted : Warning< 9108 "explicitly defaulted %sub{select_special_member_kind}0 is implicitly " 9109 "deleted">, InGroup<DefaultedFunctionDeleted>; 9110def err_out_of_line_default_deletes : Error< 9111 "defaulting this %sub{select_special_member_kind}0 " 9112 "would delete it after its first declaration">; 9113def note_deleted_type_mismatch : Note< 9114 "function is implicitly deleted because its declared type does not match " 9115 "the type of an implicit %sub{select_special_member_kind}0">; 9116def warn_cxx17_compat_defaulted_method_type_mismatch : Warning< 9117 "explicitly defaulting this %sub{select_special_member_kind}0 with a type " 9118 "different from the implicit type is incompatible with C++ standards before " 9119 "C++20">, InGroup<CXXPre20Compat>, DefaultIgnore; 9120def warn_vbase_moved_multiple_times : Warning< 9121 "defaulted move assignment operator of %0 will move assign virtual base " 9122 "class %1 multiple times">, InGroup<DiagGroup<"multiple-move-vbase">>; 9123def note_vbase_moved_here : Note< 9124 "%select{%1 is a virtual base class of base class %2 declared here|" 9125 "virtual base class %1 declared here}0">; 9126 9127// C++20 defaulted comparisons 9128// This corresponds to values of Sema::DefaultedComparisonKind. 9129def select_defaulted_comparison_kind : TextSubstitution< 9130 "%select{<ERROR>|equality|three-way|equality|relational}0 comparison " 9131 "operator">; 9132def ext_defaulted_comparison : ExtWarn< 9133 "defaulted comparison operators are a C++20 extension">, InGroup<CXX20>; 9134def warn_cxx17_compat_defaulted_comparison : Warning< 9135 "defaulted comparison operators are incompatible with C++ standards " 9136 "before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore; 9137def err_defaulted_comparison_template : Error< 9138 "comparison operator template cannot be defaulted">; 9139def err_defaulted_comparison_out_of_class : Error< 9140 "%sub{select_defaulted_comparison_kind}0 can only be defaulted in a class " 9141 "definition">; 9142def err_defaulted_comparison_param : Error< 9143 "invalid parameter type for defaulted %sub{select_defaulted_comparison_kind}0" 9144 "; found %1, expected %2%select{| or %4}3">; 9145def err_defaulted_comparison_param_mismatch : Error< 9146 "parameters for defaulted %sub{select_defaulted_comparison_kind}0 " 9147 "must have the same type%diff{ (found $ vs $)|}1,2">; 9148def err_defaulted_comparison_non_const : Error< 9149 "defaulted member %sub{select_defaulted_comparison_kind}0 must be " 9150 "const-qualified">; 9151def err_defaulted_comparison_return_type_not_bool : Error< 9152 "return type for defaulted %sub{select_defaulted_comparison_kind}0 " 9153 "must be 'bool', not %1">; 9154def err_defaulted_comparison_deduced_return_type_not_auto : Error< 9155 "deduced return type for defaulted %sub{select_defaulted_comparison_kind}0 " 9156 "must be 'auto', not %1">; 9157def warn_defaulted_comparison_deleted : Warning< 9158 "explicitly defaulted %sub{select_defaulted_comparison_kind}0 is implicitly " 9159 "deleted">, InGroup<DefaultedFunctionDeleted>; 9160def err_non_first_default_compare_deletes : Error< 9161 "defaulting %select{this %sub{select_defaulted_comparison_kind}1|" 9162 "the corresponding implicit 'operator==' for this defaulted 'operator<=>'}0 " 9163 "would delete it after its first declaration">; 9164def note_defaulted_comparison_union : Note< 9165 "defaulted %0 is implicitly deleted because " 9166 "%2 is a %select{union-like class|union}1 with variant members">; 9167def note_defaulted_comparison_reference_member : Note< 9168 "defaulted %0 is implicitly deleted because " 9169 "class %1 has a reference member">; 9170def note_defaulted_comparison_ambiguous : Note< 9171 "defaulted %0 is implicitly deleted because implied %select{|'==' |'<' }1" 9172 "comparison %select{|for member %3 |for base class %3 }2is ambiguous">; 9173def note_defaulted_comparison_inaccessible : Note< 9174 "defaulted %0 is implicitly deleted because it would invoke a " 9175 "%select{private|protected}3 %4%select{ member of %6|" 9176 " member of %6 to compare member %2| to compare base class %2}1">; 9177def note_defaulted_comparison_calls_deleted : Note< 9178 "defaulted %0 is implicitly deleted because it would invoke a deleted " 9179 "comparison function%select{| for member %2| for base class %2}1">; 9180def note_defaulted_comparison_no_viable_function : Note< 9181 "defaulted %0 is implicitly deleted because there is no viable " 9182 "%select{three-way comparison function|'operator=='}1 for " 9183 "%select{|member |base class }2%3">; 9184def note_defaulted_comparison_no_viable_function_synthesized : Note< 9185 "three-way comparison cannot be synthesized because there is no viable " 9186 "function for %select{'=='|'<'}0 comparison">; 9187def note_defaulted_comparison_not_rewritten_callee : Note< 9188 "defaulted %0 is implicitly deleted because this non-rewritten comparison " 9189 "function would be the best match for the comparison">; 9190def note_defaulted_comparison_not_rewritten_conversion : Note< 9191 "defaulted %0 is implicitly deleted because a builtin comparison function " 9192 "using this conversion would be the best match for the comparison">; 9193def note_defaulted_comparison_cannot_deduce : Note< 9194 "return type of defaulted 'operator<=>' cannot be deduced because " 9195 "return type %2 of three-way comparison for %select{|member|base class}0 %1 " 9196 "is not a standard comparison category type">; 9197def err_defaulted_comparison_cannot_deduce_undeduced_auto : Error< 9198 "return type of defaulted 'operator<=>' cannot be deduced because " 9199 "three-way comparison for %select{|member|base class}0 %1 " 9200 "has a deduced return type and is not yet defined">; 9201def note_defaulted_comparison_cannot_deduce_undeduced_auto : Note< 9202 "%select{|member|base class}0 %1 declared here">; 9203def note_defaulted_comparison_cannot_deduce_callee : Note< 9204 "selected 'operator<=>' for %select{|member|base class}0 %1 declared here">; 9205def err_incorrect_defaulted_comparison_constexpr : Error< 9206 "defaulted definition of %select{%sub{select_defaulted_comparison_kind}1|" 9207 "three-way comparison operator}0 " 9208 "cannot be declared %select{constexpr|consteval}2 because " 9209 "%select{it|the corresponding implicit 'operator=='}0 " 9210 "invokes a non-constexpr comparison function">; 9211def note_defaulted_comparison_not_constexpr : Note< 9212 "non-constexpr comparison function would be used to compare " 9213 "%select{|member %1|base class %1}0">; 9214def note_defaulted_comparison_not_constexpr_here : Note< 9215 "non-constexpr comparison function declared here">; 9216def note_in_declaration_of_implicit_equality_comparison : Note< 9217 "while declaring the corresponding implicit 'operator==' " 9218 "for this defaulted 'operator<=>'">; 9219 9220def ext_implicit_exception_spec_mismatch : ExtWarn< 9221 "function previously declared with an %select{explicit|implicit}0 exception " 9222 "specification redeclared with an %select{implicit|explicit}0 exception " 9223 "specification">, InGroup<DiagGroup<"implicit-exception-spec-mismatch">>; 9224 9225def warn_ptr_arith_precedes_bounds : Warning< 9226 "the pointer decremented by %0 refers before the beginning of the array">, 9227 InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore; 9228def warn_ptr_arith_exceeds_bounds : Warning< 9229 "the pointer incremented by %0 refers past the end of the array (that " 9230 "contains %1 element%s2)">, 9231 InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore; 9232def warn_array_index_precedes_bounds : Warning< 9233 "array index %0 is before the beginning of the array">, 9234 InGroup<ArrayBounds>; 9235def warn_array_index_exceeds_bounds : Warning< 9236 "array index %0 is past the end of the array (which contains %1 " 9237 "element%s2)">, InGroup<ArrayBounds>; 9238def warn_ptr_arith_exceeds_max_addressable_bounds : Warning< 9239 "the pointer incremented by %0 refers past the last possible element for an array in %1-bit " 9240 "address space containing %2-bit (%3-byte) elements (max possible %4 element%s5)">, 9241 InGroup<ArrayBounds>; 9242def warn_array_index_exceeds_max_addressable_bounds : Warning< 9243 "array index %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 note_array_declared_here : Note< 9247 "array %0 declared here">; 9248 9249def warn_printf_insufficient_data_args : Warning< 9250 "more '%%' conversions than data arguments">, InGroup<FormatInsufficientArgs>; 9251def warn_printf_data_arg_not_used : Warning< 9252 "data argument not used by format string">, InGroup<FormatExtraArgs>; 9253def warn_format_invalid_conversion : Warning< 9254 "invalid conversion specifier '%0'">, InGroup<FormatInvalidSpecifier>; 9255def warn_printf_incomplete_specifier : Warning< 9256 "incomplete format specifier">, InGroup<Format>; 9257def warn_missing_format_string : Warning< 9258 "format string missing">, InGroup<Format>; 9259def warn_scanf_nonzero_width : Warning< 9260 "zero field width in scanf format string is unused">, 9261 InGroup<Format>; 9262def warn_format_conversion_argument_type_mismatch : Warning< 9263 "format specifies type %0 but the argument has " 9264 "%select{type|underlying type}2 %1">, 9265 InGroup<Format>; 9266def warn_format_conversion_argument_type_mismatch_pedantic : Extension< 9267 warn_format_conversion_argument_type_mismatch.Text>, 9268 InGroup<FormatPedantic>; 9269def warn_format_conversion_argument_type_mismatch_confusion : Warning< 9270 warn_format_conversion_argument_type_mismatch.Text>, 9271 InGroup<FormatTypeConfusion>, DefaultIgnore; 9272def warn_format_argument_needs_cast : Warning< 9273 "%select{values of type|enum values with underlying type}2 '%0' should not " 9274 "be used as format arguments; add an explicit cast to %1 instead">, 9275 InGroup<Format>; 9276def warn_format_argument_needs_cast_pedantic : Warning< 9277 warn_format_argument_needs_cast.Text>, 9278 InGroup<FormatPedantic>, DefaultIgnore; 9279def warn_printf_positional_arg_exceeds_data_args : Warning < 9280 "data argument position '%0' exceeds the number of data arguments (%1)">, 9281 InGroup<Format>; 9282def warn_format_zero_positional_specifier : Warning< 9283 "position arguments in format strings start counting at 1 (not 0)">, 9284 InGroup<Format>; 9285def warn_format_invalid_positional_specifier : Warning< 9286 "invalid position specified for %select{field width|field precision}0">, 9287 InGroup<Format>; 9288def warn_format_mix_positional_nonpositional_args : Warning< 9289 "cannot mix positional and non-positional arguments in format string">, 9290 InGroup<Format>; 9291def warn_static_array_too_small : Warning< 9292 "array argument is too small; %select{contains %0 elements|is of size %0}2," 9293 " callee requires at least %1">, 9294 InGroup<ArrayBounds>; 9295def note_callee_static_array : Note< 9296 "callee declares array parameter as static here">; 9297def warn_empty_format_string : Warning< 9298 "format string is empty">, InGroup<FormatZeroLength>; 9299def warn_format_string_is_wide_literal : Warning< 9300 "format string should not be a wide string">, InGroup<Format>; 9301def warn_printf_format_string_contains_null_char : Warning< 9302 "format string contains '\\0' within the string body">, InGroup<Format>; 9303def warn_printf_format_string_not_null_terminated : Warning< 9304 "format string is not null-terminated">, InGroup<Format>; 9305def warn_printf_asterisk_missing_arg : Warning< 9306 "'%select{*|.*}0' specified field %select{width|precision}0 is missing a matching 'int' argument">, 9307 InGroup<Format>; 9308def warn_printf_asterisk_wrong_type : Warning< 9309 "field %select{width|precision}0 should have type %1, but argument has type %2">, 9310 InGroup<Format>; 9311def warn_printf_nonsensical_optional_amount: Warning< 9312 "%select{field width|precision}0 used with '%1' conversion specifier, resulting in undefined behavior">, 9313 InGroup<Format>; 9314def warn_printf_nonsensical_flag: Warning< 9315 "flag '%0' results in undefined behavior with '%1' conversion specifier">, 9316 InGroup<Format>; 9317def warn_format_nonsensical_length: Warning< 9318 "length modifier '%0' results in undefined behavior or no effect with '%1' conversion specifier">, 9319 InGroup<Format>; 9320def warn_format_non_standard_positional_arg: Warning< 9321 "positional arguments are not supported by ISO C">, InGroup<FormatNonStandard>, DefaultIgnore; 9322def warn_format_non_standard: Warning< 9323 "'%0' %select{length modifier|conversion specifier}1 is not supported by ISO C">, 9324 InGroup<FormatNonStandard>, DefaultIgnore; 9325def warn_format_non_standard_conversion_spec: Warning< 9326 "using length modifier '%0' with conversion specifier '%1' is not supported by ISO C">, 9327 InGroup<FormatNonStandard>, DefaultIgnore; 9328def err_invalid_mask_type_size : Error< 9329 "mask type size must be between 1-byte and 8-bytes">; 9330def warn_format_invalid_annotation : Warning< 9331 "using '%0' format specifier annotation outside of os_log()/os_trace()">, 9332 InGroup<Format>; 9333def warn_format_P_no_precision : Warning< 9334 "using '%%P' format specifier without precision">, 9335 InGroup<Format>; 9336def warn_printf_ignored_flag: Warning< 9337 "flag '%0' is ignored when flag '%1' is present">, 9338 InGroup<Format>; 9339def warn_printf_empty_objc_flag: Warning< 9340 "missing object format flag">, 9341 InGroup<Format>; 9342def warn_printf_ObjCflags_without_ObjCConversion: Warning< 9343 "object format flags cannot be used with '%0' conversion specifier">, 9344 InGroup<Format>; 9345def warn_printf_invalid_objc_flag: Warning< 9346 "'%0' is not a valid object format flag">, 9347 InGroup<Format>; 9348def warn_scanf_scanlist_incomplete : Warning< 9349 "no closing ']' for '%%[' in scanf format string">, 9350 InGroup<Format>; 9351def warn_format_bool_as_character : Warning< 9352 "using '%0' format specifier, but argument has boolean value">, 9353 InGroup<Format>; 9354def note_format_string_defined : Note<"format string is defined here">; 9355def note_format_fix_specifier : Note<"did you mean to use '%0'?">; 9356def note_printf_c_str: Note<"did you mean to call the %0 method?">; 9357def note_format_security_fixit: Note< 9358 "treat the string as an argument to avoid this">; 9359 9360def warn_null_arg : Warning< 9361 "null passed to a callee that requires a non-null argument">, 9362 InGroup<NonNull>; 9363def warn_null_ret : Warning< 9364 "null returned from %select{function|method}0 that requires a non-null return value">, 9365 InGroup<NonNull>; 9366 9367def err_lifetimebound_no_object_param : Error< 9368 "'lifetimebound' attribute cannot be applied; %select{static |non-}0member " 9369 "function has no implicit object parameter">; 9370def err_lifetimebound_ctor_dtor : Error< 9371 "'lifetimebound' attribute cannot be applied to a " 9372 "%select{constructor|destructor}0">; 9373 9374// CHECK: returning address/reference of stack memory 9375def warn_ret_stack_addr_ref : Warning< 9376 "%select{address of|reference to}0 stack memory associated with " 9377 "%select{local variable|parameter}2 %1 returned">, 9378 InGroup<ReturnStackAddress>; 9379def warn_ret_local_temp_addr_ref : Warning< 9380 "returning %select{address of|reference to}0 local temporary object">, 9381 InGroup<ReturnStackAddress>; 9382def warn_ret_addr_label : Warning< 9383 "returning address of label, which is local">, 9384 InGroup<ReturnStackAddress>; 9385def err_ret_local_block : Error< 9386 "returning block that lives on the local stack">; 9387def note_local_var_initializer : Note< 9388 "%select{via initialization of|binding reference}0 variable " 9389 "%select{%2 |}1here">; 9390def note_lambda_capture_initializer : Note< 9391 "%select{implicitly |}2captured%select{| by reference}3" 9392 "%select{%select{ due to use|}2 here|" 9393 " via initialization of lambda capture %0}1">; 9394def note_init_with_default_member_initalizer : Note< 9395 "initializing field %0 with default member initializer">; 9396 9397// Check for initializing a member variable with the address or a reference to 9398// a constructor parameter. 9399def warn_bind_ref_member_to_parameter : Warning< 9400 "binding reference member %0 to stack allocated " 9401 "%select{variable|parameter}2 %1">, InGroup<DanglingField>; 9402def warn_init_ptr_member_to_parameter_addr : Warning< 9403 "initializing pointer member %0 with the stack address of " 9404 "%select{variable|parameter}2 %1">, InGroup<DanglingField>; 9405def note_ref_or_ptr_member_declared_here : Note< 9406 "%select{reference|pointer}0 member declared here">; 9407 9408def err_dangling_member : Error< 9409 "%select{reference|backing array for 'std::initializer_list'}2 " 9410 "%select{|subobject of }1member %0 " 9411 "%select{binds to|is}2 a temporary object " 9412 "whose lifetime would be shorter than the lifetime of " 9413 "the constructed object">; 9414def warn_dangling_member : Warning< 9415 "%select{reference|backing array for 'std::initializer_list'}2 " 9416 "%select{|subobject of }1member %0 " 9417 "%select{binds to|is}2 a temporary object " 9418 "whose lifetime is shorter than the lifetime of the constructed object">, 9419 InGroup<DanglingField>; 9420def warn_dangling_lifetime_pointer_member : Warning< 9421 "initializing pointer member %0 to point to a temporary object " 9422 "whose lifetime is shorter than the lifetime of the constructed object">, 9423 InGroup<DanglingGsl>; 9424def note_lifetime_extending_member_declared_here : Note< 9425 "%select{%select{reference|'std::initializer_list'}0 member|" 9426 "member with %select{reference|'std::initializer_list'}0 subobject}1 " 9427 "declared here">; 9428def warn_dangling_variable : Warning< 9429 "%select{temporary %select{whose address is used as value of|" 9430 "%select{|implicitly }2bound to}4 " 9431 "%select{%select{|reference }4member of local variable|" 9432 "local %select{variable|reference}4}1|" 9433 "array backing " 9434 "%select{initializer list subobject of local variable|" 9435 "local initializer list}1}0 " 9436 "%select{%3 |}2will be destroyed at the end of the full-expression">, 9437 InGroup<Dangling>; 9438def warn_new_dangling_reference : Warning< 9439 "temporary bound to reference member of allocated object " 9440 "will be destroyed at the end of the full-expression">, 9441 InGroup<DanglingField>; 9442def warn_dangling_lifetime_pointer : Warning< 9443 "object backing the pointer " 9444 "will be destroyed at the end of the full-expression">, 9445 InGroup<DanglingGsl>; 9446def warn_new_dangling_initializer_list : Warning< 9447 "array backing " 9448 "%select{initializer list subobject of the allocated object|" 9449 "the allocated initializer list}0 " 9450 "will be destroyed at the end of the full-expression">, 9451 InGroup<DanglingInitializerList>; 9452def warn_unsupported_lifetime_extension : Warning< 9453 "sorry, lifetime extension of " 9454 "%select{temporary|backing array of initializer list}0 created " 9455 "by aggregate initialization using default member initializer " 9456 "is not supported; lifetime of %select{temporary|backing array}0 " 9457 "will end at the end of the full-expression">, InGroup<Dangling>; 9458 9459// For non-floating point, expressions of the form x == x or x != x 9460// should result in a warning, since these always evaluate to a constant. 9461// Array comparisons have similar warnings 9462def warn_comparison_always : Warning< 9463 "%select{self-|array }0comparison always evaluates to " 9464 "%select{a constant|true|false|'std::strong_ordering::equal'}1">, 9465 InGroup<TautologicalCompare>; 9466def warn_comparison_bitwise_always : Warning< 9467 "bitwise comparison always evaluates to %select{false|true}0">, 9468 InGroup<TautologicalBitwiseCompare>, DefaultIgnore; 9469def warn_comparison_bitwise_or : Warning< 9470 "bitwise or with non-zero value always evaluates to true">, 9471 InGroup<TautologicalBitwiseCompare>, DefaultIgnore; 9472def warn_tautological_overlap_comparison : Warning< 9473 "overlapping comparisons always evaluate to %select{false|true}0">, 9474 InGroup<TautologicalOverlapCompare>, DefaultIgnore; 9475def warn_depr_array_comparison : Warning< 9476 "comparison between two arrays is deprecated; " 9477 "to compare array addresses, use unary '+' to decay operands to pointers">, 9478 InGroup<DeprecatedArrayCompare>; 9479 9480def warn_stringcompare : Warning< 9481 "result of comparison against %select{a string literal|@encode}0 is " 9482 "unspecified (use an explicit string comparison function instead)">, 9483 InGroup<StringCompare>; 9484 9485def warn_identity_field_assign : Warning< 9486 "assigning %select{field|instance variable}0 to itself">, 9487 InGroup<SelfAssignmentField>; 9488 9489// Type safety attributes 9490def err_type_tag_for_datatype_not_ice : Error< 9491 "'type_tag_for_datatype' attribute requires the initializer to be " 9492 "an %select{integer|integral}0 constant expression">; 9493def err_type_tag_for_datatype_too_large : Error< 9494 "'type_tag_for_datatype' attribute requires the initializer to be " 9495 "an %select{integer|integral}0 constant expression " 9496 "that can be represented by a 64 bit integer">; 9497def err_tag_index_out_of_range : Error< 9498 "%select{type tag|argument}0 index %1 is greater than the number of arguments specified">; 9499def warn_type_tag_for_datatype_wrong_kind : Warning< 9500 "this type tag was not designed to be used with this function">, 9501 InGroup<TypeSafety>; 9502def warn_type_safety_type_mismatch : Warning< 9503 "argument type %0 doesn't match specified %1 type tag " 9504 "%select{that requires %3|}2">, InGroup<TypeSafety>; 9505def warn_type_safety_null_pointer_required : Warning< 9506 "specified %0 type tag requires a null pointer">, InGroup<TypeSafety>; 9507 9508// Generic selections. 9509def err_assoc_type_incomplete : Error< 9510 "type %0 in generic association incomplete">; 9511def err_assoc_type_nonobject : Error< 9512 "type %0 in generic association not an object type">; 9513def err_assoc_type_variably_modified : Error< 9514 "type %0 in generic association is a variably modified type">; 9515def err_assoc_compatible_types : Error< 9516 "type %0 in generic association compatible with previously specified type %1">; 9517def note_compat_assoc : Note< 9518 "compatible type %0 specified here">; 9519def err_generic_sel_no_match : Error< 9520 "controlling expression type %0 not compatible with any generic association type">; 9521def err_generic_sel_multi_match : Error< 9522 "controlling expression type %0 compatible with %1 generic association types">; 9523 9524 9525// Blocks 9526def err_blocks_disable : Error<"blocks support disabled - compile with -fblocks" 9527 " or %select{pick a deployment target that supports them|for OpenCL 2.0}0">; 9528def err_block_returning_array_function : Error< 9529 "block cannot return %select{array|function}0 type %1">; 9530 9531// Builtin annotation 9532def err_builtin_annotation_first_arg : Error< 9533 "first argument to __builtin_annotation must be an integer">; 9534def err_builtin_annotation_second_arg : Error< 9535 "second argument to __builtin_annotation must be a non-wide string constant">; 9536def err_msvc_annotation_wide_str : Error< 9537 "arguments to __annotation must be wide string constants">; 9538 9539// CFString checking 9540def err_cfstring_literal_not_string_constant : Error< 9541 "CFString literal is not a string constant">; 9542def warn_cfstring_truncated : Warning< 9543 "input conversion stopped due to an input byte that does not " 9544 "belong to the input codeset UTF-8">, 9545 InGroup<DiagGroup<"CFString-literal">>; 9546 9547// os_log checking 9548// TODO: separate diagnostic for os_trace() 9549def err_os_log_format_not_string_constant : Error< 9550 "os_log() format argument is not a string constant">; 9551def err_os_log_argument_too_big : Error< 9552 "os_log() argument %0 is too big (%1 bytes, max %2)">; 9553def warn_os_log_format_narg : Error< 9554 "os_log() '%%n' format specifier is not allowed">, DefaultError; 9555 9556// Statements. 9557def err_continue_not_in_loop : Error< 9558 "'continue' statement not in loop statement">; 9559def err_break_not_in_loop_or_switch : Error< 9560 "'break' statement not in loop or switch statement">; 9561def warn_loop_ctrl_binds_to_inner : Warning< 9562 "'%0' is bound to current loop, GCC binds it to the enclosing loop">, 9563 InGroup<GccCompat>; 9564def warn_break_binds_to_switch : Warning< 9565 "'break' is bound to loop, GCC binds it to switch">, 9566 InGroup<GccCompat>; 9567def err_default_not_in_switch : Error< 9568 "'default' statement not in switch statement">; 9569def err_case_not_in_switch : Error<"'case' statement not in switch statement">; 9570def warn_bool_switch_condition : Warning< 9571 "switch condition has boolean value">, InGroup<SwitchBool>; 9572def warn_case_value_overflow : Warning< 9573 "overflow converting case value to switch condition type (%0 to %1)">, 9574 InGroup<Switch>; 9575def err_duplicate_case : Error<"duplicate case value '%0'">; 9576def err_duplicate_case_differing_expr : Error< 9577 "duplicate case value: '%0' and '%1' both equal '%2'">; 9578def warn_case_empty_range : Warning<"empty case range specified">; 9579def warn_missing_case_for_condition : 9580 Warning<"no case matching constant switch condition '%0'">; 9581 9582def warn_def_missing_case : Warning<"%plural{" 9583 "1:enumeration value %1 not explicitly handled in switch|" 9584 "2:enumeration values %1 and %2 not explicitly handled in switch|" 9585 "3:enumeration values %1, %2, and %3 not explicitly handled in switch|" 9586 ":%0 enumeration values not explicitly handled in switch: %1, %2, %3...}0">, 9587 InGroup<SwitchEnum>, DefaultIgnore; 9588 9589def warn_missing_case : Warning<"%plural{" 9590 "1:enumeration value %1 not handled in switch|" 9591 "2:enumeration values %1 and %2 not handled in switch|" 9592 "3:enumeration values %1, %2, and %3 not handled in switch|" 9593 ":%0 enumeration values not handled in switch: %1, %2, %3...}0">, 9594 InGroup<Switch>; 9595 9596def warn_unannotated_fallthrough : Warning< 9597 "unannotated fall-through between switch labels">, 9598 InGroup<ImplicitFallthrough>, DefaultIgnore; 9599def warn_unannotated_fallthrough_per_function : Warning< 9600 "unannotated fall-through between switch labels in partly-annotated " 9601 "function">, InGroup<ImplicitFallthroughPerFunction>, DefaultIgnore; 9602def note_insert_fallthrough_fixit : Note< 9603 "insert '%0;' to silence this warning">; 9604def note_insert_break_fixit : Note< 9605 "insert 'break;' to avoid fall-through">; 9606def err_fallthrough_attr_wrong_target : Error< 9607 "%0 attribute is only allowed on empty statements">; 9608def note_fallthrough_insert_semi_fixit : Note<"did you forget ';'?">; 9609def err_fallthrough_attr_outside_switch : Error< 9610 "fallthrough annotation is outside switch statement">; 9611def err_fallthrough_attr_invalid_placement : Error< 9612 "fallthrough annotation does not directly precede switch label">; 9613 9614def warn_unreachable_default : Warning< 9615 "default label in switch which covers all enumeration values">, 9616 InGroup<CoveredSwitchDefault>, DefaultIgnore; 9617def warn_not_in_enum : Warning<"case value not in enumerated type %0">, 9618 InGroup<Switch>; 9619def warn_not_in_enum_assignment : Warning<"integer constant not in range " 9620 "of enumerated type %0">, InGroup<DiagGroup<"assign-enum">>, DefaultIgnore; 9621def err_typecheck_statement_requires_scalar : Error< 9622 "statement requires expression of scalar type (%0 invalid)">; 9623def err_typecheck_statement_requires_integer : Error< 9624 "statement requires expression of integer type (%0 invalid)">; 9625def err_multiple_default_labels_defined : Error< 9626 "multiple default labels in one switch">; 9627def err_switch_multiple_conversions : Error< 9628 "multiple conversions from switch condition type %0 to an integral or " 9629 "enumeration type">; 9630def note_switch_conversion : Note< 9631 "conversion to %select{integral|enumeration}0 type %1">; 9632def err_switch_explicit_conversion : Error< 9633 "switch condition type %0 requires explicit conversion to %1">; 9634def err_switch_incomplete_class_type : Error< 9635 "switch condition has incomplete class type %0">; 9636 9637def warn_empty_if_body : Warning< 9638 "if statement has empty body">, InGroup<EmptyBody>; 9639def warn_empty_for_body : Warning< 9640 "for loop has empty body">, InGroup<EmptyBody>; 9641def warn_empty_range_based_for_body : Warning< 9642 "range-based for loop has empty body">, InGroup<EmptyBody>; 9643def warn_empty_while_body : Warning< 9644 "while loop has empty body">, InGroup<EmptyBody>; 9645def warn_empty_switch_body : Warning< 9646 "switch statement has empty body">, InGroup<EmptyBody>; 9647def note_empty_body_on_separate_line : Note< 9648 "put the semicolon on a separate line to silence this warning">; 9649 9650def err_va_start_captured_stmt : Error< 9651 "'va_start' cannot be used in a captured statement">; 9652def err_va_start_outside_function : Error< 9653 "'va_start' cannot be used outside a function">; 9654def err_va_start_fixed_function : Error< 9655 "'va_start' used in function with fixed args">; 9656def err_va_start_used_in_wrong_abi_function : Error< 9657 "'va_start' used in %select{System V|Win64}0 ABI function">; 9658def err_ms_va_start_used_in_sysv_function : Error< 9659 "'__builtin_ms_va_start' used in System V ABI function">; 9660def warn_second_arg_of_va_start_not_last_named_param : Warning< 9661 "second argument to 'va_start' is not the last named parameter">, 9662 InGroup<Varargs>; 9663def warn_va_start_type_is_undefined : Warning< 9664 "passing %select{an object that undergoes default argument promotion|" 9665 "an object of reference type|a parameter declared with the 'register' " 9666 "keyword}0 to 'va_start' has undefined behavior">, InGroup<Varargs>; 9667def err_first_argument_to_va_arg_not_of_type_va_list : Error< 9668 "first argument to 'va_arg' is of type %0 and not 'va_list'">; 9669def err_second_parameter_to_va_arg_incomplete: Error< 9670 "second argument to 'va_arg' is of incomplete type %0">; 9671def err_second_parameter_to_va_arg_abstract: Error< 9672 "second argument to 'va_arg' is of abstract type %0">; 9673def warn_second_parameter_to_va_arg_not_pod : Warning< 9674 "second argument to 'va_arg' is of non-POD type %0">, 9675 InGroup<NonPODVarargs>, DefaultError; 9676def warn_second_parameter_to_va_arg_ownership_qualified : Warning< 9677 "second argument to 'va_arg' is of ARC ownership-qualified type %0">, 9678 InGroup<NonPODVarargs>, DefaultError; 9679def warn_second_parameter_to_va_arg_never_compatible : Warning< 9680 "second argument to 'va_arg' is of promotable type %0; this va_arg has " 9681 "undefined behavior because arguments will be promoted to %1">, InGroup<Varargs>; 9682 9683def warn_return_missing_expr : Warning< 9684 "non-void %select{function|method}1 %0 should return a value">, DefaultError, 9685 InGroup<ReturnType>; 9686def ext_return_missing_expr : ExtWarn< 9687 "non-void %select{function|method}1 %0 should return a value">, DefaultError, 9688 InGroup<ReturnType>; 9689def ext_return_has_expr : ExtWarn< 9690 "%select{void function|void method|constructor|destructor}1 %0 " 9691 "should not return a value">, 9692 DefaultError, InGroup<ReturnType>; 9693def ext_return_has_void_expr : Extension< 9694 "void %select{function|method|block}1 %0 should not return void expression">; 9695def err_return_init_list : Error< 9696 "%select{void function|void method|constructor|destructor}1 %0 " 9697 "must not return a value">; 9698def err_ctor_dtor_returns_void : Error< 9699 "%select{constructor|destructor}1 %0 must not return void expression">; 9700def warn_noreturn_function_has_return_expr : Warning< 9701 "function %0 declared 'noreturn' should not return">, 9702 InGroup<InvalidNoreturn>; 9703def warn_falloff_noreturn_function : Warning< 9704 "function declared 'noreturn' should not return">, 9705 InGroup<InvalidNoreturn>; 9706def err_noreturn_block_has_return_expr : Error< 9707 "block declared 'noreturn' should not return">; 9708def err_carries_dependency_missing_on_first_decl : Error< 9709 "%select{function|parameter}0 declared '[[carries_dependency]]' " 9710 "after its first declaration">; 9711def note_carries_dependency_missing_first_decl : Note< 9712 "declaration missing '[[carries_dependency]]' attribute is here">; 9713def err_carries_dependency_param_not_function_decl : Error< 9714 "'[[carries_dependency]]' attribute only allowed on parameter in a function " 9715 "declaration or lambda">; 9716def err_block_on_nonlocal : Error< 9717 "__block attribute not allowed, only allowed on local variables">; 9718def err_block_on_vm : Error< 9719 "__block attribute not allowed on declaration with a variably modified type">; 9720def err_sizeless_nonlocal : Error< 9721 "non-local variable with sizeless type %0">; 9722 9723def err_vec_builtin_non_vector : Error< 9724 "first two arguments to %0 must be vectors">; 9725def err_vec_builtin_incompatible_vector : Error< 9726 "first two arguments to %0 must have the same type">; 9727def err_vsx_builtin_nonconstant_argument : Error< 9728 "argument %0 to %1 must be a 2-bit unsigned literal (i.e. 0, 1, 2 or 3)">; 9729 9730def err_shufflevector_nonconstant_argument : Error< 9731 "index for __builtin_shufflevector must be a constant integer">; 9732def err_shufflevector_argument_too_large : Error< 9733 "index for __builtin_shufflevector must be less than the total number " 9734 "of vector elements">; 9735 9736def err_convertvector_non_vector : Error< 9737 "first argument to __builtin_convertvector must be a vector">; 9738def err_convertvector_non_vector_type : Error< 9739 "second argument to __builtin_convertvector must be a vector type">; 9740def err_convertvector_incompatible_vector : Error< 9741 "first two arguments to __builtin_convertvector must have the same number of elements">; 9742 9743def err_first_argument_to_cwsc_not_call : Error< 9744 "first argument to __builtin_call_with_static_chain must be a non-member call expression">; 9745def err_first_argument_to_cwsc_block_call : Error< 9746 "first argument to __builtin_call_with_static_chain must not be a block call">; 9747def err_first_argument_to_cwsc_builtin_call : Error< 9748 "first argument to __builtin_call_with_static_chain must not be a builtin call">; 9749def err_first_argument_to_cwsc_pdtor_call : Error< 9750 "first argument to __builtin_call_with_static_chain must not be a pseudo-destructor call">; 9751def err_second_argument_to_cwsc_not_pointer : Error< 9752 "second argument to __builtin_call_with_static_chain must be of pointer type">; 9753 9754def err_vector_incorrect_num_initializers : Error< 9755 "%select{too many|too few}0 elements in vector initialization (expected %1 elements, have %2)">; 9756def err_altivec_empty_initializer : Error<"expected initializer">; 9757 9758def err_invalid_neon_type_code : Error< 9759 "incompatible constant for this __builtin_neon function">; 9760def err_argument_invalid_range : Error< 9761 "argument value %0 is outside the valid range [%1, %2]">; 9762def warn_argument_invalid_range : Warning< 9763 "argument value %0 is outside the valid range [%1, %2]">, DefaultError, 9764 InGroup<DiagGroup<"argument-outside-range">>; 9765def warn_argument_undefined_behaviour : Warning< 9766 "argument value %0 will result in undefined behaviour">, 9767 InGroup<DiagGroup<"argument-undefined-behaviour">>; 9768def err_argument_not_multiple : Error< 9769 "argument should be a multiple of %0">; 9770def err_argument_not_power_of_2 : Error< 9771 "argument should be a power of 2">; 9772def err_argument_not_shifted_byte : Error< 9773 "argument should be an 8-bit value shifted by a multiple of 8 bits">; 9774def err_argument_not_shifted_byte_or_xxff : Error< 9775 "argument should be an 8-bit value shifted by a multiple of 8 bits, or in the form 0x??FF">; 9776def err_argument_not_contiguous_bit_field : Error< 9777 "argument %0 value should represent a contiguous bit field">; 9778def err_rotation_argument_to_cadd 9779 : Error<"argument should be the value 90 or 270">; 9780def err_rotation_argument_to_cmla 9781 : Error<"argument should be the value 0, 90, 180 or 270">; 9782def warn_neon_vector_initializer_non_portable : Warning< 9783 "vector initializers are not compatible with NEON intrinsics in big endian " 9784 "mode">, InGroup<DiagGroup<"nonportable-vector-initialization">>; 9785def note_neon_vector_initializer_non_portable : Note< 9786 "consider using vld1_%0%1() to initialize a vector from memory, or " 9787 "vcreate_%0%1() to initialize from an integer constant">; 9788def note_neon_vector_initializer_non_portable_q : Note< 9789 "consider using vld1q_%0%1() to initialize a vector from memory, or " 9790 "vcombine_%0%1(vcreate_%0%1(), vcreate_%0%1()) to initialize from integer " 9791 "constants">; 9792def err_systemz_invalid_tabort_code : Error< 9793 "invalid transaction abort code">; 9794def err_64_bit_builtin_32_bit_tgt : Error< 9795 "this builtin is only available on 64-bit targets">; 9796def err_32_bit_builtin_64_bit_tgt : Error< 9797 "this builtin is only available on 32-bit targets">; 9798def err_builtin_x64_aarch64_only : Error< 9799 "this builtin is only available on x86-64 and aarch64 targets">; 9800def err_mips_builtin_requires_dsp : Error< 9801 "this builtin requires 'dsp' ASE, please use -mdsp">; 9802def err_mips_builtin_requires_dspr2 : Error< 9803 "this builtin requires 'dsp r2' ASE, please use -mdspr2">; 9804def err_mips_builtin_requires_msa : Error< 9805 "this builtin requires 'msa' ASE, please use -mmsa">; 9806def err_ppc_builtin_only_on_arch : Error< 9807 "this builtin is only valid on POWER%0 or later CPUs">; 9808def err_ppc_builtin_requires_vsx : Error< 9809 "this builtin requires VSX to be enabled">; 9810def err_ppc_builtin_requires_abi : Error< 9811 "this builtin requires ABI -mabi=%0">; 9812def err_ppc_invalid_use_mma_type : Error< 9813 "invalid use of PPC MMA type">; 9814def err_ppc_invalid_test_data_class_type : Error< 9815 "expected a 'float' or 'double' for the first argument">; 9816def err_x86_builtin_invalid_rounding : Error< 9817 "invalid rounding argument">; 9818def err_x86_builtin_invalid_scale : Error< 9819 "scale argument must be 1, 2, 4, or 8">; 9820def err_x86_builtin_tile_arg_duplicate : Error< 9821 "tile arguments must refer to different tiles">; 9822 9823def err_builtin_target_unsupported : Error< 9824 "builtin is not supported on this target">; 9825def err_builtin_longjmp_unsupported : Error< 9826 "__builtin_longjmp is not supported for the current target">; 9827def err_builtin_setjmp_unsupported : Error< 9828 "__builtin_setjmp is not supported for the current target">; 9829 9830def err_builtin_longjmp_invalid_val : Error< 9831 "argument to __builtin_longjmp must be a constant 1">; 9832def err_builtin_requires_language : Error<"'%0' is only available in %1">; 9833 9834def err_constant_integer_arg_type : Error< 9835 "argument to %0 must be a constant integer">; 9836 9837def ext_mixed_decls_code : Extension< 9838 "ISO C90 forbids mixing declarations and code">, 9839 InGroup<DiagGroup<"declaration-after-statement">>; 9840 9841def err_non_local_variable_decl_in_for : Error< 9842 "declaration of non-local variable in 'for' loop">; 9843def err_non_variable_decl_in_for : Error< 9844 "non-variable declaration in 'for' loop">; 9845def err_toomany_element_decls : Error< 9846 "only one element declaration is allowed">; 9847def err_selector_element_not_lvalue : Error< 9848 "selector element is not a valid lvalue">; 9849def err_selector_element_type : Error< 9850 "selector element type %0 is not a valid object">; 9851def err_selector_element_const_type : Error< 9852 "selector element of type %0 cannot be a constant lvalue expression">; 9853def err_collection_expr_type : Error< 9854 "the type %0 is not a pointer to a fast-enumerable object">; 9855def warn_collection_expr_type : Warning< 9856 "collection expression type %0 may not respond to %1">; 9857 9858def err_invalid_conversion_between_ext_vectors : Error< 9859 "invalid conversion between ext-vector type %0 and %1">; 9860 9861def warn_duplicate_attribute_exact : Warning< 9862 "attribute %0 is already applied">, InGroup<IgnoredAttributes>; 9863 9864def warn_duplicate_attribute : Warning< 9865 "attribute %0 is already applied with different arguments">, 9866 InGroup<IgnoredAttributes>; 9867 9868def warn_sync_fetch_and_nand_semantics_change : Warning< 9869 "the semantics of this intrinsic changed with GCC " 9870 "version 4.4 - the newer semantics are provided here">, 9871 InGroup<DiagGroup<"sync-fetch-and-nand-semantics-changed">>; 9872 9873// Type 9874def ext_wchar_t_sign_spec : ExtWarn<"'%0' cannot be signed or unsigned">, 9875 InGroup<DiagGroup<"signed-unsigned-wchar">>, DefaultError; 9876def warn_receiver_forward_class : Warning< 9877 "receiver %0 is a forward class and corresponding @interface may not exist">, 9878 InGroup<ForwardClassReceiver>; 9879def note_method_sent_forward_class : Note<"method %0 is used for the forward class">; 9880def ext_missing_declspec : ExtWarn< 9881 "declaration specifier missing, defaulting to 'int'">; 9882def ext_missing_type_specifier : ExtWarn< 9883 "type specifier missing, defaults to 'int'">, 9884 InGroup<ImplicitInt>; 9885def err_decimal_unsupported : Error< 9886 "GNU decimal type extension not supported">; 9887def err_missing_type_specifier : Error< 9888 "C++ requires a type specifier for all declarations">; 9889def err_objc_array_of_interfaces : Error< 9890 "array of interface %0 is invalid (probably should be an array of pointers)">; 9891def ext_c99_array_usage : Extension< 9892 "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 " 9893 "feature">, InGroup<C99>; 9894def err_c99_array_usage_cxx : Error< 9895 "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 " 9896 "feature, not permitted in C++">; 9897def err_type_unsupported : Error< 9898 "%0 is not supported on this target">; 9899def err_nsconsumed_attribute_mismatch : Error< 9900 "overriding method has mismatched ns_consumed attribute on its" 9901 " parameter">; 9902def err_nsreturns_retained_attribute_mismatch : Error< 9903 "overriding method has mismatched ns_returns_%select{not_retained|retained}0" 9904 " attributes">; 9905def err_nserrordomain_invalid_decl : Error< 9906 "domain argument %select{|%1 }0does not refer to global constant">; 9907def err_nserrordomain_wrong_type : Error< 9908 "domain argument %0 does not point to an NSString or CFString constant">; 9909 9910def warn_nsconsumed_attribute_mismatch : Warning< 9911 err_nsconsumed_attribute_mismatch.Text>, InGroup<NSConsumedMismatch>; 9912def warn_nsreturns_retained_attribute_mismatch : Warning< 9913 err_nsreturns_retained_attribute_mismatch.Text>, InGroup<NSReturnsMismatch>; 9914 9915def note_getter_unavailable : Note< 9916 "or because setter is declared here, but no getter method %0 is found">; 9917def err_invalid_protocol_qualifiers : Error< 9918 "invalid protocol qualifiers on non-ObjC type">; 9919def warn_ivar_use_hidden : Warning< 9920 "local declaration of %0 hides instance variable">, 9921 InGroup<ShadowIvar>; 9922def warn_direct_initialize_call : Warning< 9923 "explicit call to +initialize results in duplicate call to +initialize">, 9924 InGroup<ExplicitInitializeCall>; 9925def warn_direct_super_initialize_call : Warning< 9926 "explicit call to [super initialize] should only be in implementation " 9927 "of +initialize">, 9928 InGroup<ExplicitInitializeCall>; 9929def err_ivar_use_in_class_method : Error< 9930 "instance variable %0 accessed in class method">; 9931def err_private_ivar_access : Error<"instance variable %0 is private">, 9932 AccessControl; 9933def err_protected_ivar_access : Error<"instance variable %0 is protected">, 9934 AccessControl; 9935def warn_maynot_respond : Warning<"%0 may not respond to %1">; 9936def ext_typecheck_base_super : Warning< 9937 "method parameter type " 9938 "%diff{$ does not match super class method parameter type $|" 9939 "does not match super class method parameter type}0,1">, 9940 InGroup<SuperSubClassMismatch>, DefaultIgnore; 9941def warn_missing_method_return_type : Warning< 9942 "method has no return type specified; defaults to 'id'">, 9943 InGroup<MissingMethodReturnType>, DefaultIgnore; 9944def warn_direct_ivar_access : Warning<"instance variable %0 is being " 9945 "directly accessed">, InGroup<DiagGroup<"direct-ivar-access">>, DefaultIgnore; 9946 9947// Spell-checking diagnostics 9948def err_unknown_typename : Error< 9949 "unknown type name %0">; 9950def err_unknown_type_or_class_name_suggest : Error< 9951 "unknown %select{type|class}1 name %0; did you mean %2?">; 9952def err_unknown_typename_suggest : Error< 9953 "unknown type name %0; did you mean %1?">; 9954def err_unknown_nested_typename_suggest : Error< 9955 "no type named %0 in %1; did you mean %select{|simply }2%3?">; 9956def err_no_member_suggest : Error<"no member named %0 in %1; did you mean %select{|simply }2%3?">; 9957def err_undeclared_use_suggest : Error< 9958 "use of undeclared %0; did you mean %1?">; 9959def err_undeclared_var_use_suggest : Error< 9960 "use of undeclared identifier %0; did you mean %1?">; 9961def err_no_template : Error<"no template named %0">; 9962def err_no_template_suggest : Error<"no template named %0; did you mean %1?">; 9963def err_no_member_template : Error<"no template named %0 in %1">; 9964def err_no_member_template_suggest : Error< 9965 "no template named %0 in %1; did you mean %select{|simply }2%3?">; 9966def err_non_template_in_template_id : Error< 9967 "%0 does not name a template but is followed by template arguments">; 9968def err_non_template_in_template_id_suggest : Error< 9969 "%0 does not name a template but is followed by template arguments; " 9970 "did you mean %1?">; 9971def err_non_template_in_member_template_id_suggest : Error< 9972 "member %0 of %1 is not a template; did you mean %select{|simply }2%3?">; 9973def note_non_template_in_template_id_found : Note< 9974 "non-template declaration found by name lookup">; 9975def err_mem_init_not_member_or_class_suggest : Error< 9976 "initializer %0 does not name a non-static data member or base " 9977 "class; did you mean the %select{base class|member}1 %2?">; 9978def err_field_designator_unknown_suggest : Error< 9979 "field designator %0 does not refer to any field in type %1; did you mean " 9980 "%2?">; 9981def err_typecheck_member_reference_ivar_suggest : Error< 9982 "%0 does not have a member named %1; did you mean %2?">; 9983def err_property_not_found_suggest : Error< 9984 "property %0 not found on object of type %1; did you mean %2?">; 9985def err_class_property_found : Error< 9986 "property %0 is a class property; did you mean to access it with class '%1'?">; 9987def err_ivar_access_using_property_syntax_suggest : Error< 9988 "property %0 not found on object of type %1; did you mean to access instance variable %2?">; 9989def warn_property_access_suggest : Warning< 9990"property %0 not found on object of type %1; did you mean to access property %2?">, 9991InGroup<PropertyAccessDotSyntax>; 9992def err_property_found_suggest : Error< 9993 "property %0 found on object of type %1; did you mean to access " 9994 "it with the \".\" operator?">; 9995def err_undef_interface_suggest : Error< 9996 "cannot find interface declaration for %0; did you mean %1?">; 9997def warn_undef_interface_suggest : Warning< 9998 "cannot find interface declaration for %0; did you mean %1?">; 9999def err_undef_superclass_suggest : Error< 10000 "cannot find interface declaration for %0, superclass of %1; did you mean " 10001 "%2?">; 10002def err_undeclared_protocol_suggest : Error< 10003 "cannot find protocol declaration for %0; did you mean %1?">; 10004def note_base_class_specified_here : Note< 10005 "base class %0 specified here">; 10006def err_using_directive_suggest : Error< 10007 "no namespace named %0; did you mean %1?">; 10008def err_using_directive_member_suggest : Error< 10009 "no namespace named %0 in %1; did you mean %select{|simply }2%3?">; 10010def note_namespace_defined_here : Note<"namespace %0 defined here">; 10011def err_sizeof_pack_no_pack_name_suggest : Error< 10012 "%0 does not refer to the name of a parameter pack; did you mean %1?">; 10013def note_parameter_pack_here : Note<"parameter pack %0 declared here">; 10014 10015def err_uncasted_use_of_unknown_any : Error< 10016 "%0 has unknown type; cast it to its declared type to use it">; 10017def err_uncasted_call_of_unknown_any : Error< 10018 "%0 has unknown return type; cast the call to its declared return type">; 10019def err_uncasted_send_to_unknown_any_method : Error< 10020 "no known method %select{%objcinstance1|%objcclass1}0; cast the " 10021 "message send to the method's return type">; 10022def err_unsupported_unknown_any_decl : Error< 10023 "%0 has unknown type, which is not supported for this kind of declaration">; 10024def err_unsupported_unknown_any_expr : Error< 10025 "unsupported expression with unknown type">; 10026def err_unsupported_unknown_any_call : Error< 10027 "call to unsupported expression with unknown type">; 10028def err_unknown_any_addrof : Error< 10029 "the address of a declaration with unknown type " 10030 "can only be cast to a pointer type">; 10031def err_unknown_any_addrof_call : Error< 10032 "address-of operator cannot be applied to a call to a function with " 10033 "unknown return type">; 10034def err_unknown_any_var_function_type : Error< 10035 "variable %0 with unknown type cannot be given a function type">; 10036def err_unknown_any_function : Error< 10037 "function %0 with unknown type must be given a function type">; 10038 10039def err_filter_expression_integral : Error< 10040 "filter expression has non-integral type %0">; 10041 10042def err_non_asm_stmt_in_naked_function : Error< 10043 "non-ASM statement in naked function is not supported">; 10044def err_asm_naked_this_ref : Error< 10045 "'this' pointer references not allowed in naked functions">; 10046def err_asm_naked_parm_ref : Error< 10047 "parameter references not allowed in naked functions">; 10048 10049// OpenCL warnings and errors. 10050def err_invalid_astype_of_different_size : Error< 10051 "invalid reinterpretation: sizes of %0 and %1 must match">; 10052def err_static_kernel : Error< 10053 "kernel functions cannot be declared static">; 10054def err_method_kernel : Error< 10055 "kernel functions cannot be class members">; 10056def err_template_kernel : Error< 10057 "kernel functions cannot be used in a template declaration, instantiation or specialization">; 10058def err_opencl_ptrptr_kernel_param : Error< 10059 "kernel parameter cannot be declared as a pointer to a pointer">; 10060def err_kernel_arg_address_space : Error< 10061 "pointer arguments to kernel functions must reside in '__global', " 10062 "'__constant' or '__local' address space">; 10063def err_opencl_ext_vector_component_invalid_length : Error< 10064 "vector component access has invalid length %0. Supported: 1,2,3,4,8,16.">; 10065def err_opencl_function_variable : Error< 10066 "%select{non-kernel function|function scope}0 variable cannot be declared in %1 address space">; 10067def err_opencl_addrspace_scope : Error< 10068 "variables in the %0 address space can only be declared in the outermost " 10069 "scope of a kernel function">; 10070def err_static_function_scope : Error< 10071 "variables in function scope cannot be declared static">; 10072def err_opencl_bitfields : Error< 10073 "bit-fields are not supported in OpenCL">; 10074def err_opencl_vla : Error< 10075 "variable length arrays are not supported in OpenCL">; 10076def err_opencl_scalar_type_rank_greater_than_vector_type : Error< 10077 "scalar operand type has greater rank than the type of the vector " 10078 "element. (%0 and %1)">; 10079def err_bad_kernel_param_type : Error< 10080 "%0 cannot be used as the type of a kernel parameter">; 10081def err_opencl_implicit_function_decl : Error< 10082 "implicit declaration of function %0 is invalid in OpenCL">; 10083def err_record_with_pointers_kernel_param : Error< 10084 "%select{struct|union}0 kernel parameters may not contain pointers">; 10085def note_within_field_of_type : Note< 10086 "within field of type %0 declared here">; 10087def note_illegal_field_declared_here : Note< 10088 "field of illegal %select{type|pointer type}0 %1 declared here">; 10089def err_opencl_type_struct_or_union_field : Error< 10090 "the %0 type cannot be used to declare a structure or union field">; 10091def err_event_t_addr_space_qual : Error< 10092 "the event_t type can only be used with __private address space qualifier">; 10093def err_expected_kernel_void_return_type : Error< 10094 "kernel must have void return type">; 10095def err_sampler_initializer_not_integer : Error< 10096 "sampler_t initialization requires 32-bit integer, not %0">; 10097def warn_sampler_initializer_invalid_bits : Warning< 10098 "sampler initializer has invalid %0 bits">, InGroup<SpirCompat>, DefaultIgnore; 10099def err_sampler_argument_required : Error< 10100 "sampler_t variable required - got %0">; 10101def err_wrong_sampler_addressspace: Error< 10102 "sampler type cannot be used with the __local and __global address space qualifiers">; 10103def err_opencl_nonconst_global_sampler : Error< 10104 "global sampler requires a const or constant address space qualifier">; 10105def err_opencl_cast_non_zero_to_event_t : Error< 10106 "cannot cast non-zero value '%0' to 'event_t'">; 10107def err_opencl_global_invalid_addr_space : Error< 10108 "%select{program scope|static local|extern}0 variable must reside in %1 address space">; 10109def err_missing_actual_pipe_type : Error< 10110 "missing actual type specifier for pipe">; 10111def err_reference_pipe_type : Error < 10112 "pipes packet types cannot be of reference type">; 10113def err_opencl_no_main : Error<"%select{function|kernel}0 cannot be called 'main'">; 10114def err_opencl_kernel_attr : 10115 Error<"attribute %0 can only be applied to an OpenCL kernel function">; 10116def err_opencl_return_value_with_address_space : Error< 10117 "return value cannot be qualified with address space">; 10118def err_opencl_constant_no_init : Error< 10119 "variable in constant address space must be initialized">; 10120def err_opencl_atomic_init: Error< 10121 "atomic variable can be %select{assigned|initialized}0 to a variable only " 10122 "in global address space">; 10123def err_opencl_implicit_vector_conversion : Error< 10124 "implicit conversions between vector types (%0 and %1) are not permitted">; 10125def err_opencl_invalid_type_array : Error< 10126 "array of %0 type is invalid in OpenCL">; 10127def err_opencl_ternary_with_block : Error< 10128 "block type cannot be used as expression in ternary expression in OpenCL">; 10129def err_opencl_pointer_to_type : Error< 10130 "pointer to type %0 is invalid in OpenCL">; 10131def err_opencl_type_can_only_be_used_as_function_parameter : Error < 10132 "type %0 can only be used as a function parameter in OpenCL">; 10133def err_opencl_type_not_found : Error< 10134 "%0 type %1 not found; include the base header with -finclude-default-header">; 10135def warn_opencl_attr_deprecated_ignored : Warning < 10136 "%0 attribute is deprecated and ignored in %1">, InGroup<IgnoredAttributes>; 10137def err_opencl_variadic_function : Error< 10138 "invalid prototype, variadic arguments are not allowed in OpenCL">; 10139def err_opencl_requires_extension : Error< 10140 "use of %select{type|declaration}0 %1 requires %2 support">; 10141def ext_opencl_double_without_pragma : Extension< 10142 "Clang permits use of type 'double' regardless pragma if 'cl_khr_fp64' is" 10143 " supported">; 10144def warn_opencl_generic_address_space_arg : Warning< 10145 "passing non-generic address space pointer to %0" 10146 " may cause dynamic conversion affecting performance">, 10147 InGroup<Conversion>, DefaultIgnore; 10148 10149// OpenCL v2.0 s6.13.6 -- Builtin Pipe Functions 10150def err_opencl_builtin_pipe_first_arg : Error< 10151 "first argument to %0 must be a pipe type">; 10152def err_opencl_builtin_pipe_arg_num : Error< 10153 "invalid number of arguments to function: %0">; 10154def err_opencl_builtin_pipe_invalid_arg : Error< 10155 "invalid argument type to function %0 (expecting %1 having %2)">; 10156def err_opencl_builtin_pipe_invalid_access_modifier : Error< 10157 "invalid pipe access modifier (expecting %0)">; 10158 10159// OpenCL access qualifier 10160def err_opencl_invalid_access_qualifier : Error< 10161 "access qualifier can only be used for pipe and image type">; 10162def err_opencl_invalid_read_write : Error< 10163 "access qualifier %0 can not be used for %1 %select{|prior to OpenCL C version 2.0 or in version 3.0 " 10164 "and without __opencl_c_read_write_images feature}2">; 10165def err_opencl_multiple_access_qualifiers : Error< 10166 "multiple access qualifiers">; 10167def note_opencl_typedef_access_qualifier : Note< 10168 "previously declared '%0' here">; 10169 10170// OpenCL v2.0 s6.12.5 Blocks restrictions 10171def err_opencl_block_storage_type : Error< 10172 "the __block storage type is not permitted">; 10173def err_opencl_invalid_block_declaration : Error< 10174 "invalid block variable declaration - must be %select{const qualified|initialized}0">; 10175def err_opencl_extern_block_declaration : Error< 10176 "invalid block variable declaration - using 'extern' storage class is disallowed">; 10177def err_opencl_block_ref_block : Error< 10178 "cannot refer to a block inside block">; 10179 10180// OpenCL v2.0 s6.13.9 - Address space qualifier functions. 10181def err_opencl_builtin_to_addr_invalid_arg : Error< 10182 "invalid argument %0 to function: %1, expecting a generic pointer argument">; 10183 10184// OpenCL v2.0 s6.13.17 Enqueue kernel restrictions. 10185def err_opencl_enqueue_kernel_incorrect_args : Error< 10186 "illegal call to enqueue_kernel, incorrect argument types">; 10187def err_opencl_enqueue_kernel_local_size_args : Error< 10188 "mismatch in number of block parameters and local size arguments passed">; 10189def err_opencl_enqueue_kernel_invalid_local_size_type : Error< 10190 "illegal call to enqueue_kernel, parameter needs to be specified as integer type">; 10191def err_opencl_enqueue_kernel_blocks_non_local_void_args : Error< 10192 "blocks used in enqueue_kernel call are expected to have parameters of type 'local void*'">; 10193def err_opencl_enqueue_kernel_blocks_no_args : Error< 10194 "blocks with parameters are not accepted in this prototype of enqueue_kernel call">; 10195 10196def err_opencl_builtin_expected_type : Error< 10197 "illegal call to %0, expected %1 argument type">; 10198 10199// OpenCL v3.0 s6.3.7 - Vector Components 10200def ext_opencl_ext_vector_type_rgba_selector: ExtWarn< 10201 "vector component name '%0' is a feature from OpenCL version 3.0 onwards">, 10202 InGroup<OpenCLUnsupportedRGBA>; 10203 10204def err_openclcxx_placement_new : Error< 10205 "use of placement new requires explicit declaration">; 10206 10207// MIG routine annotations. 10208def warn_mig_server_routine_does_not_return_kern_return_t : Warning< 10209 "'mig_server_routine' attribute only applies to routines that return a kern_return_t">, 10210 InGroup<IgnoredAttributes>; 10211} // end of sema category 10212 10213let CategoryName = "OpenMP Issue" in { 10214// OpenMP support. 10215def err_omp_expected_var_arg : Error< 10216 "%0 is not a global variable, static local variable or static data member">; 10217def err_omp_expected_var_arg_suggest : Error< 10218 "%0 is not a global variable, static local variable or static data member; " 10219 "did you mean %1">; 10220def err_omp_global_var_arg : Error< 10221 "arguments of '#pragma omp %0' must have %select{global storage|static storage duration}1">; 10222def err_omp_ref_type_arg : Error< 10223 "arguments of '#pragma omp %0' cannot be of reference type %1">; 10224def err_omp_region_not_file_context : Error< 10225 "directive must be at file or namespace scope">; 10226def err_omp_var_scope : Error< 10227 "'#pragma omp %0' must appear in the scope of the %q1 variable declaration">; 10228def err_omp_var_used : Error< 10229 "'#pragma omp %0' must precede all references to variable %q1">; 10230def err_omp_var_thread_local : Error< 10231 "variable %0 cannot be threadprivate because it is %select{thread-local|a global named register variable}1">; 10232def err_omp_private_incomplete_type : Error< 10233 "a private variable with incomplete type %0">; 10234def err_omp_firstprivate_incomplete_type : Error< 10235 "a firstprivate variable with incomplete type %0">; 10236def err_omp_lastprivate_incomplete_type : Error< 10237 "a lastprivate variable with incomplete type %0">; 10238def err_omp_reduction_incomplete_type : Error< 10239 "a reduction list item with incomplete type %0">; 10240def err_omp_unexpected_clause_value : Error< 10241 "expected %0 in OpenMP clause '%1'">; 10242def err_omp_expected_var_name_member_expr : Error< 10243 "expected variable name%select{| or data member of current class}0">; 10244def err_omp_expected_var_name_member_expr_or_array_item : Error< 10245 "expected variable name%select{|, data member of current class}0, array element or array section">; 10246def err_omp_expected_addressable_lvalue_or_array_item : Error< 10247 "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">; 10248def err_omp_expected_named_var_member_or_array_expression: Error< 10249 "expected expression containing only member accesses and/or array sections based on named variables">; 10250def err_omp_bit_fields_forbidden_in_clause : Error< 10251 "bit fields cannot be used to specify storage in a '%0' clause">; 10252def err_array_section_does_not_specify_contiguous_storage : Error< 10253 "array section does not specify contiguous storage">; 10254def err_array_section_does_not_specify_length : Error< 10255 "array section does not specify length for outermost dimension">; 10256def err_omp_union_type_not_allowed : Error< 10257 "mapping of union members is not allowed">; 10258def err_omp_expected_access_to_data_field : Error< 10259 "expected access to data field">; 10260def err_omp_multiple_array_items_in_map_clause : Error< 10261 "multiple array elements associated with the same variable are not allowed in map clauses of the same construct">; 10262def err_omp_duplicate_map_type_modifier : Error< 10263 "same map type modifier has been specified more than once">; 10264def err_omp_duplicate_motion_modifier : Error< 10265 "same motion modifier has been specified more than once">; 10266def err_omp_pointer_mapped_along_with_derived_section : Error< 10267 "pointer cannot be mapped along with a section derived from itself">; 10268def err_omp_original_storage_is_shared_and_does_not_contain : Error< 10269 "original storage of expression in data environment is shared but data environment do not fully contain mapped expression storage">; 10270def err_omp_same_pointer_dereferenced : Error< 10271 "same pointer dereferenced in multiple different ways in map clause expressions">; 10272def note_omp_task_predetermined_firstprivate_here : Note< 10273 "predetermined as a firstprivate in a task construct here">; 10274def err_omp_threadprivate_incomplete_type : Error< 10275 "threadprivate variable with incomplete type %0">; 10276def err_omp_no_dsa_for_variable : Error< 10277 "variable %0 must have explicitly specified data sharing attributes">; 10278def err_omp_defaultmap_no_attr_for_variable : Error< 10279 "variable %0 must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause">; 10280def note_omp_default_dsa_none : Note< 10281 "explicit data sharing attribute requested here">; 10282def note_omp_defaultmap_attr_none : Note< 10283 "explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here">; 10284def err_omp_wrong_dsa : Error< 10285 "%0 variable cannot be %1">; 10286def err_omp_variably_modified_type_not_supported : Error< 10287 "arguments of OpenMP clause '%0' in '#pragma omp %2' directive cannot be of variably-modified type %1">; 10288def note_omp_explicit_dsa : Note< 10289 "defined as %0">; 10290def note_omp_predetermined_dsa : Note< 10291 "%select{static data member is predetermined as shared|" 10292 "variable with static storage duration is predetermined as shared|" 10293 "loop iteration variable is predetermined as private|" 10294 "loop iteration variable is predetermined as linear|" 10295 "loop iteration variable is predetermined as lastprivate|" 10296 "constant variable is predetermined as shared|" 10297 "global variable is predetermined as shared|" 10298 "non-shared variable in a task construct is predetermined as firstprivate|" 10299 "variable with automatic storage duration is predetermined as private}0" 10300 "%select{|; perhaps you forget to enclose 'omp %2' directive into a parallel or another task region?}1">; 10301def note_omp_implicit_dsa : Note< 10302 "implicitly determined as %0">; 10303def err_omp_loop_var_dsa : Error< 10304 "loop iteration variable in the associated loop of 'omp %1' directive may not be %0, predetermined as %2">; 10305def err_omp_not_for : Error< 10306 "%select{statement after '#pragma omp %1' must be a for loop|" 10307 "expected %2 for loops after '#pragma omp %1'%select{|, but found only %4}3}0">; 10308def note_omp_collapse_ordered_expr : Note< 10309 "as specified in %select{'collapse'|'ordered'|'collapse' and 'ordered'}0 clause%select{||s}0">; 10310def err_omp_negative_expression_in_clause : Error< 10311 "argument to '%0' clause must be a %select{non-negative|strictly positive}1 integer value">; 10312def err_omp_not_integral : Error< 10313 "expression must have integral or unscoped enumeration " 10314 "type, not %0">; 10315def err_omp_threadprivate_in_target : Error< 10316 "threadprivate variables cannot be used in target constructs">; 10317def err_omp_incomplete_type : Error< 10318 "expression has incomplete class type %0">; 10319def err_omp_explicit_conversion : Error< 10320 "expression requires explicit conversion from %0 to %1">; 10321def note_omp_conversion_here : Note< 10322 "conversion to %select{integral|enumeration}0 type %1 declared here">; 10323def err_omp_ambiguous_conversion : Error< 10324 "ambiguous conversion from type %0 to an integral or unscoped " 10325 "enumeration type">; 10326def err_omp_iterator_not_integral_or_pointer : Error< 10327 "expected integral or pointer type as the iterator-type, not %0">; 10328def err_omp_iterator_step_not_integral : Error< 10329 "iterator step expression %0 is not the integral expression">; 10330def err_omp_iterator_step_constant_zero : Error< 10331 "iterator step expression %0 evaluates to 0">; 10332def err_omp_required_access : Error< 10333 "%0 variable must be %1">; 10334def err_omp_const_variable : Error< 10335 "const-qualified variable cannot be %0">; 10336def err_omp_const_not_mutable_variable : Error< 10337 "const-qualified variable without mutable fields cannot be %0">; 10338def err_omp_const_list_item : Error< 10339 "const-qualified list item cannot be %0">; 10340def err_omp_linear_incomplete_type : Error< 10341 "a linear variable with incomplete type %0">; 10342def err_omp_linear_expected_int_or_ptr : Error< 10343 "argument of a linear clause should be of integral or pointer " 10344 "type, not %0">; 10345def warn_omp_linear_step_zero : Warning< 10346 "zero linear step (%0 %select{|and other variables in clause }1should probably be const)">, 10347 InGroup<OpenMPClauses>; 10348def warn_omp_alignment_not_power_of_two : Warning< 10349 "aligned clause will be ignored because the requested alignment is not a power of 2">, 10350 InGroup<OpenMPClauses>; 10351def err_omp_invalid_target_decl : Error< 10352 "%0 used in declare target directive is not a variable or a function name">; 10353def err_omp_declare_target_to_and_link : Error< 10354 "%0 must not appear in both clauses 'to' and 'link'">; 10355def warn_omp_not_in_target_context : Warning< 10356 "declaration is not declared in any declare target region">, 10357 InGroup<OpenMPTarget>; 10358def err_omp_function_in_link_clause : Error< 10359 "function name is not allowed in 'link' clause">; 10360def err_omp_aligned_expected_array_or_ptr : Error< 10361 "argument of aligned clause should be array" 10362 "%select{ or pointer|, pointer, reference to array or reference to pointer}1" 10363 ", not %0">; 10364def err_omp_used_in_clause_twice : Error< 10365 "%select{a variable|a parameter|'this'}0 cannot appear in more than one %1 clause">; 10366def err_omp_local_var_in_threadprivate_init : Error< 10367 "variable with local storage in initial value of threadprivate variable">; 10368def err_omp_loop_not_canonical_init : Error< 10369 "initialization clause of OpenMP for loop is not in canonical form " 10370 "('var = init' or 'T var = init')">; 10371def ext_omp_loop_not_canonical_init : ExtWarn< 10372 "initialization clause of OpenMP for loop is not in canonical form " 10373 "('var = init' or 'T var = init')">, InGroup<OpenMPLoopForm>; 10374def err_omp_loop_not_canonical_cond : Error< 10375 "condition of OpenMP for loop must be a relational comparison " 10376 "('<', '<=', '>', %select{or '>='|'>=', or '!='}0) of loop variable %1">; 10377def err_omp_loop_not_canonical_incr : Error< 10378 "increment clause of OpenMP for loop must perform simple addition " 10379 "or subtraction on loop variable %0">; 10380def err_omp_loop_variable_type : Error< 10381 "variable must be of integer or %select{pointer|random access iterator}0 type">; 10382def err_omp_loop_incr_not_compatible : Error< 10383 "increment expression must cause %0 to %select{decrease|increase}1 " 10384 "on each iteration of OpenMP for loop">; 10385def note_omp_loop_cond_requres_compatible_incr : Note< 10386 "loop step is expected to be %select{negative|positive}0 due to this condition">; 10387def err_omp_loop_diff_cxx : Error< 10388 "could not calculate number of iterations calling 'operator-' with " 10389 "upper and lower loop bounds">; 10390def err_omp_loop_cannot_use_stmt : Error< 10391 "'%0' statement cannot be used in OpenMP for loop">; 10392def err_omp_simd_region_cannot_use_stmt : Error< 10393 "'%0' statement cannot be used in OpenMP simd region">; 10394def warn_omp_loop_64_bit_var : Warning< 10395 "OpenMP loop iteration variable cannot have more than 64 bits size and will be narrowed">, 10396 InGroup<OpenMPLoopForm>; 10397def err_omp_unknown_reduction_identifier : Error< 10398 "incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', " 10399 "'&&', '||', 'min' or 'max' or declare reduction for type %0">; 10400def err_omp_not_resolved_reduction_identifier : Error< 10401 "unable to resolve declare reduction construct for type %0">; 10402def err_omp_reduction_ref_type_arg : Error< 10403 "argument of OpenMP clause '%0' must reference the same object in all threads">; 10404def err_omp_clause_not_arithmetic_type_arg : Error< 10405 "arguments of OpenMP clause '%0' for 'min' or 'max' must be of %select{scalar|arithmetic}1 type">; 10406def err_omp_clause_floating_type_arg : Error< 10407 "arguments of OpenMP clause '%0' with bitwise operators cannot be of floating type">; 10408def err_omp_once_referenced : Error< 10409 "variable can appear only once in OpenMP '%0' clause">; 10410def err_omp_once_referenced_in_target_update : Error< 10411 "variable can appear only once in OpenMP 'target update' construct">; 10412def note_omp_referenced : Note< 10413 "previously referenced here">; 10414def err_omp_reduction_in_task : Error< 10415 "reduction variables may not be accessed in an explicit task">; 10416def err_omp_reduction_id_not_compatible : Error< 10417 "list item of type %0 is not valid for specified reduction operation: unable to provide default initialization value">; 10418def err_omp_reduction_identifier_mismatch : Error< 10419 "in_reduction variable must have the same reduction operation as in a task_reduction clause">; 10420def note_omp_previous_reduction_identifier : Note< 10421 "previously marked as task_reduction with different reduction operation">; 10422def err_omp_prohibited_region : Error< 10423 "region cannot be%select{| closely}0 nested inside '%1' region" 10424 "%select{|; perhaps you forget to enclose 'omp %3' directive into a parallel region?|" 10425 "; perhaps you forget to enclose 'omp %3' directive into a for or a parallel for region with 'ordered' clause?|" 10426 "; perhaps you forget to enclose 'omp %3' directive into a target region?|" 10427 "; perhaps you forget to enclose 'omp %3' directive into a teams region?|" 10428 "; perhaps you forget to enclose 'omp %3' directive into a for, simd, for simd, parallel for, or parallel for simd region?}2">; 10429def err_omp_prohibited_region_simd : Error< 10430 "OpenMP constructs may not be nested inside a simd region%select{| except for ordered simd, simd, scan, or atomic directive}0">; 10431def err_omp_prohibited_region_atomic : Error< 10432 "OpenMP constructs may not be nested inside an atomic region">; 10433def err_omp_prohibited_region_critical_same_name : Error< 10434 "cannot nest 'critical' regions having the same name %0">; 10435def note_omp_previous_critical_region : Note< 10436 "previous 'critical' region starts here">; 10437def err_omp_several_directives_in_region : Error< 10438 "exactly one '%0' directive must appear in the loop body of an enclosing directive">; 10439def note_omp_previous_directive : Note< 10440 "previous '%0' directive used here">; 10441def err_omp_sections_not_compound_stmt : Error< 10442 "the statement for '#pragma omp sections' must be a compound statement">; 10443def err_omp_parallel_sections_not_compound_stmt : Error< 10444 "the statement for '#pragma omp parallel sections' must be a compound statement">; 10445def err_omp_orphaned_section_directive : Error< 10446 "%select{orphaned 'omp section' directives are prohibited, it|'omp section' directive}0" 10447 " must be closely nested to a sections region%select{|, not a %1 region}0">; 10448def err_omp_sections_substmt_not_section : Error< 10449 "statement in 'omp sections' directive must be enclosed into a section region">; 10450def err_omp_parallel_sections_substmt_not_section : Error< 10451 "statement in 'omp parallel sections' directive must be enclosed into a section region">; 10452def err_omp_parallel_reduction_in_task_firstprivate : Error< 10453 "argument of a reduction clause of a %0 construct must not appear in a firstprivate clause on a task construct">; 10454def err_omp_atomic_read_not_expression_statement : Error< 10455 "the statement for 'atomic read' must be an expression statement of form 'v = x;'," 10456 " where v and x are both lvalue expressions with scalar type">; 10457def note_omp_atomic_read_write: Note< 10458 "%select{expected an expression statement|expected built-in assignment operator|expected expression of scalar type|expected lvalue expression}0">; 10459def err_omp_atomic_write_not_expression_statement : Error< 10460 "the statement for 'atomic write' must be an expression statement of form 'x = expr;'," 10461 " where x is a lvalue expression with scalar type">; 10462def err_omp_atomic_update_not_expression_statement : Error< 10463 "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'," 10464 " where x is an lvalue expression with scalar type">; 10465def err_omp_atomic_not_expression_statement : Error< 10466 "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'," 10467 " where x is an lvalue expression with scalar type">; 10468def note_omp_atomic_update: Note< 10469 "%select{expected an expression statement|expected built-in binary or unary operator|expected unary decrement/increment operation|" 10470 "expected expression of scalar type|expected assignment expression|expected built-in binary operator|" 10471 "expected one of '+', '*', '-', '/', '&', '^', '%|', '<<', or '>>' built-in operations|expected in right hand side of expression}0">; 10472def err_omp_atomic_capture_not_expression_statement : Error< 10473 "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'," 10474 " where x and v are both lvalue expressions with scalar type">; 10475def err_omp_atomic_capture_not_compound_statement : Error< 10476 "the statement for 'atomic capture' must be a compound statement of form '{v = x; x binop= expr;}', '{x binop= expr; v = x;}'," 10477 " '{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;}'," 10478 " '{v = x; x++;}', '{v = x; ++x;}', '{++x; v = x;}', '{x++; v = x;}', '{v = x; x--;}', '{v = x; --x;}', '{--x; v = x;}', '{x--; v = x;}'" 10479 " where x is an lvalue expression with scalar type">; 10480def note_omp_atomic_capture: Note< 10481 "%select{expected assignment expression|expected compound statement|expected exactly two expression statements|expected in right hand side of the first expression}0">; 10482def err_omp_atomic_several_clauses : Error< 10483 "directive '#pragma omp atomic' cannot contain more than one 'read', 'write', 'update' or 'capture' clause">; 10484def err_omp_several_mem_order_clauses : Error< 10485 "directive '#pragma omp %0' cannot contain more than one %select{'seq_cst', 'relaxed', |}1'acq_rel', 'acquire' or 'release' clause">; 10486def err_omp_atomic_incompatible_mem_order_clause : Error< 10487 "directive '#pragma omp atomic%select{ %0|}1' cannot be used with '%2' clause">; 10488def note_omp_previous_mem_order_clause : Note< 10489 "'%0' clause used here">; 10490def err_omp_target_contains_not_only_teams : Error< 10491 "target construct with nested teams region contains statements outside of the teams construct">; 10492def note_omp_nested_teams_construct_here : Note< 10493 "nested teams construct here">; 10494def note_omp_nested_statement_here : Note< 10495 "%select{statement|directive}0 outside teams construct here">; 10496def err_omp_single_copyprivate_with_nowait : Error< 10497 "the 'copyprivate' clause must not be used with the 'nowait' clause">; 10498def note_omp_nowait_clause_here : Note< 10499 "'nowait' clause is here">; 10500def err_omp_single_decl_in_declare_simd_variant : Error< 10501 "single declaration is expected after 'declare %select{simd|variant}0' directive">; 10502def err_omp_function_expected : Error< 10503 "'#pragma omp declare %select{simd|variant}0' can only be applied to functions">; 10504def err_omp_wrong_cancel_region : Error< 10505 "one of 'for', 'parallel', 'sections' or 'taskgroup' is expected">; 10506def err_omp_parent_cancel_region_nowait : Error< 10507 "parent region for 'omp %select{cancellation point|cancel}0' construct cannot be nowait">; 10508def err_omp_parent_cancel_region_ordered : Error< 10509 "parent region for 'omp %select{cancellation point|cancel}0' construct cannot be ordered">; 10510def 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">; 10511def 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">; 10512def err_omp_declare_reduction_redefinition : Error<"redefinition of user-defined reduction for type %0">; 10513def err_omp_mapper_wrong_type : Error< 10514 "mapper type must be of struct, union or class type">; 10515def err_omp_declare_mapper_wrong_var : Error< 10516 "only variable %0 is allowed in map clauses of this 'omp declare mapper' directive">; 10517def err_omp_declare_mapper_redefinition : Error< 10518 "redefinition of user-defined mapper for type %0 with name %1">; 10519def err_omp_invalid_mapper: Error< 10520 "cannot find a valid user-defined mapper for type %0 with name %1">; 10521def err_omp_array_section_use : Error<"OpenMP array section is not allowed here">; 10522def err_omp_array_shaping_use : Error<"OpenMP array shaping operation is not allowed here">; 10523def err_omp_iterator_use : Error<"OpenMP iterator is not allowed here">; 10524def err_omp_typecheck_section_value : Error< 10525 "subscripted value is not an array or pointer">; 10526def err_omp_typecheck_section_not_integer : Error< 10527 "array section %select{lower bound|length}0 is not an integer">; 10528def err_omp_typecheck_shaping_not_integer : Error< 10529 "array shaping operation dimension is not an integer">; 10530def err_omp_shaping_dimension_not_positive : Error< 10531 "array shaping dimension is evaluated to a non-positive value %0">; 10532def err_omp_section_function_type : Error< 10533 "section of pointer to function type %0">; 10534def warn_omp_section_is_char : Warning<"array section %select{lower bound|length}0 is of type 'char'">, 10535 InGroup<CharSubscript>, DefaultIgnore; 10536def err_omp_section_incomplete_type : Error< 10537 "section of pointer to incomplete type %0">; 10538def err_omp_section_not_subset_of_array : Error< 10539 "array section must be a subset of the original array">; 10540def err_omp_section_length_negative : Error< 10541 "section length is evaluated to a negative value %0">; 10542def err_omp_section_stride_non_positive : Error< 10543 "section stride is evaluated to a non-positive value %0">; 10544def err_omp_section_length_undefined : Error< 10545 "section length is unspecified and cannot be inferred because subscripted value is %select{not an array|an array of unknown bound}0">; 10546def err_omp_wrong_linear_modifier : Error< 10547 "expected %select{'val' modifier|one of 'ref', val' or 'uval' modifiers}0">; 10548def err_omp_wrong_linear_modifier_non_reference : Error< 10549 "variable of non-reference type %0 can be used only with 'val' modifier, but used with '%1'">; 10550def err_omp_wrong_simdlen_safelen_values : Error< 10551 "the value of 'simdlen' parameter must be less than or equal to the value of the 'safelen' parameter">; 10552def err_omp_wrong_if_directive_name_modifier : Error< 10553 "directive name modifier '%0' is not allowed for '#pragma omp %1'">; 10554def err_omp_no_more_if_clause : Error< 10555 "no more 'if' clause is allowed">; 10556def err_omp_unnamed_if_clause : Error< 10557 "expected%select{| one of}0 %1 directive name modifier%select{|s}0">; 10558def note_omp_previous_named_if_clause : Note< 10559 "previous clause with directive name modifier specified here">; 10560def err_omp_ordered_directive_with_param : Error< 10561 "'ordered' directive %select{without any clauses|with 'threads' clause}0 cannot be closely nested inside ordered region with specified parameter">; 10562def err_omp_ordered_directive_without_param : Error< 10563 "'ordered' directive with 'depend' clause cannot be closely nested inside ordered region without specified parameter">; 10564def note_omp_ordered_param : Note< 10565 "'ordered' clause%select{| with specified parameter}0">; 10566def err_omp_expected_base_var_name : Error< 10567 "expected variable name as a base of the array %select{subscript|section}0">; 10568def err_omp_map_shared_storage : Error< 10569 "variable already marked as mapped in current construct">; 10570def err_omp_invalid_map_type_for_directive : Error< 10571 "%select{map type '%1' is not allowed|map type must be specified}0 for '#pragma omp %2'">; 10572def err_omp_invalid_map_type_modifier_for_directive : Error< 10573 "map type modifier '%0' is not allowed for '#pragma omp %1'">; 10574def err_omp_no_clause_for_directive : Error< 10575 "expected at least one %0 clause for '#pragma omp %1'">; 10576def err_omp_threadprivate_in_clause : Error< 10577 "threadprivate variables are not allowed in '%0' clause">; 10578def err_omp_wrong_ordered_loop_count : Error< 10579 "the parameter of the 'ordered' clause must be greater than or equal to the parameter of the 'collapse' clause">; 10580def note_collapse_loop_count : Note< 10581 "parameter of the 'collapse' clause">; 10582def err_omp_clauses_mutually_exclusive : Error< 10583 "'%0' and '%1' clause are mutually exclusive and may not appear on the same directive">; 10584def note_omp_previous_clause : Note< 10585 "'%0' clause is specified here">; 10586def err_omp_hint_clause_no_name : Error< 10587 "the name of the construct must be specified in presence of 'hint' clause">; 10588def err_omp_critical_with_hint : Error< 10589 "constructs with the same name must have a 'hint' clause with the same value">; 10590def note_omp_critical_hint_here : Note< 10591 "%select{|previous }0'hint' clause with value '%1'">; 10592def note_omp_critical_no_hint : Note< 10593 "%select{|previous }0directive with no 'hint' clause specified">; 10594def err_omp_depend_clause_thread_simd : Error< 10595 "'depend' clauses cannot be mixed with '%0' clause">; 10596def err_omp_depend_sink_expected_loop_iteration : Error< 10597 "expected%select{| %1}0 loop iteration variable">; 10598def err_omp_depend_sink_unexpected_expr : Error< 10599 "unexpected expression: number of expressions is larger than the number of associated loops">; 10600def err_omp_depend_sink_expected_plus_minus : Error< 10601 "expected '+' or '-' operation">; 10602def err_omp_taskwait_depend_mutexinoutset_not_allowed : Error< 10603 "'mutexinoutset' modifier not allowed in 'depend' clause on 'taskwait' directive">; 10604def err_omp_depend_sink_source_not_allowed : Error< 10605 "'depend(%select{source|sink:vec}0)' clause%select{|s}0 cannot be mixed with 'depend(%select{sink:vec|source}0)' clause%select{s|}0">; 10606def err_omp_depend_zero_length_array_section_not_allowed : Error< 10607 "zero-length array section is not allowed in 'depend' clause">; 10608def err_omp_depend_sink_source_with_modifier : Error< 10609 "depend modifier cannot be used with 'sink' or 'source' depend type">; 10610def err_omp_depend_modifier_not_iterator : Error< 10611 "expected iterator specification as depend modifier">; 10612def err_omp_linear_ordered : Error< 10613 "'linear' clause cannot be specified along with 'ordered' clause with a parameter">; 10614def err_omp_unexpected_schedule_modifier : Error< 10615 "modifier '%0' cannot be used along with modifier '%1'">; 10616def err_omp_schedule_nonmonotonic_static : Error< 10617 "'nonmonotonic' modifier can only be specified with 'dynamic' or 'guided' schedule kind">; 10618def err_omp_simple_clause_incompatible_with_ordered : Error< 10619 "'%0' clause with '%1' modifier cannot be specified if an 'ordered' clause is specified">; 10620def err_omp_ordered_simd : Error< 10621 "'ordered' clause with a parameter can not be specified in '#pragma omp %0' directive">; 10622def err_omp_variable_in_given_clause_and_dsa : Error< 10623 "%0 variable cannot be in a %1 clause in '#pragma omp %2' directive">; 10624def err_omp_param_or_this_in_clause : Error< 10625 "expected reference to one of the parameters of function %0%select{| or 'this'}1">; 10626def err_omp_expected_uniform_param : Error< 10627 "expected a reference to a parameter specified in a 'uniform' clause">; 10628def err_omp_expected_int_param : Error< 10629 "expected a reference to an integer-typed parameter">; 10630def err_omp_at_least_one_motion_clause_required : Error< 10631 "expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'">; 10632def err_omp_usedeviceptr_not_a_pointer : Error< 10633 "expected pointer or reference to pointer in 'use_device_ptr' clause">; 10634def err_omp_argument_type_isdeviceptr : Error < 10635 "expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'">; 10636def warn_omp_nesting_simd : Warning< 10637 "OpenMP only allows an ordered construct with the simd clause nested in a simd construct">, 10638 InGroup<SourceUsesOpenMP>; 10639def err_omp_orphaned_device_directive : Error< 10640 "orphaned 'omp %0' directives are prohibited" 10641 "; perhaps you forget to enclose the directive into a " 10642 "%select{|||target |teams|for, simd, for simd, parallel for, or parallel for simd }1region?">; 10643def err_omp_reduction_non_addressable_expression : Error< 10644 "expected addressable reduction item for the task-based directives">; 10645def err_omp_reduction_with_nogroup : Error< 10646 "'reduction' clause cannot be used with 'nogroup' clause">; 10647def err_omp_reduction_vla_unsupported : Error< 10648 "cannot generate code for reduction on %select{|array section, which requires a }0variable length array">; 10649def err_omp_linear_distribute_var_non_loop_iteration : Error< 10650 "only loop iteration variables are allowed in 'linear' clause in distribute directives">; 10651def warn_omp_non_trivial_type_mapped : Warning< 10652 "Type %0 is not trivially copyable and not guaranteed to be mapped correctly">, 10653 InGroup<OpenMPMapping>; 10654def err_omp_requires_clause_redeclaration : Error < 10655 "Only one %0 clause can appear on a requires directive in a single translation unit">; 10656def note_omp_requires_previous_clause : Note < 10657 "%0 clause previously used here">; 10658def err_omp_directive_before_requires : Error < 10659 "'%0' region encountered before requires directive with '%1' clause">; 10660def note_omp_requires_encountered_directive : Note < 10661 "'%0' previously encountered here">; 10662def err_omp_invalid_scope : Error < 10663 "'#pragma omp %0' directive must appear only in file scope">; 10664def note_omp_invalid_length_on_this_ptr_mapping : Note < 10665 "expected length on mapping of 'this' array section expression to be '1'">; 10666def note_omp_invalid_lower_bound_on_this_ptr_mapping : Note < 10667 "expected lower bound on mapping of 'this' array section expression to be '0' or not specified">; 10668def note_omp_invalid_subscript_on_this_ptr_map : Note < 10669 "expected 'this' subscript expression on map clause to be 'this[0]'">; 10670def err_omp_invalid_map_this_expr : Error < 10671 "invalid 'this' expression on 'map' clause">; 10672def err_omp_implied_type_not_found : Error< 10673 "'%0' type not found; include <omp.h>">; 10674def err_omp_expected_omp_depend_t_lvalue : Error< 10675 "expected lvalue expression%select{ of 'omp_depend_t' type, not %1|}0">; 10676def err_omp_depobj_expected : Error< 10677 "expected depobj expression">; 10678def err_omp_depobj_single_clause_expected : Error< 10679 "exactly one of 'depend', 'destroy', or 'update' clauses is expected">; 10680def err_omp_scan_single_clause_expected : Error< 10681 "exactly one of 'inclusive' or 'exclusive' clauses is expected">; 10682def err_omp_inclusive_exclusive_not_reduction : Error< 10683 "the list item must appear in 'reduction' clause with the 'inscan' modifier " 10684 "of the parent directive">; 10685def err_omp_reduction_not_inclusive_exclusive : Error< 10686 "the inscan reduction list item must appear as a list item in an 'inclusive' or" 10687 " 'exclusive' clause on an inner 'omp scan' directive">; 10688def err_omp_wrong_inscan_reduction : Error< 10689 "'inscan' modifier can be used only in 'omp for', 'omp simd', 'omp for simd'," 10690 " 'omp parallel for', or 'omp parallel for simd' directive">; 10691def err_omp_inscan_reduction_expected : Error< 10692 "expected 'reduction' clause with the 'inscan' modifier">; 10693def note_omp_previous_inscan_reduction : Note< 10694 "'reduction' clause with 'inscan' modifier is used here">; 10695def err_omp_expected_predefined_allocator : Error< 10696 "expected one of the predefined allocators for the variables with the static " 10697 "storage: 'omp_default_mem_alloc', 'omp_large_cap_mem_alloc', " 10698 "'omp_const_mem_alloc', 'omp_high_bw_mem_alloc', 'omp_low_lat_mem_alloc', " 10699 "'omp_cgroup_mem_alloc', 'omp_pteam_mem_alloc' or 'omp_thread_mem_alloc'">; 10700def warn_omp_used_different_allocator : Warning< 10701 "allocate directive specifies %select{default|'%1'}0 allocator while " 10702 "previously used %select{default|'%3'}2">, 10703 InGroup<OpenMPClauses>; 10704def note_omp_previous_allocator : Note< 10705 "previous allocator is specified here">; 10706def err_expected_allocator_clause : Error<"expected an 'allocator' clause " 10707 "inside of the target region; provide an 'allocator' clause or use 'requires'" 10708 " directive with the 'dynamic_allocators' clause">; 10709def err_expected_allocator_expression : Error<"expected an allocator expression " 10710 "inside of the target region; provide an allocator expression or use 'requires'" 10711 " directive with the 'dynamic_allocators' clause">; 10712def warn_omp_allocate_thread_on_task_target_directive : Warning< 10713 "allocator with the 'thread' trait access has unspecified behavior on '%0' directive">, 10714 InGroup<OpenMPClauses>; 10715def err_omp_expected_private_copy_for_allocate : Error< 10716 "the referenced item is not found in any private clause on the same directive">; 10717def err_omp_stmt_depends_on_loop_counter : Error< 10718 "the loop %select{initializer|condition}0 expression depends on the current loop control variable">; 10719def err_omp_invariant_dependency : Error< 10720 "expected loop invariant expression">; 10721def err_omp_invariant_or_linear_dependency : Error< 10722 "expected loop invariant expression or '<invariant1> * %0 + <invariant2>' kind of expression">; 10723def err_omp_wrong_dependency_iterator_type : Error< 10724 "expected an integer or a pointer type of the outer loop counter '%0' for non-rectangular nests">; 10725def err_target_unsupported_type 10726 : Error<"%0 requires %select{|%2 bit size}1 %3 %select{|return }4type support," 10727 " but target '%5' does not support it">; 10728def err_omp_lambda_capture_in_declare_target_not_to : Error< 10729 "variable captured in declare target region must appear in a to clause">; 10730def err_omp_device_type_mismatch : Error< 10731 "'device_type(%0)' does not match previously specified 'device_type(%1)' for the same declaration">; 10732def err_omp_wrong_device_function_call : Error< 10733 "function with 'device_type(%0)' is not available on %select{device|host}1">; 10734def note_omp_marked_device_type_here : Note<"marked as 'device_type(%0)' here">; 10735def warn_omp_declare_target_after_first_use : Warning< 10736 "declaration marked as declare target after first use, it may lead to incorrect results">, 10737 InGroup<OpenMPTarget>; 10738def err_omp_declare_variant_incompat_attributes : Error< 10739 "'#pragma omp declare variant' is not compatible with any target-specific attributes">; 10740def warn_omp_declare_variant_score_not_constant 10741 : Warning<"score expressions in the OpenMP context selector need to be " 10742 "constant; %0 is not and will be ignored">, 10743 InGroup<SourceUsesOpenMP>; 10744def err_omp_declare_variant_user_condition_not_constant 10745 : Error<"the user condition in the OpenMP context selector needs to be " 10746 "constant; %0 is not">; 10747def warn_omp_declare_variant_after_used : Warning< 10748 "'#pragma omp declare variant' cannot be applied for function after first " 10749 "usage; the original function might be used">, InGroup<SourceUsesOpenMP>; 10750def warn_omp_declare_variant_after_emitted : Warning< 10751 "'#pragma omp declare variant' cannot be applied to the function that was defined already;" 10752 " the original function might be used">, InGroup<SourceUsesOpenMP>; 10753def err_omp_declare_variant_doesnt_support : Error< 10754 "'#pragma omp declare variant' does not " 10755 "support %select{function templates|virtual functions|" 10756 "deduced return types|constructors|destructors|deleted functions|" 10757 "defaulted functions|constexpr functions|consteval function}0">; 10758def err_omp_declare_variant_diff : Error< 10759 "function with '#pragma omp declare variant' has a different %select{calling convention" 10760 "|return type|constexpr specification|inline specification|storage class|" 10761 "linkage}0">; 10762def err_omp_declare_variant_prototype_required : Error< 10763 "function with '#pragma omp declare variant' must have a prototype when " 10764 "'append_args' is used">; 10765def err_omp_interop_type_not_found : Error< 10766 "'omp_interop_t' must be defined when 'append_args' clause is used; include <omp.h>">; 10767def err_omp_declare_variant_incompat_types : Error< 10768 "variant in '#pragma omp declare variant' with type %0 is incompatible with" 10769 " type %1%select{| with appended arguments}2">; 10770def warn_omp_declare_variant_marked_as_declare_variant : Warning< 10771 "variant function in '#pragma omp declare variant' is itself marked as '#pragma omp declare variant'" 10772 >, InGroup<SourceUsesOpenMP>; 10773def note_omp_marked_declare_variant_here : Note<"marked as 'declare variant' here">; 10774def err_omp_one_defaultmap_each_category: Error< 10775 "at most one defaultmap clause for each variable-category can appear on the directive">; 10776def err_omp_lastprivate_conditional_non_scalar : Error< 10777 "expected list item of scalar type in 'lastprivate' clause with 'conditional' modifier" 10778 >; 10779def err_omp_flush_order_clause_and_list : Error< 10780 "'flush' directive with memory order clause '%0' cannot have the list">; 10781def note_omp_flush_order_clause_here : Note< 10782 "memory order clause '%0' is specified here">; 10783def err_omp_non_lvalue_in_map_or_motion_clauses: Error< 10784 "expected addressable lvalue in '%0' clause">; 10785def err_omp_var_expected : Error< 10786 "expected variable of the '%0' type%select{|, not %2}1">; 10787def warn_unknown_declare_variant_isa_trait 10788 : Warning<"isa trait '%0' is not known to the current target; verify the " 10789 "spelling or consider restricting the context selector with the " 10790 "'arch' selector further">, 10791 InGroup<SourceUsesOpenMP>; 10792def err_omp_non_pointer_type_array_shaping_base : Error< 10793 "expected expression with a pointer to a complete type as a base of an array " 10794 "shaping operation">; 10795def err_omp_reduction_task_not_parallel_or_worksharing : Error< 10796 "'reduction' clause with 'task' modifier allowed only on non-simd parallel or" 10797 " worksharing constructs">; 10798def err_omp_expected_array_alloctraits : Error< 10799 "expected constant sized array of 'omp_alloctrait_t' elements, not %0">; 10800def err_omp_predefined_allocator_with_traits : Error< 10801 "predefined allocator cannot have traits specified">; 10802def note_omp_predefined_allocator : Note< 10803 "predefined trait '%0' used here">; 10804def err_omp_nonpredefined_allocator_without_traits : Error< 10805 "non-predefined allocator must have traits specified">; 10806def err_omp_allocator_used_in_clauses : Error< 10807 "allocators used in 'uses_allocators' clause cannot appear in other " 10808 "data-sharing or data-mapping attribute clauses">; 10809def err_omp_allocator_not_in_uses_allocators : Error< 10810 "allocator must be specified in the 'uses_allocators' clause">; 10811def note_omp_protected_structured_block 10812 : Note<"jump bypasses OpenMP structured block">; 10813def note_omp_exits_structured_block 10814 : Note<"jump exits scope of OpenMP structured block">; 10815def err_omp_lastprivate_loop_var_non_loop_iteration : Error< 10816 "only loop iteration variables are allowed in 'lastprivate' clause in " 10817 "'omp loop' directives">; 10818def err_omp_interop_variable_expected : Error< 10819 "expected%select{| non-const}0 variable of type 'omp_interop_t'">; 10820def err_omp_interop_variable_wrong_type : Error< 10821 "interop variable must be of type 'omp_interop_t'">; 10822def err_omp_interop_prefer_type : Error< 10823 "prefer_list item must be a string literal or constant integral " 10824 "expression">; 10825def err_omp_interop_bad_depend_clause : Error< 10826 "'depend' clause requires the 'targetsync' interop type">; 10827def err_omp_interop_var_multiple_actions : Error< 10828 "interop variable %0 used in multiple action clauses">; 10829def err_omp_dispatch_statement_call 10830 : Error<"statement after '#pragma omp dispatch' must be a direct call" 10831 " to a target function or an assignment to one">; 10832def err_omp_unroll_full_variable_trip_count : Error< 10833 "loop to be fully unrolled must have a constant trip count">; 10834def note_omp_directive_here : Note<"'%0' directive found here">; 10835def err_omp_instantiation_not_supported 10836 : Error<"instantiation of '%0' not supported yet">; 10837def err_omp_adjust_arg_multiple_clauses : Error< 10838 "'adjust_arg' argument %0 used in multiple clauses">; 10839def err_omp_clause_requires_dispatch_construct : Error< 10840 "'%0' clause requires 'dispatch' context selector">; 10841def err_omp_append_args_with_varargs : Error< 10842 "'append_args' is not allowed with varargs functions">; 10843} // end of OpenMP category 10844 10845let CategoryName = "Related Result Type Issue" in { 10846// Objective-C related result type compatibility 10847def warn_related_result_type_compatibility_class : Warning< 10848 "method is expected to return an instance of its class type " 10849 "%diff{$, but is declared to return $|" 10850 ", but is declared to return different type}0,1">; 10851def warn_related_result_type_compatibility_protocol : Warning< 10852 "protocol method is expected to return an instance of the implementing " 10853 "class, but is declared to return %0">; 10854def note_related_result_type_family : Note< 10855 "%select{overridden|current}0 method is part of the '%select{|alloc|copy|init|" 10856 "mutableCopy|new|autorelease|dealloc|finalize|release|retain|retainCount|" 10857 "self}1' method family%select{| and is expected to return an instance of its " 10858 "class type}0">; 10859def note_related_result_type_overridden : Note< 10860 "overridden method returns an instance of its class type">; 10861def note_related_result_type_inferred : Note< 10862 "%select{class|instance}0 method %1 is assumed to return an instance of " 10863 "its receiver type (%2)">; 10864def note_related_result_type_explicit : Note< 10865 "%select{overridden|current}0 method is explicitly declared 'instancetype'" 10866 "%select{| and is expected to return an instance of its class type}0">; 10867def err_invalid_type_for_program_scope_var : Error< 10868 "the %0 type cannot be used to declare a program scope variable">; 10869 10870} 10871 10872let CategoryName = "Modules Issue" in { 10873def err_module_decl_in_module_map_module : Error< 10874 "'module' declaration found while building module from module map">; 10875def err_module_decl_in_header_module : Error< 10876 "'module' declaration found while building header unit">; 10877def err_module_interface_implementation_mismatch : Error< 10878 "missing 'export' specifier in module declaration while " 10879 "building module interface">; 10880def err_current_module_name_mismatch : Error< 10881 "module name '%0' specified on command line does not match name of module">; 10882def err_module_redefinition : Error< 10883 "redefinition of module '%0'">; 10884def note_prev_module_definition : Note<"previously defined here">; 10885def note_prev_module_definition_from_ast_file : Note<"module loaded from '%0'">; 10886def err_module_not_defined : Error< 10887 "definition of module '%0' is not available; use -fmodule-file= to specify " 10888 "path to precompiled module interface">; 10889def err_module_redeclaration : Error< 10890 "translation unit contains multiple module declarations">; 10891def note_prev_module_declaration : Note<"previous module declaration is here">; 10892def err_module_declaration_missing : Error< 10893 "missing 'export module' declaration in module interface unit">; 10894def err_module_declaration_missing_after_global_module_introducer : Error< 10895 "missing 'module' declaration at end of global module fragment " 10896 "introduced here">; 10897def err_module_private_specialization : Error< 10898 "%select{template|partial|member}0 specialization cannot be " 10899 "declared __module_private__">; 10900def err_module_private_local : Error< 10901 "%select{local variable|parameter|typedef}0 %1 cannot be declared " 10902 "__module_private__">; 10903def err_module_private_local_class : Error< 10904 "local %select{struct|interface|union|class|enum}0 cannot be declared " 10905 "__module_private__">; 10906def err_module_unimported_use : Error< 10907 "%select{declaration|definition|default argument|" 10908 "explicit specialization|partial specialization}0 of %1 must be imported " 10909 "from module '%2' before it is required">; 10910def err_module_unimported_use_header : Error< 10911 "%select{missing '#include'|missing '#include %3'}2; " 10912 "%select{||default argument of |explicit specialization of |" 10913 "partial specialization of }0%1 must be " 10914 "%select{declared|defined|defined|declared|declared}0 " 10915 "before it is used">; 10916def err_module_unimported_use_multiple : Error< 10917 "%select{declaration|definition|default argument|" 10918 "explicit specialization|partial specialization}0 of %1 must be imported " 10919 "from one of the following modules before it is required:%2">; 10920def note_unreachable_entity : Note< 10921 "%select{declaration|definition|default argument declared|" 10922 "explicit specialization declared|partial specialization declared}0 here " 10923 "is not %select{visible|reachable|reachable|reachable|reachable|reachable}0">; 10924def ext_module_import_in_extern_c : ExtWarn< 10925 "import of C++ module '%0' appears within extern \"C\" language linkage " 10926 "specification">, DefaultError, 10927 InGroup<DiagGroup<"module-import-in-extern-c">>; 10928def err_module_import_not_at_top_level_fatal : Error< 10929 "import of module '%0' appears within %1">, DefaultFatal; 10930def ext_module_import_not_at_top_level_noop : ExtWarn< 10931 "redundant #include of module '%0' appears within %1">, DefaultError, 10932 InGroup<DiagGroup<"modules-import-nested-redundant">>; 10933def note_module_import_not_at_top_level : Note<"%0 begins here">; 10934def err_module_self_import : Error< 10935 "import of module '%0' appears within same top-level module '%1'">; 10936def err_module_import_in_implementation : Error< 10937 "@import of module '%0' in implementation of '%1'; use #import">; 10938 10939// C++ Modules 10940def err_module_decl_not_at_start : Error< 10941 "module declaration must occur at the start of the translation unit">; 10942def note_global_module_introducer_missing : Note< 10943 "add 'module;' to the start of the file to introduce a " 10944 "global module fragment">; 10945def err_export_within_anonymous_namespace : Error< 10946 "export declaration appears within anonymous namespace">; 10947def note_anonymous_namespace : Note<"anonymous namespace begins here">; 10948def ext_export_no_name_block : ExtWarn< 10949 "ISO C++20 does not permit %select{an empty|a static_assert}0 declaration " 10950 "to appear in an export block">, InGroup<ExportUnnamed>; 10951def ext_export_no_names : ExtWarn< 10952 "ISO C++20 does not permit a declaration that does not introduce any names " 10953 "to be exported">, InGroup<ExportUnnamed>; 10954def note_export : Note<"export block begins here">; 10955def err_export_no_name : Error< 10956 "%select{empty|static_assert|asm}0 declaration cannot be exported">; 10957def ext_export_using_directive : ExtWarn< 10958 "ISO C++20 does not permit using directive to be exported">, 10959 InGroup<DiagGroup<"export-using-directive">>; 10960def err_export_within_export : Error< 10961 "export declaration appears within another export declaration">; 10962def err_export_internal : Error< 10963 "declaration of %0 with internal linkage cannot be exported">; 10964def err_export_using_internal : Error< 10965 "using declaration referring to %0 with internal linkage cannot be exported">; 10966def err_export_not_in_module_interface : Error< 10967 "export declaration can only be used within a module interface unit" 10968 "%select{ after the module declaration|}0">; 10969def err_export_in_private_module_fragment : Error< 10970 "export declaration cannot be used in a private module fragment">; 10971def note_private_module_fragment : Note< 10972 "private module fragment begins here">; 10973def err_private_module_fragment_not_module : Error< 10974 "private module fragment declaration with no preceding module declaration">; 10975def err_private_module_fragment_redefined : Error< 10976 "private module fragment redefined">; 10977def err_private_module_fragment_not_module_interface : Error< 10978 "private module fragment in module implementation unit">; 10979def note_not_module_interface_add_export : Note< 10980 "add 'export' here if this is intended to be a module interface unit">; 10981 10982def ext_equivalent_internal_linkage_decl_in_modules : ExtWarn< 10983 "ambiguous use of internal linkage declaration %0 defined in multiple modules">, 10984 InGroup<DiagGroup<"modules-ambiguous-internal-linkage">>; 10985def note_equivalent_internal_linkage_decl : Note< 10986 "declared here%select{ in module '%1'|}0">; 10987 10988def note_redefinition_modules_same_file : Note< 10989 "'%0' included multiple times, additional include site in header from module '%1'">; 10990def note_redefinition_include_same_file : Note< 10991 "'%0' included multiple times, additional include site here">; 10992} 10993 10994let CategoryName = "Coroutines Issue" in { 10995def err_return_in_coroutine : Error< 10996 "return statement not allowed in coroutine; did you mean 'co_return'?">; 10997def note_declared_coroutine_here : Note< 10998 "function is a coroutine due to use of '%0' here">; 10999def err_coroutine_objc_method : Error< 11000 "Objective-C methods as coroutines are not yet supported">; 11001def err_coroutine_unevaluated_context : Error< 11002 "'%0' cannot be used in an unevaluated context">; 11003def err_coroutine_within_handler : Error< 11004 "'%0' cannot be used in the handler of a try block">; 11005def err_coroutine_outside_function : Error< 11006 "'%0' cannot be used outside a function">; 11007def err_coroutine_invalid_func_context : Error< 11008 "'%1' cannot be used in %select{a constructor|a destructor" 11009 "|the 'main' function|a constexpr function" 11010 "|a function with a deduced return type|a varargs function" 11011 "|a consteval function}0">; 11012def err_implied_coroutine_type_not_found : Error< 11013 "%0 type was not found; include <coroutine> before defining " 11014 "a coroutine; include <experimental/coroutine> if your version " 11015 "of libcxx is less than 14.0">; 11016def warn_deprecated_coroutine_namespace : Warning< 11017 "Please move from std::experimental::%0 to std::%0. " 11018 "Support for std::experimental::%0 will be removed in LLVM 15.">, 11019 InGroup<DeprecatedExperimentalCoroutine>; 11020def err_mixed_use_std_and_experimental_namespace_for_coroutine : Error < 11021 "Found mixed use of std namespace and std::experimental namespace for " 11022 "coroutine, which is disallowed. The coroutine components in " 11023 "std::experimental namespace is deprecated. Please use coroutine components " 11024 "under std namespace.">; 11025def err_implicit_coroutine_std_nothrow_type_not_found : Error< 11026 "std::nothrow was not found; include <new> before defining a coroutine which " 11027 "uses get_return_object_on_allocation_failure()">; 11028def err_malformed_std_nothrow : Error< 11029 "std::nothrow must be a valid variable declaration">; 11030def err_malformed_std_coroutine_handle : Error< 11031 "std::coroutine_handle isn't a class template">; 11032def err_coroutine_handle_missing_member : Error< 11033 "std::coroutine_handle must have a member named '%0'">; 11034def err_malformed_std_coroutine_traits : Error< 11035 "std::coroutine_traits isn't a class template">; 11036def err_implied_std_coroutine_traits_promise_type_not_found : Error< 11037 "this function cannot be a coroutine: %q0 has no member named 'promise_type'">; 11038def err_implied_std_coroutine_traits_promise_type_not_class : Error< 11039 "this function cannot be a coroutine: %0 is not a class">; 11040def err_coroutine_promise_type_incomplete : Error< 11041 "this function cannot be a coroutine: %0 is an incomplete type">; 11042def err_coroutine_type_missing_specialization : Error< 11043 "this function cannot be a coroutine: missing definition of " 11044 "specialization %0">; 11045def err_coroutine_promise_incompatible_return_functions : Error< 11046 "the coroutine promise type %0 declares both 'return_value' and 'return_void'">; 11047def err_coroutine_promise_requires_return_function : Error< 11048 "the coroutine promise type %0 must declare either 'return_value' or 'return_void'">; 11049def note_coroutine_promise_implicit_await_transform_required_here : Note< 11050 "call to 'await_transform' implicitly required by 'co_await' here">; 11051def note_coroutine_promise_suspend_implicitly_required : Note< 11052 "call to '%select{initial_suspend|final_suspend}0' implicitly " 11053 "required by the %select{initial suspend point|final suspend point}0">; 11054def err_coroutine_promise_unhandled_exception_required : Error< 11055 "%0 is required to declare the member 'unhandled_exception()'">; 11056def warn_coroutine_promise_unhandled_exception_required_with_exceptions : Warning< 11057 "%0 is required to declare the member 'unhandled_exception()' when exceptions are enabled">, 11058 InGroup<CoroutineMissingUnhandledException>; 11059def err_coroutine_promise_get_return_object_on_allocation_failure : Error< 11060 "%0: 'get_return_object_on_allocation_failure()' must be a static member function">; 11061def err_seh_in_a_coroutine_with_cxx_exceptions : Error< 11062 "cannot use SEH '__try' in a coroutine when C++ exceptions are enabled">; 11063def err_coroutine_promise_new_requires_nothrow : Error< 11064 "%0 is required to have a non-throwing noexcept specification when the promise " 11065 "type declares 'get_return_object_on_allocation_failure()'">; 11066def note_coroutine_promise_call_implicitly_required : Note< 11067 "call to %0 implicitly required by coroutine function here">; 11068def err_await_suspend_invalid_return_type : Error< 11069 "return type of 'await_suspend' is required to be 'void' or 'bool' (have %0)" 11070>; 11071def note_await_ready_no_bool_conversion : Note< 11072 "return type of 'await_ready' is required to be contextually convertible to 'bool'" 11073>; 11074def warn_coroutine_handle_address_invalid_return_type : Warning < 11075 "return type of 'coroutine_handle<>::address should be 'void*' (have %0) in order to get capability with existing async C API.">, 11076 InGroup<Coroutine>; 11077def err_coroutine_promise_final_suspend_requires_nothrow : Error< 11078 "the expression 'co_await __promise.final_suspend()' is required to be non-throwing" 11079>; 11080def note_coroutine_function_declare_noexcept : Note< 11081 "must be declared with 'noexcept'" 11082>; 11083} // end of coroutines issue category 11084 11085let CategoryName = "Documentation Issue" in { 11086def warn_not_a_doxygen_trailing_member_comment : Warning< 11087 "not a Doxygen trailing comment">, InGroup<Documentation>, DefaultIgnore; 11088} // end of documentation issue category 11089 11090let CategoryName = "Nullability Issue" in { 11091 11092def warn_mismatched_nullability_attr : Warning< 11093 "nullability specifier %0 conflicts with existing specifier %1">, 11094 InGroup<Nullability>; 11095 11096def warn_nullability_declspec : Warning< 11097 "nullability specifier %0 cannot be applied " 11098 "to non-pointer type %1; did you mean to apply the specifier to the " 11099 "%select{pointer|block pointer|member pointer|function pointer|" 11100 "member function pointer}2?">, 11101 InGroup<NullabilityDeclSpec>, 11102 DefaultError; 11103 11104def note_nullability_here : Note<"%0 specified here">; 11105 11106def err_nullability_nonpointer : Error< 11107 "nullability specifier %0 cannot be applied to non-pointer type %1">; 11108 11109def warn_nullability_lost : Warning< 11110 "implicit conversion from nullable pointer %0 to non-nullable pointer " 11111 "type %1">, 11112 InGroup<NullableToNonNullConversion>, DefaultIgnore; 11113def warn_zero_as_null_pointer_constant : Warning< 11114 "zero as null pointer constant">, 11115 InGroup<DiagGroup<"zero-as-null-pointer-constant">>, DefaultIgnore; 11116 11117def err_nullability_cs_multilevel : Error< 11118 "nullability keyword %0 cannot be applied to multi-level pointer type %1">; 11119def note_nullability_type_specifier : Note< 11120 "use nullability type specifier %0 to affect the innermost " 11121 "pointer type of %1">; 11122 11123def warn_null_resettable_setter : Warning< 11124 "synthesized setter %0 for null_resettable property %1 does not handle nil">, 11125 InGroup<Nullability>; 11126 11127def warn_nullability_missing : Warning< 11128 "%select{pointer|block pointer|member pointer}0 is missing a nullability " 11129 "type specifier (_Nonnull, _Nullable, or _Null_unspecified)">, 11130 InGroup<NullabilityCompleteness>; 11131def warn_nullability_missing_array : Warning< 11132 "array parameter is missing a nullability type specifier (_Nonnull, " 11133 "_Nullable, or _Null_unspecified)">, 11134 InGroup<NullabilityCompletenessOnArrays>; 11135def note_nullability_fix_it : Note< 11136 "insert '%select{_Nonnull|_Nullable|_Null_unspecified}0' if the " 11137 "%select{pointer|block pointer|member pointer|array parameter}1 " 11138 "%select{should never be null|may be null|should not declare nullability}0">; 11139 11140def warn_nullability_inferred_on_nested_type : Warning< 11141 "inferring '_Nonnull' for pointer type within %select{array|reference}0 is " 11142 "deprecated">, 11143 InGroup<NullabilityInferredOnNestedType>; 11144 11145def err_objc_type_arg_explicit_nullability : Error< 11146 "type argument %0 cannot explicitly specify nullability">; 11147 11148def err_objc_type_param_bound_explicit_nullability : Error< 11149 "type parameter %0 bound %1 cannot explicitly specify nullability">; 11150 11151} 11152 11153let CategoryName = "Generics Issue" in { 11154 11155def err_objc_type_param_bound_nonobject : Error< 11156 "type bound %0 for type parameter %1 is not an Objective-C pointer type">; 11157 11158def err_objc_type_param_bound_missing_pointer : Error< 11159 "missing '*' in type bound %0 for type parameter %1">; 11160def err_objc_type_param_bound_qualified : Error< 11161 "type bound %1 for type parameter %0 cannot be qualified with '%2'">; 11162 11163def err_objc_type_param_redecl : Error< 11164 "redeclaration of type parameter %0">; 11165 11166def err_objc_type_param_arity_mismatch : Error< 11167 "%select{forward class declaration|class definition|category|extension}0 has " 11168 "too %select{few|many}1 type parameters (expected %2, have %3)">; 11169 11170def err_objc_type_param_bound_conflict : Error< 11171 "type bound %0 for type parameter %1 conflicts with " 11172 "%select{implicit|previous}2 bound %3%select{for type parameter %5|}4">; 11173 11174def err_objc_type_param_variance_conflict : Error< 11175 "%select{in|co|contra}0variant type parameter %1 conflicts with previous " 11176 "%select{in|co|contra}2variant type parameter %3">; 11177 11178def note_objc_type_param_here : Note<"type parameter %0 declared here">; 11179 11180def err_objc_type_param_bound_missing : Error< 11181 "missing type bound %0 for type parameter %1 in %select{@interface|@class}2">; 11182 11183def err_objc_parameterized_category_nonclass : Error< 11184 "%select{extension|category}0 of non-parameterized class %1 cannot have type " 11185 "parameters">; 11186 11187def err_objc_parameterized_forward_class : Error< 11188 "forward declaration of non-parameterized class %0 cannot have type " 11189 "parameters">; 11190 11191def err_objc_parameterized_forward_class_first : Error< 11192 "class %0 previously declared with type parameters">; 11193 11194def err_objc_type_arg_missing_star : Error< 11195 "type argument %0 must be a pointer (requires a '*')">; 11196def err_objc_type_arg_qualified : Error< 11197 "type argument %0 cannot be qualified with '%1'">; 11198 11199def err_objc_type_arg_missing : Error< 11200 "no type or protocol named %0">; 11201 11202def err_objc_type_args_and_protocols : Error< 11203 "angle brackets contain both a %select{type|protocol}0 (%1) and a " 11204 "%select{protocol|type}0 (%2)">; 11205 11206def err_objc_type_args_non_class : Error< 11207 "type arguments cannot be applied to non-class type %0">; 11208 11209def err_objc_type_args_non_parameterized_class : Error< 11210 "type arguments cannot be applied to non-parameterized class %0">; 11211 11212def err_objc_type_args_specialized_class : Error< 11213 "type arguments cannot be applied to already-specialized class type %0">; 11214 11215def err_objc_type_args_wrong_arity : Error< 11216 "too %select{many|few}0 type arguments for class %1 (have %2, expected %3)">; 11217} 11218 11219def err_objc_type_arg_not_id_compatible : Error< 11220 "type argument %0 is neither an Objective-C object nor a block type">; 11221 11222def err_objc_type_arg_does_not_match_bound : Error< 11223 "type argument %0 does not satisfy the bound (%1) of type parameter %2">; 11224 11225def warn_objc_redundant_qualified_class_type : Warning< 11226 "parameterized class %0 already conforms to the protocols listed; did you " 11227 "forget a '*'?">, InGroup<ObjCProtocolQualifiers>; 11228 11229def warn_block_literal_attributes_on_omitted_return_type : Warning< 11230 "attribute %0 ignored, because it cannot be applied to omitted return type">, 11231 InGroup<IgnoredAttributes>; 11232 11233def warn_block_literal_qualifiers_on_omitted_return_type : Warning< 11234 "'%0' qualifier on omitted return type %1 has no effect">, 11235 InGroup<IgnoredQualifiers>; 11236 11237def warn_shadow_field : Warning< 11238 "%select{parameter|non-static data member}3 %0 %select{|of %1 }3shadows " 11239 "member inherited from type %2">, InGroup<ShadowField>, DefaultIgnore; 11240def note_shadow_field : Note<"declared here">; 11241 11242def err_multiversion_required_in_redecl : Error< 11243 "function declaration is missing %select{'target'|'cpu_specific' or " 11244 "'cpu_dispatch'}0 attribute in a multiversioned function">; 11245def note_multiversioning_caused_here : Note< 11246 "function multiversioning caused by this declaration">; 11247def err_multiversion_after_used : Error< 11248 "function declaration cannot become a multiversioned function after first " 11249 "usage">; 11250def err_bad_multiversion_option : Error< 11251 "function multiversioning doesn't support %select{feature|architecture}0 " 11252 "'%1'">; 11253def err_multiversion_duplicate : Error< 11254 "multiversioned function redeclarations require identical target attributes">; 11255def err_multiversion_noproto : Error< 11256 "multiversioned function must have a prototype">; 11257def err_multiversion_disallowed_other_attr : Error< 11258 "attribute '%select{target|cpu_specific|cpu_dispatch}0' multiversioning cannot be combined" 11259 " with attribute %1">; 11260def err_multiversion_mismatched_attrs 11261 : Error<"attributes on multiversioned functions must all match, attribute " 11262 "%0 %select{is missing|has different arguments}1">; 11263def err_multiversion_diff : Error< 11264 "multiversioned function declaration has a different %select{calling convention" 11265 "|return type|constexpr specification|inline specification|linkage|" 11266 "language linkage}0">; 11267def err_multiversion_doesnt_support : Error< 11268 "attribute '%select{target|cpu_specific|cpu_dispatch}0' multiversioned functions do not " 11269 "yet support %select{function templates|virtual functions|" 11270 "deduced return types|constructors|destructors|deleted functions|" 11271 "defaulted functions|constexpr functions|consteval function}1">; 11272def err_multiversion_not_allowed_on_main : Error< 11273 "'main' cannot be a multiversioned function">; 11274def err_multiversion_not_supported : Error< 11275 "function multiversioning is not supported on the current target">; 11276def err_multiversion_types_mixed : Error< 11277 "multiversioning attributes cannot be combined">; 11278def err_cpu_dispatch_mismatch : Error< 11279 "'cpu_dispatch' function redeclared with different CPUs">; 11280def err_cpu_specific_multiple_defs : Error< 11281 "multiple 'cpu_specific' functions cannot specify the same CPU: %0">; 11282def warn_multiversion_duplicate_entries : Warning< 11283 "CPU list contains duplicate entries; attribute ignored">, 11284 InGroup<FunctionMultiVersioning>; 11285def warn_dispatch_body_ignored : Warning< 11286 "body of cpu_dispatch function will be ignored">, 11287 InGroup<FunctionMultiVersioning>; 11288 11289// three-way comparison operator diagnostics 11290def err_implied_comparison_category_type_not_found : Error< 11291 "cannot %select{use builtin operator '<=>'|default 'operator<=>'}1 " 11292 "because type '%0' was not found; include <compare>">; 11293def err_spaceship_argument_narrowing : Error< 11294 "argument to 'operator<=>' " 11295 "%select{cannot be narrowed from type %1 to %2|" 11296 "evaluates to %1, which cannot be narrowed to type %2}0">; 11297def err_std_compare_type_not_supported : Error< 11298 "standard library implementation of %0 is not supported; " 11299 "%select{member '%2' does not have expected form|" 11300 "member '%2' is missing|" 11301 "the type is not trivially copyable|" 11302 "the type does not have the expected form}1">; 11303def note_rewriting_operator_as_spaceship : Note< 11304 "while rewriting comparison as call to 'operator<=>' declared here">; 11305def err_three_way_vector_comparison : Error< 11306 "three-way comparison between vectors is not supported">; 11307 11308// Memory Tagging Extensions (MTE) diagnostics 11309def err_memtag_arg_null_or_pointer : Error< 11310 "%0 argument of MTE builtin function must be a null or a pointer (%1 invalid)">; 11311def err_memtag_any2arg_pointer : Error< 11312 "at least one argument of MTE builtin function must be a pointer (%0, %1 invalid)">; 11313def err_memtag_arg_must_be_pointer : Error< 11314 "%0 argument of MTE builtin function must be a pointer (%1 invalid)">; 11315def err_memtag_arg_must_be_integer : Error< 11316 "%0 argument of MTE builtin function must be an integer type (%1 invalid)">; 11317 11318def warn_dereference_of_noderef_type : Warning< 11319 "dereferencing %0; was declared with a 'noderef' type">, InGroup<NoDeref>; 11320def warn_dereference_of_noderef_type_no_decl : Warning< 11321 "dereferencing expression marked as 'noderef'">, InGroup<NoDeref>; 11322def warn_noderef_on_non_pointer_or_array : Warning< 11323 "'noderef' can only be used on an array or pointer type">, InGroup<IgnoredAttributes>; 11324def warn_noderef_to_dereferenceable_pointer : Warning< 11325 "casting to dereferenceable pointer removes 'noderef' attribute">, InGroup<NoDeref>; 11326 11327def err_builtin_launder_invalid_arg : Error< 11328 "%select{non-pointer|function pointer|void pointer}0 argument to " 11329 "'__builtin_launder' is not allowed">; 11330 11331def err_builtin_invalid_arg_type: Error < 11332 "%ordinal0 argument must be a " 11333 "%select{vector, integer or floating point type|matrix|" 11334 "pointer to a valid matrix element type|" 11335 "signed integer or floating point type|vector type}1 (was %2)">; 11336 11337def err_builtin_matrix_disabled: Error< 11338 "matrix types extension is disabled. Pass -fenable-matrix to enable it">; 11339def err_matrix_index_not_integer: Error< 11340 "matrix %select{row|column}0 index is not an integer">; 11341def err_matrix_index_outside_range: Error< 11342 "matrix %select{row|column}0 index is outside the allowed range [0, %1)">; 11343def err_matrix_incomplete_index: Error< 11344 "single subscript expressions are not allowed for matrix values">; 11345def err_matrix_separate_incomplete_index: Error< 11346 "matrix row and column subscripts cannot be separated by any expression">; 11347def err_matrix_subscript_comma: Error< 11348 "comma expressions are not allowed as indices in matrix subscript expressions">; 11349def err_builtin_matrix_scalar_unsigned_arg: Error< 11350 "%0 argument must be a constant unsigned integer expression">; 11351def err_builtin_matrix_pointer_arg_mismatch: Error< 11352 "the pointee of the 2nd argument must match the element type of the 1st argument (%0 != %1)">; 11353def err_builtin_matrix_store_to_const: Error< 11354 "cannot store matrix to read-only pointer">; 11355def err_builtin_matrix_stride_too_small: Error< 11356 "stride must be greater or equal to the number of rows">; 11357def err_builtin_matrix_invalid_dimension: Error< 11358 "%0 dimension is outside the allowed range [1, %1]">; 11359 11360def warn_mismatched_import : Warning< 11361 "import %select{module|name}0 (%1) does not match the import %select{module|name}0 (%2) of the " 11362 "previous declaration">, 11363 InGroup<IgnoredAttributes>; 11364def warn_import_on_definition : Warning< 11365 "import %select{module|name}0 cannot be applied to a function with a definition">, 11366 InGroup<IgnoredAttributes>; 11367 11368def err_preserve_field_info_not_field : Error< 11369 "__builtin_preserve_field_info argument %0 not a field access">; 11370def err_preserve_field_info_not_const: Error< 11371 "__builtin_preserve_field_info argument %0 not a constant">; 11372def err_btf_type_id_not_const: Error< 11373 "__builtin_btf_type_id argument %0 not a constant">; 11374def err_preserve_type_info_invalid : Error< 11375 "__builtin_preserve_type_info argument %0 invalid">; 11376def err_preserve_type_info_not_const: Error< 11377 "__builtin_preserve_type_info argument %0 not a constant">; 11378def err_preserve_enum_value_invalid : Error< 11379 "__builtin_preserve_enum_value argument %0 invalid">; 11380def err_preserve_enum_value_not_const: Error< 11381 "__builtin_preserve_enum_value argument %0 not a constant">; 11382 11383def err_bit_cast_non_trivially_copyable : Error< 11384 "__builtin_bit_cast %select{source|destination}0 type must be trivially copyable">; 11385def err_bit_cast_type_size_mismatch : Error< 11386 "__builtin_bit_cast source size does not equal destination size (%0 vs %1)">; 11387 11388// SYCL-specific diagnostics 11389def warn_sycl_kernel_num_of_template_params : Warning< 11390 "'sycl_kernel' attribute only applies to a function template with at least" 11391 " two template parameters">, InGroup<IgnoredAttributes>; 11392def warn_sycl_kernel_invalid_template_param_type : Warning< 11393 "template parameter of a function template with the 'sycl_kernel' attribute" 11394 " cannot be a non-type template parameter">, InGroup<IgnoredAttributes>; 11395def warn_sycl_kernel_num_of_function_params : Warning< 11396 "function template with 'sycl_kernel' attribute must have a single parameter">, 11397 InGroup<IgnoredAttributes>; 11398def warn_sycl_kernel_return_type : Warning< 11399 "function template with 'sycl_kernel' attribute must have a 'void' return type">, 11400 InGroup<IgnoredAttributes>; 11401 11402def err_ext_int_bad_size : Error<"%select{signed|unsigned}0 _ExtInt must " 11403 "have a bit size of at least %select{2|1}0">; 11404def err_ext_int_max_size : Error<"%select{signed|unsigned}0 _ExtInt of bit " 11405 "sizes greater than %1 not supported">; 11406 11407// errors of expect.with.probability 11408def err_probability_not_constant_float : Error< 11409 "probability argument to __builtin_expect_with_probability must be constant " 11410 "floating-point expression">; 11411def err_probability_out_of_range : Error< 11412 "probability argument to __builtin_expect_with_probability is outside the " 11413 "range [0.0, 1.0]">; 11414 11415// TCB warnings 11416def err_tcb_conflicting_attributes : Error< 11417 "attributes '%0(\"%2\")' and '%1(\"%2\")' are mutually exclusive">; 11418def warn_tcb_enforcement_violation : Warning< 11419 "calling %0 is a violation of trusted computing base '%1'">, 11420 InGroup<DiagGroup<"tcb-enforcement">>; 11421 11422// RISC-V builtin required extension warning 11423def err_riscv_builtin_requires_extension : Error< 11424 "builtin requires '%0' extension support to be enabled">; 11425def err_riscv_builtin_invalid_lmul : Error< 11426 "LMUL argument must be in the range [0,3] or [5,7]">; 11427} // end of sema component. 11428