PageRenderTime 32ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/include/clang/Basic/DiagnosticSemaKinds.td

https://bitbucket.org/danchr/clang
Unknown | 3166 lines | 2969 code | 197 blank | 0 comment | 0 complexity | 843804699b53431aec84986d4b94b16e MD5 | raw file
Possible License(s): JSON
  1. //==--- DiagnosticSemaKinds.td - libsema diagnostics ----------------------===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is distributed under the University of Illinois Open Source
  6. // License. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. //===----------------------------------------------------------------------===//
  10. // Semantic Analysis
  11. //===----------------------------------------------------------------------===//
  12. let Component = "Sema" in {
  13. let CategoryName = "Semantic Issue" in {
  14. // Constant expressions
  15. def err_expr_not_ice : Error<
  16. "expression is not an integer constant expression">;
  17. def ext_expr_not_ice : Extension<
  18. "expression is not integer constant expression "
  19. "(but is allowed as an extension)">;
  20. def ext_null_pointer_expr_not_ice : Extension<
  21. "null pointer expression is not an integer constant expression "
  22. "(but is allowed as an extension)">;
  23. // Semantic analysis of constant literals.
  24. def ext_predef_outside_function : Warning<
  25. "predefined identifier is only valid inside function">;
  26. def warn_float_overflow : Warning<
  27. "magnitude of floating-point constant too large for type %0; maximum is %1">,
  28. InGroup<LiteralRange>;
  29. def warn_float_underflow : Warning<
  30. "magnitude of floating-point constant too small for type %0; minimum is %1">,
  31. InGroup<LiteralRange>;
  32. // C99 variable-length arrays
  33. def ext_vla : Extension<
  34. "variable length arrays are a C99 feature, accepted as an extension">,
  35. InGroup<VLA>;
  36. def err_vla_non_pod : Error<"variable length array of non-POD element type %0">;
  37. def err_vla_in_sfinae : Error<
  38. "variable length array cannot be formed during template argument deduction">;
  39. def err_array_star_in_function_definition : Error<
  40. "variable length array must be bound in function definition">;
  41. def err_vla_decl_in_file_scope : Error<
  42. "variable length array declaration not allowed at file scope">;
  43. def err_vla_decl_has_static_storage : Error<
  44. "variable length array declaration can not have 'static' storage duration">;
  45. def err_vla_decl_has_extern_linkage : Error<
  46. "variable length array declaration can not have 'extern' linkage">;
  47. // C99 variably modified types
  48. def err_variably_modified_template_arg : Error<
  49. "variably modified type %0 cannot be used as a template argument">;
  50. def err_variably_modified_nontype_template_param : Error<
  51. "non-type template parameter of variably modified type %0">;
  52. // C99 Designated Initializers
  53. def err_array_designator_negative : Error<
  54. "array designator value '%0' is negative">;
  55. def err_array_designator_empty_range : Error<
  56. "array designator range [%0, %1] is empty">;
  57. def err_array_designator_non_array : Error<
  58. "array designator cannot initialize non-array type %0">;
  59. def err_array_designator_too_large : Error<
  60. "array designator index (%0) exceeds array bounds (%1)">;
  61. def err_field_designator_non_aggr : Error<
  62. "field designator cannot initialize a "
  63. "%select{non-struct, non-union|non-class}0 type %1">;
  64. def err_field_designator_unknown : Error<
  65. "field designator %0 does not refer to any field in type %1">;
  66. def err_field_designator_nonfield : Error<
  67. "field designator %0 does not refer to a non-static data member">;
  68. def note_field_designator_found : Note<"field designator refers here">;
  69. def err_designator_for_scalar_init : Error<
  70. "designator in initializer for scalar type %0">;
  71. def warn_subobject_initializer_overrides : Warning<
  72. "subobject initialization overrides initialization of other fields "
  73. "within its enclosing subobject">, InGroup<InitializerOverrides>;
  74. def warn_initializer_overrides : Warning<
  75. "initializer overrides prior initialization of this subobject">,
  76. InGroup<InitializerOverrides>;
  77. def note_previous_initializer : Note<
  78. "previous initialization %select{|with side effects }0is here"
  79. "%select{| (side effects may not occur at run time)}0">;
  80. def err_designator_into_flexible_array_member : Error<
  81. "designator into flexible array member subobject">;
  82. def note_flexible_array_member : Note<
  83. "initialized flexible array member %0 is here">;
  84. def ext_flexible_array_init : Extension<
  85. "flexible array initialization is a GNU extension">, InGroup<GNU>;
  86. // Declarations.
  87. def ext_anon_param_requires_type_specifier : Extension<
  88. "type specifier required for unnamed parameter, defaults to int">;
  89. def err_bad_variable_name : Error<
  90. "'%0' cannot be the name of a variable or data member">;
  91. def err_parameter_name_omitted : Error<"parameter name omitted">;
  92. def warn_unused_parameter : Warning<"unused parameter %0">,
  93. InGroup<UnusedParameter>, DefaultIgnore;
  94. def warn_unused_variable : Warning<"unused variable %0">,
  95. InGroup<UnusedVariable>, DefaultIgnore;
  96. def warn_unused_exception_param : Warning<"unused exception parameter %0">,
  97. InGroup<UnusedExceptionParameter>, DefaultIgnore;
  98. def warn_decl_in_param_list : Warning<
  99. "declaration of %0 will not be visible outside of this function">;
  100. def warn_unused_function : Warning<"unused function %0">,
  101. InGroup<UnusedFunction>, DefaultIgnore;
  102. def warn_implicit_function_decl : Warning<
  103. "implicit declaration of function %0">,
  104. InGroup<ImplicitFunctionDeclare>, DefaultIgnore;
  105. def ext_implicit_function_decl : ExtWarn<
  106. "implicit declaration of function %0 is invalid in C99">,
  107. InGroup<ImplicitFunctionDeclare>;
  108. def err_ellipsis_first_arg : Error<
  109. "ISO C requires a named argument before '...'">;
  110. def err_declarator_need_ident : Error<"declarator requires an identifier">;
  111. def err_bad_language : Error<"unknown linkage language">;
  112. def warn_use_out_of_scope_declaration : Warning<
  113. "use of out-of-scope declaration of %0">;
  114. def err_inline_non_function : Error<
  115. "'inline' can only appear on functions">;
  116. def warn_decl_shadow :
  117. Warning<"declaration shadows a %select{"
  118. "local variable|"
  119. "variable in %2|"
  120. "static data member of %2|"
  121. "field of %2}1">,
  122. InGroup<Shadow>, DefaultIgnore;
  123. // C++ using declarations
  124. def err_using_requires_qualname : Error<
  125. "using declaration requires a qualified name">;
  126. def err_using_typename_non_type : Error<
  127. "'typename' keyword used on a non-type">;
  128. def err_using_dependent_value_is_type : Error<
  129. "dependent using declaration resolved to type without 'typename'">;
  130. def err_using_decl_nested_name_specifier_is_not_class : Error<
  131. "using declaration in class refers into '%0', which is not a class">;
  132. def err_using_decl_nested_name_specifier_is_current_class : Error<
  133. "using declaration refers to its own class">;
  134. def err_using_decl_nested_name_specifier_is_not_base_class : Error<
  135. "using declaration refers into '%0', which is not a base class of %1">;
  136. def err_using_decl_can_not_refer_to_class_member : Error<
  137. "using declaration can not refer to class member">;
  138. def err_using_decl_can_not_refer_to_namespace : Error<
  139. "using declaration can not refer to namespace">;
  140. def err_using_decl_constructor : Error<
  141. "using declaration can not refer to a constructor">;
  142. def err_using_decl_destructor : Error<
  143. "using declaration can not refer to a destructor">;
  144. def err_using_decl_template_id : Error<
  145. "using declaration can not refer to a template specialization">;
  146. def note_using_decl_target : Note<"target of using declaration">;
  147. def note_using_decl_conflict : Note<"conflicting declaration">;
  148. def err_using_decl_redeclaration : Error<"redeclaration of using decl">;
  149. def err_using_decl_conflict : Error<
  150. "target of using declaration conflicts with declaration already in scope">;
  151. def err_using_decl_conflict_reverse : Error<
  152. "declaration conflicts with target of using declaration already in scope">;
  153. def note_using_decl : Note<"%select{|previous }0using declaration">;
  154. def warn_access_decl_deprecated : Warning<
  155. "access declarations are deprecated; use using declarations instead">,
  156. InGroup<Deprecated>;
  157. def err_invalid_thread : Error<
  158. "'__thread' is only allowed on variable declarations">;
  159. def err_thread_non_global : Error<
  160. "'__thread' variables must have global storage">;
  161. def err_thread_unsupported : Error<
  162. "thread-local storage is unsupported for the current target">;
  163. def warn_maybe_falloff_nonvoid_function : Warning<
  164. "control may reach end of non-void function">,
  165. InGroup<ReturnType>;
  166. def warn_falloff_nonvoid_function : Warning<
  167. "control reaches end of non-void function">,
  168. InGroup<ReturnType>;
  169. def err_maybe_falloff_nonvoid_block : Error<
  170. "control may reach end of non-void block">;
  171. def err_falloff_nonvoid_block : Error<
  172. "control reaches end of non-void block">;
  173. def warn_suggest_noreturn_function : Warning<
  174. "function could be attribute 'noreturn'">,
  175. InGroup<DiagGroup<"missing-noreturn">>, DefaultIgnore;
  176. def warn_suggest_noreturn_block : Warning<
  177. "block could be attribute 'noreturn'">,
  178. InGroup<DiagGroup<"missing-noreturn">>, DefaultIgnore;
  179. def warn_unreachable : Warning<"will never be executed">,
  180. InGroup<DiagGroup<"unreachable-code">>, DefaultIgnore;
  181. /// Built-in functions.
  182. def ext_implicit_lib_function_decl : ExtWarn<
  183. "implicitly declaring C library function '%0' with type %1">;
  184. def note_please_include_header : Note<
  185. "please include the header <%0> or explicitly provide a "
  186. "declaration for '%1'">;
  187. def note_previous_builtin_declaration : Note<"%0 is a builtin with type %1">;
  188. def err_implicit_decl_requires_stdio : Error<
  189. "implicit declaration of '%0' requires inclusion of the header <stdio.h>">;
  190. def err_implicit_decl_requires_setjmp : Error<
  191. "implicit declaration of '%0' requires inclusion of the header <setjmp.h>">;
  192. def warn_redecl_library_builtin : Warning<
  193. "incompatible redeclaration of library function %0">;
  194. def err_builtin_definition : Error<"definition of builtin function %0">;
  195. def err_types_compatible_p_in_cplusplus : Error<
  196. "__builtin_types_compatible_p is not valid in C++">;
  197. def warn_builtin_unknown : Warning<"use of unknown builtin %0">, DefaultError;
  198. /// main()
  199. // static/inline main() are not errors in C, just in C++.
  200. def warn_unusual_main_decl : Warning<"'main' should not be declared "
  201. "%select{static|inline|static or inline}0">;
  202. def err_unusual_main_decl : Error<"'main' is not allowed to be declared "
  203. "%select{static|inline|static or inline}0">;
  204. def err_main_returns_nonint : Error<"'main' must return 'int'">;
  205. def err_main_surplus_args : Error<"too many parameters (%0) for 'main': "
  206. "must be 0, 2, or 3">;
  207. def warn_main_one_arg : Warning<"only one parameter on 'main' declaration">;
  208. def err_main_arg_wrong : Error<"%select{first|second|third|fourth}0 "
  209. "parameter of 'main' (%select{argument count|argument array|environment|"
  210. "platform-specific data}0) must be of type %1">;
  211. /// parser diagnostics
  212. def ext_typedef_without_a_name : ExtWarn<"typedef requires a name">;
  213. def err_statically_allocated_object : Error<
  214. "interface type cannot be statically allocated">;
  215. def err_object_cannot_be_passed_returned_by_value : Error<
  216. "interface type %1 cannot be %select{returned|passed}0 by value"
  217. "; did you forget * in %1">;
  218. def warn_enum_value_overflow : Warning<"overflow in enumeration value">;
  219. def warn_pragma_options_align_unsupported_option : Warning<
  220. "unsupported alignment option in '#pragma options align'">;
  221. def warn_pragma_options_align_reset_failed : Warning<
  222. "#pragma options align=reset failed: %0">;
  223. def err_pragma_options_align_mac68k_target_unsupported : Error<
  224. "mac68k alignment pragma is not supported on this target">;
  225. def warn_pragma_pack_invalid_alignment : Warning<
  226. "expected #pragma pack parameter to be '1', '2', '4', '8', or '16'">;
  227. // Follow the MSVC implementation.
  228. def warn_pragma_pack_show : Warning<"value of #pragma pack(show) == %0">;
  229. def warn_pragma_pack_pop_identifer_and_alignment : Warning<
  230. "specifying both a name and alignment to 'pop' is undefined">;
  231. def warn_pragma_pack_pop_failed : Warning<"#pragma pack(pop, ...) failed: %0">;
  232. def warn_pragma_unused_undeclared_var : Warning<
  233. "undeclared variable %0 used as an argument for '#pragma unused'">;
  234. def warn_pragma_unused_expected_localvar : Warning<
  235. "only local variables can be arguments to '#pragma unused'">;
  236. def err_unsupported_pragma_weak : Error<
  237. "using '#pragma weak' to refer to an undeclared identifier is not yet supported">;
  238. /// Objective-C parser diagnostics
  239. def err_duplicate_class_def : Error<
  240. "duplicate interface definition for class %0">;
  241. def err_undef_superclass : Error<
  242. "cannot find interface declaration for %0, superclass of %1">;
  243. def err_no_nsconstant_string_class : Error<
  244. "cannot find interface declaration for %0">;
  245. def err_recursive_superclass : Error<
  246. "trying to recursively use %0 as superclass of %1">;
  247. def warn_previous_alias_decl : Warning<"previously declared alias is ignored">;
  248. def err_conflicting_aliasing_type : Error<"conflicting types for alias %0">;
  249. def warn_undef_interface : Warning<"cannot find interface declaration for %0">;
  250. def warn_duplicate_protocol_def : Warning<"duplicate protocol definition of %0 is ignored">;
  251. def err_protocol_has_circular_dependency : Error<
  252. "protocol has circular dependency">;
  253. def err_undeclared_protocol : Error<"cannot find protocol declaration for %0">;
  254. def warn_undef_protocolref : Warning<"cannot find protocol definition for %0">;
  255. def warn_readonly_property : Warning<
  256. "attribute 'readonly' of property %0 restricts attribute "
  257. "'readwrite' of property inherited from %1">;
  258. def warn_property_attribute : Warning<
  259. "property %0 '%1' attribute does not match the property inherited from %2">;
  260. def warn_property_types_are_incompatible : Warning<
  261. "property type %0 is incompatible with type %1 inherited from %2">;
  262. def err_undef_interface : Error<"cannot find interface declaration for %0">;
  263. def err_class_extension_after_impl : Error<
  264. "cannot declare class extension for %0 after class implementation">;
  265. def note_implementation_declared : Note<
  266. "class implementation is declared here">;
  267. def warn_dup_category_def : Warning<
  268. "duplicate definition of category %1 on interface %0">;
  269. def err_conflicting_super_class : Error<"conflicting super class name %0">;
  270. def err_dup_implementation_class : Error<"reimplementation of class %0">;
  271. def err_dup_implementation_category : Error<
  272. "reimplementation of category %1 for class %0">;
  273. def err_conflicting_ivar_type : Error<
  274. "instance variable %0 has conflicting type: %1 vs %2">;
  275. def err_duplicate_ivar_declaration : Error<
  276. "instance variable is already declared">;
  277. def warn_on_superclass_use : Warning<
  278. "class implementation may not have super class">;
  279. def err_conflicting_ivar_bitwidth : Error<
  280. "instance variable %0 has conflicting bit-field width">;
  281. def err_conflicting_ivar_name : Error<
  282. "conflicting instance variable names: %0 vs %1">;
  283. def err_inconsistant_ivar_count : Error<
  284. "inconsistent number of instance variables specified">;
  285. def warn_incomplete_impl : Warning<"incomplete implementation">;
  286. def note_undef_method_impl : Note<"method definition for %0 not found">;
  287. def note_required_for_protocol_at :
  288. Note<"required for direct or indirect protocol %0">;
  289. def warn_conflicting_ret_types : Warning<
  290. "conflicting return type in implementation of %0: %1 vs %2">;
  291. def warn_conflicting_param_types : Warning<
  292. "conflicting parameter types in implementation of %0: %1 vs %2">;
  293. def warn_conflicting_variadic :Warning<
  294. "conflicting variadic declaration of method and its implementation">;
  295. def warn_implements_nscopying : Warning<
  296. "default assign attribute on property %0 which implements "
  297. "NSCopying protocol is not appropriate with -fobjc-gc[-only]">;
  298. def warn_multiple_method_decl : Warning<"multiple methods named %0 found">;
  299. def warn_accessor_property_type_mismatch : Warning<
  300. "type of property %0 does not match type of accessor %1">;
  301. def note_declared_at : Note<"declared here">;
  302. def err_setter_type_void : Error<"type of setter must be void">;
  303. def err_duplicate_method_decl : Error<"duplicate declaration of method %0">;
  304. def warn_missing_atend : Warning<"'@end' is missing in implementation context">;
  305. def err_objc_var_decl_inclass :
  306. Error<"cannot declare variable inside @interface or @protocol">;
  307. def error_missing_method_context : Error<
  308. "missing context for method declaration">;
  309. def err_objc_property_attr_mutually_exclusive : Error<
  310. "property attributes '%0' and '%1' are mutually exclusive">;
  311. def err_objc_property_requires_object : Error<
  312. "property with '%0' attribute must be of object type">;
  313. def warn_objc_property_no_assignment_attribute : Warning<
  314. "no 'assign', 'retain', or 'copy' attribute is specified - "
  315. "'assign' is assumed">;
  316. def warn_objc_property_default_assign_on_object : Warning<
  317. "default property attribute 'assign' not appropriate for non-gc object">;
  318. def warn_property_attr_mismatch : Warning<
  319. "property attribute in continuation class does not match the primary class">;
  320. def warn_objc_property_copy_missing_on_block : Warning<
  321. "'copy' attribute must be specified for the block property "
  322. "when -fobjc-gc-only is specified">;
  323. def warn_atomic_property_rule : Warning<
  324. "writable atomic property %0 cannot pair a synthesized setter/getter "
  325. "with a user defined setter/getter">;
  326. def err_use_continuation_class : Error<
  327. "illegal declaration of property in continuation class %0"
  328. ": attribute must be readwrite, while its primary must be readonly">;
  329. def err_continuation_class : Error<"continuation class has no primary class">;
  330. def err_property_type : Error<"property cannot have array or function type %0">;
  331. def error_missing_property_context : Error<
  332. "missing context for property implementation declaration">;
  333. def error_bad_property_decl : Error<
  334. "property implementation must have its declaration in interface %0">;
  335. def error_category_property : Error<
  336. "property declared in category %0 cannot be implemented in "
  337. "class implementation">;
  338. def note_property_declare : Note<
  339. "property declared here">;
  340. def error_synthesize_category_decl : Error<
  341. "@synthesize not allowed in a category's implementation">;
  342. def error_reference_property : Error<
  343. "property of reference type is not supported">;
  344. def error_missing_property_interface : Error<
  345. "property implementation in a category with no category declaration">;
  346. def error_bad_category_property_decl : Error<
  347. "property implementation must have its declaration in the category %0">;
  348. def error_bad_property_context : Error<
  349. "property implementation must be in a class or category implementation">;
  350. def error_missing_property_ivar_decl : Error<
  351. "synthesized property %0 must either be named the same as a compatible"
  352. " ivar or must explicitly name an ivar">;
  353. def error_synthesized_ivar_yet_not_supported : Error<
  354. "instance variable synthesis not yet supported"
  355. " (need to declare %0 explicitly)">;
  356. def error_property_ivar_type : Error<
  357. "type of property %0 (%1) does not match type of ivar %2 (%3)">;
  358. def error_ivar_in_superclass_use : Error<
  359. "property %0 attempting to use ivar %1 declared in super class %2">;
  360. def error_weak_property : Error<
  361. "existing ivar %1 for __weak property %0 must be __weak">;
  362. def error_strong_property : Error<
  363. "existing ivar %1 for a __strong property %0 must be garbage collectable">;
  364. def error_dynamic_property_ivar_decl : Error<
  365. "dynamic property can not have ivar specification">;
  366. def error_duplicate_ivar_use : Error<
  367. "synthesized properties %0 and %1 both claim ivar %2">;
  368. def error_property_implemented : Error<"property %0 is already implemented">;
  369. def warn_objc_property_attr_mutually_exclusive : Warning<
  370. "property attributes '%0' and '%1' are mutually exclusive">,
  371. InGroup<ReadOnlySetterAttrs>, DefaultIgnore;
  372. def warn_undeclared_selector : Warning<
  373. "undeclared selector %0">, InGroup<UndeclaredSelector>, DefaultIgnore;
  374. def warn_unimplemented_protocol_method : Warning<
  375. "method in protocol not implemented">, InGroup<Protocol>;
  376. // C++ declarations
  377. def err_static_assert_expression_is_not_constant : Error<
  378. "static_assert expression is not an integral constant expression">;
  379. def err_static_assert_failed : Error<"static_assert failed \"%0\"">;
  380. def err_unexpected_friend : Error<
  381. "friends can only be classes or functions">;
  382. def ext_enum_friend : ExtWarn<
  383. "enumeration type %0 cannot be a friend">;
  384. def ext_nonclass_type_friend : ExtWarn<
  385. "non-class type %0 cannot be a friend">;
  386. def err_friend_is_member : Error<
  387. "friends cannot be members of the declaring class">;
  388. def ext_unelaborated_friend_type : ExtWarn<
  389. "must specify '%select{struct|union|class|enum}0' to befriend %1">;
  390. def err_qualified_friend_not_found : Error<
  391. "no function named %0 with type %1 was found in the specified scope">;
  392. def err_introducing_special_friend : Error<
  393. "must use a qualified name when declaring a %select{constructor|"
  394. "destructor|conversion operator}0 as a friend">;
  395. def err_tagless_friend_type_template : Error<
  396. "friend type templates must use an elaborated type">;
  397. def err_abstract_type_in_decl : Error<
  398. "%select{return|parameter|variable|field}0 type %1 is an abstract class">;
  399. def err_allocation_of_abstract_type : Error<
  400. "allocation of an object of abstract type %0">;
  401. def err_throw_abstract_type : Error<
  402. "cannot throw an object of abstract type %0">;
  403. def err_array_of_abstract_type : Error<"array of abstract class type %0">;
  404. def err_multiple_final_overriders : Error<
  405. "virtual function %q0 has more than one final overrider in %1">;
  406. def note_final_overrider : Note<"final overrider of %q0 in %1">;
  407. def err_type_defined_in_type_specifier : Error<
  408. "%0 can not be defined in a type specifier">;
  409. def err_type_defined_in_result_type : Error<
  410. "%0 can not be defined in the result type of a function">;
  411. def err_type_defined_in_param_type : Error<
  412. "%0 can not be defined in a parameter type">;
  413. def note_pure_virtual_function : Note<
  414. "pure virtual function %0">;
  415. def err_deleted_non_function : Error<
  416. "only functions can have deleted definitions">;
  417. def err_deleted_decl_not_first : Error<
  418. "deleted definition must be first declaration">;
  419. def warn_weak_vtable : Warning<
  420. "%0 has no out-of-line virtual method definitions; its vtable will be "
  421. "emitted in every translation unit">,
  422. InGroup<DiagGroup<"weak-vtables">>, DefaultIgnore;
  423. // C++ exception specifications
  424. def err_exception_spec_in_typedef : Error<
  425. "exception specifications are not allowed in typedefs">;
  426. def err_distant_exception_spec : Error<
  427. "exception specifications are not allowed beyond a single level "
  428. "of indirection">;
  429. def err_incomplete_in_exception_spec : Error<
  430. "%select{|pointer to |reference to }0incomplete type %1 is not allowed "
  431. "in exception specification">;
  432. def err_mismatched_exception_spec : Error<
  433. "exception specification in declaration does not match previous declaration">;
  434. def err_override_exception_spec : Error<
  435. "exception specification of overriding function is more lax than "
  436. "base version">;
  437. def err_incompatible_exception_specs : Error<
  438. "target exception specification is not superset of source">;
  439. def err_deep_exception_specs_differ : Error<
  440. "exception specifications of %select{return|argument}0 types differ">;
  441. def warn_missing_exception_specification : Warning<
  442. "%0 is missing exception specification '%1'">;
  443. // C++ access checking
  444. def err_class_redeclared_with_different_access : Error<
  445. "%0 redeclared with '%1' access">;
  446. def err_access : Error<
  447. "%1 is a %select{private|protected}0 member of %3">, NoSFINAE;
  448. def err_access_ctor : Error<
  449. "calling a %select{private|protected}0 constructor of class %2">, NoSFINAE;
  450. def ext_rvalue_to_reference_access_ctor : ExtWarn<
  451. "C++98 requires an accessible copy constructor for class %2 when binding "
  452. "a reference to a temporary; was %select{private|protected}0">,
  453. NoSFINAE, InGroup<BindToTemporaryCopy>;
  454. def err_access_base : Error<
  455. "%select{base class|inherited virtual base class}0 %1 has %select{private|"
  456. "protected}3 %select{constructor|copy constructor|copy assignment operator|"
  457. "destructor}2">, NoSFINAE;
  458. def err_access_field: Error<
  459. "field of type %0 has %select{private|protected}2 %select{constructor|copy "
  460. "constructor|copy assignment operator|destructor}1">, NoSFINAE;
  461. def err_access_ctor_field :
  462. Error<"field of type %1 has %select{private|protected}2 constructor">,
  463. NoSFINAE;
  464. def err_access_dtor_base :
  465. Error<"base class %0 has %select{private|protected}1 destructor">,
  466. NoSFINAE;
  467. def err_access_dtor_vbase :
  468. Error<"inherited virtual base class %0 has "
  469. "%select{private|protected}1 destructor">,
  470. NoSFINAE;
  471. def err_access_dtor_temp :
  472. Error<"temporary of type %0 has %select{private|protected}1 destructor">,
  473. NoSFINAE;
  474. def err_access_dtor_field :
  475. Error<"field of type %1 has %select{private|protected}2 destructor">,
  476. NoSFINAE;
  477. def err_access_dtor_var :
  478. Error<"variable of type %1 has %select{private|protected}2 destructor">,
  479. NoSFINAE;
  480. def err_access_assign_field :
  481. Error<"field of type %1 has %select{private|protected}2 copy assignment"
  482. " operator">,
  483. NoSFINAE;
  484. def err_access_assign_base :
  485. Error<"base class %0 has %select{private|protected}1 copy assignment"
  486. " operator">,
  487. NoSFINAE;
  488. def err_access_copy_field :
  489. Error<"field of type %1 has %select{private|protected}2 copy constructor">,
  490. NoSFINAE;
  491. def err_access_copy_base :
  492. Error<"base class %0 has %select{private|protected}1 copy constructor">,
  493. NoSFINAE;
  494. def err_access_dtor_ivar :
  495. Error<"instance variable of type %0 has %select{private|protected}1 "
  496. "destructor">,
  497. NoSFINAE;
  498. def note_previous_access_declaration : Note<
  499. "previously declared '%1' here">;
  500. def err_access_outside_class : Error<
  501. "access to %select{private|protected}0 member outside any class context">;
  502. def note_access_natural : Note<
  503. "%select{|implicitly }1declared %select{private|protected}0 here">;
  504. def note_access_constrained_by_path : Note<
  505. "constrained by %select{|implicitly }1%select{private|protected}0"
  506. " inheritance here">;
  507. // C++ name lookup
  508. def err_incomplete_nested_name_spec : Error<
  509. "incomplete type %0 named in nested name specifier">;
  510. def err_dependent_nested_name_spec : Error<
  511. "nested name specifier for a declaration cannot depend on a template "
  512. "parameter">;
  513. def err_nested_name_member_ref_lookup_ambiguous : Error<
  514. "lookup of %0 in member access expression is ambiguous">;
  515. def ext_nested_name_member_ref_lookup_ambiguous : ExtWarn<
  516. "lookup of %0 in member access expression is ambiguous; using member of %1">,
  517. InGroup<AmbigMemberTemplate>;
  518. def note_ambig_member_ref_object_type : Note<
  519. "lookup in the object type %0 refers here">;
  520. def note_ambig_member_ref_scope : Note<
  521. "lookup from the current scope refers here">;
  522. def err_qualified_member_nonclass : Error<
  523. "qualified member access refers to a member in %0">;
  524. def err_incomplete_member_access : Error<
  525. "member access into incomplete type %0">;
  526. def err_incomplete_type : Error<
  527. "incomplete type %0 where a complete type is required">;
  528. // C++ class members
  529. def err_storageclass_invalid_for_member : Error<
  530. "storage class specified for a member declaration">;
  531. def err_mutable_function : Error<"'mutable' cannot be applied to functions">;
  532. def err_mutable_reference : Error<"'mutable' cannot be applied to references">;
  533. def err_mutable_const : Error<"'mutable' and 'const' cannot be mixed">;
  534. def err_mutable_nonmember : Error<
  535. "'mutable' can only be applied to member variables">;
  536. def err_virtual_non_function : Error<
  537. "'virtual' can only appear on non-static member functions">;
  538. def err_virtual_out_of_class : Error<
  539. "'virtual' can only be specified inside the class definition">;
  540. def err_explicit_non_function : Error<
  541. "'explicit' can only appear on non-static member functions">;
  542. def err_explicit_out_of_class : Error<
  543. "'explicit' can only be specified inside the class definition">;
  544. def err_explicit_non_ctor_or_conv_function : Error<
  545. "'explicit' can only be applied to a constructor or conversion function">;
  546. def err_static_not_bitfield : Error<"static member %0 cannot be a bit-field">;
  547. def err_static_out_of_line : Error<
  548. "'static' can only be specified inside the class definition">;
  549. def err_typedef_not_bitfield : Error<"typedef member %0 cannot be a bit-field">;
  550. def err_not_integral_type_bitfield : Error<
  551. "bit-field %0 has non-integral type %1">;
  552. def err_not_integral_type_anon_bitfield : Error<
  553. "anonymous bit-field has non-integral type %0">;
  554. def err_member_initialization : Error<
  555. "%0 can only be initialized if it is a static const integral data member">;
  556. def err_member_function_initialization : Error<
  557. "initializer on function does not look like a pure-specifier">;
  558. def err_non_virtual_pure : Error<
  559. "%0 is not virtual and cannot be declared pure">;
  560. def err_implicit_object_parameter_init : Error<
  561. "cannot initialize object parameter of type %0 with an expression "
  562. "of type %1">;
  563. def err_qualified_member_of_unrelated : Error<
  564. "%q0 is not a member of class %1">;
  565. def note_field_decl : Note<"member is declared here">;
  566. def note_ivar_decl : Note<"ivar is declared here">;
  567. def note_bitfield_decl : Note<"bit-field is declared here">;
  568. def note_previous_decl : Note<"%0 declared here">;
  569. def note_member_synthesized_at : Note<
  570. "implicit default %select{constructor|copy constructor|"
  571. "copy assignment operator|destructor}0 for %1 first required here">;
  572. def err_missing_default_ctor : Error<
  573. "%select{|implicit default }0constructor for %1 must explicitly initialize "
  574. "the %select{base class|member}2 %3 which does not have a default "
  575. "constructor">;
  576. def err_illegal_union_member : Error<
  577. "union member %0 has a non-trivial %select{constructor|"
  578. "copy constructor|copy assignment operator|destructor}1">;
  579. def note_nontrivial_has_virtual : Note<
  580. "because type %0 has a virtual %select{member function|base class}1">;
  581. def note_nontrivial_has_nontrivial : Note<
  582. "because type %0 has a %select{member|base class}1 with a non-trivial "
  583. "%select{constructor|copy constructor|copy assignment operator|destructor}2">;
  584. def note_nontrivial_user_defined : Note<
  585. "because type %0 has a user-declared %select{constructor|copy constructor|"
  586. "copy assignment operator|destructor}1">;
  587. def err_different_return_type_for_overriding_virtual_function : Error<
  588. "virtual function %0 has a different return type (%1) than the "
  589. "function it overrides (which has return type %2)">;
  590. def note_overridden_virtual_function : Note<
  591. "overridden virtual function is here">;
  592. def err_covariant_return_inaccessible_base : Error<
  593. "invalid covariant return for virtual function: %1 is a "
  594. "%select{private|protected}2 base class of %0">, NoSFINAE;
  595. def err_covariant_return_ambiguous_derived_to_base_conv : Error<
  596. "return type of virtual function %3 is not covariant with the return type of "
  597. "the function it overrides (ambiguous conversion from derived class "
  598. "%0 to base class %1:%2)">;
  599. def err_covariant_return_not_derived : Error<
  600. "return type of virtual function %0 is not covariant with the return type of "
  601. "the function it overrides (%1 is not derived from %2)">;
  602. def err_covariant_return_incomplete : Error<
  603. "return type of virtual function %0 is not covariant with the return type of "
  604. "the function it overrides (%1 is incomplete)">;
  605. def err_covariant_return_type_different_qualifications : Error<
  606. "return type of virtual function %0 is not covariant with the return type of "
  607. "the function it overrides (%1 has different qualifiers than %2)">;
  608. def err_covariant_return_type_class_type_more_qualified : Error<
  609. "return type of virtual function %0 is not covariant with the return type of "
  610. "the function it overrides (class type %1 is more qualified than class "
  611. "type %2">;
  612. // C++ constructors
  613. def err_constructor_cannot_be : Error<"constructor cannot be declared '%0'">;
  614. def err_invalid_qualified_constructor : Error<
  615. "'%0' qualifier is not allowed on a constructor">;
  616. def err_constructor_return_type : Error<
  617. "constructor cannot have a return type">;
  618. def err_constructor_redeclared : Error<"constructor cannot be redeclared">;
  619. def err_constructor_byvalue_arg : Error<
  620. "copy constructor must pass its first argument by reference">;
  621. def warn_no_constructor_for_refconst : Warning<
  622. "%select{struct|union|class|enum}0 %1 does not declare any constructor to "
  623. "initialize its non-modifiable members">;
  624. def note_refconst_member_not_initialized : Note<
  625. "%select{const|reference}0 member %1 will never be initialized">;
  626. // C++ destructors
  627. def err_destructor_not_member : Error<
  628. "destructor must be a non-static member function">;
  629. def err_destructor_cannot_be : Error<"destructor cannot be declared '%0'">;
  630. def err_invalid_qualified_destructor : Error<
  631. "'%0' qualifier is not allowed on a destructor">;
  632. def err_destructor_return_type : Error<"destructor cannot have a return type">;
  633. def err_destructor_redeclared : Error<"destructor cannot be redeclared">;
  634. def err_destructor_with_params : Error<"destructor cannot have any parameters">;
  635. def err_destructor_variadic : Error<"destructor cannot be variadic">;
  636. def err_destructor_typedef_name : Error<
  637. "destructor cannot be declared using a typedef %0 of the class name">;
  638. def err_destructor_name : Error<
  639. "expected the class name after '~' to name the enclosing class">;
  640. def err_destructor_class_name : Error<
  641. "expected the class name after '~' to name a destructor">;
  642. def err_ident_in_pseudo_dtor_not_a_type : Error<
  643. "identifier %0 in pseudo-destructor expression does not name a type">;
  644. // C++ initialization
  645. def err_init_conversion_failed : Error<
  646. "cannot initialize %select{a variable|a parameter|return object|an "
  647. "exception object|a member subobject|an array element|a new value|a value|a "
  648. "base class|a vector element}0 of type %1 with an %select{rvalue|lvalue}2 of "
  649. "type %3">;
  650. def err_lvalue_to_rvalue_ref : Error<"rvalue reference cannot bind to lvalue">;
  651. def err_invalid_initialization : Error<
  652. "invalid initialization of reference of type %0 from expression of type %1">;
  653. def err_lvalue_to_rvalue_ambig_ref : Error<"rvalue reference cannot bind to lvalue "
  654. "due to multiple conversion functions">;
  655. def err_not_reference_to_const_init : Error<
  656. "%select{non-const|volatile}0 lvalue reference to type %1 cannot be "
  657. "initialized with a %select{value|temporary}2 of type %3">;
  658. def err_lvalue_reference_bind_to_temporary : Error<
  659. "%select{non-const|volatile}0 lvalue reference to type %1 cannot bind to a "
  660. "temporary of type %2">;
  661. def err_lvalue_reference_bind_to_unrelated : Error<
  662. "%select{non-const|volatile}0 lvalue reference to type %1 cannot bind to a "
  663. "value of unrelated type %2">;
  664. def err_reference_bind_drops_quals : Error<
  665. "binding of reference to type %0 to a value of type %1 drops qualifiers">;
  666. def err_reference_bind_failed : Error<
  667. "reference to type %0 could not bind to an %select{rvalue|lvalue}1 of type "
  668. "%2">;
  669. def err_reference_bind_init_list : Error<
  670. "reference to type %0 cannot bind to an initializer list">;
  671. def err_init_list_bad_dest_type : Error<
  672. "%select{|non-aggregate }0type %1 cannot be initialized with an initializer "
  673. "list">;
  674. def err_reference_init_drops_quals : Error<
  675. "initialization of reference to type %0 with a %select{value|temporary}1 of type %2 drops "
  676. "qualifiers">;
  677. def err_reference_bind_to_bitfield : Error<
  678. "%select{non-const|volatile}0 reference cannot bind to bit-field %1">;
  679. def err_reference_bind_to_vector_element : Error<
  680. "%select{non-const|volatile}0 reference cannot bind to vector element">;
  681. def err_reference_var_requires_init : Error<
  682. "declaration of reference variable %0 requires an initializer">;
  683. def err_const_var_requires_init : Error<
  684. "declaration of const variable '%0' requires an initializer">;
  685. def err_reference_without_init : Error<
  686. "reference to type %0 requires an initializer">;
  687. def err_reference_has_multiple_inits : Error<
  688. "reference cannot be initialized with multiple values">;
  689. def err_init_non_aggr_init_list : Error<
  690. "initialization of non-aggregate type %0 with an initializer list">;
  691. def err_init_reference_member_uninitialized : Error<
  692. "reference member of type %0 uninitialized">;
  693. def note_uninit_reference_member : Note<
  694. "uninitialized reference member is here">;
  695. def warn_field_is_uninit : Warning<"field is uninitialized when used here">,
  696. InGroup<DiagGroup<"uninitialized">>;
  697. def err_init_incomplete_type : Error<"initialization of incomplete type %0">;
  698. def err_temp_copy_no_viable : Error<
  699. "no viable constructor %select{copying variable|copying parameter|"
  700. "returning object|throwing object|copying member subobject|copying array "
  701. "element|allocating object|copying temporary|initializing base subobject|"
  702. "initializing vector element}0 of type %1">;
  703. def ext_rvalue_to_reference_temp_copy_no_viable : ExtWarn<
  704. "no viable constructor %select{copying variable|copying parameter|"
  705. "returning object|throwing object|copying member subobject|copying array "
  706. "element|allocating object|copying temporary|initializing base subobject|"
  707. "initializing vector element}0 of type %1; C++98 requires a copy "
  708. "constructor when binding a reference to a temporary">,
  709. InGroup<BindToTemporaryCopy>;
  710. def err_temp_copy_ambiguous : Error<
  711. "ambiguous constructor call when %select{copying variable|copying "
  712. "parameter|returning object|throwing object|copying member subobject|copying "
  713. "array element|allocating object|copying temporary|initializing base subobject|"
  714. "initializing vector element}0 of type %1">;
  715. def err_temp_copy_deleted : Error<
  716. "%select{copying variable|copying parameter|returning object|throwing "
  717. "object|copying member subobject|copying array element|allocating object|"
  718. "copying temporary|initializing base subobject|initializing vector element}0 "
  719. "of type %1 invokes deleted constructor">;
  720. def err_temp_copy_incomplete : Error<
  721. "copying a temporary object of incomplete type %0">;
  722. // C++0x decltype
  723. def err_cannot_determine_declared_type_of_overloaded_function : Error<
  724. "cannot determine the %select{type|declared type}0 of an overloaded "
  725. "function">;
  726. // C++0x auto
  727. def err_auto_variable_cannot_appear_in_own_initializer : Error<
  728. "variable %0 declared with 'auto' type cannot appear in its own initializer">;
  729. def err_illegal_decl_array_of_auto : Error<
  730. "'%0' declared as array of 'auto'">;
  731. def err_auto_not_allowed : Error<
  732. "'auto' not allowed in %select{function prototype|struct member|union member"
  733. "|class member|exception declaration|template parameter|block literal}0">;
  734. def err_auto_var_requires_init : Error<
  735. "declaration of variable %0 with type %1 requires an initializer">;
  736. // C++0x attributes
  737. def err_repeat_attribute : Error<"'%0' attribute cannot be repeated">;
  738. // C++0x [[final]]
  739. def err_final_function_overridden : Error<
  740. "declaration of %0 overrides a 'final' function">;
  741. def err_final_base : Error<
  742. "derivation from 'final' %0">;
  743. // Objective-C++
  744. def err_objc_decls_may_only_appear_in_global_scope : Error<
  745. "Objective-C declarations may only appear in global scope">;
  746. def err_nsobject_attribute : Error<
  747. "__attribute ((NSObject)) is for pointer types only">;
  748. // Attributes
  749. def err_attribute_can_be_applied_only_to_symbol_declaration : Error<
  750. "%0 attribute can be applied only to symbol declaration">;
  751. def err_attributes_are_not_compatible : Error<
  752. "%0 and %1 attributes are not compatible">;
  753. def err_attribute_wrong_number_arguments : Error<
  754. "attribute requires %0 argument(s)">;
  755. def err_attribute_missing_parameter_name : Error<
  756. "attribute requires unquoted parameter">;
  757. def err_attribute_invalid_vector_type : Error<"invalid vector type %0">;
  758. def err_attribute_argument_not_int : Error<
  759. "'%0' attribute requires integer constant">;
  760. def err_attribute_argument_outof_range : Error<
  761. "init_priority attribute requires integer constant between "
  762. "101 and 65535 inclusive">;
  763. def err_init_priority_object_attr : Error<
  764. "can only use �&#x20AC;&#x2DC;init_priority�&#x20AC;&#x2122; attribute on file-scope definitions "
  765. "of objects of class type">;
  766. def err_attribute_argument_n_not_int : Error<
  767. "'%0' attribute requires parameter %1 to be an integer constant">;
  768. def err_attribute_argument_n_not_string : Error<
  769. "'%0' attribute requires parameter %1 to be a string">;
  770. def err_attribute_argument_out_of_bounds : Error<
  771. "'%0' attribute parameter %1 is out of bounds">;
  772. def err_attribute_requires_objc_interface : Error<
  773. "attribute may only be applied to an Objective-C interface">;
  774. def err_nonnull_pointers_only : Error<
  775. "nonnull attribute only applies to pointer arguments">;
  776. def err_format_strftime_third_parameter : Error<
  777. "strftime format attribute requires 3rd parameter to be 0">;
  778. def err_format_attribute_requires_variadic : Error<
  779. "format attribute requires variadic function">;
  780. def err_format_attribute_not : Error<"format argument not %0">;
  781. def err_format_attribute_result_not : Error<"function does not return %0">;
  782. def err_attribute_invalid_size : Error<
  783. "vector size not an integral multiple of component size">;
  784. def err_attribute_zero_size : Error<"zero vector size">;
  785. def err_typecheck_vector_not_convertable : Error<
  786. "can't convert between vector values of different size (%0 and %1)">;
  787. def err_typecheck_ext_vector_not_typedef : Error<
  788. "ext_vector_type only applies to types, not variables">;
  789. def err_unsupported_vector_size : Error<
  790. "unsupported type %0 for vector_size attribute, please use on typedef">;
  791. def err_ext_vector_component_exceeds_length : Error<
  792. "vector component access exceeds type %0">;
  793. def err_ext_vector_component_name_illegal : Error<
  794. "illegal vector component name '%0'">;
  795. def err_attribute_address_space_not_int : Error<
  796. "address space attribute requires an integer constant">;
  797. def err_attribute_address_space_negative : Error<
  798. "address space is negative">;
  799. def err_attribute_address_space_too_high : Error<
  800. "address space is larger than the maximum supported (%0)">;
  801. def err_attribute_address_multiple_qualifiers : Error<
  802. "multiple address spaces specified for type">;
  803. def err_implicit_pointer_address_space_cast : Error<
  804. "illegal implicit cast between two pointers with different address spaces">;
  805. def err_as_qualified_auto_decl : Error<
  806. "automatic variable qualified with an address space">;
  807. def err_arg_with_address_space : Error<
  808. "parameter may not be qualified with an address space">;
  809. def err_attribute_not_string : Error<
  810. "argument to %0 attribute was not a string literal">;
  811. def err_attribute_section_invalid_for_target : Error<
  812. "argument to 'section' attribute is not valid for this target: %0">;
  813. def err_attribute_section_local_variable : Error<
  814. "'section' attribute is not valid on local variables">;
  815. def err_attribute_aligned_not_power_of_two : Error<
  816. "requested alignment is not a power of 2">;
  817. def warn_redeclaration_without_attribute_prev_attribute_ignored : Warning<
  818. "'%0' redeclared without %1 attribute: previous %1 ignored">;
  819. def warn_attribute_ignored : Warning<"%0 attribute ignored">;
  820. def warn_attribute_precede_definition : Warning<
  821. "attribute declaration must precede definition">;
  822. def warn_attribute_void_function_method : Warning<
  823. "attribute %0 cannot be applied to "
  824. "%select{functions|Objective-C method}1 without return value">;
  825. def warn_attribute_weak_on_field : Warning<
  826. "__weak attribute cannot be specified on a field declaration">;
  827. def warn_attribute_weak_on_local : Warning<
  828. "__weak attribute cannot be specified on an automatic variable">;
  829. def warn_weak_identifier_undeclared : Warning<
  830. "weak identifier %0 never declared">;
  831. def err_attribute_weak_static : Error<
  832. "weak declaration of '%0' must be public">;
  833. def warn_attribute_weak_import_invalid_on_definition : Warning<
  834. "'weak_import' attribute cannot be specified on a definition">;
  835. def err_attribute_weakref_not_static : Error<
  836. "weakref declaration of '%0' must be static">;
  837. def err_attribute_weakref_not_global_context : Error<
  838. "weakref declaration of '%0' must be in a global context">;
  839. def err_attribute_weakref_without_alias : Error<
  840. "weakref declaration of '%0' must also have an alias attribute">;
  841. def warn_attribute_wrong_decl_type : Warning<
  842. "%0 attribute only applies to %select{function|union|"
  843. "variable and function|function or method|parameter|"
  844. "parameter or Objective-C method |function, method or block|"
  845. "virtual method or class|function, method, or parameter|class|virtual method"
  846. "|member}1 types">;
  847. def err_attribute_wrong_decl_type : Error<
  848. "%0 attribute only applies to %select{function|union|"
  849. "variable and function|function or method|parameter|"
  850. "parameter or Objective-C method |function, method or block|"
  851. "virtual method or class|function, method, or parameter|class|virtual method"
  852. "|member}1 types">;
  853. def warn_function_attribute_wrong_type : Warning<
  854. "%0 only applies to function types; type here is %1">;
  855. def warn_gnu_inline_attribute_requires_inline : Warning<
  856. "'gnu_inline' attribute requires function to be marked 'inline',"
  857. " attribute ignored">;
  858. def err_cconv_change : Error<
  859. "function declared '%0' here was previously declared "
  860. "%select{'%2'|without calling convention}1">;
  861. def err_cconv_knr : Error<
  862. "function with no prototype cannot use %0 calling convention">;
  863. def err_cconv_varargs : Error<
  864. "variadic function cannot use %0 calling convention">;
  865. def err_regparm_mismatch : Error<"function declared with with regparm(%0) "
  866. "attribute was previously declared %plural{0:without the regparm|1:"
  867. "with the regparm(1)|2:with the regparm(2)|3:with the regparm(3)|:with the"
  868. "regparm}1 attribute">;
  869. def warn_impcast_vector_scalar : Warning<
  870. "implicit cast turns vector to scalar: %0 to %1">,
  871. InGroup<DiagGroup<"conversion">>, DefaultIgnore;
  872. def warn_impcast_complex_scalar : Warning<
  873. "implicit cast discards imaginary component: %0 to %1">,
  874. InGroup<DiagGroup<"conversion">>, DefaultIgnore;
  875. def warn_impcast_float_precision : Warning<
  876. "implicit cast loses floating-point precision: %0 to %1">,
  877. InGroup<DiagGroup<"conversion">>, DefaultIgnore;
  878. def warn_impcast_float_integer : Warning<
  879. "implicit cast turns floating-point number into integer: %0 to %1">,
  880. InGroup<DiagGroup<"conversion">>, DefaultIgnore;
  881. def warn_impcast_integer_sign : Warning<
  882. "implicit cast changes signedness: %0 to %1">,
  883. InGroup<DiagGroup<"conversion">>, DefaultIgnore;
  884. def warn_impcast_integer_sign_conditional : Warning<
  885. "operand of ? changes signedness: %0 to %1">,
  886. InGroup<DiagGroup<"conversion">>, DefaultIgnore;
  887. def warn_impcast_integer_precision : Warning<
  888. "implicit cast loses integer precision: %0 to %1">,
  889. InGroup<DiagGroup<"conversion">>, DefaultIgnore;
  890. def warn_impcast_integer_64_32 : Warning<
  891. "implicit cast loses integer precision: %0 to %1">,
  892. InGroup<DiagGroup<"shorten-64-to-32">>, DefaultIgnore;
  893. def warn_attribute_ignored_for_field_of_type : Warning<
  894. "%0 attribute ignored for field of type %1">;
  895. def warn_transparent_union_attribute_field_size_align : Warning<
  896. "%select{alignment|size}0 of field %1 (%2 bits) does not match the "
  897. "%select{alignment|size}0 of the first field in transparent union; "
  898. "transparent_union attribute ignored">;
  899. def note_transparent_union_first_field_size_align : Note<
  900. "%select{alignment|size}0 of first field is %1 bits">;
  901. def warn_transparent_union_attribute_not_definition : Warning<
  902. "transparent_union attribute can only be applied to a union definition; "
  903. "attribute ignored">;
  904. def warn_transparent_union_attribute_floating : Warning<
  905. "first field of a transparent union cannot have floating point or vector "
  906. "type; transparent_union attribute ignored">;
  907. def warn_transparent_union_attribute_zero_fields : Warning<
  908. "transparent union definition must contain at least one field; "
  909. "transparent_union attribute ignored">;
  910. def warn_attribute_type_not_supported : Warning<
  911. "'%0' attribute argument not supported: %1">;
  912. def warn_attribute_unknown_visibility : Warning<"unknown visibility '%1'">;
  913. def err_unknown_machine_mode : Error<"unknown machine mode %0">;
  914. def err_unsupported_machine_mode : Error<"unsupported machine mode %0">;
  915. def err_mode_not_primitive : Error<
  916. "mode attribute only supported for integer and floating-point types">;
  917. def err_mode_wrong_type : Error<
  918. "type of machine mode does not match type of base type">;
  919. def err_attr_wrong_decl : Error<
  920. "'%0' attribute invalid on this declaration, requires typedef or value">;
  921. def warn_attribute_nonnull_no_pointers : Warning<
  922. "'nonnull' attribute applied to function with no pointer arguments">;
  923. def warn_attribute_malloc_pointer_only : Warning<
  924. "'malloc' attribute only applies to functions returning a pointer type">;
  925. def warn_transparent_union_nonpointer : Warning<
  926. "'transparent_union' attribute support incomplete; only supported for "
  927. "pointer unions">;
  928. def warn_attribute_sentinel_named_arguments : Warning<
  929. "'sentinel' attribute requires named arguments">;
  930. def warn_attribute_sentinel_not_variadic : Warning<
  931. "'sentinel' attribute only supported for variadic %select{functions|blocks}0">;
  932. def err_attribute_sentinel_less_than_zero : Error<
  933. "'sentinel' parameter 1 less than zero">;
  934. def err_attribute_sentinel_not_zero_or_one : Error<
  935. "'sentinel' parameter 2 not 0 or 1">;
  936. def err_attribute_cleanup_arg_not_found : Error<
  937. "'cleanup' argument %0 not found">;
  938. def err_attribute_cleanup_arg_not_function : Error<
  939. "'cleanup' argument %0 is not a function">;
  940. def err_attribute_cleanup_func_must_take_one_arg : Error<
  941. "'cleanup' function %0 must take 1 parameter">;
  942. def err_attribute_cleanup_func_arg_incompatible_type : Error<
  943. "'cleanup' function %0 parameter has type %1 which is incompatible with "
  944. "type %2">;
  945. def err_attribute_regparm_wrong_platform : Error<
  946. "'regparm' is not valid on this platform">;
  947. def err_attribute_regparm_invalid_number : Error<
  948. "'regparm' parameter must be between 0 and %0 inclusive">;
  949. // Clang-Specific Attributes
  950. def err_attribute_iboutlet : Error<
  951. "%0 attribute can only be applied to instance variables or properties">;
  952. def err_attribute_ibaction: Error<
  953. "ibaction attribute can only be applied to Objective-C instance methods">;
  954. def err_attribute_overloadable_not_function : Error<
  955. "'overloadable' attribute can only be applied to a function">;
  956. def err_attribute_overloadable_missing : Error<
  957. "%select{overloaded function|redeclaration of}0 %1 must have the "
  958. "'overloadable' attribute">;
  959. def note_attribute_overloadable_prev_overload : Note<
  960. "previous overload of function is here">;
  961. def err_attribute_overloadable_no_prototype : Error<
  962. "'overloadable' function %0 must have a prototype">;
  963. def warn_ns_attribute_wrong_return_type : Warning<
  964. "%0 attribute only applies to functions or methods that "
  965. "return a pointer or Objective-C object">;
  966. // Function Parameter Semantic Analysis.
  967. def err_param_with_void_type : Error<"argument may not have 'void' type">;
  968. def err_void_only_param : Error<
  969. "'void' must be the first and only parameter if specified">;
  970. def err_void_param_qualified : Error<
  971. "'void' as parameter must not have type qualifiers">;
  972. def err_ident_list_in_fn_declaration : Error<
  973. "a parameter list without types is only allowed in a function definition">;
  974. def ext_param_not_declared : Extension<
  975. "parameter %0 was not declared, defaulting to type 'int'">;
  976. def err_param_typedef_of_void : Error<
  977. "empty parameter list defined with a typedef of 'void' not allowed in C++">;
  978. def err_param_default_argument : Error<
  979. "C does not support default arguments">;
  980. def err_param_default_argument_redefinition : Error<
  981. "redefinition of default argument">;
  982. def err_param_default_argument_missing : Error<
  983. "missing default argument on parameter">;
  984. def err_param_default_argument_missing_name : Error<
  985. "missing default argument on parameter %0">;
  986. def err_param_default_argument_references_param : Error<
  987. "default argument references parameter %0">;
  988. def err_param_default_argument_references_local : Error<
  989. "default argument references local variable %0 of enclosing function">;
  990. def err_param_default_argument_references_this : Error<
  991. "default argument references 'this'">;
  992. def err_param_default_argument_nonfunc : Error<
  993. "default arguments can only be specified for parameters in a function "
  994. "declaration">;
  995. def err_param_default_argument_template_redecl : Error<
  996. "default arguments cannot be added to a function template that has already "
  997. "been declared">;
  998. def err_param_default_argument_member_template_redecl : Error<
  999. "default arguments cannot be added to an out-of-line definition of a member "
  1000. "of a %select{class template|class template partial specialization|nested "
  1001. "class in a template}0">;
  1002. def err_uninitialized_member_for_assign : Error<
  1003. "cannot define the implicit default assignment operator for %0, because "
  1004. "non-static %select{reference|const}1 member %2 can't use default "
  1005. "assignment operator">;
  1006. def note_first_required_here : Note<
  1007. "synthesized method is first required here">;
  1008. def err_uninitialized_member_in_ctor : Error<
  1009. "%select{|implicit default }0constructor for %1 must explicitly initialize "
  1010. "the %select{reference|const}2 member %3">;
  1011. def err_use_of_default_argument_to_function_declared_later : Error<
  1012. "use of default argument to function %0 that is declared later in class %1">;
  1013. def note_default_argument_declared_here : Note<
  1014. "default argument declared here">;
  1015. def ext_param_promoted_not_compatible_with_prototype : ExtWarn<
  1016. "promoted type %0 of K&R function parameter is not compatible with the "
  1017. "parameter type %1 declared in a previous prototype">;
  1018. // C++ Overloading Semantic Analysis.
  1019. def err_ovl_diff_return_type : Error<
  1020. "functions that differ only in their return type cannot be overloaded">;
  1021. def err_ovl_static_nonstatic_member : Error<
  1022. "static and non-static member functions with the same parameter types "
  1023. "cannot be overloaded">;
  1024. def err_ovl_no_viable_function_in_call : Error<
  1025. "no matching function for call to %0">;
  1026. def err_ovl_no_viable_member_function_in_call : Error<
  1027. "no matching member function for call to %0">;
  1028. def err_ovl_ambiguous_call : Error<
  1029. "call to %0 is ambiguous">;
  1030. def err_ovl_deleted_call : Error<
  1031. "call to %select{unavailable|deleted}0 function %1">;
  1032. def err_ovl_ambiguous_member_call : Error<
  1033. "call to member function %0 is ambiguous">;
  1034. def err_ovl_deleted_member_call : Error<
  1035. "call to %select{unavailable|deleted}0 member function %1">;
  1036. def note_ovl_too_many_candidates : Note<
  1037. "remaining %0 candidate%s0 omitted; "
  1038. "pass -fshow-overloads=all to show them">;
  1039. def note_ovl_candidate : Note<"candidate "
  1040. "%select{function|function|constructor|"
  1041. "function |function |constructor |"
  1042. "is the implicit default constructor|"
  1043. "is the implicit copy constructor|"
  1044. "is the implicit copy assignment operator}0%1">;
  1045. def warn_init_pointer_from_false : Warning<
  1046. "initialization of pointer of type %0 from literal 'false'">,
  1047. InGroup<BoolConversions>;
  1048. def note_ovl_candidate_bad_deduction : Note<
  1049. "candidate template ignored: failed template argument deduction">;
  1050. def note_ovl_candidate_incomplete_deduction : Note<"candidate template ignored: "
  1051. "couldn't infer template argument %0">;
  1052. def note_ovl_candidate_inconsistent_deduction : Note<
  1053. "candidate template ignored: deduced conflicting %select{types|values|"
  1054. "templates}0 for parameter %1 (%2 vs. %3)">;
  1055. def note_ovl_candidate_explicit_arg_mismatch_named : Note<
  1056. "candidate template ignored: invalid explicitly-specified argument "
  1057. "for template parameter %0">;
  1058. def note_ovl_candidate_explicit_arg_mismatch_unnamed : Note<
  1059. "candidate template ignored: invalid explicitly-specified argument "
  1060. "for %ordinal0 template parameter">;
  1061. def note_ovl_candidate_instantiation_depth : Note<
  1062. "candidate template ignored: substitution exceeded maximum template "
  1063. "instantiation depth">;
  1064. def note_ovl_candidate_substitution_failure : Note<
  1065. "candidate template ignored: substitution failure %0">;
  1066. // Note that we don't treat templates differently for this diagnostic.
  1067. def note_ovl_candidate_arity : Note<"candidate "
  1068. "%select{function|function|constructor|function|function|constructor|"
  1069. "constructor (the implicit default constructor)|"
  1070. "constructor (the implicit copy constructor)|"
  1071. "function (the implicit copy assignment operator)}0 %select{|template }1"
  1072. "not viable: requires%select{ at least| at most|}2 %3 argument%s3, but %4 "
  1073. "%plural{1:was|:were}4 provided">;
  1074. def note_ovl_candidate_deleted : Note<
  1075. "candidate %select{function|function|constructor|"
  1076. "function |function |constructor |||}0%1 "
  1077. "has been explicitly %select{made unavailable|deleted}2">;
  1078. // Giving the index of the bad argument really clutters this message, and
  1079. // it's relatively unimportant because 1) it's generally obvious which
  1080. // argument(s) are of the given object type and 2) the fix is usually
  1081. // to complete the type, which doesn't involve changes to the call line
  1082. // anyway. If people complain, we can change it.
  1083. def note_ovl_candidate_bad_conv_incomplete : Note<"candidate "
  1084. "%select{function|function|constructor|"
  1085. "function |function |constructor |"
  1086. "constructor (the implicit default constructor)|"
  1087. "constructor (the implicit copy constructor)|"
  1088. "function (the implicit copy assignment operator)}0%1 "
  1089. "not viable: cannot convert argument of incomplete type %2 to %3">;
  1090. def note_ovl_candidate_bad_overload : Note<"candidate "
  1091. "%select{function|function|constructor|"
  1092. "function |function |constructor |"
  1093. "constructor (the implicit default constructor)|"
  1094. "constructor (the implicit copy constructor)|"
  1095. "function (the implicit copy assignment operator)}0%1"
  1096. " not viable: no overload of %3 matching %2 for %ordinal4 argument">;
  1097. def note_ovl_candidate_bad_conv : Note<"candidate "
  1098. "%select{function|function|constructor|"
  1099. "function |function |constructor |"
  1100. "constructor (the implicit default constructor)|"
  1101. "constructor (the implicit copy constructor)|"
  1102. "function (the implicit copy assignment operator)}0%1"
  1103. " not viable: no known conversion from %2 to %3 for "
  1104. "%select{%ordinal5 argument|object argument}4">;
  1105. def note_ovl_candidate_bad_addrspace : Note<"candidate "
  1106. "%select{function|function|constructor|"
  1107. "function |function |constructor |"
  1108. "constructor (the implicit default constructor)|"
  1109. "constructor (the implicit copy constructor)|"
  1110. "function (the implicit copy assignment operator)}0%1 not viable: "
  1111. "%select{%ordinal6|'this'}5 argument (%2) is in "
  1112. "address space %3, but parameter must be in address space %4">;
  1113. def note_ovl_candidate_bad_cvr_this : Note<"candidate "
  1114. "%select{|function|||function||||"
  1115. "function (the implicit copy assignment operator)}0 not viable: "
  1116. "'this' argument has type %2, but method is not marked "
  1117. "%select{const|volatile|const or volatile|restrict|const or restrict|"
  1118. "volatile or restrict|const, volatile, or restrict}3">;
  1119. def note_ovl_candidate_bad_cvr : Note<"candidate "
  1120. "%select{function|function|constructor|"
  1121. "function |function |constructor |"
  1122. "constructor (the implicit default constructor)|"
  1123. "constructor (the implicit copy constructor)|"
  1124. "function (the implicit copy assignment operator)}0%1 not viable: "
  1125. "%ordinal4 argument (%2) would lose "
  1126. "%select{const|volatile|const and volatile|restrict|const and restrict|"
  1127. "volatile and restrict|const, volatile, and restrict}3 qualifier"
  1128. "%select{||s||s|s|s}3">;
  1129. def note_ambiguous_type_conversion: Note<
  1130. "because of ambiguity in conversion of %0 to %1">;
  1131. def note_ovl_builtin_binary_candidate : Note<
  1132. "built-in candidate %0">;
  1133. def note_ovl_builtin_unary_candidate : Note<
  1134. "built-in candidate %0">;
  1135. def err_ovl_no_viable_function_in_init : Error<
  1136. "no matching constructor for initialization of %0">;
  1137. def err_ovl_ambiguous_init : Error<"call to constructor of %0 is ambiguous">;
  1138. def err_ref_init_ambiguous : Error<
  1139. "reference initialization of type %0 with initializer of type %1 is ambiguous">;
  1140. def err_ovl_deleted_init : Error<
  1141. "call to %select{unavailable|deleted}0 constructor of %1">;
  1142. def err_ovl_ambiguous_oper : Error<
  1143. "use of overloaded operator '%0' is ambiguous">;
  1144. def err_ovl_no_viable_oper : Error<"no viable overloaded '%0'">;
  1145. def err_ovl_deleted_oper : Error<
  1146. "overload resolution selected %select{unavailable|deleted}0 operator '%1'">;
  1147. def err_ovl_no_viable_subscript :
  1148. Error<"no viable overloaded operator[] for type %0">;
  1149. def err_ovl_no_oper :
  1150. Error<"type %0 does not provide a %select{subscript|call}1 operator">;
  1151. def err_ovl_no_viable_object_call : Error<
  1152. "no matching function for call to object of type %0">;
  1153. def err_ovl_ambiguous_object_call : Error<
  1154. "call to object of type %0 is ambiguous">;
  1155. def err_ovl_deleted_object_call : Error<
  1156. "call to %select{unavailable|deleted}0 function call operator in type %1">;
  1157. def note_ovl_surrogate_cand : Note<"conversion candidate of type %0">;
  1158. def err_member_call_without_object : Error<
  1159. "call to non-static member function without an object argument">;
  1160. // C++ Address of Overloaded Function
  1161. def err_addr_ovl_no_viable : Error<
  1162. "address of overloaded function %0 does not match required type %1">;
  1163. def err_addr_ovl_ambiguous : Error<
  1164. "address of overloaded function %0 is ambiguous">;
  1165. def err_addr_ovl_not_func_ptrref : Error<
  1166. "address of overloaded function %0 cannot be converted to type %1">;
  1167. // C++ Template Declarations
  1168. def err_template_param_shadow : Error<
  1169. "declaration of %0 shadows template parameter">;
  1170. def note_template_param_here : Note<"template parameter is declared here">;
  1171. def warn_template_export_unsupported : Warning<
  1172. "exported templates are unsupported">;
  1173. def err_template_outside_namespace_or_class_scope : Error<
  1174. "templates can only be declared in namespace or class scope">;
  1175. def err_template_linkage : Error<"templates must have C++ linkage">;
  1176. def err_template_typedef : Error<"a typedef cannot be a template">;
  1177. def err_template_unnamed_class : Error<
  1178. "cannot declare a class template with no name">;
  1179. def err_template_param_list_different_arity : Error<
  1180. "%select{too few|too many}0 template parameters in template "
  1181. "%select{|template parameter }1redeclaration">;
  1182. def note_template_param_list_different_arity : Note<
  1183. "%select{too few|too many}0 template parameters in template template "
  1184. "argument">;
  1185. def note_template_prev_declaration : Note<
  1186. "previous template %select{declaration|template parameter}0 is here">;
  1187. def err_template_param_different_kind : Error<
  1188. "template parameter has a different kind in template "
  1189. "%select{|template parameter }0redeclaration">;
  1190. def note_template_param_different_kind : Note<
  1191. "template parameter has a different kind in template argument">;
  1192. def err_template_nontype_parm_different_type : Error<
  1193. "template non-type parameter has a different type %0 in template "
  1194. "%select{|template parameter }1redeclaration">;
  1195. def note_template_nontype_parm_different_type : Note<
  1196. "template non-type parameter has a different type %0 in template argument">;
  1197. def note_template_nontype_parm_prev_declaration : Note<
  1198. "previous non-type template parameter with type %0 is here">;
  1199. def err_template_nontype_parm_bad_type : Error<
  1200. "a non-type template parameter cannot have type %0">;
  1201. def err_template_param_default_arg_redefinition : Error<
  1202. "template parameter redefines default argument">;
  1203. def note_template_param_prev_default_arg : Note<
  1204. "previous default template argument defined here">;
  1205. def err_template_param_default_arg_missing : Error<
  1206. "template parameter missing a default argument">;
  1207. def err_template_parameter_default_in_function_template : Error<
  1208. "a template parameter of a function template cannot have a default argument "
  1209. "in C++98">;
  1210. def err_template_parameter_default_template_member : Error<
  1211. "cannot add a default template argument to the definition of a member of a "
  1212. "class template">;
  1213. def err_template_parameter_default_friend_template : Error<
  1214. "default template argument not permitted on a friend template">;
  1215. def err_template_variable : Error<"variable %0 declared as a template">;
  1216. def err_template_variable_noparams : Error<
  1217. "extraneous 'template<>' in declaration of variable %0">;
  1218. def err_template_tag_noparams : Error<
  1219. "extraneous 'template<>' in declaration of %0 %1">;
  1220. def err_template_decl_ref : Error<
  1221. "cannot refer to class template %0 without a template argument list">;
  1222. // C++ Template Argument Lists
  1223. def err_template_missing_args : Error<
  1224. "use of class template %0 requires template arguments">;
  1225. def err_template_arg_list_different_arity : Error<
  1226. "%select{too few|too many}0 template arguments for "
  1227. "%select{class template|function template|template template parameter"
  1228. "|template}1 %2">;
  1229. def note_template_decl_here : Note<"template is declared here">;
  1230. def note_member_of_template_here : Note<"member is declared here">;
  1231. def err_template_arg_must_be_type : Error<
  1232. "template argument for template type parameter must be a type">;
  1233. def err_template_arg_must_be_expr : Error<
  1234. "template argument for non-type template parameter must be an expression">;
  1235. def err_template_arg_nontype_ambig : Error<
  1236. "template argument for non-type template parameter is treated as type %0">;
  1237. def err_template_arg_must_be_template : Error<
  1238. "template argument for template template parameter must be a class template">;
  1239. def err_template_arg_local_type : Error<"template argument uses local type %0">;
  1240. def err_template_arg_unnamed_type : Error<
  1241. "template argument uses unnamed type">;
  1242. def note_template_unnamed_type_here : Note<
  1243. "unnamed type used in template argument was declared here">;
  1244. def err_template_arg_overload_type : Error<
  1245. "template argument is the type of an unresolved overloaded function">;
  1246. def err_template_arg_not_class_template : Error<
  1247. "template argument does not refer to a class template or template "
  1248. "template parameter">;
  1249. def note_template_arg_refers_here_func : Note<
  1250. "template argument refers to function template %0, here">;
  1251. def err_template_arg_template_params_mismatch : Error<
  1252. "template template argument has different template parameters than its "
  1253. "corresponding template template parameter">;
  1254. def err_template_arg_not_integral_or_enumeral : Error<
  1255. "non-type template argument of type %0 must have an integral or enumeration"
  1256. " type">;
  1257. def err_template_arg_not_ice : Error<
  1258. "non-type template argument of type %0 is not an integral constant "
  1259. "expression">;
  1260. def err_deduced_non_type_template_arg_type_mismatch : Error<
  1261. "deduced non-type template argument does not have the same type as the "
  1262. "its corresponding template parameter (%0 vs %1)">;
  1263. def err_template_arg_not_convertible : Error<
  1264. "non-type template argument of type %0 cannot be converted to a value "
  1265. "of type %1">;
  1266. def warn_template_arg_negative : Warning<
  1267. "non-type template argument with value '%0' converted to '%1' for unsigned "
  1268. "template parameter of type %2">;
  1269. def warn_template_arg_too_large : Warning<
  1270. "non-type template argument value '%0' truncated to '%1' for "
  1271. "template parameter of type %2">;
  1272. def err_template_arg_no_ref_bind : Error<
  1273. "non-type template parameter of reference type %0 cannot bind to template "
  1274. "argument of type %1">;
  1275. def err_template_arg_ref_bind_ignores_quals : Error<
  1276. "reference binding of non-type template parameter of type %0 to template "
  1277. "argument of type %1 ignores qualifiers">;
  1278. def err_template_arg_not_decl_ref : Error<
  1279. "non-type template argument does not refer to any declaration">;
  1280. def err_template_arg_not_object_or_func_form : Error<
  1281. "non-type template argument does not directly refer to an object or "
  1282. "function">;
  1283. def err_template_arg_not_address_of : Error<
  1284. "non-type template argument for template parameter of pointer type %0 must "
  1285. "have its address taken">;
  1286. def err_template_arg_address_of_non_pointer : Error<
  1287. "address taken in non-type template argument for template parameter of "
  1288. "reference type %0">;
  1289. def err_template_arg_reference_var : Error<
  1290. "non-type template argument of reference type %0 is not an object">;
  1291. def err_template_arg_field : Error<
  1292. "non-type template argument refers to non-static data member %0">;
  1293. def err_template_arg_method : Error<
  1294. "non-type template argument refers to non-static member function %0">;
  1295. def err_template_arg_function_not_extern : Error<
  1296. "non-template argument refers to function %0 with internal linkage">;
  1297. def err_template_arg_object_not_extern : Error<
  1298. "non-template argument refers to object %0 that does not have external "
  1299. "linkage">;
  1300. def note_template_arg_internal_object : Note<
  1301. "non-template argument refers to %select{function|object}0 here">;
  1302. def note_template_arg_refers_here : Note<"non-template argument refers here">;
  1303. def err_template_arg_not_object_or_func : Error<
  1304. "non-type template argument does not refer to an object or function">;
  1305. def err_template_arg_not_pointer_to_member_form : Error<
  1306. "non-type template argument is not a pointer to member constant">;
  1307. def err_template_arg_extra_parens : Error<
  1308. "non-type template argument cannot be surrounded by parentheses">;
  1309. def err_pointer_to_member_type : Error<
  1310. "invalid use of pointer to member type after %select{.*|->*}0">;
  1311. // C++ template specialization
  1312. def err_template_spec_unknown_kind : Error<
  1313. "can only provide an explicit specialization for a class template, function "
  1314. "template, or a member function, static data member, or member class of a "
  1315. "class template">;
  1316. def note_specialized_entity : Note<
  1317. "explicitly specialized declaration is here">;
  1318. def err_template_spec_decl_function_scope : Error<
  1319. "explicit specialization of %0 in function scope">;
  1320. def err_template_spec_decl_class_scope : Error<
  1321. "explicit specialization of %0 in class scope">;
  1322. def err_template_spec_decl_friend : Error<
  1323. "cannot declare an explicit specialization in a friend">;
  1324. def err_template_spec_decl_out_of_scope_global : Error<
  1325. "%select{class template|class template partial|function template|member "
  1326. "function|static data member|member class}0 specialization of %1 must "
  1327. "originally be declared in the global scope">;
  1328. def err_template_spec_decl_out_of_scope : Error<
  1329. "%select{class template|class template partial|function template|member "
  1330. "function|static data member|member class}0 specialization of %1 must "
  1331. "originally be declared in namespace %2">;
  1332. def err_template_spec_redecl_out_of_scope : Error<
  1333. "%select{class template|class template partial|function template|member "
  1334. "function|static data member|member class}0 specialization of %1 not in a "
  1335. "namespace enclosing %2">;
  1336. def err_template_spec_redecl_global_scope : Error<
  1337. "%select{class template|class template partial|function template|member "
  1338. "function|static data member|member class}0 specialization of %1 must occur "
  1339. "at global scope">;
  1340. def err_spec_member_not_instantiated : Error<
  1341. "specialization of member %q0 does not specialize an instantiated member">;
  1342. def note_specialized_decl : Note<"attempt to specialize declaration here">;
  1343. def err_specialization_after_instantiation : Error<
  1344. "explicit specialization of %0 after instantiation">;
  1345. def note_instantiation_required_here : Note<
  1346. "%select{implicit|explicit}0 instantiation first required here">;
  1347. def err_template_spec_friend : Error<
  1348. "template specialization declaration cannot be a friend">;
  1349. def err_template_spec_default_arg : Error<
  1350. "default argument not permitted on an explicit "
  1351. "%select{instantiation|specialization}0 of function %1">;
  1352. def err_not_class_template_specialization : Error<
  1353. "cannot specialize a %select{dependent template|template template "
  1354. "parameter}0">;
  1355. // C++ class template specializations and out-of-line definitions
  1356. def err_template_spec_needs_header : Error<
  1357. "template specialization requires 'template<>'">;
  1358. def err_template_spec_needs_template_parameters : Error<
  1359. "template specialization or definition requires a template parameter list "
  1360. "corresponding to the nested type %0">;
  1361. def err_template_param_list_matches_nontemplate : Error<
  1362. "template parameter list matching the non-templated nested type %0 should "
  1363. "be empty ('template<>')">;
  1364. def err_template_spec_extra_headers : Error<
  1365. "extraneous template parameter list in template specialization or "
  1366. "out-of-line template definition">;
  1367. def warn_template_spec_extra_headers : Warning<
  1368. "extraneous template parameter list in template specialization">;
  1369. def note_explicit_template_spec_does_not_need_header : Note<
  1370. "'template<>' header not required for explicitly-specialized class %0 "
  1371. "declared here">;
  1372. def err_template_qualified_declarator_no_match : Error<
  1373. "nested name specifier '%0' for declaration does not refer into a class, "
  1374. "class template or class template partial specialization">;
  1375. // C++ Class Template Partial Specialization
  1376. def err_default_arg_in_partial_spec : Error<
  1377. "default template argument in a class template partial specialization">;
  1378. def err_dependent_non_type_arg_in_partial_spec : Error<
  1379. "non-type template argument depends on a template parameter of the "
  1380. "partial specialization">;
  1381. def err_dependent_typed_non_type_arg_in_partial_spec : Error<
  1382. "non-type template argument specializes a template parameter with "
  1383. "dependent type %0">;
  1384. def err_partial_spec_args_match_primary_template : Error<
  1385. "class template partial specialization does not specialize any template "
  1386. "argument; to %select{declare|define}0 the primary template, remove the "
  1387. "template argument list">;
  1388. def warn_partial_specs_not_deducible : Warning<
  1389. "class template partial specialization contains "
  1390. "%select{a template parameter|template parameters}0 that can not be "
  1391. "deduced; this partial specialization will never be used">;
  1392. def note_partial_spec_unused_parameter : Note<
  1393. "non-deducible template parameter %0">;
  1394. def err_partial_spec_ordering_ambiguous : Error<
  1395. "ambiguous partial specializations of %0">;
  1396. def note_partial_spec_match : Note<"partial specialization matches %0">;
  1397. def err_partial_spec_redeclared : Error<
  1398. "class template partial specialization %0 cannot be redeclared">;
  1399. def note_prev_partial_spec_here : Note<
  1400. "previous declaration of class template partial specialization %0 is here">;
  1401. def err_partial_spec_fully_specialized : Error<
  1402. "partial specialization of %0 does not use any of its template parameters">;
  1403. // C++ Function template specializations
  1404. def err_function_template_spec_no_match : Error<
  1405. "no function template matches function template specialization %0">;
  1406. def err_function_template_spec_ambiguous : Error<
  1407. "function template specialization %0 ambiguously refers to more than one "
  1408. "function template; explicitly specify%select{|additional }1 template "
  1409. "arguments to identify a particular function template">;
  1410. def note_function_template_spec_matched : Note<
  1411. "function template matches specialization %0">;
  1412. // C++ Template Instantiation
  1413. def err_template_recursion_depth_exceeded : Error<
  1414. "recursive template instantiation exceeded maximum depth of %0">,
  1415. DefaultFatal, NoSFINAE;
  1416. def note_template_recursion_depth : Note<
  1417. "use -ftemplate-depth-N to increase recursive template instantiation depth">;
  1418. def err_template_instantiate_undefined : Error<
  1419. "%select{implicit|explicit}0 instantiation of undefined template %1">;
  1420. def err_implicit_instantiate_member_undefined : Error<
  1421. "implicit instantiation of undefined member %0">;
  1422. def note_template_class_instantiation_here : Note<
  1423. "in instantiation of template class %0 requested here">;
  1424. def note_template_member_class_here : Note<
  1425. "in instantiation of member class %0 requested here">;
  1426. def note_template_member_function_here : Note<
  1427. "in instantiation of member function %q0 requested here">;
  1428. def note_function_template_spec_here : Note<
  1429. "in instantiation of function template specialization %q0 requested here">;
  1430. def note_template_static_data_member_def_here : Note<
  1431. "in instantiation of static data member %q0 requested here">;
  1432. def note_default_arg_instantiation_here : Note<
  1433. "in instantiation of default argument for '%0' required here">;
  1434. def note_default_function_arg_instantiation_here : Note<
  1435. "in instantiation of default function argument expression "
  1436. "for '%0' required here">;
  1437. def note_explicit_template_arg_substitution_here : Note<
  1438. "while substituting explicitly-specified template arguments into function "
  1439. "template %0 %1">;
  1440. def note_function_template_deduction_instantiation_here : Note<
  1441. "while substituting deduced template arguments into function template %0 "
  1442. "%1">;
  1443. def note_partial_spec_deduct_instantiation_here : Note<
  1444. "during template argument deduction for class template partial "
  1445. "specialization %0 %1">;
  1446. def note_prior_template_arg_substitution : Note<
  1447. "while substituting prior template arguments into %select{non-type|template}0"
  1448. " template parameter%1 %2">;
  1449. def note_template_default_arg_checking : Note<
  1450. "while checking a default template argument used here">;
  1451. def note_instantiation_contexts_suppressed : Note<
  1452. "(skipping %0 context%s0 in backtrace; use -ftemplate-backtrace-limit=0 to "
  1453. "see all)">;
  1454. def err_field_instantiates_to_function : Error<
  1455. "data member instantiated with function type %0">;
  1456. def err_nested_name_spec_non_tag : Error<
  1457. "type %0 cannot be used prior to '::' because it has no members">;
  1458. // C++ Explicit Instantiation
  1459. def err_explicit_instantiation_duplicate : Error<
  1460. "duplicate explicit instantiation of %0">;
  1461. def note_previous_explicit_instantiation : Note<
  1462. "previous explicit instantiation is here">;
  1463. def ext_explicit_instantiation_after_specialization : Extension<
  1464. "explicit instantiation of %0 that occurs after an explicit "
  1465. "specialization will be ignored (C++0x extension)">;
  1466. def note_previous_template_specialization : Note<
  1467. "previous template specialization is here">;
  1468. def err_explicit_instantiation_enum : Error<
  1469. "explicit instantiation of enumeration type %0">;
  1470. def err_explicit_instantiation_nontemplate_type : Error<
  1471. "explicit instantiation of non-templated type %0">;
  1472. def note_nontemplate_decl_here : Note<
  1473. "non-templated declaration is here">;
  1474. def err_explicit_instantiation_out_of_scope : Error<
  1475. "explicit instantiation of %0 not in a namespace enclosing %1">;
  1476. def err_explicit_instantiation_must_be_global : Error<
  1477. "explicit instantiation of %0 must occur at global scope">;
  1478. def warn_explicit_instantiation_out_of_scope_0x : Warning<
  1479. "explicit instantiation of %0 not in a namespace enclosing %1">,
  1480. InGroup<DiagGroup<"-Wc++0x-compat"> >;
  1481. def warn_explicit_instantiation_must_be_global_0x : Warning<
  1482. "explicit instantiation of %0 must occur at global scope">,
  1483. InGroup<DiagGroup<"-Wc++0x-compat"> >;
  1484. def err_explicit_instantiation_requires_name : Error<
  1485. "explicit instantiation declaration requires a name">;
  1486. def err_explicit_instantiation_of_typedef : Error<
  1487. "explicit instantiation of typedef %0">;
  1488. def err_explicit_instantiation_not_known : Error<
  1489. "explicit instantiation of %0 does not refer to a function template, member "
  1490. "function, member class, or static data member">;
  1491. def note_explicit_instantiation_here : Note<
  1492. "explicit instantiation refers here">;
  1493. def err_explicit_instantiation_data_member_not_instantiated : Error<
  1494. "explicit instantiation refers to static data member %q0 that is not an "
  1495. "instantiation">;
  1496. def err_explicit_instantiation_member_function_not_instantiated : Error<
  1497. "explicit instantiation refers to member function %q0 that is not an "
  1498. "instantiation">;
  1499. def err_explicit_instantiation_ambiguous : Error<
  1500. "partial ordering for explicit instantiation of %0 is ambiguous">;
  1501. def note_explicit_instantiation_candidate : Note<
  1502. "explicit instantiation candidate function template here %0">;
  1503. def err_explicit_instantiation_inline : Error<
  1504. "explicit instantiation cannot be 'inline'">;
  1505. def ext_explicit_instantiation_without_qualified_id : ExtWarn<
  1506. "qualifier in explicit instantiation of %q0 requires a template-id "
  1507. "(a typedef is not permitted)">;
  1508. def err_explicit_instantiation_unqualified_wrong_namespace : Error<
  1509. "explicit instantiation of %q0 must occur in %1">;
  1510. def warn_explicit_instantiation_unqualified_wrong_namespace_0x : Warning<
  1511. "explicit instantiation of %q0 must occur in %1">,
  1512. InGroup<DiagGroup<"c++0x-compat"> >;
  1513. def err_explicit_instantiation_undefined_member : Error<
  1514. "explicit instantiation of undefined %select{member class|member function|"
  1515. "static data member}0 %1 of class template %2">;
  1516. def err_explicit_instantiation_undefined_func_template : Error<
  1517. "explicit instantiation of undefined function template %0">;
  1518. def err_explicit_instantiation_declaration_after_definition : Error<
  1519. "explicit instantiation declaration (with 'extern') follows explicit "
  1520. "instantiation definition (without 'extern')">;
  1521. def note_explicit_instantiation_definition_here : Note<
  1522. "explicit instantiation definition is here">;
  1523. // C++ typename-specifiers
  1524. def err_typename_nested_not_found : Error<"no type named %0 in %1">;
  1525. def err_typename_nested_not_type : Error<
  1526. "typename specifier refers to non-type member %0 in %1">;
  1527. def note_typename_refers_here : Note<
  1528. "referenced member %0 is declared here">;
  1529. def err_typename_missing : Error<
  1530. "missing 'typename' prior to dependent type name '%0%1'">;
  1531. def ext_typename_outside_of_template : ExtWarn<
  1532. "'typename' occurs outside of a template">;
  1533. def err_template_kw_refers_to_non_template : Error<
  1534. "%0 following the 'template' keyword does not refer to a template">;
  1535. def err_template_kw_refers_to_function_template : Error<
  1536. "%0 following the 'template' keyword refers to a function template">;
  1537. def err_template_kw_refers_to_class_template : Error<
  1538. "'%0%1' instantiated to a class template, not a function template">;
  1539. def note_referenced_class_template : Error<
  1540. "class template declared here">;
  1541. def err_template_kw_missing : Error<
  1542. "missing 'template' keyword prior to dependent template name '%0%1'">;
  1543. def ext_template_outside_of_template : ExtWarn<
  1544. "'template' keyword outside of a template">;
  1545. // C++0x Variadic Templates
  1546. def err_template_param_pack_default_arg : Error<
  1547. "template parameter pack cannot have a default argument">;
  1548. def err_template_param_pack_must_be_last_template_parameter : Error<
  1549. "template parameter pack must be the last template parameter">;
  1550. def err_template_parameter_pack_non_pack : Error<
  1551. "template %select{type|non-type|template}0 parameter%select{| pack}1 "
  1552. "conflicts with previous template %select{type|non-type|template}0 "
  1553. "parameter%select{ pack|}1">;
  1554. def note_template_parameter_pack_non_pack : Note<
  1555. "template %select{type|non-type|template}0 parameter%select{| pack}1 "
  1556. "does not match template %select{type|non-type|template}0 "
  1557. "parameter%select{ pack|}1 in template argument">;
  1558. def note_template_parameter_pack_here : Note<
  1559. "previous template %select{type|non-type|template}0 "
  1560. "parameter%select{| pack}1 declared here">;
  1561. def err_unexpected_typedef : Error<
  1562. "unexpected type name %0: expected expression">;
  1563. def err_unexpected_namespace : Error<
  1564. "unexpected namespace name %0: expected expression">;
  1565. def err_undeclared_var_use : Error<"use of undeclared identifier %0">;
  1566. def note_dependent_var_use : Note<"must qualify identifier to find this "
  1567. "declaration in dependent base class">;
  1568. def err_undeclared_use : Error<"use of undeclared %0">;
  1569. def warn_deprecated : Warning<"%0 is deprecated">,
  1570. InGroup<DiagGroup<"deprecated-declarations">>;
  1571. def warn_unavailable : Warning<"%0 is unavailable">,
  1572. InGroup<DiagGroup<"unavailable-declarations">>;
  1573. def note_unavailable_here : Note<
  1574. "function has been explicitly marked %select{unavailable|deleted}0 here">;
  1575. def warn_not_enough_argument : Warning<
  1576. "not enough variable arguments in %0 declaration to fit a sentinel">;
  1577. def warn_missing_sentinel : Warning <
  1578. "missing sentinel in %select{function call|method dispatch|block call}0">;
  1579. def note_sentinel_here : Note<
  1580. "%select{function|method|block}0 has been explicitly marked sentinel here">;
  1581. def warn_missing_prototype : Warning<
  1582. "no previous prototype for function %0">,
  1583. InGroup<DiagGroup<"missing-prototypes">>, DefaultIgnore;
  1584. def err_redefinition : Error<"redefinition of %0">;
  1585. def err_definition_of_implicitly_declared_member : Error<
  1586. "definition of implicitly declared %select{constructor|copy constructor|"
  1587. "copy assignment operator|destructor}1">;
  1588. def warn_redefinition_of_typedef : Warning<
  1589. "redefinition of typedef %0 is invalid in C">,
  1590. InGroup<DiagGroup<"typedef-redefinition"> >, DefaultError;
  1591. def err_static_non_static : Error<
  1592. "static declaration of %0 follows non-static declaration">;
  1593. def err_non_static_static : Error<
  1594. "non-static declaration of %0 follows static declaration">;
  1595. def err_non_thread_thread : Error<
  1596. "non-thread-local declaration of %0 follows thread-local declaration">;
  1597. def err_thread_non_thread : Error<
  1598. "thread-local declaration of %0 follows non-thread-local declaration">;
  1599. def err_redefinition_different_type : Error<
  1600. "redefinition of %0 with a different type">;
  1601. def err_redefinition_different_kind : Error<
  1602. "redefinition of %0 as different kind of symbol">;
  1603. def err_redefinition_different_typedef : Error<
  1604. "typedef redefinition with different types (%0 vs %1)">;
  1605. def err_tag_reference_non_tag : Error<
  1606. "elaborated type refers to %select{a non-tag type|a typedef|a template}0">;
  1607. def err_tag_reference_conflict : Error<
  1608. "implicit declaration introduced by elaborated type conflicts with "
  1609. "%select{a declaration|a typedef|a template}0 of the same name">;
  1610. def err_dependent_tag_decl : Error<
  1611. "%select{declaration|definition}0 of %select{struct|union|class|enum}1 "
  1612. "in a dependent scope">;
  1613. def err_tag_definition_of_typedef : Error<
  1614. "definition of type %0 conflicts with typedef of the same name">;
  1615. def err_conflicting_types : Error<"conflicting types for %0">;
  1616. def err_nested_redefinition : Error<"nested redefinition of %0">;
  1617. def err_use_with_wrong_tag : Error<
  1618. "use of %0 with tag type that does not match previous declaration">;
  1619. def warn_struct_class_tag_mismatch : Warning<
  1620. "%select{struct|class}0 %select{|template}1 %2 was previously declared "
  1621. "as a %select{class|struct}0 %select{|template}1">,
  1622. InGroup<MismatchedTags>, DefaultIgnore;
  1623. def ext_forward_ref_enum : Extension<
  1624. "ISO C forbids forward references to 'enum' types">;
  1625. def err_forward_ref_enum : Error<
  1626. "ISO C++ forbids forward references to 'enum' types">;
  1627. def err_redefinition_of_enumerator : Error<"redefinition of enumerator %0">;
  1628. def err_duplicate_member : Error<"duplicate member %0">;
  1629. def err_misplaced_ivar : Error<
  1630. "ivars may not be placed in %select{categories|class extension}0">;
  1631. def ext_enum_value_not_int : Extension<
  1632. "ISO C restricts enumerator values to range of 'int' (%0 is too "
  1633. "%select{small|large}1)">;
  1634. def warn_enum_too_large : Warning<
  1635. "enumeration values exceed range of largest integer">;
  1636. def warn_enumerator_too_large : Warning<
  1637. "enumerator value %0 is not representable in the largest integer type">;
  1638. def warn_illegal_constant_array_size : Extension<
  1639. "size of static array must be an integer constant expression">;
  1640. def err_vm_decl_in_file_scope : Error<
  1641. "variably modified type declaration not allowed at file scope">;
  1642. def err_vm_decl_has_extern_linkage : Error<
  1643. "variably modified type declaration can not have 'extern' linkage">;
  1644. def err_typecheck_field_variable_size : Error<
  1645. "fields must have a constant size: 'variable length array in structure' "
  1646. "extension will never be supported">;
  1647. def err_vm_func_decl : Error<
  1648. "function declaration cannot have variably modified type">;
  1649. def err_typecheck_negative_array_size : Error<"array size is negative">;
  1650. def warn_typecheck_function_qualifiers : Warning<
  1651. "qualifier on function type %0 has unspecified behavior">;
  1652. def err_typecheck_invalid_restrict_not_pointer : Error<
  1653. "restrict requires a pointer or reference (%0 is invalid)">;
  1654. def err_typecheck_invalid_restrict_not_pointer_noarg : Error<
  1655. "restrict requires a pointer or reference">;
  1656. def err_typecheck_invalid_restrict_invalid_pointee : Error<
  1657. "pointer to function type %0 may not be 'restrict' qualified">;
  1658. def ext_typecheck_zero_array_size : Extension<
  1659. "zero size arrays are an extension">;
  1660. def err_typecheck_zero_array_size : Error<
  1661. "zero-length arrays are not permitted in C++">;
  1662. def err_at_least_one_initializer_needed_to_size_array : Error<
  1663. "at least one initializer value required to size array">;
  1664. def err_array_size_non_int : Error<"size of array has non-integer type %0">;
  1665. def err_init_element_not_constant : Error<
  1666. "initializer element is not a compile-time constant">;
  1667. def err_block_extern_cant_init : Error<
  1668. "'extern' variable cannot have an initializer">;
  1669. def warn_extern_init : Warning<"'extern' variable has an initializer">;
  1670. def err_variable_object_no_init : Error<
  1671. "variable-sized object may not be initialized">;
  1672. def err_array_init_list_required : Error<
  1673. "initialization with '{...}' expected for array">;
  1674. def err_excess_initializers : Error<
  1675. "excess elements in %select{array|vector|scalar|union|struct}0 initializer">;
  1676. def warn_excess_initializers : ExtWarn<
  1677. "excess elements in %select{array|vector|scalar|union|struct}0 initializer">;
  1678. def err_excess_initializers_in_char_array_initializer : Error<
  1679. "excess elements in char array initializer">;
  1680. def warn_excess_initializers_in_char_array_initializer : ExtWarn<
  1681. "excess elements in char array initializer">;
  1682. def warn_initializer_string_for_char_array_too_long : ExtWarn<
  1683. "initializer-string for char array is too long">;
  1684. def warn_missing_field_initializers : Warning<
  1685. "missing field '%0' initializer">,
  1686. InGroup<MissingFieldInitializers>, DefaultIgnore;
  1687. def warn_braces_around_scalar_init : Warning<
  1688. "braces around scalar initializer">;
  1689. def err_many_braces_around_scalar_init : Error<
  1690. "too many braces around scalar initializer">;
  1691. def err_empty_scalar_initializer : Error<"scalar initializer cannot be empty">;
  1692. def err_illegal_initializer : Error<
  1693. "illegal initializer (only variables can be initialized)">;
  1694. def err_illegal_initializer_type : Error<"illegal initializer type %0">;
  1695. def err_init_objc_class : Error<
  1696. "cannot initialize Objective-C class type %0">;
  1697. def err_implicit_empty_initializer : Error<
  1698. "initializer for aggregate with no elements requires explicit braces">;
  1699. def err_bitfield_has_negative_width : Error<
  1700. "bit-field %0 has negative width (%1)">;
  1701. def err_anon_bitfield_has_negative_width : Error<
  1702. "anonymous bit-field has negative width (%0)">;
  1703. def err_bitfield_has_zero_width : Error<"named bit-field %0 has zero width">;
  1704. def err_bitfield_width_exceeds_type_size : Error<
  1705. "size of bit-field %0 (%1 bits) exceeds size of its type (%2 bits)">;
  1706. def err_anon_bitfield_width_exceeds_type_size : Error<
  1707. "size of anonymous bit-field (%0 bits) exceeds size of its type (%1 bits)">;
  1708. // Used by C++ which allows bit-fields that are wider than the type.
  1709. def warn_bitfield_width_exceeds_type_size: Warning<
  1710. "size of bit-field %0 (%1 bits) exceeds the size of its type; value will be "
  1711. "truncated to %2 bits">;
  1712. def warn_anon_bitfield_width_exceeds_type_size : Warning<
  1713. "size of anonymous bit-field (%0 bits) exceeds size of its type; value will "
  1714. "be truncated to %1 bits">;
  1715. def warn_missing_braces : Warning<
  1716. "suggest braces around initialization of subobject">,
  1717. InGroup<DiagGroup<"missing-braces">>, DefaultIgnore;
  1718. def err_redefinition_of_label : Error<"redefinition of label '%0'">;
  1719. def err_undeclared_label_use : Error<"use of undeclared label '%0'">;
  1720. def err_goto_into_protected_scope : Error<"illegal goto into protected scope">;
  1721. def err_switch_into_protected_scope : Error<
  1722. "illegal switch case into protected scope">;
  1723. def err_indirect_goto_without_addrlabel : Error<
  1724. "indirect goto in function with no address-of-label expressions">;
  1725. def warn_indirect_goto_in_protected_scope : Warning<
  1726. "indirect goto might cross protected scopes">,
  1727. InGroup<DiagGroup<"label-address-scope">>;
  1728. def note_indirect_goto_target : Note<"possible target of indirect goto">;
  1729. def note_protected_by_variable_init : Note<
  1730. "jump bypasses variable initialization">;
  1731. def note_protected_by_cleanup : Note<
  1732. "jump bypasses initialization of variable with __attribute__((cleanup))">;
  1733. def note_protected_by_vla_typedef : Note<
  1734. "jump bypasses initialization of VLA typedef">;
  1735. def note_protected_by_vla : Note<
  1736. "jump bypasses initialization of variable length array">;
  1737. def note_protected_by_objc_try : Note<
  1738. "jump bypasses initialization of @try block">;
  1739. def note_protected_by_objc_catch : Note<
  1740. "jump bypasses initialization of @catch block">;
  1741. def note_protected_by_objc_finally : Note<
  1742. "jump bypasses initialization of @finally block">;
  1743. def note_protected_by_objc_synchronized : Note<
  1744. "jump bypasses initialization of @synchronized block">;
  1745. def note_protected_by_cxx_try : Note<
  1746. "jump bypasses initialization of try block">;
  1747. def note_protected_by_cxx_catch : Note<
  1748. "jump bypasses initialization of catch block">;
  1749. def note_protected_by___block : Note<
  1750. "jump bypasses setup of __block variable">;
  1751. def note_exits_cleanup : Note<
  1752. "jump exits scope of variable with __attribute__((cleanup))">;
  1753. def note_exits_dtor : Note<
  1754. "jump exits scope of variable with non-trivial destructor">;
  1755. def note_exits___block : Note<
  1756. "jump exits scope of __block variable">;
  1757. def note_exits_objc_try : Note<
  1758. "jump exits @try block">;
  1759. def note_exits_objc_catch : Note<
  1760. "jump exits @catch block">;
  1761. def note_exits_objc_finally : Note<
  1762. "jump exits @finally block">;
  1763. def note_exits_objc_synchronized : Note<
  1764. "jump exits @synchronized block">;
  1765. def note_exits_cxx_try : Note<
  1766. "jump exits try block">;
  1767. def note_exits_cxx_catch : Note<
  1768. "jump exits catch block">;
  1769. def err_func_returning_array_function : Error<
  1770. "function cannot return %select{array|function}0 type %1">;
  1771. def err_field_declared_as_function : Error<"field %0 declared as a function">;
  1772. def err_field_incomplete : Error<"field has incomplete type %0">;
  1773. def ext_variable_sized_type_in_struct : ExtWarn<
  1774. "field %0 with variable sized type %1 not at the end of a struct or class is"
  1775. " a GNU extension">, InGroup<GNU>;
  1776. def err_flexible_array_empty_struct : Error<
  1777. "flexible array %0 not allowed in otherwise empty struct">;
  1778. def err_flexible_array_has_nonpod_type : Error<
  1779. "flexible array member %0 of non-POD element type %1">;
  1780. def ext_flexible_array_in_struct : Extension<
  1781. "%0 may not be nested in a struct due to flexible array member">;
  1782. def ext_flexible_array_in_array : Extension<
  1783. "%0 may not be used as an array element due to flexible array member">;
  1784. def err_flexible_array_init_nonempty : Error<
  1785. "non-empty initialization of flexible array member inside subobject">;
  1786. def err_flexible_array_init_needs_braces : Error<
  1787. "flexible array requires brace-enclosed initializer">;
  1788. def err_illegal_decl_array_of_functions : Error<
  1789. "'%0' declared as array of functions of type %1">;
  1790. def err_illegal_decl_array_incomplete_type : Error<
  1791. "array has incomplete element type %0">;
  1792. def err_illegal_message_expr_incomplete_type : Error<
  1793. "objective-c message has incomplete result type %0">;
  1794. def err_illegal_decl_array_of_references : Error<
  1795. "'%0' declared as array of references of type %1">;
  1796. def err_array_star_outside_prototype : Error<
  1797. "star modifier used outside of function prototype">;
  1798. def err_illegal_decl_pointer_to_reference : Error<
  1799. "'%0' declared as a pointer to a reference of type %1">;
  1800. def err_illegal_decl_mempointer_to_reference : Error<
  1801. "'%0' declared as a member pointer to a reference of type %1">;
  1802. def err_illegal_decl_mempointer_to_void : Error<
  1803. "'%0' declared as a member pointer to void">;
  1804. def err_illegal_decl_mempointer_in_nonclass : Error<
  1805. "'%0' does not point into a class">;
  1806. def err_mempointer_in_nonclass_type : Error<
  1807. "member pointer refers into non-class type %0">;
  1808. def err_reference_to_void : Error<"cannot form a reference to 'void'">;
  1809. def err_qualified_block_pointer_type : Error<
  1810. "qualifier specification on block pointer type not allowed">;
  1811. def err_nonfunction_block_type : Error<
  1812. "block pointer to non-function type is invalid">;
  1813. def err_return_block_has_expr : Error<"void block should not return a value">;
  1814. def err_block_return_missing_expr : Error<
  1815. "non-void block should return a value">;
  1816. def err_block_with_return_type_requires_args : Error<
  1817. "block with explicit return type requires argument list">;
  1818. def err_func_def_incomplete_result : Error<
  1819. "incomplete result type %0 in function definition">;
  1820. // Expressions.
  1821. def ext_sizeof_function_type : Extension<
  1822. "invalid application of 'sizeof' to a function type">, InGroup<PointerArith>;
  1823. def err_sizeof_alignof_overloaded_function_type : Error<
  1824. "invalid application of '%select{sizeof|__alignof}0' to an overloaded "
  1825. "function">;
  1826. def ext_sizeof_void_type : Extension<
  1827. "invalid application of '%0' to a void type">, InGroup<PointerArith>;
  1828. def err_sizeof_alignof_incomplete_type : Error<
  1829. "invalid application of '%select{sizeof|__alignof}0' to an incomplete type %1">;
  1830. def err_sizeof_alignof_bitfield : Error<
  1831. "invalid application of '%select{sizeof|__alignof}0' to bit-field">;
  1832. def err_offsetof_incomplete_type : Error<
  1833. "offsetof of incomplete type %0">;
  1834. def err_offsetof_record_type : Error<
  1835. "offsetof requires struct, union, or class type, %0 invalid">;
  1836. def err_offsetof_array_type : Error<"offsetof requires array type, %0 invalid">;
  1837. def ext_offsetof_extended_field_designator : Extension<
  1838. "using extended field designator is an extension">;
  1839. def warn_offsetof_non_pod_type : ExtWarn<"offset of on non-POD type %0">,
  1840. InGroup<InvalidOffsetof>;
  1841. def err_offsetof_bitfield : Error<"cannot compute offset of bit-field %0">;
  1842. def warn_floatingpoint_eq : Warning<
  1843. "comparing floating point with == or != is unsafe">,
  1844. InGroup<DiagGroup<"float-equal">>, DefaultIgnore;
  1845. def warn_division_by_zero : Warning<"division by zero is undefined">;
  1846. def warn_remainder_by_zero : Warning<"remainder by zero is undefined">;
  1847. def warn_shift_negative : Warning<"shift count is negative">;
  1848. def warn_shift_gt_typewidth : Warning<"shift count >= width of type">;
  1849. def warn_precedence_bitwise_rel : Warning<
  1850. "%0 has lower precedence than %1; %1 will be evaluated first">,
  1851. InGroup<Parentheses>;
  1852. def note_precedence_bitwise_first : Note<
  1853. "place parentheses around the %0 expression to evaluate it first">;
  1854. def note_precedence_bitwise_silence : Note<
  1855. "place parentheses around the %0 expression to silence this warning">;
  1856. def err_sizeof_nonfragile_interface : Error<
  1857. "invalid application of '%select{alignof|sizeof}1' to interface %0 in "
  1858. "non-fragile ABI">;
  1859. def err_atdef_nonfragile_interface : Error<
  1860. "invalid application of @defs in non-fragile ABI">;
  1861. def err_subscript_nonfragile_interface : Error<
  1862. "subscript requires size of interface %0, which is not constant in "
  1863. "non-fragile ABI">;
  1864. def err_arithmetic_nonfragile_interface : Error<
  1865. "arithmetic on pointer to interface %0, which is not a constant size in "
  1866. "non-fragile ABI">;
  1867. def ext_subscript_non_lvalue : Extension<
  1868. "ISO C90 does not allow subscripting non-lvalue array">;
  1869. def err_typecheck_subscript_value : Error<
  1870. "subscripted value is not an array, pointer, or vector">;
  1871. def err_typecheck_subscript_not_integer : Error<
  1872. "array subscript is not an integer">;
  1873. def err_subscript_function_type : Error<
  1874. "subscript of pointer to function type %0">;
  1875. def err_subscript_incomplete_type : Error<
  1876. "subscript of pointer to incomplete type %0">;
  1877. def err_typecheck_member_reference_struct_union : Error<
  1878. "member reference base type %0 is not a structure or union">;
  1879. def err_typecheck_member_reference_ivar : Error<
  1880. "%0 does not have a member named %1">;
  1881. def err_typecheck_member_reference_arrow : Error<
  1882. "member reference type %0 is not a pointer">;
  1883. def err_typecheck_member_reference_suggestion : Error<
  1884. "member reference type %0 is %select{a|not a}1 pointer; maybe you meant to use '%select{->|.}1'?">;
  1885. def err_typecheck_member_reference_type : Error<
  1886. "cannot refer to type member %0 in %1 with '%select{.|->}2'">;
  1887. def err_typecheck_member_reference_unknown : Error<
  1888. "cannot refer to member %0 in %1 with '%select{.|->}2'">;
  1889. def err_member_reference_needs_call : Error<
  1890. "base of member reference has function type %0; perhaps you meant to call "
  1891. "this function with '()'?">;
  1892. def warn_subscript_is_char : Warning<"array subscript is of type 'char'">,
  1893. InGroup<CharSubscript>, DefaultIgnore;
  1894. def err_typecheck_incomplete_tag : Error<"incomplete definition of type %0">;
  1895. def err_no_member : Error<"no member named %0 in %1">;
  1896. def err_member_redeclared : Error<"class member cannot be redeclared">;
  1897. def err_member_def_undefined_record : Error<
  1898. "out-of-line definition of %0 from class %1 without definition">;
  1899. def err_member_def_does_not_match : Error<
  1900. "out-of-line definition of %0 does not match any declaration in %1">;
  1901. def err_nonstatic_member_out_of_line : Error<
  1902. "non-static data member defined out-of-line">;
  1903. def err_qualified_typedef_declarator : Error<
  1904. "typedef declarator cannot be qualified">;
  1905. def err_qualified_param_declarator : Error<
  1906. "parameter declarator cannot be qualified">;
  1907. def err_out_of_line_declaration : Error<
  1908. "out-of-line declaration of a member must be a definition">;
  1909. def note_member_def_close_match : Note<"member declaration nearly matches">;
  1910. def err_typecheck_ivar_variable_size : Error<
  1911. "instance variables must have a constant size">;
  1912. def err_ivar_reference_type : Error<
  1913. "instance variables cannot be of reference type">;
  1914. def err_typecheck_illegal_increment_decrement : Error<
  1915. "cannot %select{decrement|increment}1 value of type %0">;
  1916. def err_typecheck_arithmetic_incomplete_type : Error<
  1917. "arithmetic on pointer to incomplete type %0">;
  1918. def err_typecheck_pointer_arith_function_type : Error<
  1919. "arithmetic on pointer to function type %0">;
  1920. def err_typecheck_pointer_arith_void_type : Error<
  1921. "arithmetic on pointer to void type">;
  1922. def err_typecheck_decl_incomplete_type : Error<
  1923. "variable has incomplete type %0">;
  1924. def ext_typecheck_decl_incomplete_type : ExtWarn<
  1925. "tentative definition of variable with internal linkage has incomplete non-array type %0">;
  1926. def err_tentative_def_incomplete_type : Error<
  1927. "tentative definition has type %0 that is never completed">;
  1928. def err_tentative_def_incomplete_type_arr : Error<
  1929. "tentative definition has array of type %0 that is never completed">;
  1930. def warn_tentative_incomplete_array : Warning<
  1931. "tentative array definition assumed to have one element">;
  1932. def err_typecheck_incomplete_array_needs_initializer : Error<
  1933. "definition of variable with array type needs an explicit size "
  1934. "or an initializer">;
  1935. def err_array_init_not_init_list : Error<
  1936. "array initializer must be an initializer "
  1937. "list%select{| or string literal}0">;
  1938. def warn_deprecated_string_literal_conversion : Warning<
  1939. "conversion from string literal to %0 is deprecated">, InGroup<Deprecated>;
  1940. def err_realimag_invalid_type : Error<"invalid type %0 to %1 operator">;
  1941. def err_typecheck_sclass_fscope : Error<
  1942. "illegal storage class on file-scoped variable">;
  1943. def err_unsupported_global_register : Error<
  1944. "global register variables are not supported">;
  1945. def err_typecheck_sclass_func : Error<"illegal storage class on function">;
  1946. def err_static_block_func : Error<
  1947. "function declared in block scope cannot have 'static' storage class">;
  1948. def err_typecheck_address_of : Error<"address of %0 requested">;
  1949. def ext_typecheck_addrof_void : Extension<
  1950. "ISO C forbids taking the address of an expression of type 'void'">;
  1951. def err_unqualified_pointer_member_function : Error<
  1952. "must explicitly qualify member function %0 when taking its address">;
  1953. def err_typecheck_invalid_lvalue_addrof : Error<
  1954. "address expression must be an lvalue or a function designator">;
  1955. def ext_typecheck_addrof_class_temporary : ExtWarn<
  1956. "taking the address of a temporary object of type %0">,
  1957. InGroup<DiagGroup<"address-of-temporary">>, DefaultError;
  1958. def err_typecheck_addrof_class_temporary : Error<
  1959. "taking the address of a temporary object of type %0">;
  1960. def err_typecheck_unary_expr : Error<
  1961. "invalid argument type %0 to unary expression">;
  1962. def err_typecheck_indirection_requires_pointer : Error<
  1963. "indirection requires pointer operand (%0 invalid)">;
  1964. def err_indirection_requires_nonfragile_object : Error<
  1965. "indirection cannot be to an interface in non-fragile ABI (%0 invalid)">;
  1966. def err_direct_interface_unsupported : Error<
  1967. "indirection to an interface is not supported (%0 invalid)">;
  1968. def err_typecheck_invalid_operands : Error<
  1969. "invalid operands to binary expression (%0 and %1)">;
  1970. def err_typecheck_sub_ptr_object : Error<
  1971. "subtraction of pointer %0 requires pointee to be a complete object type">;
  1972. def err_typecheck_sub_ptr_compatible : Error<
  1973. "%0 and %1 are not pointers to compatible types">;
  1974. def ext_typecheck_ordered_comparison_of_pointer_integer : ExtWarn<
  1975. "ordered comparison between pointer and integer (%0 and %1)">;
  1976. def ext_typecheck_ordered_comparison_of_pointer_and_zero : Extension<
  1977. "ordered comparison between pointer and zero (%0 and %1) is an extension">;
  1978. def ext_typecheck_ordered_comparison_of_function_pointers : ExtWarn<
  1979. "ordered comparison of function pointers (%0 and %1)">;
  1980. def ext_typecheck_comparison_of_fptr_to_void : Extension<
  1981. "equality comparison between function pointer and void pointer (%0 and %1)">;
  1982. def err_typecheck_comparison_of_fptr_to_void : Error<
  1983. "equality comparison between function pointer and void pointer (%0 and %1)">;
  1984. def ext_typecheck_comparison_of_pointer_integer : ExtWarn<
  1985. "comparison between pointer and integer (%0 and %1)">;
  1986. def err_typecheck_comparison_of_pointer_integer : Error<
  1987. "comparison between pointer and integer (%0 and %1)">;
  1988. def ext_typecheck_comparison_of_distinct_pointers : ExtWarn<
  1989. "comparison of distinct pointer types (%0 and %1)">;
  1990. def ext_typecheck_cond_incompatible_operands : ExtWarn<
  1991. "incompatible operand types (%0 and %1)">;
  1992. def err_typecheck_comparison_of_distinct_pointers : Error<
  1993. "comparison of distinct pointer types (%0 and %1)">;
  1994. def ext_typecheck_comparison_of_distinct_pointers_nonstandard : ExtWarn<
  1995. "comparison of distinct pointer types (%0 and %1) uses non-standard "
  1996. "composite pointer type %2">;
  1997. def err_typecheck_vector_comparison : Error<
  1998. "comparison of vector types (%0 and %1) not supported yet">;
  1999. def err_typecheck_assign_const : Error<"read-only variable is not assignable">;
  2000. def err_stmtexpr_file_scope : Error<
  2001. "statement expression not allowed at file scope">;
  2002. def warn_mixed_sign_comparison : Warning<
  2003. "comparison of integers of different signs: %0 and %1">,
  2004. InGroup<SignCompare>, DefaultIgnore;
  2005. def warn_mixed_sign_conditional : Warning<
  2006. "operands of ? are integers of different signs: %0 and %1">,
  2007. InGroup<SignCompare>, DefaultIgnore;
  2008. def warn_lunsigned_always_true_comparison : Warning<
  2009. "comparison of unsigned expression %0 is always %1">,
  2010. InGroup<SignCompare>, DefaultIgnore;
  2011. def warn_runsigned_always_true_comparison : Warning<
  2012. "comparison of %0 unsigned expression is always %1">,
  2013. InGroup<SignCompare>, DefaultIgnore;
  2014. def err_invalid_this_use : Error<
  2015. "invalid use of 'this' outside of a nonstatic member function">;
  2016. def err_invalid_member_use_in_static_method : Error<
  2017. "invalid use of member %0 in static member function">;
  2018. def err_invalid_qualified_function_type : Error<
  2019. "type qualifier is not allowed on this function">;
  2020. def err_invalid_qualified_typedef_function_type_use : Error<
  2021. "a qualified function type cannot be used to declare a nonmember function "
  2022. "or a static member function">;
  2023. def err_invalid_non_static_member_use : Error<
  2024. "invalid use of nonstatic data member %0">;
  2025. def err_invalid_incomplete_type_use : Error<
  2026. "invalid use of incomplete type %0">;
  2027. def err_builtin_func_cast_more_than_one_arg : Error<
  2028. "function-style cast to a builtin type can only take one argument">;
  2029. def err_builtin_direct_init_more_than_one_arg : Error<
  2030. "initializer of a builtin type can only take one argument">;
  2031. def err_value_init_for_array_type : Error<
  2032. "array types cannot be value-initialized">;
  2033. def warn_printf_nonliteral_noargs : Warning<
  2034. "format string is not a string literal (potentially insecure)">,
  2035. InGroup<FormatSecurity>;
  2036. def warn_printf_nonliteral : Warning<
  2037. "format string is not a string literal">,
  2038. InGroup<FormatNonLiteral>, DefaultIgnore;
  2039. def err_unexpected_interface : Error<
  2040. "unexpected interface name %0: expected expression">;
  2041. def err_ref_non_value : Error<"%0 does not refer to a value">;
  2042. def err_ref_vm_type : Error<
  2043. "cannot refer to declaration with a variably modified type inside block">;
  2044. def err_ref_array_type : Error<
  2045. "cannot refer to declaration with an array type inside block">;
  2046. def err_property_not_found : Error<
  2047. "property %0 not found on object of type %1">;
  2048. def err_duplicate_property : Error<
  2049. "property has a previous declaration">;
  2050. def ext_gnu_void_ptr : Extension<
  2051. "use of GNU void* extension">, InGroup<PointerArith>;
  2052. def ext_gnu_ptr_func_arith : Extension<
  2053. "arithmetic on pointer to function type %0 is a GNU extension">,
  2054. InGroup<PointerArith>;
  2055. def error_readonly_property_assignment : Error<
  2056. "assigning to property with 'readonly' attribute not allowed">;
  2057. def ext_integer_increment_complex : Extension<
  2058. "ISO C does not support '++'/'--' on complex integer type %0">;
  2059. def ext_integer_complement_complex : Extension<
  2060. "ISO C does not support '~' for complex conjugation of %0">;
  2061. def error_nosetter_property_assignment : Error<
  2062. "setter method is needed to assign to object using property" " assignment syntax">;
  2063. def error_no_subobject_property_setting : Error<
  2064. "expression is not assignable using property assignment syntax">;
  2065. def ext_freestanding_complex : Extension<
  2066. "complex numbers are an extension in a freestanding C99 implementation">;
  2067. // Obj-c expressions
  2068. def warn_root_inst_method_not_found : Warning<
  2069. "instance method %0 is being used on 'Class' which is not in the root class">;
  2070. def warn_class_method_not_found : Warning<
  2071. "method %objcclass0 not found (return type defaults to 'id')">;
  2072. def warn_inst_method_not_found : Warning<
  2073. "method %objcinstance0 not found (return type defaults to 'id')">;
  2074. def error_no_super_class_message : Error<
  2075. "no @interface declaration found in class messaging of %0">;
  2076. def error_no_super_class : Error<
  2077. "no super class declared in @interface for %0">;
  2078. def err_invalid_receiver_to_message : Error<
  2079. "invalid receiver to message expression">;
  2080. def err_invalid_receiver_to_message_super : Error<
  2081. "'super' is only valid in a method body">;
  2082. def err_invalid_receiver_class_message : Error<
  2083. "receiver type %0 is not an Objective-C class">;
  2084. def warn_bad_receiver_type : Warning<
  2085. "receiver type %0 is not 'id' or interface pointer, consider "
  2086. "casting it to 'id'">;
  2087. def err_bad_receiver_type : Error<"bad receiver type %0">;
  2088. def err_unknown_receiver_suggest : Error<
  2089. "unknown receiver %0; did you mean %1?">;
  2090. def error_objc_throw_expects_object : Error<
  2091. "@throw requires an Objective-C object type (%0 invalid)">;
  2092. def error_objc_synchronized_expects_object : Error<
  2093. "@synchronized requires an Objective-C object type (%0 invalid)">;
  2094. def error_rethrow_used_outside_catch : Error<
  2095. "@throw (rethrow) used outside of a @catch block">;
  2096. def err_attribute_multiple_objc_gc : Error<
  2097. "multiple garbage collection attributes specified for type">;
  2098. def err_catch_param_not_objc_type : Error<
  2099. "@catch parameter is not a pointer to an interface type">;
  2100. def err_illegal_qualifiers_on_catch_parm : Error<
  2101. "illegal qualifiers on @catch parameter">;
  2102. def err_storage_spec_on_catch_parm : Error<
  2103. "@catch parameter cannot have storage specifier %select{|'typedef'|'extern'|"
  2104. "'static'|'auto'|'register'|'__private_extern__'|'mutable'}0">;
  2105. def warn_register_objc_catch_parm : Warning<
  2106. "'register' storage specifier on @catch parameter will be ignored">;
  2107. def err_qualified_objc_catch_parm : Error<
  2108. "@catch parameter declarator cannot be qualified">;
  2109. def warn_setter_getter_impl_required : Warning<
  2110. "property %0 requires method %1 to be defined - "
  2111. "use @synthesize, @dynamic or provide a method implementation">;
  2112. def warn_setter_getter_impl_required_in_category : Warning<
  2113. "property %0 requires method %1 to be defined - "
  2114. "use @dynamic or provide a method implementation in category">;
  2115. def note_property_impl_required : Note<
  2116. "implementation is here">;
  2117. def note_parameter_named_here : Note<
  2118. "passing argument to parameter %0 here">;
  2119. def note_parameter_here : Note<
  2120. "passing argument to parameter here">;
  2121. // C++ casts
  2122. // These messages adhere to the TryCast pattern: %0 is an int specifying the
  2123. // cast type, %1 is the source type, %2 is the destination type.
  2124. def err_bad_cxx_cast_generic : Error<
  2125. "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
  2126. "functional-style cast}0 from %1 to %2 is not allowed">;
  2127. def err_bad_cxx_cast_rvalue : Error<
  2128. "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
  2129. "functional-style cast}0 from rvalue to reference type %2">;
  2130. def err_bad_cxx_cast_const_away : Error<
  2131. "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
  2132. "functional-style cast}0 from %1 to %2 casts away constness">;
  2133. def err_bad_const_cast_dest : Error<
  2134. "%select{const_cast||||C-style cast|functional-style cast}0 to %2, "
  2135. "which is not a reference, pointer-to-object, or pointer-to-data-member">;
  2136. def ext_cast_fn_obj : Extension<
  2137. "cast between pointer-to-function and pointer-to-object is an extension">;
  2138. def err_bad_reinterpret_cast_small_int : Error<
  2139. "cast from pointer to smaller type %2 loses information">;
  2140. def err_bad_cxx_cast_vector_to_scalar_different_size : Error<
  2141. "%select{||reinterpret_cast||C-style cast|}0 from vector %1 "
  2142. "to scalar %2 of different size">;
  2143. def err_bad_cxx_cast_scalar_to_vector_different_size : Error<
  2144. "%select{||reinterpret_cast||C-style cast|}0 from scalar %1 "
  2145. "to vector %2 of different size">;
  2146. def err_bad_cxx_cast_vector_to_vector_different_size : Error<
  2147. "%select{||reinterpret_cast||C-style cast|}0 from vector %1 "
  2148. "to vector %2 of different size">;
  2149. def err_bad_lvalue_to_rvalue_cast : Error<
  2150. "cannot cast from lvalue of type %1 to rvalue reference type %2; types are "
  2151. "not compatible">;
  2152. def err_bad_static_cast_pointer_nonpointer : Error<
  2153. "cannot cast from type %1 to pointer type %2">;
  2154. def err_bad_static_cast_member_pointer_nonmp : Error<
  2155. "cannot cast from type %1 to member pointer type %2">;
  2156. def err_bad_static_cast_incomplete : Error<"%0 is an incomplete type">;
  2157. // These messages don't adhere to the pattern.
  2158. // FIXME: Display the path somehow better.
  2159. def err_ambiguous_base_to_derived_cast : Error<
  2160. "ambiguous cast from base %0 to derived %1:%2">;
  2161. def err_static_downcast_via_virtual : Error<
  2162. "cannot cast %0 to %1 via virtual base %2">;
  2163. def err_downcast_from_inaccessible_base : Error<
  2164. "cannot cast %select{private|protected}2 base class %1 to %0">;
  2165. def err_upcast_to_inaccessible_base : Error<
  2166. "cannot cast %0 to its %select{private|protected}2 base class %1">;
  2167. def err_bad_dynamic_cast_not_ref_or_ptr : Error<
  2168. "%0 is not a reference or pointer">;
  2169. def err_bad_dynamic_cast_not_class : Error<"%0 is not a class">;
  2170. def err_bad_dynamic_cast_incomplete : Error<"%0 is an incomplete type">;
  2171. def err_bad_dynamic_cast_not_ptr : Error<"%0 is not a pointer">;
  2172. def err_bad_dynamic_cast_not_polymorphic : Error<"%0 is not polymorphic">;
  2173. // Other C++ expressions
  2174. def err_need_header_before_typeid : Error<
  2175. "you need to include <typeinfo> before using the 'typeid' operator">;
  2176. def err_incomplete_typeid : Error<"'typeid' of incomplete type %0">;
  2177. def err_static_illegal_in_new : Error<
  2178. "the 'static' modifier for the array size is not legal in new expressions">;
  2179. def err_array_new_needs_size : Error<
  2180. "array size must be specified in new expressions">;
  2181. def err_bad_new_type : Error<
  2182. "cannot allocate %select{function|reference}1 type %0 with new">;
  2183. def err_new_incomplete_type : Error<
  2184. "allocation of incomplete type %0">;
  2185. def err_new_array_nonconst : Error<
  2186. "only the first dimension of an allocated array may have dynamic size">;
  2187. def err_new_array_init_args : Error<
  2188. "array 'new' cannot have initialization arguments">;
  2189. def err_new_paren_array_nonconst : Error<
  2190. "when type is in parentheses, array cannot have dynamic size">;
  2191. def err_placement_new_non_placement_delete : Error<
  2192. "'new' expression with placement arguments refers to non-placement "
  2193. "'operator delete'">;
  2194. def err_array_size_not_integral : Error<
  2195. "array size expression must have integral or enumerated type, not %0">;
  2196. def err_default_init_const : Error<
  2197. "default initialization of an object of const type %0"
  2198. "%select{| requires a user-provided default constructor}1">;
  2199. def err_delete_operand : Error<"cannot delete expression of type %0">;
  2200. def ext_delete_void_ptr_operand : ExtWarn<
  2201. "cannot delete expression with pointer-to-'void' type %0">;
  2202. def err_ambiguous_delete_operand : Error<"ambiguous conversion of delete "
  2203. "expression of type %0 to a pointer">;
  2204. def warn_delete_incomplete : Warning<
  2205. "deleting pointer to incomplete type %0 may cause undefined behaviour">;
  2206. def err_no_suitable_delete_member_function_found : Error<
  2207. "no suitable member %0 in %1">;
  2208. def note_member_declared_here : Note<
  2209. "member %0 declared here">;
  2210. def err_decrement_bool : Error<"cannot decrement expression of type bool">;
  2211. def warn_increment_bool : Warning<
  2212. "incrementing expression of type bool is deprecated">, InGroup<Deprecated>;
  2213. def ext_catch_incomplete_ptr : ExtWarn<
  2214. "ISO C++ forbids catching a pointer to incomplete type %0">;
  2215. def ext_catch_incomplete_ref : ExtWarn<
  2216. "ISO C++ forbids catching a reference to incomplete type %0">;
  2217. def err_catch_incomplete : Error<"cannot catch incomplete type %0">;
  2218. def err_catch_rvalue_ref : Error<"cannot catch exceptions by rvalue reference">;
  2219. def err_qualified_catch_declarator : Error<
  2220. "exception declarator cannot be qualified">;
  2221. def err_early_catch_all : Error<"catch-all handler must come last">;
  2222. def err_bad_memptr_rhs : Error<
  2223. "right hand operand to %0 has non pointer-to-member type %1">;
  2224. def err_memptr_rhs_to_incomplete : Error<
  2225. "cannot dereference pointer into incomplete class type %0">;
  2226. def err_bad_memptr_lhs : Error<
  2227. "left hand operand to %0 must be a %select{|pointer to }1class "
  2228. "compatible with the right hand operand, but is %2">;
  2229. def warn_exception_caught_by_earlier_handler : Warning<
  2230. "exception of type %0 will be caught by earlier handler">;
  2231. def note_previous_exception_handler : Note<"for type %0">;
  2232. def err_conditional_void_nonvoid : Error<
  2233. "%select{left|right}1 operand to ? is void, but %select{right|left}1 operand "
  2234. "is of type %0">;
  2235. def err_conditional_ambiguous : Error<
  2236. "conditional expression is ambiguous; %0 can be converted to %1 "
  2237. "and vice versa">;
  2238. def err_conditional_ambiguous_ovl : Error<
  2239. "conditional expression is ambiguous; %0 and %1 can be converted to several "
  2240. "common types">;
  2241. def err_throw_incomplete : Error<
  2242. "cannot throw object of incomplete type %0">;
  2243. def err_throw_incomplete_ptr : Error<
  2244. "cannot throw pointer to object of incomplete type %0">;
  2245. def err_return_in_constructor_handler : Error<
  2246. "return in the catch of a function try block of a constructor is illegal">;
  2247. def err_operator_arrow_circular : Error<
  2248. "circular pointer delegation detected">;
  2249. def err_pseudo_dtor_base_not_scalar : Error<
  2250. "object expression of non-scalar type %0 cannot be used in a "
  2251. "pseudo-destructor expression">;
  2252. def err_pseudo_dtor_type_mismatch : Error<
  2253. "the type of object expression (%0) does not match the type being destroyed "
  2254. "(%1) in pseudo-destructor expression">;
  2255. def err_pseudo_dtor_call_with_args : Error<
  2256. "call to pseudo-destructor cannot have any arguments">;
  2257. def err_dtor_expr_without_call : Error<
  2258. "%select{destructor reference|pseudo-destructor expression}0 must be "
  2259. "called immediately with '()'">;
  2260. def err_pseudo_dtor_destructor_non_type : Error<
  2261. "%0 does not refer to a type name in pseudo-destructor expression; expected "
  2262. "the name of type %1">;
  2263. def err_pseudo_dtor_template : Error<
  2264. "specialization of template %0 does not refer to a scalar type in pseudo-"
  2265. "destructor expression">;
  2266. def err_invalid_use_of_function_type : Error<
  2267. "a function type is not allowed here">;
  2268. def err_invalid_use_of_array_type : Error<"an array type is not allowed here">;
  2269. def err_type_defined_in_condition : Error<
  2270. "types may not be defined in conditions">;
  2271. def err_typecheck_bool_condition : Error<
  2272. "value of type %0 is not contextually convertible to 'bool'">;
  2273. def err_typecheck_ambiguous_condition : Error<
  2274. "conversion from %0 to %1 is ambiguous">;
  2275. def err_typecheck_nonviable_condition : Error<
  2276. "no viable conversion from %0 to %1">;
  2277. def err_typecheck_deleted_function : Error<
  2278. "conversion function from %0 to %1 invokes a deleted function">;
  2279. def err_expected_class_or_namespace : Error<"expected a class or namespace">;
  2280. def err_missing_qualified_for_redecl : Error<
  2281. "must qualify the name %0 to declare %q1 in this scope">;
  2282. def err_invalid_declarator_scope : Error<
  2283. "definition or redeclaration of %0 not in a namespace enclosing %1">;
  2284. def err_invalid_declarator_global_scope : Error<
  2285. "definition or redeclaration of %0 cannot name the global scope">;
  2286. def err_invalid_declarator_in_function : Error<
  2287. "definition or redeclaration of %0 not allowed inside a function">;
  2288. def err_not_tag_in_scope : Error<
  2289. "no %select{struct|union|class|enum}0 named %1 in %2">;
  2290. def err_cannot_form_pointer_to_member_of_reference_type : Error<
  2291. "cannot form a pointer-to-member to member %0 of reference type %1">;
  2292. def err_incomplete_object_call : Error<
  2293. "incomplete type in call to object of type %0">;
  2294. def err_incomplete_pointer_to_member_return : Error<
  2295. "incomplete return type %0 of pointer-to-member constant">;
  2296. def warn_condition_is_assignment : Warning<"using the result of an "
  2297. "assignment as a condition without parentheses">,
  2298. InGroup<Parentheses>;
  2299. // Completely identical except off by default.
  2300. def warn_condition_is_idiomatic_assignment : Warning<"using the result "
  2301. "of an assignment as a condition without parentheses">,
  2302. InGroup<DiagGroup<"idiomatic-parentheses">>, DefaultIgnore;
  2303. def note_condition_assign_to_comparison : Note<
  2304. "use '==' to turn this assignment into an equality comparison">;
  2305. def note_condition_assign_silence : Note<
  2306. "place parentheses around the assignment to silence this warning">;
  2307. def warn_value_always_zero : Warning<
  2308. "%0 is always %select{zero|false|NULL}1 in this context">;
  2309. // assignment related diagnostics (also for argument passing, returning, etc).
  2310. // In most of these diagnostics the %2 is a value from the
  2311. // Sema::AssignmentAction enumeration
  2312. def err_typecheck_convert_incompatible : Error<
  2313. "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
  2314. " %0 "
  2315. "%select{from incompatible type|to parameter of incompatible type|"
  2316. "from a function with incompatible result type|to incompatible type|"
  2317. "with an expression of incompatible type|to parameter of incompatible type|"
  2318. "to incompatible type}2 %1">;
  2319. def warn_incompatible_qualified_id : Warning<
  2320. "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
  2321. " %0 "
  2322. "%select{from incompatible type|to parameter of incompatible type|"
  2323. "from a function with incompatible result type|to incompatible type|"
  2324. "with an expression of incompatible type|to parameter of incompatible type|"
  2325. "to incompatible type}2 %1">;
  2326. def ext_typecheck_convert_pointer_int : ExtWarn<
  2327. "incompatible pointer to integer conversion "
  2328. "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
  2329. " %0 "
  2330. "%select{from|to parameter of type|from a function with result type|to type|"
  2331. "with an expression of type|to parameter of type|to type}2 %1">;
  2332. def ext_typecheck_convert_int_pointer : ExtWarn<
  2333. "incompatible integer to pointer conversion "
  2334. "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
  2335. " %0 "
  2336. "%select{from|to parameter of type|from a function with result type|to type|"
  2337. "with an expression of type|to parameter of type|to type}2 %1">;
  2338. def ext_typecheck_convert_pointer_void_func : Extension<
  2339. "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
  2340. " %0 "
  2341. "%select{from|to parameter of type|from a function with result type|to type|"
  2342. "with an expression of type|to parameter of type|to type}2 %1 "
  2343. "converts between void pointer and function pointer">;
  2344. def ext_typecheck_convert_incompatible_pointer_sign : ExtWarn<
  2345. "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
  2346. " %0 "
  2347. "%select{from|to parameter of type|from a function with result type|to type|"
  2348. "with an expression of type|to parameter of type|to type}2 %1 "
  2349. "converts between pointers to integer types with different sign">,
  2350. InGroup<DiagGroup<"pointer-sign">>;
  2351. def ext_typecheck_convert_incompatible_pointer : ExtWarn<
  2352. "incompatible pointer types "
  2353. "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
  2354. " %0 "
  2355. "%select{from|to parameter of type|from a function with result type|to type|"
  2356. "with an expression of type|to parameter of type|to type}2 %1">;
  2357. def ext_typecheck_convert_discards_qualifiers : ExtWarn<
  2358. "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
  2359. " %0 "
  2360. "%select{from|to parameter of type|from a function with result type|to type|"
  2361. "with an expression of type|to parameter of type|to type}2 %1 discards "
  2362. "qualifiers">;
  2363. def ext_nested_pointer_qualifier_mismatch : ExtWarn<
  2364. "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
  2365. " %0 "
  2366. "%select{from|to parameter of type|from a function with result type|to type|"
  2367. "with an expression of type|to parameter of type|to type}2 %1 discards "
  2368. "qualifiers in nested pointer types">;
  2369. def warn_incompatible_vectors : Warning<
  2370. "incompatible vector types "
  2371. "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
  2372. " %0 "
  2373. "%select{from|to parameter of type|from a function with result type|to type|"
  2374. "with an expression of type|to parameter of type|to type}2 %1">,
  2375. InGroup<VectorConversions>, DefaultIgnore;
  2376. def err_int_to_block_pointer : Error<
  2377. "invalid block pointer conversion "
  2378. "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
  2379. " %0 "
  2380. "%select{from|to parameter of type|from a function with result type|to type|"
  2381. "with an expression of type|to parameter of type|to type}2 %1">;
  2382. def err_typecheck_convert_incompatible_block_pointer : Error<
  2383. "incompatible block pointer types "
  2384. "%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
  2385. " %0 "
  2386. "%select{from|to parameter of type|from a function with result type|to type|"
  2387. "with an expression of type|to parameter of type|to type}2 %1">;
  2388. def err_typecheck_convert_ambiguous : Error<
  2389. "ambiguity in initializing value of type %0 with initializer of type %1">;
  2390. def err_cannot_initialize_decl_noname : Error<
  2391. "cannot initialize a value of type %0 with an %select{rvalue|lvalue}1 "
  2392. "of type %2">;
  2393. def err_cannot_initialize_decl : Error<
  2394. "cannot initialize %0 with an %select{rvalue|lvalue}1 of type %2">;
  2395. def err_typecheck_comparison_of_distinct_blocks : Error<
  2396. "comparison of distinct block types (%0 and %1)">;
  2397. def err_typecheck_array_not_modifiable_lvalue : Error<
  2398. "array type %0 is not assignable">;
  2399. def err_typecheck_non_object_not_modifiable_lvalue : Error<
  2400. "non-object type %0 is not assignable">;
  2401. def err_typecheck_expression_not_modifiable_lvalue : Error<
  2402. "expression is not assignable">;
  2403. def err_typecheck_incomplete_type_not_modifiable_lvalue : Error<
  2404. "incomplete type %0 is not assignable">;
  2405. def err_typecheck_lvalue_casts_not_supported : Error<
  2406. "assignment to cast is illegal, lvalue casts are not supported">;
  2407. def err_typecheck_duplicate_vector_components_not_mlvalue : Error<
  2408. "vector is not assignable (contains duplicate components)">;
  2409. def err_block_decl_ref_not_modifiable_lvalue : Error<
  2410. "variable is not assignable (missing __block type specifier)">;
  2411. def err_typecheck_call_not_function : Error<
  2412. "called object type %0 is not a function or function pointer">;
  2413. def err_call_incomplete_return : Error<
  2414. "calling function with incomplete return type %0">;
  2415. def err_call_function_incomplete_return : Error<
  2416. "calling %0 with incomplete return type %1">;
  2417. def note_function_with_incomplete_return_type_declared_here : Note<
  2418. "%0 declared here">;
  2419. def err_call_incomplete_argument : Error<
  2420. "argument type %0 is incomplete">;
  2421. def err_typecheck_call_too_few_args : Error<
  2422. "too few arguments to %select{function|block|method}0 call, "
  2423. "expected %1, have %2">;
  2424. def err_typecheck_call_too_few_args_at_least : Error<
  2425. "too few arguments to %select{function|block|method}0 call, "
  2426. "expected at least %1, have %2">;
  2427. def err_typecheck_call_too_many_args : Error<
  2428. "too many arguments to %select{function|block|method}0 call, "
  2429. "expected %1, have %2">;
  2430. def err_typecheck_call_too_many_args_at_most : Error<
  2431. "too many arguments to %select{function|block|method}0 call, "
  2432. "expected at most %1, have %2">;
  2433. def warn_call_wrong_number_of_arguments : Warning<
  2434. "too %select{few|many}0 arguments in call to %1">;
  2435. def err_atomic_builtin_must_be_pointer : Error<
  2436. "first argument to atomic builtin must be a pointer (%0 invalid)">;
  2437. def err_atomic_builtin_must_be_pointer_intptr : Error<
  2438. "first argument to atomic builtin must be a pointer to integer or pointer"
  2439. " (%0 invalid)">;
  2440. def err_atomic_builtin_pointer_size : Error<
  2441. "first argument to atomic builtin must be a pointer to 1,2,4,8 or 16 byte "
  2442. "type (%0 invalid)">;
  2443. def err_deleted_function_use : Error<"attempt to use a deleted function">;
  2444. def err_cannot_pass_objc_interface_to_vararg : Error<
  2445. "cannot pass object with interface type %0 by-value through variadic "
  2446. "%select{function|block|method}1">;
  2447. def warn_cannot_pass_non_pod_arg_to_vararg : Warning<
  2448. "cannot pass object of non-POD type %0 through variadic "
  2449. "%select{function|block|method|constructor}1; call will abort at runtime">,
  2450. InGroup<DiagGroup<"non-pod-varargs">>, DefaultError;
  2451. def err_typecheck_call_invalid_ordered_compare : Error<
  2452. "ordered compare requires two args of floating point type (%0 and %1)">;
  2453. def err_typecheck_call_invalid_unary_fp : Error<
  2454. "floating point classification requires argument of floating point type "
  2455. "(passed in %0)">;
  2456. def err_typecheck_cond_expect_scalar : Error<
  2457. "used type %0 where arithmetic or pointer type is required">;
  2458. def ext_typecheck_cond_one_void : Extension<
  2459. "C99 forbids conditional expressions with only one void side">;
  2460. def ext_typecheck_cast_nonscalar : Extension<
  2461. "C99 forbids casting nonscalar type %0 to the same type">;
  2462. def ext_typecheck_cast_to_union : Extension<"C99 forbids casts to union type">;
  2463. def err_typecheck_cast_to_union_no_type : Error<
  2464. "cast to union type from type %0 not present in union">;
  2465. def err_cast_pointer_from_non_pointer_int : Error<
  2466. "operand of type %0 cannot be cast to a pointer type">;
  2467. def err_cast_pointer_to_non_pointer_int : Error<
  2468. "pointer cannot be cast to type %0">;
  2469. def err_typecheck_expect_scalar_operand : Error<
  2470. "operand of type %0 where arithmetic or pointer type is required">;
  2471. def err_typecheck_cond_incompatible_operands : Error<
  2472. "incompatible operand types (%0 and %1)">;
  2473. def ext_typecheck_cond_incompatible_operands_nonstandard : ExtWarn<
  2474. "incompatible operand types (%0 and %1) use non-standard composite pointer "
  2475. "type %2">;
  2476. def err_cast_selector_expr : Error<
  2477. "cannot type cast @selector expression">;
  2478. def warn_typecheck_cond_incompatible_pointers : ExtWarn<
  2479. "pointer type mismatch (%0 and %1)">;
  2480. def warn_typecheck_cond_pointer_integer_mismatch : ExtWarn<
  2481. "pointer/integer type mismatch in conditional expression (%0 and %1)">;
  2482. def err_typecheck_choose_expr_requires_constant : Error<
  2483. "'__builtin_choose_expr' requires a constant expression">;
  2484. def ext_typecheck_expression_not_constant_but_accepted : Extension<
  2485. "expression is not a constant, but is accepted as one by GNU extensions">,
  2486. InGroup<GNU>;
  2487. def warn_unused_expr : Warning<"expression result unused">,
  2488. InGroup<UnusedValue>;
  2489. def warn_unused_voidptr : Warning<
  2490. "expression result unused; should this cast be to 'void'?">,
  2491. InGroup<UnusedValue>;
  2492. def warn_unused_property_expr : Warning<
  2493. "property access result unused - getters should not be used for side effects">,
  2494. InGroup<UnusedValue>;
  2495. def warn_unused_call : Warning<
  2496. "ignoring return value of function declared with %0 attribute">,
  2497. InGroup<UnusedValue>;
  2498. def err_incomplete_type_used_in_type_trait_expr : Error<
  2499. "incomplete type %0 used in type trait expression">;
  2500. def err_expected_ident_or_lparen : Error<"expected identifier or '('">;
  2501. } // End of general sema category.
  2502. // inline asm.
  2503. let CategoryName = "Inline Assembly Issue" in {
  2504. def err_asm_wide_character : Error<"wide string is invalid in 'asm'">;
  2505. def err_asm_invalid_lvalue_in_output : Error<"invalid lvalue in asm output">;
  2506. def err_asm_invalid_output_constraint : Error<
  2507. "invalid output constraint '%0' in asm">;
  2508. def err_asm_invalid_lvalue_in_input : Error<
  2509. "invalid lvalue in asm input for constraint '%0'">;
  2510. def err_asm_invalid_input_constraint : Error<
  2511. "invalid input constraint '%0' in asm">;
  2512. def err_asm_invalid_type_in_input : Error<
  2513. "invalid type %0 in asm input for constraint '%1'">;
  2514. def err_asm_tying_incompatible_types : Error<
  2515. "unsupported inline asm: input with type %0 matching output with type %1">;
  2516. def err_asm_unknown_register_name : Error<"unknown register name '%0' in asm">;
  2517. def err_invalid_asm_cast_lvalue : Error<
  2518. "invalid use of a cast in a inline asm context requiring an l-value: "
  2519. "remove the cast or build with -fheinous-gnu-extensions">;
  2520. def warn_invalid_asm_cast_lvalue : Warning<
  2521. "invalid use of a cast in a inline asm context requiring an l-value: "
  2522. "accepted due to -fheinous-gnu-extensions, but clang may remove support "
  2523. "for this in the future">;
  2524. }
  2525. let CategoryName = "Semantic Issue" in {
  2526. def err_invalid_conversion_between_vectors : Error<
  2527. "invalid conversion between vector type %0 and %1 of different size">;
  2528. def err_invalid_conversion_between_vector_and_integer : Error<
  2529. "invalid conversion between vector type %0 and integer type %1 "
  2530. "of different size">;
  2531. def err_invalid_conversion_between_vector_and_scalar : Error<
  2532. "invalid conversion between vector type %0 and scalar type %1">;
  2533. def err_overload_expr_requires_non_zero_constant : Error<
  2534. "overload requires a non-zero constant expression as first argument">;
  2535. def err_overload_incorrect_fntype : Error<
  2536. "argument is not a function, or has wrong number of parameters">;
  2537. // C++ member initializers.
  2538. def err_only_constructors_take_base_inits : Error<
  2539. "only constructors take base initializers">;
  2540. def err_multiple_mem_initialization : Error <
  2541. "multiple initializations given for non-static member %0">;
  2542. def err_multiple_mem_union_initialization : Error <
  2543. "initializing multiple members of anonymous union">;
  2544. def err_multiple_base_initialization : Error <
  2545. "multiple initializations given for base %0">;
  2546. def err_mem_init_not_member_or_class : Error<
  2547. "member initializer %0 does not name a non-static data member or base "
  2548. "class">;
  2549. def warn_initializer_out_of_order : Warning<
  2550. "%select{field|base class}0 %1 will be initialized after "
  2551. "%select{field|base}2 %3">,
  2552. InGroup<Reorder>, DefaultIgnore;
  2553. def err_base_init_does_not_name_class : Error<
  2554. "constructor initializer %0 does not name a class">;
  2555. def err_base_init_direct_and_virtual : Error<
  2556. "base class initializer %0 names both a direct base class and an "
  2557. "inherited virtual base class">;
  2558. def err_not_direct_base_or_virtual : Error<
  2559. "type %0 is not a direct or virtual base of %1">;
  2560. def err_in_class_initializer_non_integral_type : Error<
  2561. "in-class initializer has non-integral, non-enumeration type %0">;
  2562. def err_in_class_initializer_non_constant : Error<
  2563. "in-class initializer is not an integral constant expression">;
  2564. // C++ anonymous unions and GNU anonymous structs/unions
  2565. def ext_anonymous_union : Extension<
  2566. "anonymous unions are a GNU extension in C">, InGroup<GNU>;
  2567. def ext_anonymous_struct : Extension<
  2568. "anonymous structs are a GNU extension">, InGroup<GNU>;
  2569. def err_anonymous_union_not_static : Error<
  2570. "anonymous unions at namespace or global scope must be declared 'static'">;
  2571. def err_anonymous_union_with_storage_spec : Error<
  2572. "anonymous union at class scope must not have a storage specifier">;
  2573. def err_anonymous_struct_not_member : Error<
  2574. "anonymous %select{structs|structs and classes}0 must be "
  2575. "%select{struct or union|class}0 members">;
  2576. def err_anonymous_union_member_redecl : Error<
  2577. "member of anonymous union redeclares %0">;
  2578. def err_anonymous_struct_member_redecl : Error<
  2579. "member of anonymous struct redeclares %0">;
  2580. def err_anonymous_record_with_type : Error<
  2581. "types cannot be declared in an anonymous %select{struct|union}0">;
  2582. def err_anonymous_record_with_function : Error<
  2583. "functions cannot be declared in an anonymous %select{struct|union}0">;
  2584. def err_anonymous_record_with_static : Error<
  2585. "static members cannot be declared in an anonymous %select{struct|union}0">;
  2586. def err_anonymous_record_bad_member : Error<
  2587. "anonymous %select{struct|union}0 can only contain non-static data members">;
  2588. def err_anonymous_record_nonpublic_member : Error<
  2589. "anonymous %select{struct|union}0 cannot contain a "
  2590. "%select{private|protected}1 data member">;
  2591. // C++ local classes
  2592. def err_reference_to_local_var_in_enclosing_function : Error<
  2593. "reference to local variable %0 declared in enclosed function %1">;
  2594. def note_local_variable_declared_here : Note<
  2595. "%0 declared here">;
  2596. def err_static_data_member_not_allowed_in_local_class : Error<
  2597. "static data member %0 not allowed in local class %1">;
  2598. // C++ derived classes
  2599. def err_base_clause_on_union : Error<"unions cannot have base classes">;
  2600. def err_base_must_be_class : Error<"base specifier must name a class">;
  2601. def err_union_as_base_class : Error<"unions cannot be base classes">;
  2602. def err_incomplete_base_class : Error<"base class has incomplete type">;
  2603. def err_duplicate_base_class : Error<
  2604. "base class %0 specified more than once as a direct base class">;
  2605. // FIXME: better way to display derivation? Pass entire thing into diagclient?
  2606. def err_ambiguous_derived_to_base_conv : Error<
  2607. "ambiguous conversion from derived class %0 to base class %1:%2">;
  2608. def err_ambiguous_memptr_conv : Error<
  2609. "ambiguous conversion from pointer to member of %select{base|derived}0 "
  2610. "class %1 to pointer to member of %select{derived|base}0 class %2:%3">;
  2611. def err_memptr_conv_via_virtual : Error<
  2612. "conversion from pointer to member of class %0 to pointer to member "
  2613. "of class %1 via virtual base %2 is not allowed">;
  2614. // C++ access control
  2615. def err_conv_to_inaccessible_base : Error<
  2616. "conversion from %0 to inaccessible base class %1">, NoSFINAE;
  2617. def note_inheritance_specifier_here : Note<
  2618. "'%0' inheritance specifier here">;
  2619. def note_inheritance_implicitly_private_here : Note<
  2620. "inheritance is implicitly 'private'">;
  2621. // C++ member name lookup
  2622. def err_ambiguous_member_multiple_subobjects : Error<
  2623. "non-static member %0 found in multiple base-class subobjects of type %1:%2">;
  2624. def err_ambiguous_member_multiple_subobject_types : Error<
  2625. "member %0 found in multiple base classes of different types">;
  2626. def note_ambiguous_member_found : Note<"member found by ambiguous name lookup">;
  2627. def err_ambiguous_reference : Error<"reference to %0 is ambiguous">;
  2628. def note_ambiguous_candidate : Note<"candidate found by name lookup is %q0">;
  2629. def err_ambiguous_tag_hiding : Error<"a type named %0 is hidden by a "
  2630. "declaration in a different namespace">;
  2631. def note_hidden_tag : Note<"type declaration hidden">;
  2632. def note_hiding_object : Note<"declaration hides type">;
  2633. // C++ operator overloading
  2634. def err_operator_overload_needs_class_or_enum : Error<
  2635. "overloaded %0 must have at least one parameter of class "
  2636. "or enumeration type">;
  2637. def err_operator_overload_variadic : Error<"overloaded %0 cannot be variadic">;
  2638. def err_operator_overload_static : Error<
  2639. "overloaded %0 cannot be a static member function">;
  2640. def err_operator_overload_default_arg : Error<
  2641. "parameter of overloaded %0 cannot have a default argument">;
  2642. def err_operator_overload_must_be : Error<
  2643. "overloaded %0 must be a %select{unary|binary|unary or binary}2 operator "
  2644. "(has %1 parameter%s1)">;
  2645. def err_operator_overload_must_be_member : Error<
  2646. "overloaded %0 must be a non-static member function">;
  2647. def err_operator_overload_post_incdec_must_be_int : Error<
  2648. "parameter of overloaded post-%select{increment|decrement}1 operator must "
  2649. "have type 'int' (not %0)">;
  2650. // C++ allocation and deallocation functions.
  2651. def err_operator_new_delete_declared_in_namespace : Error<
  2652. "%0 cannot be declared inside a namespace">;
  2653. def err_operator_new_delete_declared_static : Error<
  2654. "%0 cannot be declared static in global scope">;
  2655. def err_operator_new_delete_invalid_result_type : Error<
  2656. "%0 must return type %1">;
  2657. def err_operator_new_delete_dependent_result_type : Error<
  2658. "%0 cannot have a dependent return type; use %1 instead">;
  2659. def err_operator_new_delete_too_few_parameters : Error<
  2660. "%0 must have at least one parameter.">;
  2661. def err_operator_new_delete_template_too_few_parameters : Error<
  2662. "%0 template must have at least two parameters.">;
  2663. def err_operator_new_dependent_param_type : Error<
  2664. "%0 cannot take a dependent type as first parameter; "
  2665. "use size_t (%1) instead">;
  2666. def err_operator_new_param_type : Error<
  2667. "%0 takes type size_t (%1) as first parameter">;
  2668. def err_operator_new_default_arg: Error<
  2669. "parameter of %0 cannot have a default argument">;
  2670. def err_operator_delete_dependent_param_type : Error<
  2671. "%0 cannot take a dependent type as first parameter; use %1 instead">;
  2672. def err_operator_delete_param_type : Error<
  2673. "%0 takes type %1 as first parameter">;
  2674. // C++ literal operators
  2675. def err_literal_operator_outside_namespace : Error<
  2676. "literal operator %0 must be in a namespace or global scope">;
  2677. // FIXME: This diagnostic sucks
  2678. def err_literal_operator_params : Error<
  2679. "parameter declaration for literal operator %0 is not valid">;
  2680. // C++ conversion functions
  2681. def err_conv_function_not_member : Error<
  2682. "conversion function must be a non-static member function">;
  2683. def err_conv_function_return_type : Error<
  2684. "conversion function cannot have a return type">;
  2685. def err_conv_function_with_params : Error<
  2686. "conversion function cannot have any parameters">;
  2687. def err_conv_function_variadic : Error<
  2688. "conversion function cannot be variadic">;
  2689. def err_conv_function_to_array : Error<
  2690. "conversion function cannot convert to an array type">;
  2691. def err_conv_function_to_function : Error<
  2692. "conversion function cannot convert to a function type">;
  2693. def err_conv_function_with_complex_decl : Error<
  2694. "must use a typedef to declare a conversion to %0">;
  2695. def err_conv_function_redeclared : Error<
  2696. "conversion function cannot be redeclared">;
  2697. def warn_conv_to_self_not_used : Warning<
  2698. "conversion function converting %0 to itself will never be used">;
  2699. def warn_conv_to_base_not_used : Warning<
  2700. "conversion function converting %0 to its base class %1 will never be used">;
  2701. def warn_conv_to_void_not_used : Warning<
  2702. "conversion function converting %0 to %1 will never be used">;
  2703. def warn_not_compound_assign : Warning<
  2704. "use of unary operator that may be intended as compound assignment (%0=)">;
  2705. // C++0x explicit conversion operators
  2706. def warn_explicit_conversion_functions : Warning<
  2707. "explicit conversion functions are a C++0x extension">;
  2708. def warn_printf_write_back : Warning<
  2709. "use of '%%n' in format string discouraged (potentially insecure)">,
  2710. InGroup<FormatSecurity>;
  2711. def warn_printf_insufficient_data_args : Warning<
  2712. "more '%%' conversions than data arguments">, InGroup<Format>;
  2713. def warn_printf_data_arg_not_used : Warning<
  2714. "data argument not used by format string">, InGroup<FormatExtraArgs>;
  2715. def warn_printf_invalid_conversion : Warning<
  2716. "invalid conversion specifier '%0'">, InGroup<Format>;
  2717. def warn_printf_incomplete_specifier : Warning<
  2718. "incomplete format specifier">, InGroup<Format>;
  2719. def warn_printf_missing_format_string : Warning<
  2720. "format string missing">, InGroup<Format>;
  2721. def warn_printf_conversion_argument_type_mismatch : Warning<
  2722. "conversion specifies type %0 but the argument has type %1">,
  2723. InGroup<Format>;
  2724. def warn_printf_positional_arg_exceeds_data_args : Warning <
  2725. "data argument position '%0' exceeds the number of data arguments (%1)">,
  2726. InGroup<Format>;
  2727. def warn_printf_zero_positional_specifier : Warning<
  2728. "position arguments in format strings start counting at 1 (not 0)">,
  2729. InGroup<Format>;
  2730. def warn_printf_invalid_positional_specifier : Warning<
  2731. "invalid position specified for %select{field width|field precision}0">,
  2732. InGroup<Format>;
  2733. def warn_printf_mix_positional_nonpositional_args : Warning<
  2734. "cannot mix positional and non-positional arguments in format string">,
  2735. InGroup<Format>;
  2736. def warn_null_arg : Warning<
  2737. "null passed to a callee which requires a non-null argument">,
  2738. InGroup<NonNull>;
  2739. def warn_printf_empty_format_string : Warning<
  2740. "format string is empty">, InGroup<FormatZeroLength>;
  2741. def warn_printf_format_string_is_wide_literal : Warning<
  2742. "format string should not be a wide string">, InGroup<Format>;
  2743. def warn_printf_format_string_contains_null_char : Warning<
  2744. "format string contains '\\0' within the string body">, InGroup<Format>;
  2745. def warn_printf_asterisk_missing_arg : Warning<
  2746. "'%select{*|.*}0' specified field %select{width|precision}0 is missing a matching 'int' argument">;
  2747. def warn_printf_asterisk_wrong_type : Warning<
  2748. "field %select{width|precision}0 should have type %1, but argument has type %2">,
  2749. InGroup<Format>;
  2750. def warn_printf_nonsensical_optional_amount: Warning<
  2751. "%select{field width|precision}0 used with '%1' conversion specifier, resulting in undefined behavior">,
  2752. InGroup<Format>;
  2753. def warn_printf_nonsensical_flag: Warning<
  2754. "flag '%0' results in undefined behavior with '%1' conversion specifier">,
  2755. InGroup<Format>;
  2756. def warn_printf_nonsensical_length: Warning<
  2757. "length modifier '%0' results in undefined behavior or no effect with '%1' conversion specifier">,
  2758. InGroup<Format>;
  2759. def warn_printf_ignored_flag: Warning<
  2760. "flag '%0' is ignored when flag '%1' is present">,
  2761. InGroup<Format>;
  2762. // CHECK: returning address/reference of stack memory
  2763. def warn_ret_stack_addr : Warning<
  2764. "address of stack memory associated with local variable %0 returned">;
  2765. def warn_ret_stack_ref : Warning<
  2766. "reference to stack memory associated with local variable %0 returned">;
  2767. def warn_ret_addr_label : Warning<
  2768. "returning address of label, which is local">;
  2769. def err_ret_local_block : Error<
  2770. "returning block that lives on the local stack">;
  2771. // For non-floating point, expressions of the form x == x or x != x
  2772. // should result in a warning, since these always evaluate to a constant.
  2773. // Array comparisons have similar warnings
  2774. def warn_comparison_always : Warning<
  2775. "%select{self-|array }0comparison always evaluates to %select{false|true|a constant}1">;
  2776. def warn_stringcompare : Warning<
  2777. "result of comparison against %select{a string literal|@encode}0 is "
  2778. "unspecified (use strncmp instead)">;
  2779. // Blocks
  2780. def err_blocks_disable : Error<"blocks support disabled - compile with -fblocks"
  2781. " or pick a deployment target that supports them">;
  2782. def err_expected_block_lbrace : Error<"expected '{' in block literal">;
  2783. def err_return_in_block_expression : Error<
  2784. "return not allowed in block expression literal">;
  2785. def err_block_returns_array : Error<
  2786. "block declared as returning an array">;
  2787. // CFString checking
  2788. def err_cfstring_literal_not_string_constant : Error<
  2789. "CFString literal is not a string constant">;
  2790. def warn_cfstring_literal_contains_nul_character : Warning<
  2791. "CFString literal contains NUL character">;
  2792. // Statements.
  2793. def err_continue_not_in_loop : Error<
  2794. "'continue' statement not in loop statement">;
  2795. def err_break_not_in_loop_or_switch : Error<
  2796. "'break' statement not in loop or switch statement">;
  2797. def err_default_not_in_switch : Error<
  2798. "'default' statement not in switch statement">;
  2799. def err_case_not_in_switch : Error<"'case' statement not in switch statement">;
  2800. def warn_bool_switch_condition : Warning<
  2801. "switch condition has boolean value">;
  2802. def warn_case_value_overflow : Warning<
  2803. "overflow converting case value to switch condition type (%0 to %1)">,
  2804. InGroup<DiagGroup<"switch">>;
  2805. def err_duplicate_case : Error<"duplicate case value '%0'">;
  2806. def warn_case_empty_range : Warning<"empty case range specified">;
  2807. def warn_missing_case_for_condition :
  2808. Warning<"no case matching constant switch condition '%0'">;
  2809. def warn_missing_cases : Warning<"enumeration value %0 not handled in switch">,
  2810. InGroup<DiagGroup<"switch-enum"> >;
  2811. def warn_not_in_enum : Warning<"case value not in enumerated type %0">,
  2812. InGroup<DiagGroup<"switch-enum"> >;
  2813. def err_typecheck_statement_requires_scalar : Error<
  2814. "statement requires expression of scalar type (%0 invalid)">;
  2815. def err_typecheck_statement_requires_integer : Error<
  2816. "statement requires expression of integer type (%0 invalid)">;
  2817. def err_multiple_default_labels_defined : Error<
  2818. "multiple default labels in one switch">;
  2819. def err_switch_multiple_conversions : Error<
  2820. "multiple conversions from switch condition type %0 to an integral or "
  2821. "enumeration type">;
  2822. def note_switch_conversion : Note<
  2823. "conversion to %select{integral|enumeration}0 type %1">;
  2824. def err_switch_explicit_conversion : Error<
  2825. "switch condition type %0 requires explicit conversion to %1">;
  2826. def err_switch_incomplete_class_type : Error<
  2827. "switch condition has incomplete class type %0">;
  2828. def warn_empty_if_body : Warning<
  2829. "if statement has empty body">, InGroup<EmptyBody>;
  2830. def err_va_start_used_in_non_variadic_function : Error<
  2831. "'va_start' used in function with fixed args">;
  2832. def warn_second_parameter_of_va_start_not_last_named_argument : Warning<
  2833. "second parameter of 'va_start' not last named argument">;
  2834. def err_first_argument_to_va_arg_not_of_type_va_list : Error<
  2835. "first argument to 'va_arg' is of type %0 and not 'va_list'">;
  2836. def warn_return_missing_expr : Warning<
  2837. "non-void %select{function|method}1 %0 should return a value">,
  2838. InGroup<ReturnType>;
  2839. def ext_return_missing_expr : ExtWarn<
  2840. "non-void %select{function|method}1 %0 should return a value">,
  2841. InGroup<ReturnType>;
  2842. def ext_return_has_expr : ExtWarn<
  2843. "void %select{function|method}1 %0 should not return a value">,
  2844. InGroup<ReturnType>;
  2845. def ext_return_has_void_expr : Extension<
  2846. "void %select{function|method}1 %0 should not return void expression">;
  2847. def warn_noreturn_function_has_return_expr : Warning<
  2848. "function %0 declared 'noreturn' should not return">,
  2849. InGroup<DiagGroup<"invalid-noreturn">>;
  2850. def warn_falloff_noreturn_function : Warning<
  2851. "function declared 'noreturn' should not return">,
  2852. InGroup<DiagGroup<"invalid-noreturn">>;
  2853. def err_noreturn_block_has_return_expr : Error<
  2854. "block declared 'noreturn' should not return">;
  2855. def err_block_on_nonlocal : Error<
  2856. "__block attribute not allowed, only allowed on local variables">;
  2857. def err_block_on_vm : Error<
  2858. "__block attribute not allowed on declaration with a variably modified type">;
  2859. def err_shufflevector_non_vector : Error<
  2860. "first two arguments to __builtin_shufflevector must be vectors">;
  2861. def err_shufflevector_incompatible_vector : Error<
  2862. "first two arguments to __builtin_shufflevector must have the same type">;
  2863. def err_shufflevector_nonconstant_argument : Error<
  2864. "index for __builtin_shufflevector must be a constant integer">;
  2865. def err_shufflevector_argument_too_large : Error<
  2866. "index for __builtin_shufflevector must be less than the total number "
  2867. "of vector elements">;
  2868. def err_vector_incorrect_num_initializers : Error<
  2869. "%select{too many|too few}0 elements in vector initialization (expected %1 elements, have %2)">;
  2870. def err_altivec_empty_initializer : Error<"expected initializer">;
  2871. def err_invalid_neon_type_code : Error<
  2872. "incompatible constant for this __builtin_neon function">;
  2873. def err_argument_invalid_range : Error<
  2874. "argument should be a value from %0 to %1">;
  2875. def err_builtin_longjmp_invalid_val : Error<
  2876. "argument to __builtin_longjmp must be a constant 1">;
  2877. def err_constant_integer_arg_type : Error<
  2878. "argument to %0 must be a constant integer">;
  2879. def ext_mixed_decls_code : Extension<
  2880. "ISO C90 forbids mixing declarations and code">,
  2881. InGroup<DiagGroup<"declaration-after-statement">>;
  2882. def err_non_variable_decl_in_for : Error<
  2883. "declaration of non-local variable in 'for' loop">;
  2884. def err_toomany_element_decls : Error<
  2885. "only one element declaration is allowed">;
  2886. def err_selector_element_not_lvalue : Error<
  2887. "selector element is not a valid lvalue">;
  2888. def err_selector_element_type : Error<
  2889. "selector element type %0 is not a valid object">;
  2890. def err_collection_expr_type : Error<
  2891. "collection expression type %0 is not a valid object">;
  2892. def err_invalid_conversion_between_ext_vectors : Error<
  2893. "invalid conversion between ext-vector type %0 and %1">;
  2894. // Type
  2895. def ext_invalid_sign_spec : Extension<"'%0' cannot be signed or unsigned">;
  2896. def warn_receiver_forward_class : Warning<
  2897. "receiver %0 is a forward class and corresponding @interface may not exist">;
  2898. def note_method_sent_forward_class : Note<"method %0 is used for the forward class">;
  2899. def ext_missing_declspec : ExtWarn<
  2900. "declaration specifier missing, defaulting to 'int'">;
  2901. def ext_missing_type_specifier : ExtWarn<
  2902. "type specifier missing, defaults to 'int'">,
  2903. InGroup<ImplicitInt>;
  2904. def err_decimal_unsupported : Error<
  2905. "GNU decimal type extension not supported">;
  2906. def err_missing_type_specifier : Error<
  2907. "C++ requires a type specifier for all declarations">;
  2908. def err_missing_param_declspec : Error<
  2909. "parameter requires a declaration specifier">;
  2910. def err_objc_array_of_interfaces : Error<
  2911. "array of interface %0 is invalid (probably should be an array of pointers)">;
  2912. def ext_c99_array_usage : Extension<
  2913. "use of C99-specific array features, accepted as an extension">;
  2914. def err_c99_array_usage_cxx : Error<
  2915. "C99-specific array features are not permitted in C++">;
  2916. def note_getter_unavailable : Note<
  2917. "or because setter is declared here, but no getter method %0 is found">;
  2918. def err_invalid_protocol_qualifiers : Error<
  2919. "invalid protocol qualifiers on non-ObjC type">;
  2920. def warn_ivar_use_hidden : Warning<
  2921. "local declaration of %0 hides instance variable">;
  2922. def error_ivar_use_in_class_method : Error<
  2923. "instance variable %0 accessed in class method">;
  2924. def error_private_ivar_access : Error<"instance variable %0 is private">,
  2925. NoSFINAE;
  2926. def error_protected_ivar_access : Error<"instance variable %0 is protected">,
  2927. NoSFINAE;
  2928. def warn_maynot_respond : Warning<"%0 may not respond to %1">;
  2929. def warn_attribute_method_def : Warning<
  2930. "method attribute can only be specified on method declarations">;
  2931. def ext_typecheck_base_super : Warning<
  2932. "method parameter type %0 does not match "
  2933. "super class method parameter type %1">, InGroup<SuperSubClassMismatch>, DefaultIgnore;
  2934. // Spell-checking diagnostics
  2935. def err_unknown_typename_suggest : Error<
  2936. "unknown type name %0; did you mean %1?">;
  2937. def err_unknown_nested_typename_suggest : Error<
  2938. "no type named %0 in %1; did you mean %2?">;
  2939. def err_no_member_suggest : Error<"no member named %0 in %1; did you mean %2?">;
  2940. def err_undeclared_use_suggest : Error<
  2941. "use of undeclared %0; did you mean %1?">;
  2942. def err_undeclared_var_use_suggest : Error<
  2943. "use of undeclared identifier %0; did you mean %1?">;
  2944. def err_no_template_suggest : Error<"no template named %0; did you mean %1?">;
  2945. def err_no_member_template_suggest : Error<
  2946. "no template named %0 in %1; did you mean %2?">;
  2947. def err_mem_init_not_member_or_class_suggest : Error<
  2948. "initializer %0 does not name a non-static data member or base "
  2949. "class; did you mean the %select{base class|member}1 %2?">;
  2950. def err_field_designator_unknown_suggest : Error<
  2951. "field designator %0 does not refer to any field in type %1; did you mean "
  2952. "%2?">;
  2953. def err_typecheck_member_reference_ivar_suggest : Error<
  2954. "%0 does not have a member named %1; did you mean %2?">;
  2955. def err_property_not_found_suggest : Error<
  2956. "property %0 not found on object of type %1; did you mean %2?">;
  2957. def err_undef_interface_suggest : Error<
  2958. "cannot find interface declaration for %0; did you mean %1?">;
  2959. def warn_undef_interface_suggest : Warning<
  2960. "cannot find interface declaration for %0; did you mean %1?">;
  2961. def err_undef_superclass_suggest : Error<
  2962. "cannot find interface declaration for %0, superclass of %1; did you mean "
  2963. "%2?">;
  2964. def err_undeclared_protocol_suggest : Error<
  2965. "cannot find protocol declaration for %0; did you mean %1?">;
  2966. def note_base_class_specified_here : Note<
  2967. "base class %0 specified here">;
  2968. } // end of sema category
  2969. } // end of sema component.