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