DiagnosticParseKinds.td 76 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587
  1. //==--- DiagnosticParseKinds.td - libparse diagnostics --------------------===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //===----------------------------------------------------------------------===//
  9. // Parser Diagnostics
  10. //===----------------------------------------------------------------------===//
  11. let Component = "Parse" in {
  12. def err_asm_qualifier_ignored : Error<
  13. "expected 'volatile', 'inline', 'goto', or '('">, CatInlineAsm;
  14. def err_global_asm_qualifier_ignored : Error<
  15. "meaningless '%0' on asm outside function">, CatInlineAsm;
  16. let CategoryName = "Inline Assembly Issue" in {
  17. def err_asm_empty : Error<"__asm used with no assembly instructions">;
  18. def err_inline_ms_asm_parsing : Error<"%0">;
  19. def err_msasm_unsupported_arch : Error<
  20. "unsupported architecture '%0' for MS-style inline assembly">;
  21. def err_msasm_unable_to_create_target : Error<
  22. "MS-style inline assembly is not available: %0">;
  23. def err_gnu_inline_asm_disabled : Error<
  24. "GNU-style inline assembly is disabled">;
  25. def err_asm_duplicate_qual : Error<"duplicate asm qualifier '%0'">;
  26. }
  27. let CategoryName = "Parse Issue" in {
  28. def ext_empty_translation_unit : Extension<
  29. "ISO C requires a translation unit to contain at least one declaration">,
  30. InGroup<DiagGroup<"empty-translation-unit">>;
  31. def warn_cxx98_compat_top_level_semi : Warning<
  32. "extra ';' outside of a function is incompatible with C++98">,
  33. InGroup<CXX98CompatExtraSemi>, DefaultIgnore;
  34. def ext_extra_semi : Extension<
  35. "extra ';' %select{"
  36. "outside of a function|"
  37. "inside a %1|"
  38. "inside instance variable list|"
  39. "after member function definition}0">,
  40. InGroup<ExtraSemi>;
  41. def ext_extra_semi_cxx11 : Extension<
  42. "extra ';' outside of a function is a C++11 extension">,
  43. InGroup<CXX11ExtraSemi>;
  44. def warn_extra_semi_after_mem_fn_def : Warning<
  45. "extra ';' after member function definition">,
  46. InGroup<ExtraSemi>, DefaultIgnore;
  47. def warn_null_statement : Warning<
  48. "empty expression statement has no effect; "
  49. "remove unnecessary ';' to silence this warning">,
  50. InGroup<ExtraSemiStmt>, DefaultIgnore;
  51. def warn_misleading_indentation : Warning<
  52. "misleading indentation; statement is not part of "
  53. "the previous '%select{if|else|for|while}0'">,
  54. InGroup<MisleadingIndentation>, DefaultIgnore;
  55. def note_previous_statement : Note<
  56. "previous statement is here">;
  57. def subst_compound_token_kind : TextSubstitution<
  58. "%select{%1 and |}0%2 tokens "
  59. "%select{introducing statement expression|terminating statement expression|"
  60. "introducing attribute|terminating attribute|"
  61. "forming pointer to member type}3">;
  62. def warn_compound_token_split_by_macro : Warning<
  63. "%sub{subst_compound_token_kind}0,1,2,3 appear in different "
  64. "macro expansion contexts">, InGroup<CompoundTokenSplitByMacro>;
  65. def note_compound_token_split_second_token_here : Note<
  66. "%select{|second }0%1 token is here">;
  67. def warn_compound_token_split_by_whitespace : Warning<
  68. "%sub{subst_compound_token_kind}0,1,2,3 are separated by whitespace">,
  69. InGroup<CompoundTokenSplitBySpace>, DefaultIgnore;
  70. def ext_thread_before : Extension<"'__thread' before '%0'">;
  71. def ext_keyword_as_ident : ExtWarn<
  72. "keyword '%0' will be made available as an identifier "
  73. "%select{here|for the remainder of the translation unit}1">,
  74. InGroup<KeywordCompat>;
  75. def ext_nullability : Extension<
  76. "type nullability specifier %0 is a Clang extension">,
  77. InGroup<DiagGroup<"nullability-extension">>;
  78. def err_empty_enum : Error<"use of empty enum">;
  79. def ext_ident_list_in_param : Extension<
  80. "type-less parameter names in function declaration">;
  81. def ext_c99_variable_decl_in_for_loop : Extension<
  82. "variable declaration in for loop is a C99-specific feature">, InGroup<C99>;
  83. def ext_c99_compound_literal : Extension<
  84. "compound literals are a C99-specific feature">, InGroup<C99>;
  85. def ext_enumerator_list_comma_c : Extension<
  86. "commas at the end of enumerator lists are a C99-specific "
  87. "feature">, InGroup<C99>;
  88. def ext_enumerator_list_comma_cxx : Extension<
  89. "commas at the end of enumerator lists are a C++11 extension">,
  90. InGroup<CXX11>;
  91. def warn_cxx98_compat_enumerator_list_comma : Warning<
  92. "commas at the end of enumerator lists are incompatible with C++98">,
  93. InGroup<CXX98CompatPedantic>, DefaultIgnore;
  94. def err_enumerator_list_missing_comma : Error<
  95. "missing ',' between enumerators">;
  96. def err_enumerator_unnamed_no_def : Error<
  97. "unnamed enumeration must be a definition">;
  98. def ext_cxx11_enum_fixed_underlying_type : Extension<
  99. "enumeration types with a fixed underlying type are a C++11 extension">,
  100. InGroup<CXX11>;
  101. def ext_ms_c_enum_fixed_underlying_type : Extension<
  102. "enumeration types with a fixed underlying type are a Microsoft extension">,
  103. InGroup<MicrosoftFixedEnum>;
  104. def ext_clang_c_enum_fixed_underlying_type : Extension<
  105. "enumeration types with a fixed underlying type are a Clang extension">,
  106. InGroup<DiagGroup<"fixed-enum-extension">>;
  107. def warn_cxx98_compat_enum_fixed_underlying_type : Warning<
  108. "enumeration types with a fixed underlying type are incompatible with C++98">,
  109. InGroup<CXX98Compat>, DefaultIgnore;
  110. def ext_enum_base_in_type_specifier : ExtWarn<
  111. "non-defining declaration of enumeration with a fixed underlying type is "
  112. "only permitted as a standalone declaration"
  113. "%select{|; missing list of enumerators?}0">,
  114. InGroup<DiagGroup<"elaborated-enum-base">>, DefaultError;
  115. def ext_elaborated_enum_class : ExtWarn<
  116. "reference to enumeration must use 'enum' not 'enum %select{struct|class}0'">,
  117. InGroup<DiagGroup<"elaborated-enum-class">>, DefaultError;
  118. def err_scoped_enum_missing_identifier : Error<
  119. "scoped enumeration requires a name">;
  120. def ext_scoped_enum : ExtWarn<
  121. "scoped enumerations are a C++11 extension">, InGroup<CXX11>;
  122. def warn_cxx98_compat_scoped_enum : Warning<
  123. "scoped enumerations are incompatible with C++98">,
  124. InGroup<CXX98Compat>, DefaultIgnore;
  125. def err_anonymous_enum_bitfield : Error<
  126. "ISO C++ only allows ':' in member enumeration declaration to introduce "
  127. "a fixed underlying type, not an anonymous bit-field">;
  128. def warn_cxx98_compat_alignof : Warning<
  129. "alignof expressions are incompatible with C++98">,
  130. InGroup<CXX98Compat>, DefaultIgnore;
  131. def ext_alignof_expr : ExtWarn<
  132. "%0 applied to an expression is a GNU extension">, InGroup<GNUAlignofExpression>;
  133. def err_lambda_after_delete : Error<
  134. "'[]' after delete interpreted as 'delete[]'; add parentheses to treat this as a lambda-expression">;
  135. def warn_microsoft_dependent_exists : Warning<
  136. "dependent %select{__if_not_exists|__if_exists}0 declarations are ignored">,
  137. InGroup<DiagGroup<"microsoft-exists">>;
  138. def warn_microsoft_qualifiers_ignored : Warning<
  139. "qualifiers after comma in declarator list are ignored">,
  140. InGroup<IgnoredAttributes>;
  141. def err_duplicate_default_assoc : Error<
  142. "duplicate default generic association">;
  143. def note_previous_default_assoc : Note<
  144. "previous default generic association is here">;
  145. def ext_c99_feature : Extension<
  146. "'%0' is a C99 extension">, InGroup<C99>;
  147. def ext_c11_feature : Extension<
  148. "'%0' is a C11 extension">, InGroup<C11>;
  149. def err_c11_noreturn_misplaced : Error<
  150. "'_Noreturn' keyword must precede function declarator">;
  151. def ext_gnu_indirect_goto : Extension<
  152. "use of GNU indirect-goto extension">, InGroup<GNULabelsAsValue>;
  153. def ext_gnu_address_of_label : Extension<
  154. "use of GNU address-of-label extension">, InGroup<GNULabelsAsValue>;
  155. def err_stmtexpr_file_scope : Error<
  156. "statement expression not allowed at file scope">;
  157. def ext_gnu_statement_expr : Extension<
  158. "use of GNU statement expression extension">, InGroup<GNUStatementExpression>;
  159. def ext_gnu_conditional_expr : Extension<
  160. "use of GNU ?: conditional expression extension, omitting middle operand">, InGroup<GNUConditionalOmittedOperand>;
  161. def ext_gnu_empty_initializer : Extension<
  162. "use of GNU empty initializer extension">, InGroup<GNUEmptyInitializer>;
  163. def ext_gnu_array_range : Extension<"use of GNU array range extension">,
  164. InGroup<GNUDesignator>;
  165. def ext_gnu_missing_equal_designator : ExtWarn<
  166. "use of GNU 'missing =' extension in designator">,
  167. InGroup<GNUDesignator>;
  168. def err_expected_equal_designator : Error<"expected '=' or another designator">;
  169. def ext_gnu_old_style_field_designator : ExtWarn<
  170. "use of GNU old-style field designator extension">,
  171. InGroup<GNUDesignator>;
  172. def ext_gnu_case_range : Extension<"use of GNU case range extension">,
  173. InGroup<GNUCaseRange>;
  174. // Generic errors.
  175. def err_expected_expression : Error<"expected expression">;
  176. def err_expected_type : Error<"expected a type">;
  177. def err_expected_external_declaration : Error<"expected external declaration">;
  178. def err_extraneous_closing_brace : Error<"extraneous closing brace ('}')">;
  179. def err_expected_semi_declaration : Error<
  180. "expected ';' at end of declaration">;
  181. def err_expected_semi_decl_list : Error<
  182. "expected ';' at end of declaration list">;
  183. def ext_expected_semi_decl_list : ExtWarn<
  184. "expected ';' at end of declaration list">;
  185. def err_expected_member_name_or_semi : Error<
  186. "expected member name or ';' after declaration specifiers">;
  187. def err_function_declared_typedef : Error<
  188. "function definition declared 'typedef'">;
  189. def err_at_defs_cxx : Error<"@defs is not supported in Objective-C++">;
  190. def err_at_in_class : Error<"unexpected '@' in member specification">;
  191. def err_unexpected_semi : Error<"unexpected ';' before %0">;
  192. def err_postfix_after_unary_requires_parens : Error<
  193. "expression cannot be followed by a postfix %0 operator; add parentheses">;
  194. def err_unparenthesized_non_primary_expr_in_requires_clause : Error<
  195. "parentheses are required around this expression in a requires clause">;
  196. def note_unparenthesized_non_primary_expr_in_requires_clause : Note<
  197. "parentheses are required around this expression in a requires clause">;
  198. def err_expected_fn_body : Error<
  199. "expected function body after function declarator">;
  200. def warn_attribute_on_function_definition : Warning<
  201. "GCC does not allow %0 attribute in this position on a function definition">,
  202. InGroup<GccCompat>;
  203. def warn_gcc_attribute_location : Warning<
  204. "GCC does not allow an attribute in this position on a function declaration">,
  205. InGroup<GccCompat>;
  206. def warn_gcc_variable_decl_in_for_loop : Warning<
  207. "GCC does not allow variable declarations in for loop initializers before "
  208. "C99">, InGroup<GccCompat>;
  209. def warn_attribute_no_decl : Warning<
  210. "attribute %0 ignored, because it is not attached to a declaration">,
  211. InGroup<IgnoredAttributes>;
  212. def err_ms_attributes_not_enabled : Error<
  213. "'__declspec' attributes are not enabled; use '-fdeclspec' or "
  214. "'-fms-extensions' to enable support for __declspec attributes">;
  215. def err_expected_method_body : Error<"expected method body">;
  216. def err_declspec_after_virtspec : Error<
  217. "'%0' qualifier may not appear after the virtual specifier '%1'">;
  218. def err_invalid_token_after_toplevel_declarator : Error<
  219. "expected ';' after top level declarator">;
  220. def err_invalid_token_after_declarator_suggest_equal : Error<
  221. "invalid %0 at end of declaration; did you mean '='?">;
  222. def err_expected_statement : Error<"expected statement">;
  223. def err_expected_lparen_after : Error<"expected '(' after '%0'">;
  224. def err_expected_rparen_after : Error<"expected ')' after '%0'">;
  225. def err_expected_punc : Error<"expected ')' or ',' after '%0'">;
  226. def err_expected_less_after : Error<"expected '<' after '%0'">;
  227. def err_expected_lbrace_in_compound_literal : Error<
  228. "expected '{' in compound literal">;
  229. def err_expected_while : Error<"expected 'while' in do/while loop">;
  230. def err_expected_semi_after_stmt : Error<"expected ';' after %0 statement">;
  231. def err_expected_semi_after_expr : Error<"expected ';' after expression">;
  232. def err_extraneous_token_before_semi : Error<"extraneous '%0' before ';'">;
  233. def err_expected_semi_after_method_proto : Error<
  234. "expected ';' after method prototype">;
  235. def err_expected_semi_after_namespace_name : Error<
  236. "expected ';' after namespace name">;
  237. def err_unexpected_namespace_attributes_alias : Error<
  238. "attributes cannot be specified on namespace alias">;
  239. def err_unexpected_nested_namespace_attribute : Error<
  240. "attributes cannot be specified on a nested namespace definition">;
  241. def err_inline_namespace_alias : Error<"namespace alias cannot be inline">;
  242. def err_namespace_nonnamespace_scope : Error<
  243. "namespaces can only be defined in global or namespace scope">;
  244. def ext_nested_namespace_definition : ExtWarn<
  245. "nested namespace definition is a C++17 extension; "
  246. "define each namespace separately">, InGroup<CXX17>;
  247. def warn_cxx14_compat_nested_namespace_definition : Warning<
  248. "nested namespace definition is incompatible with C++ standards before C++17">,
  249. InGroup<CXXPre17Compat>, DefaultIgnore;
  250. def ext_inline_nested_namespace_definition : ExtWarn<
  251. "inline nested namespace definition is a C++20 extension">, InGroup<CXX20>;
  252. def warn_cxx17_compat_inline_nested_namespace_definition : Warning<
  253. "inline nested namespace definition is incompatible with C++ standards before"
  254. " C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
  255. def err_inline_nested_namespace_definition : Error<
  256. "nested namespace definition cannot be 'inline'">;
  257. def err_expected_semi_after_attribute_list : Error<
  258. "expected ';' after attribute list">;
  259. def err_expected_semi_after_static_assert : Error<
  260. "expected ';' after static_assert">;
  261. def err_expected_semi_for : Error<"expected ';' in 'for' statement specifier">;
  262. def err_single_decl_assign_in_for_range : Error<
  263. "range-based 'for' statement uses ':', not '='">;
  264. def warn_missing_selector_name : Warning<
  265. "%0 used as the name of the previous parameter rather than as part "
  266. "of the selector">,
  267. InGroup<DiagGroup<"missing-selector-name">>;
  268. def note_missing_selector_name : Note<
  269. "introduce a parameter name to make %0 part of the selector">;
  270. def note_force_empty_selector_name : Note<
  271. "or insert whitespace before ':' to use %0 as parameter name "
  272. "and have an empty entry in the selector">;
  273. def err_label_end_of_compound_statement : Error<
  274. "label at end of compound statement: expected statement">;
  275. def err_address_of_label_outside_fn : Error<
  276. "use of address-of-label extension outside of a function body">;
  277. def err_asm_operand_wide_string_literal : Error<
  278. "cannot use %select{unicode|wide|an empty}0 string literal in 'asm'">;
  279. def err_expected_selector_for_method : Error<
  280. "expected selector for Objective-C method">;
  281. def err_expected_property_name : Error<"expected property name">;
  282. def err_unexpected_at : Error<"unexpected '@' in program">;
  283. def err_atimport : Error<
  284. "use of '@import' when modules are disabled">;
  285. def warn_atimport_in_framework_header : Warning<
  286. "use of '@import' in framework header is discouraged, "
  287. "including this header requires -fmodules">,
  288. InGroup<FrameworkHdrAtImport>;
  289. def err_invalid_reference_qualifier_application : Error<
  290. "'%0' qualifier may not be applied to a reference">;
  291. def err_illegal_decl_reference_to_reference : Error<
  292. "%0 declared as a reference to a reference">;
  293. def ext_rvalue_reference : ExtWarn<
  294. "rvalue references are a C++11 extension">, InGroup<CXX11>;
  295. def warn_cxx98_compat_rvalue_reference : Warning<
  296. "rvalue references are incompatible with C++98">,
  297. InGroup<CXX98Compat>, DefaultIgnore;
  298. def ext_ref_qualifier : ExtWarn<
  299. "reference qualifiers on functions are a C++11 extension">, InGroup<CXX11>;
  300. def warn_cxx98_compat_ref_qualifier : Warning<
  301. "reference qualifiers on functions are incompatible with C++98">,
  302. InGroup<CXX98Compat>, DefaultIgnore;
  303. def ext_inline_namespace : ExtWarn<
  304. "inline namespaces are a C++11 feature">, InGroup<CXX11InlineNamespace>;
  305. def warn_cxx98_compat_inline_namespace : Warning<
  306. "inline namespaces are incompatible with C++98">,
  307. InGroup<CXX98Compat>, DefaultIgnore;
  308. def ext_generalized_initializer_lists : ExtWarn<
  309. "generalized initializer lists are a C++11 extension">,
  310. InGroup<CXX11>;
  311. def warn_cxx98_compat_generalized_initializer_lists : Warning<
  312. "generalized initializer lists are incompatible with C++98">,
  313. InGroup<CXX98Compat>, DefaultIgnore;
  314. def err_init_list_bin_op : Error<"initializer list cannot be used on the "
  315. "%select{left|right}0 hand side of operator '%1'">;
  316. def warn_cxx98_compat_trailing_return_type : Warning<
  317. "trailing return types are incompatible with C++98">,
  318. InGroup<CXX98Compat>, DefaultIgnore;
  319. def err_requires_clause_must_appear_after_trailing_return : Error<
  320. "trailing return type must appear before trailing requires clause">;
  321. def err_requires_clause_on_declarator_not_declaring_a_function : Error<
  322. "trailing requires clause can only be used when declaring a function">;
  323. def err_requires_clause_inside_parens : Error<
  324. "trailing requires clause should be placed outside parentheses">;
  325. def ext_auto_storage_class : ExtWarn<
  326. "'auto' storage class specifier is not permitted in C++11, and will not "
  327. "be supported in future releases">, InGroup<DiagGroup<"auto-storage-class">>;
  328. def ext_decltype_auto_type_specifier : ExtWarn<
  329. "'decltype(auto)' type specifier is a C++14 extension">, InGroup<CXX14>;
  330. def warn_cxx11_compat_decltype_auto_type_specifier : Warning<
  331. "'decltype(auto)' type specifier is incompatible with C++ standards before "
  332. "C++14">, InGroup<CXXPre14Compat>, DefaultIgnore;
  333. def ext_auto_type : Extension<
  334. "'__auto_type' is a GNU extension">,
  335. InGroup<GNUAutoType>;
  336. def ext_for_range : ExtWarn<
  337. "range-based for loop is a C++11 extension">, InGroup<CXX11>;
  338. def warn_cxx98_compat_for_range : Warning<
  339. "range-based for loop is incompatible with C++98">,
  340. InGroup<CXX98Compat>, DefaultIgnore;
  341. def err_for_range_identifier : Error<
  342. "range-based for loop requires type for loop variable">;
  343. def err_for_range_expected_decl : Error<
  344. "for range declaration must declare a variable">;
  345. def err_argument_required_after_attribute : Error<
  346. "argument required after attribute">;
  347. def err_missing_param : Error<"expected parameter declarator">;
  348. def err_function_scope_depth_exceeded : Error<
  349. "function scope depth exceeded maximum of %0">, DefaultFatal;
  350. def err_missing_comma_before_ellipsis : Error<
  351. "C requires a comma prior to the ellipsis in a variadic function type">;
  352. def err_unexpected_typedef_ident : Error<
  353. "unexpected type name %0: expected identifier">;
  354. def warn_cxx98_compat_decltype : Warning<
  355. "'decltype' type specifier is incompatible with C++98">,
  356. InGroup<CXX98Compat>, DefaultIgnore;
  357. def err_unexpected_scope_on_base_decltype : Error<
  358. "unexpected namespace scope prior to decltype">;
  359. def err_expected_class_name : Error<"expected class name">;
  360. def err_expected_class_name_not_template :
  361. Error<"'typename' is redundant; base classes are implicitly types">;
  362. def err_unspecified_vla_size_with_static : Error<
  363. "'static' may not be used with an unspecified variable length array size">;
  364. def err_unspecified_size_with_static : Error<
  365. "'static' may not be used without an array size">;
  366. def err_expected_parentheses_around_typename : Error<
  367. "expected parentheses around type name in %0 expression">;
  368. def err_expected_case_before_expression: Error<
  369. "expected 'case' keyword before expression">;
  370. def ext_warn_gnu_final : ExtWarn<
  371. "__final is a GNU extension, consider using C++11 final">,
  372. InGroup<GccCompat>;
  373. // Declarations.
  374. def err_typename_requires_specqual : Error<
  375. "type name requires a specifier or qualifier">;
  376. def err_typename_invalid_storageclass : Error<
  377. "type name does not allow storage class to be specified">;
  378. def err_typename_invalid_functionspec : Error<
  379. "type name does not allow function specifier to be specified">;
  380. def err_typename_invalid_constexpr : Error<
  381. "type name does not allow %sub{select_constexpr_spec_kind}0 specifier "
  382. "to be specified">;
  383. def err_typename_identifiers_only : Error<
  384. "typename is allowed for identifiers only">;
  385. def err_friend_invalid_in_context : Error<
  386. "'friend' used outside of class">;
  387. def err_templated_using_directive_declaration : Error<
  388. "cannot template a using %select{directive|declaration}0">;
  389. def err_unexpected_colon_in_nested_name_spec : Error<
  390. "unexpected ':' in nested name specifier; did you mean '::'?">;
  391. def err_unexpected_token_in_nested_name_spec : Error<
  392. "'%0' cannot be a part of nested name specifier; did you mean ':'?">;
  393. def err_bool_redeclaration : Error<
  394. "redeclaration of C++ built-in type 'bool'">;
  395. def warn_cxx98_compat_static_assert : Warning<
  396. "static_assert declarations are incompatible with C++98">,
  397. InGroup<CXX98Compat>, DefaultIgnore;
  398. def ext_ms_static_assert : ExtWarn<
  399. "use of 'static_assert' without inclusion of <assert.h> is a Microsoft "
  400. "extension">, InGroup<MicrosoftStaticAssert>;
  401. def ext_cxx_static_assert_no_message : ExtWarn<
  402. "'static_assert' with no message is a C++17 extension">, InGroup<CXX17>;
  403. def ext_c_static_assert_no_message : ExtWarn<
  404. "'_Static_assert' with no message is a C2x extension">, InGroup<C2x>;
  405. def warn_cxx14_compat_static_assert_no_message : Warning<
  406. "'static_assert' with no message is incompatible with C++ standards before "
  407. "C++17">,
  408. DefaultIgnore, InGroup<CXXPre17Compat>;
  409. def warn_c17_compat_static_assert_no_message : Warning<
  410. "'_Static_assert' with no message is incompatible with C standards before "
  411. "C2x">,
  412. DefaultIgnore, InGroup<CPre2xCompat>;
  413. def err_function_definition_not_allowed : Error<
  414. "function definition is not allowed here">;
  415. def err_expected_end_of_enumerator : Error<
  416. "expected '= constant-expression' or end of enumerator definition">;
  417. def err_expected_coloncolon_after_super : Error<
  418. "expected '::' after '__super'">;
  419. def ext_decomp_decl_empty : ExtWarn<
  420. "ISO C++17 does not allow a decomposition group to be empty">,
  421. InGroup<DiagGroup<"empty-decomposition">>;
  422. /// Objective-C parser diagnostics
  423. def err_expected_minus_or_plus : Error<
  424. "method type specifier must start with '-' or '+'">;
  425. def err_objc_missing_end : Error<"missing '@end'">;
  426. def note_objc_container_start : Note<
  427. "%select{class|protocol|category|class extension|implementation"
  428. "|category implementation}0 started here">;
  429. def warn_objc_protocol_qualifier_missing_id : Warning<
  430. "protocol has no object type specified; defaults to qualified 'id'">;
  431. def err_objc_unknown_at : Error<"expected an Objective-C directive after '@'">;
  432. def err_illegal_super_cast : Error<
  433. "cannot cast 'super' (it isn't an expression)">;
  434. def err_nsnumber_nonliteral_unary : Error<
  435. "@%0 must be followed by a number to form an NSNumber object">;
  436. def warn_cstyle_param : Warning<
  437. "use of C-style parameters in Objective-C method declarations"
  438. " is deprecated">, InGroup<DeprecatedDeclarations>;
  439. let CategoryName = "ARC Parse Issue" in {
  440. def err_arc_bridge_retain : Error<
  441. "unknown cast annotation __bridge_retain; did you mean __bridge_retained?">;
  442. // To be default mapped to an error later.
  443. def warn_arc_bridge_cast_nonarc : Warning<
  444. "'%0' casts have no effect when not using ARC">,
  445. InGroup<DiagGroup<"arc-bridge-casts-disallowed-in-nonarc">>;
  446. }
  447. def err_objc_illegal_visibility_spec : Error<
  448. "illegal visibility specification">;
  449. def err_objc_illegal_interface_qual : Error<"illegal interface qualifier">;
  450. def err_objc_expected_equal_for_getter : Error<
  451. "expected '=' for Objective-C getter">;
  452. def err_objc_expected_equal_for_setter : Error<
  453. "expected '=' for Objective-C setter">;
  454. def err_objc_expected_selector_for_getter_setter : Error<
  455. "expected selector for Objective-C %select{setter|getter}0">;
  456. def err_objc_property_requires_field_name : Error<
  457. "property requires fields to be named">;
  458. def err_objc_property_bitfield : Error<"property name cannot be a bit-field">;
  459. def err_objc_expected_property_attr : Error<"unknown property attribute %0">;
  460. def err_objc_unexpected_attr : Error<
  461. "prefix attribute must be followed by an interface, protocol, or implementation">;
  462. def err_objc_postfix_attribute : Error <
  463. "postfix attributes are not allowed on Objective-C directives">;
  464. def err_objc_postfix_attribute_hint : Error <
  465. "postfix attributes are not allowed on Objective-C directives, place"
  466. " them in front of '%select{@interface|@protocol}0'">;
  467. def err_objc_directive_only_in_protocol : Error<
  468. "directive may only be specified in protocols only">;
  469. def err_missing_catch_finally : Error<
  470. "@try statement without a @catch and @finally clause">;
  471. def err_objc_concat_string : Error<"unexpected token after Objective-C string">;
  472. def err_expected_objc_container : Error<
  473. "'@end' must appear in an Objective-C context">;
  474. def err_unexpected_protocol_qualifier : Error<
  475. "@implementation declaration cannot be protocol qualified">;
  476. def err_objc_unexpected_atend : Error<
  477. "'@end' appears where closing brace '}' is expected">;
  478. def err_synthesized_property_name : Error<
  479. "expected a property name in @synthesize">;
  480. def warn_semicolon_before_method_body : Warning<
  481. "semicolon before method body is ignored">,
  482. InGroup<SemiBeforeMethodBody>, DefaultIgnore;
  483. def note_extra_comma_message_arg : Note<
  484. "comma separating Objective-C messaging arguments">;
  485. def err_expected_field_designator : Error<
  486. "expected a field designator, such as '.field = 4'">;
  487. def err_declaration_does_not_declare_param : Error<
  488. "declaration does not declare a parameter">;
  489. def err_no_matching_param : Error<"parameter named %0 is missing">;
  490. /// Objective-C++ parser diagnostics
  491. def err_expected_token_instead_of_objcxx_keyword : Error<
  492. "expected %0; %1 is a keyword in Objective-C++">;
  493. def err_expected_member_name_or_semi_objcxx_keyword : Error<
  494. "expected member name or ';' after declaration specifiers; "
  495. "%0 is a keyword in Objective-C++">;
  496. /// C++ parser diagnostics
  497. def err_invalid_operator_on_type : Error<
  498. "cannot use %select{dot|arrow}0 operator on a type">;
  499. def err_expected_unqualified_id : Error<
  500. "expected %select{identifier|unqualified-id}0">;
  501. def err_brackets_go_after_unqualified_id : Error<
  502. "brackets are not allowed here; to declare an array, "
  503. "place the brackets after the %select{identifier|name}0">;
  504. def err_unexpected_unqualified_id : Error<"type-id cannot have a name">;
  505. def err_func_def_no_params : Error<
  506. "function definition does not declare parameters">;
  507. def err_expected_lparen_after_type : Error<
  508. "expected '(' for function-style cast or type construction">;
  509. def err_expected_init_in_condition : Error<
  510. "variable declaration in condition must have an initializer">;
  511. def err_expected_init_in_condition_lparen : Error<
  512. "variable declaration in condition cannot have a parenthesized initializer">;
  513. def err_extraneous_rparen_in_condition : Error<
  514. "extraneous ')' after condition, expected a statement">;
  515. def ext_alias_in_init_statement : ExtWarn<
  516. "alias declaration in this context is a C++2b extension">,
  517. InGroup<CXX2b>;
  518. def warn_cxx20_alias_in_init_statement : Warning<
  519. "alias declaration in this context is incompatible with C++ standards before C++2b">,
  520. DefaultIgnore, InGroup<CXXPre2bCompat>;
  521. def warn_dangling_else : Warning<
  522. "add explicit braces to avoid dangling else">,
  523. InGroup<DanglingElse>;
  524. def err_expected_member_or_base_name : Error<
  525. "expected class member or base class name">;
  526. def err_expected_lbrace_after_base_specifiers : Error<
  527. "expected '{' after base class list">;
  528. def err_missing_end_of_definition : Error<
  529. "missing '}' at end of definition of %q0">;
  530. def note_missing_end_of_definition_before : Note<
  531. "still within definition of %q0 here">;
  532. def ext_ellipsis_exception_spec : Extension<
  533. "exception specification of '...' is a Microsoft extension">,
  534. InGroup<MicrosoftExceptionSpec>;
  535. def err_dynamic_and_noexcept_specification : Error<
  536. "cannot have both throw() and noexcept() clause on the same function">;
  537. def err_except_spec_unparsed : Error<
  538. "unexpected end of exception specification">;
  539. def ext_dynamic_exception_spec : ExtWarn<
  540. "ISO C++17 does not allow dynamic exception specifications">,
  541. InGroup<DynamicExceptionSpec>, DefaultError;
  542. def warn_exception_spec_deprecated : Warning<
  543. "dynamic exception specifications are deprecated">,
  544. InGroup<DeprecatedDynamicExceptionSpec>, DefaultIgnore;
  545. def note_exception_spec_deprecated : Note<"use '%0' instead">;
  546. def warn_cxx98_compat_noexcept_decl : Warning<
  547. "noexcept specifications are incompatible with C++98">,
  548. InGroup<CXX98Compat>, DefaultIgnore;
  549. def err_expected_catch : Error<"expected catch">;
  550. def err_using_namespace_in_class : Error<
  551. "'using namespace' is not allowed in classes">;
  552. def warn_cxx17_compat_using_enum_declaration : Warning<
  553. "using enum declaration is incompatible with C++ standards before C++20">,
  554. InGroup<CXXPre20Compat>, DefaultIgnore;
  555. def ext_using_enum_declaration : ExtWarn<
  556. "using enum declaration is a C++20 extension">,
  557. InGroup<CXX20>;
  558. def err_constructor_bad_name : Error<
  559. "missing return type for function %0; did you mean the constructor name %1?">;
  560. def err_destructor_tilde_identifier : Error<
  561. "expected a class name after '~' to name a destructor">;
  562. def err_destructor_tilde_scope : Error<
  563. "'~' in destructor name should be after nested name specifier">;
  564. def err_destructor_template_id : Error<
  565. "destructor name %0 does not refer to a template">;
  566. def err_default_arg_unparsed : Error<
  567. "unexpected end of default argument expression">;
  568. def err_bracket_depth_exceeded : Error<
  569. "bracket nesting level exceeded maximum of %0">, DefaultFatal;
  570. def note_bracket_depth : Note<
  571. "use -fbracket-depth=N to increase maximum nesting level">;
  572. def err_misplaced_ellipsis_in_declaration : Error<
  573. "'...' must %select{immediately precede declared identifier|"
  574. "be innermost component of anonymous pack declaration}0">;
  575. def warn_misplaced_ellipsis_vararg : Warning<
  576. "'...' in this location creates a C-style varargs function"
  577. "%select{, not a function parameter pack|}0">,
  578. InGroup<DiagGroup<"ambiguous-ellipsis">>;
  579. def note_misplaced_ellipsis_vararg_existing_ellipsis : Note<
  580. "preceding '...' declares a function parameter pack">;
  581. def note_misplaced_ellipsis_vararg_add_ellipsis : Note<
  582. "place '...' %select{immediately before declared identifier|here}0 "
  583. "to declare a function parameter pack">;
  584. def note_misplaced_ellipsis_vararg_add_comma : Note<
  585. "insert ',' before '...' to silence this warning">;
  586. def ext_abstract_pack_declarator_parens : ExtWarn<
  587. "ISO C++11 requires a parenthesized pack declaration to have a name">,
  588. InGroup<DiagGroup<"anonymous-pack-parens">>;
  589. def err_function_is_not_record : Error<
  590. "unexpected %0 in function call; perhaps remove the %0?">;
  591. def err_super_in_using_declaration : Error<
  592. "'__super' cannot be used with a using declaration">;
  593. def ext_constexpr_if : ExtWarn<
  594. "constexpr if is a C++17 extension">, InGroup<CXX17>;
  595. def warn_cxx14_compat_constexpr_if : Warning<
  596. "constexpr if is incompatible with C++ standards before C++17">,
  597. DefaultIgnore, InGroup<CXXPre17Compat>;
  598. def ext_consteval_if : ExtWarn<
  599. "consteval if is a C++2b extension">,
  600. InGroup<CXX2b>;
  601. def warn_cxx20_compat_consteval_if : Warning<
  602. "consteval if is incompatible with C++ standards before C++2b">,
  603. InGroup<CXXPre2bCompat>, DefaultIgnore;
  604. def ext_init_statement : ExtWarn<
  605. "'%select{if|switch}0' initialization statements are a C++17 extension">,
  606. InGroup<CXX17>;
  607. def warn_cxx14_compat_init_statement : Warning<
  608. "%select{if|switch}0 initialization statements are incompatible with "
  609. "C++ standards before C++17">, DefaultIgnore, InGroup<CXXPre17Compat>;
  610. def ext_for_range_init_stmt : ExtWarn<
  611. "range-based for loop initialization statements are a C++20 extension">,
  612. InGroup<CXX20>;
  613. def warn_cxx17_compat_for_range_init_stmt : Warning<
  614. "range-based for loop initialization statements are incompatible with "
  615. "C++ standards before C++20">, DefaultIgnore, InGroup<CXXPre20Compat>;
  616. def warn_empty_init_statement : Warning<
  617. "empty initialization statement of '%select{if|switch|range-based for}0' "
  618. "has no effect">, InGroup<EmptyInitStatement>, DefaultIgnore;
  619. def err_keyword_as_parameter : Error <
  620. "invalid parameter name: '%0' is a keyword">;
  621. // C++ derived classes
  622. def err_dup_virtual : Error<"duplicate 'virtual' in base specifier">;
  623. // C++ operator overloading
  624. def err_literal_operator_string_prefix : Error<
  625. "string literal after 'operator' cannot have an encoding prefix">;
  626. def err_literal_operator_string_not_empty : Error<
  627. "string literal after 'operator' must be '\"\"'">;
  628. def warn_cxx98_compat_literal_operator : Warning<
  629. "literal operators are incompatible with C++98">,
  630. InGroup<CXX98Compat>, DefaultIgnore;
  631. // Classes.
  632. def err_anon_type_definition : Error<
  633. "declaration of anonymous %0 must be a definition">;
  634. def err_default_delete_in_multiple_declaration : Error<
  635. "'= %select{default|delete}0' is a function definition and must occur in a "
  636. "standalone declaration">;
  637. def warn_cxx98_compat_noexcept_expr : Warning<
  638. "noexcept expressions are incompatible with C++98">,
  639. InGroup<CXX98Compat>, DefaultIgnore;
  640. def warn_cxx98_compat_nullptr : Warning<
  641. "'nullptr' is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
  642. def warn_wrong_clang_attr_namespace : Warning<
  643. "'__clang__' is a predefined macro name, not an attribute scope specifier; "
  644. "did you mean '_Clang' instead?">, InGroup<IgnoredAttributes>;
  645. def ext_ns_enum_attribute : Extension<
  646. "attributes on %select{a namespace|an enumerator}0 declaration are "
  647. "a C++17 extension">, InGroup<CXX17>;
  648. def warn_cxx14_compat_ns_enum_attribute : Warning<
  649. "attributes on %select{a namespace|an enumerator}0 declaration are "
  650. "incompatible with C++ standards before C++17">,
  651. InGroup<CXXPre17CompatPedantic>, DefaultIgnore;
  652. def warn_cxx98_compat_alignas : Warning<"'alignas' is incompatible with C++98">,
  653. InGroup<CXX98Compat>, DefaultIgnore;
  654. def warn_cxx98_compat_attribute : Warning<
  655. "C++11 attribute syntax is incompatible with C++98">,
  656. InGroup<CXX98Compat>, DefaultIgnore;
  657. def err_cxx11_attribute_forbids_arguments : Error<
  658. "attribute %0 cannot have an argument list">;
  659. def err_attribute_requires_arguments : Error<
  660. "parentheses must be omitted if %0 attribute's argument list is empty">;
  661. def err_cxx11_attribute_forbids_ellipsis : Error<
  662. "attribute %0 cannot be used as an attribute pack">;
  663. def warn_cxx14_compat_using_attribute_ns : Warning<
  664. "default scope specifier for attributes is incompatible with C++ standards "
  665. "before C++17">, InGroup<CXXPre17Compat>, DefaultIgnore;
  666. def ext_using_attribute_ns : ExtWarn<
  667. "default scope specifier for attributes is a C++17 extension">,
  668. InGroup<CXX17>;
  669. def err_using_attribute_ns_conflict : Error<
  670. "attribute with scope specifier cannot follow default scope specifier">;
  671. def err_attributes_not_allowed : Error<"an attribute list cannot appear here">;
  672. def ext_cxx11_attr_placement : ExtWarn<
  673. "ISO C++ does not allow an attribute list to appear here">,
  674. InGroup<DiagGroup<"cxx-attribute-extension">>;
  675. def err_attributes_misplaced : Error<"misplaced attributes; expected attributes here">;
  676. def err_l_square_l_square_not_attribute : Error<
  677. "C++11 only allows consecutive left square brackets when "
  678. "introducing an attribute">;
  679. def err_ms_declspec_type : Error<
  680. "__declspec attributes must be an identifier or string literal">;
  681. def err_ms_property_no_getter_or_putter : Error<
  682. "property does not specify a getter or a putter">;
  683. def err_ms_property_unknown_accessor : Error<
  684. "expected 'get' or 'put' in property declaration">;
  685. def err_ms_property_has_set_accessor : Error<
  686. "putter for property must be specified as 'put', not 'set'">;
  687. def err_ms_property_missing_accessor_kind : Error<
  688. "missing 'get=' or 'put='">;
  689. def err_ms_property_expected_equal : Error<
  690. "expected '=' after '%0'">;
  691. def err_ms_property_duplicate_accessor : Error<
  692. "property declaration specifies '%0' accessor twice">;
  693. def err_ms_property_expected_accessor_name : Error<
  694. "expected name of accessor method">;
  695. def err_ms_property_expected_comma_or_rparen : Error<
  696. "expected ',' or ')' at end of property accessor list">;
  697. def err_ms_property_initializer : Error<
  698. "property declaration cannot have a default member initializer">;
  699. def warn_cxx20_compat_explicit_bool : Warning<
  700. "this expression will be parsed as explicit(bool) in C++20">,
  701. InGroup<CXX20Compat>, DefaultIgnore;
  702. def warn_cxx17_compat_explicit_bool : Warning<
  703. "explicit(bool) is incompatible with C++ standards before C++20">,
  704. InGroup<CXXPre20Compat>, DefaultIgnore;
  705. def ext_explicit_bool : ExtWarn<"explicit(bool) is a C++20 extension">,
  706. InGroup<CXX20>;
  707. /// C++ Templates
  708. def err_expected_template : Error<"expected template">;
  709. def err_unknown_template_name : Error<
  710. "unknown template name %0">;
  711. def err_expected_comma_greater : Error<
  712. "expected ',' or '>' in template-parameter-list">;
  713. def err_class_on_template_template_param
  714. : Error<"template template parameter requires 'class'%select{| or "
  715. "'typename'}0 after the parameter list">;
  716. def ext_template_template_param_typename : ExtWarn<
  717. "template template parameter using 'typename' is a C++17 extension">,
  718. InGroup<CXX17>;
  719. def warn_cxx14_compat_template_template_param_typename : Warning<
  720. "template template parameter using 'typename' is "
  721. "incompatible with C++ standards before C++17">,
  722. InGroup<CXXPre17Compat>, DefaultIgnore;
  723. def err_template_spec_syntax_non_template : Error<
  724. "identifier followed by '<' indicates a class template specialization but "
  725. "%0 %select{does not refer to a template|refers to a function template|"
  726. "<unused>|refers to a variable template|<unused>|refers to a concept}1">;
  727. def err_id_after_template_in_nested_name_spec : Error<
  728. "expected template name after 'template' keyword in nested name specifier">;
  729. def err_unexpected_template_in_unqualified_id : Error<
  730. "'template' keyword not permitted here">;
  731. def err_unexpected_template_in_destructor_name : Error<
  732. "'template' keyword not permitted in destructor name">;
  733. def err_unexpected_template_after_using : Error<
  734. "'template' keyword not permitted after 'using' keyword">;
  735. def err_two_right_angle_brackets_need_space : Error<
  736. "a space is required between consecutive right angle brackets (use '> >')">;
  737. def err_right_angle_bracket_equal_needs_space : Error<
  738. "a space is required between a right angle bracket and an equals sign "
  739. "(use '> =')">;
  740. def warn_cxx11_right_shift_in_template_arg : Warning<
  741. "use of right-shift operator ('>>') in template argument will require "
  742. "parentheses in C++11">, InGroup<CXX11Compat>;
  743. def warn_cxx98_compat_two_right_angle_brackets : Warning<
  744. "consecutive right angle brackets are incompatible with C++98 (use '> >')">,
  745. InGroup<CXX98Compat>, DefaultIgnore;
  746. def err_templated_invalid_declaration : Error<
  747. "a static_assert declaration cannot be a template">;
  748. def err_multiple_template_declarators : Error<
  749. "%select{|a template declaration|an explicit template specialization|"
  750. "an explicit template instantiation}0 can "
  751. "only %select{|declare|declare|instantiate}0 a single entity">;
  752. def err_explicit_instantiation_with_definition : Error<
  753. "explicit template instantiation cannot have a definition; if this "
  754. "definition is meant to be an explicit specialization, add '<>' after the "
  755. "'template' keyword">;
  756. def err_template_defn_explicit_instantiation : Error<
  757. "%select{function|class|variable}0 cannot be defined in an explicit instantiation; if this "
  758. "declaration is meant to be a %select{function|class|variable}0 definition, remove the 'template' keyword">;
  759. def err_friend_explicit_instantiation : Error<
  760. "friend cannot be declared in an explicit instantiation; if this "
  761. "declaration is meant to be a friend declaration, remove the 'template' keyword">;
  762. def err_explicit_instantiation_enum : Error<
  763. "enumerations cannot be explicitly instantiated">;
  764. def err_expected_template_parameter : Error<"expected template parameter">;
  765. def err_empty_requires_expr : Error<
  766. "a requires expression must contain at least one requirement">;
  767. def err_requires_expr_parameter_list_ellipsis : Error<
  768. "varargs not allowed in requires expression">;
  769. def err_expected_semi_requirement : Error<
  770. "expected ';' at end of requirement">;
  771. def err_requires_expr_missing_arrow : Error<
  772. "expected '->' before expression type requirement">;
  773. def err_requires_expr_expected_type_constraint : Error<
  774. "expected concept name with optional arguments">;
  775. def err_requires_expr_simple_requirement_noexcept : Error<
  776. "'noexcept' can only be used in a compound requirement (with '{' '}' around "
  777. "the expression)">;
  778. def err_requires_expr_in_simple_requirement : Error<
  779. "requires expression in requirement body; did "
  780. "you intend to place it in a nested requirement? (add another 'requires' "
  781. "before the expression)">;
  782. def err_missing_dependent_template_keyword : Error<
  783. "use 'template' keyword to treat '%0' as a dependent template name">;
  784. def warn_missing_dependent_template_keyword : ExtWarn<
  785. "use 'template' keyword to treat '%0' as a dependent template name">;
  786. def ext_extern_template : Extension<
  787. "extern templates are a C++11 extension">, InGroup<CXX11>;
  788. def warn_cxx98_compat_extern_template : Warning<
  789. "extern templates are incompatible with C++98">,
  790. InGroup<CXX98CompatPedantic>, DefaultIgnore;
  791. def warn_static_inline_explicit_inst_ignored : Warning<
  792. "ignoring '%select{static|inline}0' keyword on explicit template "
  793. "instantiation">, InGroup<DiagGroup<"static-inline-explicit-instantiation">>;
  794. // Constructor template diagnostics.
  795. def err_out_of_line_constructor_template_id : Error<
  796. "out-of-line constructor for %0 cannot have template arguments">;
  797. def err_expected_qualified_after_typename : Error<
  798. "expected a qualified name after 'typename'">;
  799. def warn_expected_qualified_after_typename : ExtWarn<
  800. "expected a qualified name after 'typename'">;
  801. def err_typename_refers_to_non_type_template : Error<
  802. "typename specifier refers to a non-type template">;
  803. def err_expected_type_name_after_typename : Error<
  804. "expected an identifier or template-id after '::'">;
  805. def err_explicit_spec_non_template : Error<
  806. "explicit %select{specialization|instantiation}0 of "
  807. "%select{non-|undeclared }3template %1 %2">;
  808. def err_default_template_template_parameter_not_template : Error<
  809. "default template argument for a template template parameter must be a class "
  810. "template">;
  811. def ext_fold_expression : ExtWarn<
  812. "pack fold expression is a C++17 extension">,
  813. InGroup<CXX17>;
  814. def warn_cxx14_compat_fold_expression : Warning<
  815. "pack fold expression is incompatible with C++ standards before C++17">,
  816. InGroup<CXXPre17Compat>, DefaultIgnore;
  817. def err_expected_fold_operator : Error<
  818. "expected a foldable binary operator in fold expression">;
  819. def err_fold_operator_mismatch : Error<
  820. "operators in fold expression must be the same">;
  821. def err_ctor_init_missing_comma : Error<
  822. "missing ',' between base or member initializers">;
  823. // C++ declarations
  824. def err_friend_decl_defines_type : Error<
  825. "cannot define a type in a friend declaration">;
  826. def err_missing_whitespace_digraph : Error<
  827. "found '<::' after a "
  828. "%select{template name|addrspace_cast|const_cast|dynamic_cast|reinterpret_cast|static_cast}0"
  829. " which forms the digraph '<:' (aka '[') and a ':', did you mean '< ::'?">;
  830. def ext_defaulted_deleted_function : ExtWarn<
  831. "%select{defaulted|deleted}0 function definitions are a C++11 extension">,
  832. InGroup<CXX11>;
  833. def warn_cxx98_compat_defaulted_deleted_function : Warning<
  834. "%select{defaulted|deleted}0 function definitions are incompatible with C++98">,
  835. InGroup<CXX98Compat>, DefaultIgnore;
  836. // C++11 default member initialization
  837. def ext_nonstatic_member_init : ExtWarn<
  838. "default member initializer for non-static data member is a C++11 "
  839. "extension">, InGroup<CXX11>;
  840. def warn_cxx98_compat_nonstatic_member_init : Warning<
  841. "default member initializer for non-static data members is incompatible with "
  842. "C++98">, InGroup<CXX98Compat>, DefaultIgnore;
  843. def ext_bitfield_member_init: ExtWarn<
  844. "default member initializer for bit-field is a C++20 extension">,
  845. InGroup<CXX20>;
  846. def warn_cxx17_compat_bitfield_member_init: Warning<
  847. "default member initializer for bit-field is incompatible with "
  848. "C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
  849. def err_anon_bitfield_member_init : Error<
  850. "anonymous bit-field cannot have a default member initializer">;
  851. def err_incomplete_array_member_init: Error<
  852. "array bound cannot be deduced from a default member initializer">;
  853. // C++11 alias-declaration
  854. def ext_alias_declaration : ExtWarn<
  855. "alias declarations are a C++11 extension">, InGroup<CXX11>;
  856. def warn_cxx98_compat_alias_declaration : Warning<
  857. "alias declarations are incompatible with C++98">,
  858. InGroup<CXX98Compat>, DefaultIgnore;
  859. def err_alias_declaration_not_identifier : Error<
  860. "name defined in alias declaration must be an identifier">;
  861. def err_alias_declaration_specialization : Error<
  862. "%select{partial specialization|explicit specialization|explicit instantiation}0 of alias templates is not permitted">;
  863. def err_alias_declaration_pack_expansion : Error<
  864. "alias declaration cannot be a pack expansion">;
  865. // C++17 using-declaration pack expansions
  866. def ext_multi_using_declaration : ExtWarn<
  867. "use of multiple declarators in a single using declaration is "
  868. "a C++17 extension">, InGroup<CXX17>;
  869. def warn_cxx17_compat_multi_using_declaration : Warning<
  870. "use of multiple declarators in a single using declaration is "
  871. "incompatible with C++ standards before C++17">,
  872. InGroup<CXXPre17Compat>, DefaultIgnore;
  873. def ext_using_declaration_pack : ExtWarn<
  874. "pack expansion of using declaration is a C++17 extension">, InGroup<CXX17>;
  875. def warn_cxx17_compat_using_declaration_pack : Warning<
  876. "pack expansion using declaration is incompatible with C++ standards "
  877. "before C++17">, InGroup<CXXPre17Compat>, DefaultIgnore;
  878. // C++11 override control
  879. def ext_override_control_keyword : ExtWarn<
  880. "'%0' keyword is a C++11 extension">, InGroup<CXX11>;
  881. def warn_cxx98_compat_override_control_keyword : Warning<
  882. "'%0' keyword is incompatible with C++98">,
  883. InGroup<CXX98Compat>, DefaultIgnore;
  884. def err_override_control_interface : Error<
  885. "'%0' keyword not permitted with interface types">;
  886. def ext_ms_sealed_keyword : ExtWarn<
  887. "'sealed' keyword is a Microsoft extension">,
  888. InGroup<MicrosoftSealed>;
  889. def ext_ms_abstract_keyword : ExtWarn<
  890. "'abstract' keyword is a Microsoft extension">,
  891. InGroup<MicrosoftAbstract>;
  892. def err_access_specifier_interface : Error<
  893. "interface types cannot specify '%select{private|protected}0' access">;
  894. def err_duplicate_class_virt_specifier : Error<
  895. "class already marked '%0'">;
  896. def err_duplicate_virt_specifier : Error<
  897. "class member already marked '%0'">;
  898. def err_virt_specifier_outside_class : Error<
  899. "'%0' specifier is not allowed outside a class definition">;
  900. def err_expected_parameter_pack : Error<
  901. "expected the name of a parameter pack">;
  902. def err_paren_sizeof_parameter_pack : Error<
  903. "missing parentheses around the size of parameter pack %0">;
  904. def err_sizeof_parameter_pack : Error<
  905. "expected parenthesized parameter pack name in 'sizeof...' expression">;
  906. // C++11 lambda expressions
  907. def err_expected_comma_or_rsquare : Error<
  908. "expected ',' or ']' in lambda capture list">;
  909. def err_this_captured_by_reference : Error<
  910. "'this' cannot be captured by reference">;
  911. def err_expected_capture : Error<
  912. "expected variable name or 'this' in lambda capture list">;
  913. def err_expected_lambda_body : Error<"expected body of lambda expression">;
  914. def warn_cxx98_compat_lambda : Warning<
  915. "lambda expressions are incompatible with C++98">,
  916. InGroup<CXX98Compat>, DefaultIgnore;
  917. def err_lambda_decl_specifier_repeated : Error<
  918. "%select{'mutable'|'constexpr'|'consteval'}0 cannot appear multiple times in a lambda declarator">;
  919. def err_lambda_capture_misplaced_ellipsis : Error<
  920. "ellipsis in pack %select{|init-}0capture must appear %select{after|before}0 "
  921. "the name of the capture">;
  922. def err_lambda_capture_multiple_ellipses : Error<
  923. "multiple ellipses in pack capture">;
  924. def err_capture_default_first : Error<
  925. "capture default must be first">;
  926. def ext_decl_attrs_on_lambda : ExtWarn<
  927. "an attribute specifier sequence in this position is a C++2b extension">,
  928. InGroup<CXX2b>;
  929. def ext_lambda_missing_parens : ExtWarn<
  930. "lambda without a parameter clause is a C++2b extension">,
  931. InGroup<CXX2b>;
  932. def warn_cxx20_compat_decl_attrs_on_lambda : Warning<
  933. "an attribute specifier sequence in this position is incompatible with C++ "
  934. "standards before C++2b">, InGroup<CXXPre2bCompat>, DefaultIgnore;
  935. // C++17 lambda expressions
  936. def err_expected_star_this_capture : Error<
  937. "expected 'this' following '*' in lambda capture list">;
  938. // C++17 constexpr lambda expressions
  939. def warn_cxx14_compat_constexpr_on_lambda : Warning<
  940. "constexpr on lambda expressions is incompatible with C++ standards before C++17">,
  941. InGroup<CXXPre17Compat>, DefaultIgnore;
  942. def ext_constexpr_on_lambda_cxx17 : ExtWarn<
  943. "'constexpr' on lambda expressions is a C++17 extension">, InGroup<CXX17>;
  944. // C++20 template lambdas
  945. def ext_lambda_template_parameter_list: ExtWarn<
  946. "explicit template parameter list for lambdas is a C++20 extension">,
  947. InGroup<CXX20>;
  948. def warn_cxx17_compat_lambda_template_parameter_list: Warning<
  949. "explicit template parameter list for lambdas is incompatible with "
  950. "C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
  951. def err_lambda_template_parameter_list_empty : Error<
  952. "lambda template parameter list cannot be empty">;
  953. // Availability attribute
  954. def err_expected_version : Error<
  955. "expected a version of the form 'major[.minor[.subminor]]'">;
  956. def warn_expected_consistent_version_separator : Warning<
  957. "use same version number separators '_' or '.'; as in "
  958. "'major[.minor[.subminor]]'">, InGroup<Availability>;
  959. def err_zero_version : Error<
  960. "version number must have non-zero major, minor, or sub-minor version">;
  961. def err_availability_expected_platform : Error<
  962. "expected a platform name, e.g., 'macos'">;
  963. // objc_bridge_related attribute
  964. def err_objcbridge_related_expected_related_class : Error<
  965. "expected a related ObjectiveC class name, e.g., 'NSColor'">;
  966. def err_objcbridge_related_selector_name : Error<
  967. "expected a class method selector with single argument, e.g., 'colorWithCGColor:'">;
  968. def err_availability_expected_change : Error<
  969. "expected 'introduced', 'deprecated', or 'obsoleted'">;
  970. def err_availability_unknown_change : Error<
  971. "%0 is not an availability stage; use 'introduced', 'deprecated', or "
  972. "'obsoleted'">;
  973. def err_availability_redundant : Error<
  974. "redundant %0 availability change; only the last specified change will "
  975. "be used">;
  976. def warn_availability_and_unavailable : Warning<
  977. "'unavailable' availability overrides all other availability information">,
  978. InGroup<Availability>;
  979. // @available(...)
  980. def err_avail_query_expected_platform_name : Error<
  981. "expected a platform name here">;
  982. def err_avail_query_unrecognized_platform_name : Error<
  983. "unrecognized platform name %0">;
  984. def err_availability_query_wildcard_required: Error<
  985. "must handle potential future platforms with '*'">;
  986. def err_availability_query_repeated_platform: Error<
  987. "version for '%0' already specified">;
  988. def err_availability_query_repeated_star : Error<
  989. "'*' query has already been specified">;
  990. // External source symbol attribute
  991. def err_external_source_symbol_expected_keyword : Error<
  992. "expected 'language', 'defined_in', or 'generated_declaration'">;
  993. def err_external_source_symbol_duplicate_clause : Error<
  994. "duplicate %0 clause in an 'external_source_symbol' attribute">;
  995. // Type safety attributes
  996. def err_type_safety_unknown_flag : Error<
  997. "invalid comparison flag %0; use 'layout_compatible' or 'must_be_null'">;
  998. // Type traits
  999. def err_type_trait_arity : Error<
  1000. "type trait requires %0%select{| or more}1 argument%select{|s}2; have "
  1001. "%3 argument%s3">;
  1002. // Language specific pragmas
  1003. // - Generic warnings
  1004. def warn_pragma_expected_lparen : Warning<
  1005. "missing '(' after '#pragma %0' - ignoring">, InGroup<IgnoredPragmas>;
  1006. def warn_pragma_expected_rparen : Warning<
  1007. "missing ')' after '#pragma %0' - ignoring">, InGroup<IgnoredPragmas>;
  1008. def warn_pragma_expected_identifier : Warning<
  1009. "expected identifier in '#pragma %0' - ignored">, InGroup<IgnoredPragmas>;
  1010. def warn_pragma_expected_string : Warning<
  1011. "expected string literal in '#pragma %0' - ignoring">, InGroup<IgnoredPragmas>;
  1012. def warn_pragma_missing_argument : Warning<
  1013. "missing argument to '#pragma %0'%select{|; expected %2}1">, InGroup<IgnoredPragmas>;
  1014. def warn_pragma_invalid_argument : Warning<
  1015. "unexpected argument '%0' to '#pragma %1'%select{|; expected %3}2">, InGroup<IgnoredPragmas>;
  1016. def err_pragma_misplaced_in_decl : Error<"this pragma cannot appear in %0 declaration">;
  1017. // '#pragma clang section' related errors
  1018. def err_pragma_expected_clang_section_name : Error<
  1019. "expected one of [bss|data|rodata|text|relro] section kind in '#pragma %0'">;
  1020. def err_pragma_clang_section_expected_equal : Error<
  1021. "expected '=' following '#pragma clang section %select{invalid|bss|data|rodata|text|relro}0'">;
  1022. def warn_pragma_expected_section_name : Warning<
  1023. "expected a string literal for the section name in '#pragma %0' - ignored">,
  1024. InGroup<IgnoredPragmas>;
  1025. def warn_pragma_expected_section_push_pop_or_name : Warning<
  1026. "expected push, pop or a string literal for the section name in '#pragma %0' - ignored">,
  1027. InGroup<IgnoredPragmas>;
  1028. def warn_pragma_expected_section_label_or_name : Warning<
  1029. "expected a stack label or a string literal for the section name in '#pragma %0' - ignored">,
  1030. InGroup<IgnoredPragmas>;
  1031. def warn_pragma_expected_init_seg : Warning<
  1032. "expected 'compiler', 'lib', 'user', or a string literal for the section name in '#pragma %0' - ignored">,
  1033. InGroup<IgnoredPragmas>;
  1034. def err_pragma_expected_integer : Error<"expected an integer argument in '#pragma %0'">;
  1035. def warn_pragma_expected_integer : Warning<
  1036. "expected integer between %0 and %1 inclusive in '#pragma %2' - ignored">,
  1037. InGroup<IgnoredPragmas>;
  1038. def warn_pragma_ms_struct : Warning<
  1039. "incorrect use of '#pragma ms_struct on|off' - ignored">,
  1040. InGroup<IgnoredPragmas>;
  1041. def warn_pragma_ms_fenv_access : Warning<
  1042. "incorrect use of '#pragma fenv_access (on|off)' - ignored">,
  1043. InGroup<IgnoredPragmas>;
  1044. def warn_pragma_extra_tokens_at_eol : Warning<
  1045. "extra tokens at end of '#pragma %0' - ignored">,
  1046. InGroup<IgnoredPragmas>;
  1047. def warn_pragma_expected_comma : Warning<
  1048. "expected ',' in '#pragma %0'">, InGroup<IgnoredPragmas>;
  1049. def warn_pragma_expected_punc : Warning<
  1050. "expected ')' or ',' in '#pragma %0'">, InGroup<IgnoredPragmas>;
  1051. def warn_pragma_expected_non_wide_string : Warning<
  1052. "expected non-wide string literal in '#pragma %0'">, InGroup<IgnoredPragmas>;
  1053. // - Generic errors
  1054. def err_pragma_missing_argument : Error<
  1055. "missing argument to '#pragma %0'%select{|; expected %2}1">;
  1056. // - #pragma options
  1057. def warn_pragma_options_expected_align : Warning<
  1058. "expected 'align' following '#pragma options' - ignored">,
  1059. InGroup<IgnoredPragmas>;
  1060. def warn_pragma_align_expected_equal : Warning<
  1061. "expected '=' following '#pragma %select{align|options align}0' - ignored">,
  1062. InGroup<IgnoredPragmas>;
  1063. def warn_pragma_align_invalid_option : Warning<
  1064. "invalid alignment option in '#pragma %select{align|options align}0' - ignored">,
  1065. InGroup<IgnoredPragmas>;
  1066. // - #pragma pack
  1067. def warn_pragma_unsupported_action : Warning<
  1068. "known but unsupported action '%1' for '#pragma %0' - ignored">,
  1069. InGroup<IgnoredPragmas>;
  1070. def warn_pragma_invalid_specific_action : Warning<
  1071. "unknown action '%1' for '#pragma %0' - ignored">,
  1072. InGroup<IgnoredPragmas>;
  1073. def warn_pragma_expected_action_or_r_paren : Warning<
  1074. "expected action or ')' in '#pragma %0' - ignored">,
  1075. InGroup<IgnoredPragmas>;
  1076. def warn_pragma_invalid_action : Warning<
  1077. "unknown action for '#pragma %0' - ignored">,
  1078. InGroup<IgnoredPragmas>;
  1079. def warn_pragma_pack_malformed : Warning<
  1080. "expected integer or identifier in '#pragma pack' - ignored">,
  1081. InGroup<IgnoredPragmas>;
  1082. // - #pragma intrinsic
  1083. def warn_pragma_intrinsic_builtin : Warning<
  1084. "%0 is not a recognized builtin%select{|; consider including <intrin.h> to access non-builtin intrinsics}1">,
  1085. InGroup<IgnoredPragmaIntrinsic>;
  1086. // - #pragma optimize
  1087. def warn_pragma_optimize : Warning<
  1088. "'#pragma optimize' is not supported">,
  1089. InGroup<IgnoredPragmaOptimize>;
  1090. // - #pragma unused
  1091. def warn_pragma_unused_expected_var : Warning<
  1092. "expected '#pragma unused' argument to be a variable name">,
  1093. InGroup<IgnoredPragmas>;
  1094. // - #pragma init_seg
  1095. def warn_pragma_init_seg_unsupported_target : Warning<
  1096. "'#pragma init_seg' is only supported when targeting a "
  1097. "Microsoft environment">,
  1098. InGroup<IgnoredPragmas>;
  1099. // - #pragma restricted to file scope or start of compound statement
  1100. def err_pragma_file_or_compound_scope : Error<
  1101. "'#pragma %0' can only appear at file scope or at the start of a "
  1102. "compound statement">;
  1103. // - #pragma stdc unknown
  1104. def ext_stdc_pragma_ignored : ExtWarn<"unknown pragma in STDC namespace">,
  1105. InGroup<UnknownPragmas>;
  1106. // The C standard 7.6.1p2 says "The [FENV_ACCESS] pragma shall occur either
  1107. // outside external declarations or preceding all explicit declarations and
  1108. // statements inside a compound statement.
  1109. def warn_stdc_fenv_round_not_supported :
  1110. Warning<"pragma STDC FENV_ROUND is not supported">,
  1111. InGroup<UnknownPragmas>;
  1112. def warn_stdc_unknown_rounding_mode : Warning<
  1113. "invalid or unsupported rounding mode in '#pragma STDC FENV_ROUND' - ignored">,
  1114. InGroup<IgnoredPragmas>;
  1115. def warn_pragma_fp_ignored : Warning<
  1116. "'#pragma %0' is not supported on this target - ignored">,
  1117. InGroup<IgnoredPragmas>;
  1118. // - #pragma comment
  1119. def err_pragma_comment_malformed : Error<
  1120. "pragma comment requires parenthesized identifier and optional string">;
  1121. def err_pragma_comment_unknown_kind : Error<"unknown kind of pragma comment">;
  1122. // PS4 recognizes only #pragma comment(lib)
  1123. def warn_pragma_comment_ignored : Warning<"'#pragma comment %0' ignored">,
  1124. InGroup<IgnoredPragmas>;
  1125. // - #pragma detect_mismatch
  1126. def err_pragma_detect_mismatch_malformed : Error<
  1127. "pragma detect_mismatch is malformed; it requires two comma-separated "
  1128. "string literals">;
  1129. // - #pragma float_control
  1130. def err_pragma_float_control_malformed : Error<
  1131. "pragma float_control is malformed; use 'float_control({push|pop})' or "
  1132. "'float_control({precise|except}, {on|off} [,push])'">;
  1133. // - #pragma pointers_to_members
  1134. def err_pragma_pointers_to_members_unknown_kind : Error<
  1135. "unexpected %0, expected to see one of %select{|'best_case', 'full_generality', }1"
  1136. "'single_inheritance', 'multiple_inheritance', or 'virtual_inheritance'">;
  1137. // - #pragma clang optimize on/off
  1138. def err_pragma_optimize_invalid_argument : Error<
  1139. "unexpected argument '%0' to '#pragma clang optimize'; "
  1140. "expected 'on' or 'off'">;
  1141. def err_pragma_optimize_extra_argument : Error<
  1142. "unexpected extra argument '%0' to '#pragma clang optimize'">;
  1143. // - #pragma clang attribute
  1144. def err_pragma_attribute_expected_push_pop_paren : Error<
  1145. "expected 'push', 'pop', or '(' after '#pragma clang attribute'">;
  1146. def err_pragma_attribute_invalid_argument : Error<
  1147. "unexpected argument '%0' to '#pragma clang attribute'; "
  1148. "expected 'push' or 'pop'">;
  1149. def err_pragma_attribute_expected_attribute : Error<
  1150. "expected an attribute after '('">;
  1151. def err_pragma_attribute_expected_attribute_name : Error<
  1152. "expected identifier that represents an attribute name">;
  1153. def err_pragma_attribute_extra_tokens_after_attribute : Error<
  1154. "extra tokens after attribute in a '#pragma clang attribute push'">;
  1155. def err_pragma_attribute_unsupported_attribute : Error<
  1156. "attribute %0 is not supported by '#pragma clang attribute'">;
  1157. def err_pragma_attribute_multiple_attributes : Error<
  1158. "more than one attribute specified in '#pragma clang attribute push'">;
  1159. def err_pragma_attribute_expected_attribute_syntax : Error<
  1160. "expected an attribute that is specified using the GNU, C++11 or '__declspec'"
  1161. " syntax">;
  1162. def note_pragma_attribute_use_attribute_kw : Note<"use the GNU '__attribute__' "
  1163. "syntax">;
  1164. def err_pragma_attribute_invalid_subject_set_specifier : Error<
  1165. "expected attribute subject set specifier 'apply_to'">;
  1166. def err_pragma_attribute_expected_subject_identifier : Error<
  1167. "expected an identifier that corresponds to an attribute subject rule">;
  1168. def err_pragma_attribute_unknown_subject_rule : Error<
  1169. "unknown attribute subject rule '%0'">;
  1170. def err_pragma_attribute_expected_subject_sub_identifier : Error<
  1171. "expected an identifier that corresponds to an attribute subject matcher "
  1172. "sub-rule; '%0' matcher %select{does not support sub-rules|supports the "
  1173. "following sub-rules: %2|}1">;
  1174. def err_pragma_attribute_unknown_subject_sub_rule : Error<
  1175. "%select{invalid use of|unknown}2 attribute subject matcher sub-rule '%0'; "
  1176. "'%1' matcher %select{does not support sub-rules|supports the following "
  1177. "sub-rules: %3}2">;
  1178. def err_pragma_attribute_duplicate_subject : Error<
  1179. "duplicate attribute subject matcher '%0'">;
  1180. def err_pragma_attribute_expected_period : Error<
  1181. "expected '.' after pragma attribute namespace %0">;
  1182. def err_pragma_attribute_namespace_on_attribute : Error<
  1183. "namespace can only apply to 'push' or 'pop' directives">;
  1184. def note_pragma_attribute_namespace_on_attribute : Note<
  1185. "omit the namespace to add attributes to the most-recently"
  1186. " pushed attribute group">;
  1187. // OpenCL EXTENSION pragma (OpenCL 1.1 [9.1])
  1188. def warn_pragma_expected_colon : Warning<
  1189. "missing ':' after %0 - ignoring">, InGroup<IgnoredPragmas>;
  1190. def warn_pragma_expected_predicate : Warning<
  1191. "expected %select{'enable', 'disable', 'begin' or 'end'|'disable'}0 - ignoring">, InGroup<IgnoredPragmas>;
  1192. def warn_pragma_unknown_extension : Warning<
  1193. "unknown OpenCL extension %0 - ignoring">, InGroup<IgnoredPragmas>;
  1194. def warn_pragma_unsupported_extension : Warning<
  1195. "unsupported OpenCL extension %0 - ignoring">, InGroup<IgnoredPragmas>;
  1196. def warn_pragma_extension_is_core : Warning<
  1197. "OpenCL extension %0 is core feature or supported optional core feature - ignoring">,
  1198. InGroup<OpenCLCoreFeaturesDiagGroup>, DefaultIgnore;
  1199. // OpenCL errors.
  1200. def err_opencl_taking_function_address_parser : Error<
  1201. "taking address of function is not allowed">;
  1202. def err_opencl_logical_exclusive_or : Error<
  1203. "^^ is a reserved operator in OpenCL">;
  1204. // C++ for OpenCL.
  1205. def err_openclcxx_virtual_function : Error<
  1206. "virtual functions are not supported in C++ for OpenCL">;
  1207. // OpenMP support.
  1208. def warn_pragma_omp_ignored : Warning<
  1209. "unexpected '#pragma omp ...' in program">, InGroup<SourceUsesOpenMP>, DefaultIgnore;
  1210. def warn_omp_extra_tokens_at_eol : Warning<
  1211. "extra tokens at the end of '#pragma omp %0' are ignored">,
  1212. InGroup<ExtraTokens>;
  1213. def warn_pragma_expected_colon_r_paren : Warning<
  1214. "missing ':' or ')' after %0 - ignoring">, InGroup<IgnoredPragmas>;
  1215. def err_omp_unknown_directive : Error<
  1216. "expected an OpenMP directive">;
  1217. def err_omp_unexpected_directive : Error<
  1218. "unexpected OpenMP directive %select{|'#pragma omp %1'}0">;
  1219. def err_omp_expected_punc : Error<
  1220. "expected ',' or ')' in '%0' %select{clause|directive}1">;
  1221. def err_omp_unexpected_clause : Error<
  1222. "unexpected OpenMP clause '%0' in directive '#pragma omp %1'">;
  1223. def err_omp_immediate_directive : Error<
  1224. "'#pragma omp %0' %select{|with '%2' clause }1cannot be an immediate substatement">;
  1225. def err_omp_expected_identifier_for_critical : Error<
  1226. "expected identifier specifying the name of the 'omp critical' directive">;
  1227. def err_omp_expected_reduction_identifier : Error<
  1228. "expected identifier or one of the following operators: '+', '-', '*', '&', '|', '^', '&&', or '||'">;
  1229. def err_omp_expected_equal_in_iterator : Error<
  1230. "expected '=' in iterator specifier">;
  1231. def err_omp_expected_punc_after_iterator : Error<
  1232. "expected ',' or ')' after iterator specifier">;
  1233. def err_omp_decl_in_declare_simd_variant : Error<
  1234. "function declaration is expected after 'declare %select{simd|variant}0' directive">;
  1235. def err_omp_unknown_map_type : Error<
  1236. "incorrect map type, expected one of 'to', 'from', 'tofrom', 'alloc', 'release', or 'delete'">;
  1237. def err_omp_unknown_map_type_modifier : Error<
  1238. "incorrect map type modifier, expected one of: 'always', 'close', 'mapper'"
  1239. "%select{|, 'present'}0%select{|, 'ompx_hold'}1">;
  1240. def err_omp_map_type_missing : Error<
  1241. "missing map type">;
  1242. def err_omp_map_type_modifier_missing : Error<
  1243. "missing map type modifier">;
  1244. def err_omp_declare_simd_inbranch_notinbranch : Error<
  1245. "unexpected '%0' clause, '%1' is specified already">;
  1246. def err_expected_end_declare_target_or_variant : Error<
  1247. "expected '#pragma omp end declare %select{target|variant}0'">;
  1248. def err_expected_begin_declare_variant
  1249. : Error<"'#pragma omp end declare variant' with no matching '#pragma omp "
  1250. "begin declare variant'">;
  1251. def err_expected_begin_assumes
  1252. : Error<"'#pragma omp end assumes' with no matching '#pragma omp begin assumes'">;
  1253. def warn_omp_unknown_assumption_clause_missing_id
  1254. : Warning<"valid %0 clauses start with %1; %select{token|tokens}2 will be ignored">,
  1255. InGroup<OpenMPClauses>;
  1256. def warn_omp_unknown_assumption_clause_without_args
  1257. : Warning<"%0 clause should not be followed by arguments; tokens will be ignored">,
  1258. InGroup<OpenMPClauses>;
  1259. def note_omp_assumption_clause_continue_here
  1260. : Note<"the ignored tokens spans until here">;
  1261. def err_omp_declare_target_unexpected_clause: Error<
  1262. "unexpected '%0' clause, only %select{'device_type'|'to' or 'link'|'to', 'link' or 'device_type'|'device_type', 'indirect'|'to', 'link', 'device_type' or 'indirect'}1 clauses expected">;
  1263. def err_omp_begin_declare_target_unexpected_implicit_to_clause: Error<
  1264. "unexpected '(', only 'to', 'link' or 'device_type' clauses expected for 'begin declare target' directive">;
  1265. def err_omp_declare_target_unexpected_clause_after_implicit_to: Error<
  1266. "unexpected clause after an implicit 'to' clause">;
  1267. def err_omp_declare_target_missing_to_or_link_clause: Error<
  1268. "expected at least one %select{'to' or 'link'|'to', 'link' or 'indirect'}0 clause">;
  1269. def err_omp_declare_target_multiple : Error<
  1270. "%0 appears multiple times in clauses on the same declare target directive">;
  1271. def err_omp_declare_target_indirect_device_type: Error<
  1272. "only 'device_type(any)' clause is allowed with indirect clause">;
  1273. def err_omp_expected_clause: Error<
  1274. "expected at least one clause on '#pragma omp %0' directive">;
  1275. def err_omp_mapper_illegal_identifier : Error<
  1276. "illegal OpenMP user-defined mapper identifier">;
  1277. def err_omp_mapper_expected_declarator : Error<
  1278. "expected declarator on 'omp declare mapper' directive">;
  1279. def err_omp_unexpected_append_op : Error<
  1280. "unexpected operation specified in 'append_args' clause, expected 'interop'">;
  1281. def err_omp_declare_variant_wrong_clause : Error<
  1282. "expected %select{'match'|'match', 'adjust_args', or 'append_args'}0 clause "
  1283. "on 'omp declare variant' directive">;
  1284. def err_omp_declare_variant_duplicate_nested_trait : Error<
  1285. "nested OpenMP context selector contains duplicated trait '%0'"
  1286. " in selector '%1' and set '%2' with different score">;
  1287. def err_omp_declare_variant_nested_user_condition : Error<
  1288. "nested user conditions in OpenMP context selector not supported (yet)">;
  1289. def warn_omp_declare_variant_string_literal_or_identifier
  1290. : Warning<"expected identifier or string literal describing a context "
  1291. "%select{set|selector|property}0; "
  1292. "%select{set|selector|property}0 skipped">,
  1293. InGroup<OpenMPClauses>;
  1294. def warn_unknown_declare_variant_isa_trait
  1295. : Warning<"isa trait '%0' is not known to the current target; verify the "
  1296. "spelling or consider restricting the context selector with the "
  1297. "'arch' selector further">,
  1298. InGroup<SourceUsesOpenMP>;
  1299. def note_omp_declare_variant_ctx_options
  1300. : Note<"context %select{set|selector|property}0 options are: %1">;
  1301. def warn_omp_declare_variant_expected
  1302. : Warning<"expected '%0' after the %1; '%0' assumed">,
  1303. InGroup<OpenMPClauses>;
  1304. def warn_omp_declare_variant_ctx_not_a_property
  1305. : Warning<"'%0' is not a valid context property for the context selector "
  1306. "'%1' and the context set '%2'; property ignored">,
  1307. InGroup<OpenMPClauses>;
  1308. def note_omp_declare_variant_ctx_is_a
  1309. : Note<"'%0' is a context %select{set|selector|property}1 not a context "
  1310. "%select{set|selector|property}2">;
  1311. def note_omp_declare_variant_ctx_try : Note<"try 'match(%0={%1%2})'">;
  1312. def warn_omp_declare_variant_ctx_not_a_selector
  1313. : Warning<"'%0' is not a valid context selector for the context set '%1'; "
  1314. "selector ignored">,
  1315. InGroup<OpenMPClauses>;
  1316. def warn_omp_declare_variant_ctx_not_a_set
  1317. : Warning<"'%0' is not a valid context set in a `declare variant`; set "
  1318. "ignored">,
  1319. InGroup<OpenMPClauses>;
  1320. def warn_omp_declare_variant_ctx_mutiple_use
  1321. : Warning<"the context %select{set|selector|property}0 '%1' was used "
  1322. "already in the same 'omp declare variant' directive; "
  1323. "%select{set|selector|property}0 ignored">,
  1324. InGroup<OpenMPClauses>;
  1325. def note_omp_declare_variant_ctx_used_here
  1326. : Note<"the previous context %select{set|selector|property}0 '%1' used "
  1327. "here">;
  1328. def note_omp_declare_variant_ctx_continue_here
  1329. : Note<"the ignored %select{set|selector|property}0 spans until here">;
  1330. def warn_omp_ctx_incompatible_selector_for_set
  1331. : Warning<"the context selector '%0' is not valid for the context set "
  1332. "'%1'; selector ignored">,
  1333. InGroup<OpenMPClauses>;
  1334. def note_omp_ctx_compatible_set_for_selector
  1335. : Note<"the context selector '%0' can be nested in the context set '%1'; "
  1336. "try 'match(%1={%0%select{|(property)}2})'">;
  1337. def warn_omp_ctx_selector_without_properties
  1338. : Warning<"the context selector '%0' in context set '%1' requires a "
  1339. "context property defined in parentheses; selector ignored">,
  1340. InGroup<OpenMPClauses>;
  1341. def warn_omp_ctx_incompatible_property_for_selector
  1342. : Warning<"the context property '%0' is not valid for the context selector "
  1343. "'%1' and the context set '%2'; property ignored">,
  1344. InGroup<OpenMPClauses>;
  1345. def note_omp_ctx_compatible_set_and_selector_for_property
  1346. : Note<"the context property '%0' can be nested in the context selector "
  1347. "'%1' which is nested in the context set '%2'; try "
  1348. "'match(%2={%1(%0)})'">;
  1349. def warn_omp_ctx_incompatible_score_for_property
  1350. : Warning<"the context selector '%0' in the context set '%1' cannot have a "
  1351. "score ('%2'); score ignored">,
  1352. InGroup<OpenMPClauses>;
  1353. def warn_omp_more_one_device_type_clause
  1354. : Warning<"more than one 'device_type' clause is specified">,
  1355. InGroup<OpenMPClauses>;
  1356. def err_omp_variant_ctx_second_match_extension : Error<
  1357. "only a single match extension allowed per OpenMP context selector">;
  1358. def err_omp_invalid_dsa: Error<
  1359. "data-sharing attribute '%0' in '%1' clause requires OpenMP version %2 or above">;
  1360. def err_omp_expected_punc_after_interop_mod : Error<
  1361. "expected ',' after interop modifier">;
  1362. def err_omp_expected_interop_type : Error<
  1363. "expected interop type: 'target' and/or 'targetsync'">;
  1364. def warn_omp_more_one_interop_type
  1365. : Warning<"interop type '%0' cannot be specified more than once">,
  1366. InGroup<OpenMPClauses>;
  1367. def err_expected_sequence_or_directive : Error<
  1368. "expected an OpenMP 'directive' or 'sequence' attribute argument">;
  1369. def ext_omp_attributes : ExtWarn<
  1370. "specifying OpenMP directives with [[]] is an OpenMP 5.1 extension">,
  1371. InGroup<OpenMP51Ext>;
  1372. def warn_omp51_compat_attributes : Warning<
  1373. "specifying OpenMP directives with [[]] is incompatible with OpenMP "
  1374. "standards before OpenMP 5.1">,
  1375. InGroup<OpenMPPre51Compat>, DefaultIgnore;
  1376. def err_omp_expected_colon : Error<"missing ':' in %0">;
  1377. def err_omp_expected_context_selector
  1378. : Error<"expected valid context selector in %0">;
  1379. // Pragma loop support.
  1380. def err_pragma_loop_missing_argument : Error<
  1381. "missing argument; expected %select{an integer value|"
  1382. "'enable'%select{|, 'full'}1%select{|, 'assume_safety'}2 or 'disable'}0">;
  1383. def err_pragma_loop_invalid_option : Error<
  1384. "%select{invalid|missing}0 option%select{ %1|}0; expected vectorize, "
  1385. "vectorize_width, interleave, interleave_count, unroll, unroll_count, "
  1386. "pipeline, pipeline_initiation_interval, vectorize_predicate, or distribute">;
  1387. def err_pragma_loop_invalid_vectorize_option : Error<
  1388. "vectorize_width loop hint malformed; use vectorize_width(X, fixed) or "
  1389. "vectorize_width(X, scalable) where X is an integer, or vectorize_width('fixed' or 'scalable')">;
  1390. def note_pragma_loop_invalid_vectorize_option : Note<
  1391. "vectorize_width loop hint malformed; use vectorize_width(X, fixed) or "
  1392. "vectorize_width(X, scalable) where X is an integer, or vectorize_width('fixed' or 'scalable')">;
  1393. def err_pragma_fp_invalid_option : Error<
  1394. "%select{invalid|missing}0 option%select{ %1|}0; expected 'contract', 'reassociate' or 'exceptions'">;
  1395. def err_pragma_fp_invalid_argument : Error<
  1396. "unexpected argument '%0' to '#pragma clang fp %1'; expected "
  1397. "%select{"
  1398. "'fast' or 'on' or 'off'|"
  1399. "'on' or 'off'|"
  1400. "'ignore', 'maytrap' or 'strict'}2">;
  1401. def err_pragma_invalid_keyword : Error<
  1402. "invalid argument; expected 'enable'%select{|, 'full'}0%select{|, 'assume_safety'}1 or 'disable'">;
  1403. def err_pragma_pipeline_invalid_keyword : Error<
  1404. "invalid argument; expected 'disable'">;
  1405. // Pragma unroll support.
  1406. def warn_pragma_unroll_cuda_value_in_parens : Warning<
  1407. "argument to '#pragma unroll' should not be in parentheses in CUDA C/C++">,
  1408. InGroup<CudaCompat>;
  1409. def warn_cuda_attr_lambda_position : Warning<
  1410. "nvcc does not allow '__%0__' to appear after the parameter list in lambdas">,
  1411. InGroup<CudaCompat>;
  1412. def warn_pragma_force_cuda_host_device_bad_arg : Warning<
  1413. "incorrect use of #pragma clang force_cuda_host_device begin|end">,
  1414. InGroup<IgnoredPragmas>;
  1415. def err_pragma_cannot_end_force_cuda_host_device : Error<
  1416. "force_cuda_host_device end pragma without matching "
  1417. "force_cuda_host_device begin">;
  1418. def warn_ext_int_deprecated : Warning<
  1419. "'_ExtInt' is deprecated; use '_BitInt' instead">, InGroup<DeprecatedType>;
  1420. def ext_bit_int : Extension<
  1421. "'_BitInt' in %select{C17 and earlier|C++}0 is a Clang extension">,
  1422. InGroup<DiagGroup<"bit-int-extension">>;
  1423. def warn_c17_compat_bit_int : Warning<
  1424. "'_BitInt' is incompatible with C standards before C2x">,
  1425. InGroup<CPre2xCompat>, DefaultIgnore;
  1426. } // end of Parse Issue category.
  1427. let CategoryName = "Modules Issue" in {
  1428. def err_unexpected_module_decl : Error<
  1429. "module declaration can only appear at the top level">;
  1430. def err_module_expected_ident : Error<
  1431. "expected a module name after '%select{module|import}0'">;
  1432. def err_attribute_not_module_attr : Error<
  1433. "%0 attribute cannot be applied to a module">;
  1434. def err_attribute_not_import_attr : Error<
  1435. "%0 attribute cannot be applied to a module import">;
  1436. def err_module_expected_semi : Error<
  1437. "expected ';' after module name">;
  1438. def err_global_module_introducer_not_at_start : Error<
  1439. "'module;' introducing a global module fragment can appear only "
  1440. "at the start of the translation unit">;
  1441. def err_module_fragment_exported : Error<
  1442. "%select{global|private}0 module fragment cannot be exported">;
  1443. def err_private_module_fragment_expected_semi : Error<
  1444. "expected ';' after private module fragment declaration">;
  1445. def err_missing_before_module_end : Error<"expected %0 at end of module">;
  1446. def err_unsupported_module_partition : Error<
  1447. "sorry, module partitions are not yet supported">;
  1448. def err_export_empty : Error<"export declaration cannot be empty">;
  1449. }
  1450. let CategoryName = "Generics Issue" in {
  1451. def err_objc_expected_type_parameter : Error<
  1452. "expected type parameter name">;
  1453. def err_objc_parameterized_implementation : Error<
  1454. "@implementation cannot have type parameters">;
  1455. def err_objc_type_args_after_protocols : Error<
  1456. "protocol qualifiers must precede type arguments">;
  1457. def note_meant_to_use_typename : Note<
  1458. "did you mean to use 'typename'?">;
  1459. }
  1460. let CategoryName = "Coroutines Issue" in {
  1461. def err_for_co_await_not_range_for : Error<
  1462. "'co_await' modifier can only be applied to range-based for loop">;
  1463. def warn_deprecated_for_co_await : Warning<
  1464. "'for co_await' belongs to CoroutineTS instead of C++20, which is deprecated">,
  1465. InGroup<DeprecatedCoroutine>;
  1466. }
  1467. let CategoryName = "Concepts Issue" in {
  1468. def err_concept_definition_not_identifier : Error<
  1469. "name defined in concept definition must be an identifier">;
  1470. def ext_concept_legacy_bool_keyword : ExtWarn<
  1471. "ISO C++20 does not permit the 'bool' keyword after 'concept'">,
  1472. InGroup<DiagGroup<"concepts-ts-compat">>;
  1473. def err_placeholder_expected_auto_or_decltype_auto : Error<
  1474. "expected 'auto' or 'decltype(auto)' after concept name">;
  1475. }
  1476. def warn_max_tokens : Warning<
  1477. "the number of preprocessor source tokens (%0) exceeds this token limit (%1)">,
  1478. InGroup<MaxTokens>, DefaultIgnore;
  1479. def warn_max_tokens_total : Warning<
  1480. "the total number of preprocessor source tokens (%0) exceeds the token limit (%1)">,
  1481. InGroup<MaxTokens>, DefaultIgnore;
  1482. def note_max_tokens_total_override : Note<"total token limit set here">;
  1483. } // end of Parser diagnostics