DiagnosticLexKinds.td 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890
  1. //==--- DiagnosticLexKinds.td - liblex 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. // Lexer Diagnostics
  10. //===----------------------------------------------------------------------===//
  11. let Component = "Lex", CategoryName = "Lexical or Preprocessor Issue" in {
  12. def null_in_char_or_string : Warning<
  13. "null character(s) preserved in %select{char|string}0 literal">,
  14. InGroup<NullCharacter>;
  15. def null_in_file : Warning<"null character ignored">, InGroup<NullCharacter>;
  16. def warn_nested_block_comment : Warning<"'/*' within block comment">,
  17. InGroup<Comment>;
  18. def escaped_newline_block_comment_end : Warning<
  19. "escaped newline between */ characters at block comment end">,
  20. InGroup<Comment>;
  21. def backslash_newline_space : Warning<
  22. "backslash and newline separated by space">,
  23. InGroup<DiagGroup<"backslash-newline-escape">>;
  24. // Digraphs.
  25. def warn_cxx98_compat_less_colon_colon : Warning<
  26. "'<::' is treated as digraph '<:' (aka '[') followed by ':' in C++98">,
  27. InGroup<CXX98Compat>, DefaultIgnore;
  28. def warn_cxx17_compat_spaceship : Warning<
  29. "'<=>' operator is incompatible with C++ standards before C++20">,
  30. InGroup<CXXPre20Compat>, DefaultIgnore;
  31. def warn_cxx20_compat_spaceship : Warning<
  32. "'<=>' is a single token in C++20; "
  33. "add a space to avoid a change in behavior">,
  34. InGroup<CXX20Compat>;
  35. // Trigraphs.
  36. def trigraph_ignored : Warning<"trigraph ignored">, InGroup<Trigraphs>;
  37. def trigraph_ignored_block_comment : Warning<
  38. "ignored trigraph would end block comment">, InGroup<Trigraphs>;
  39. def trigraph_ends_block_comment : Warning<"trigraph ends block comment">,
  40. InGroup<Trigraphs>;
  41. def trigraph_converted : Warning<"trigraph converted to '%0' character">,
  42. InGroup<Trigraphs>;
  43. def ext_multi_line_line_comment : Extension<"multi-line // comment">,
  44. InGroup<Comment>;
  45. def ext_line_comment : Extension<
  46. "// comments are not allowed in this language">,
  47. InGroup<Comment>;
  48. def ext_no_newline_eof : Extension<"no newline at end of file">,
  49. InGroup<NewlineEOF>;
  50. def warn_no_newline_eof : Warning<"no newline at end of file">,
  51. InGroup<NewlineEOF>, DefaultIgnore;
  52. def warn_cxx98_compat_no_newline_eof : Warning<
  53. "C++98 requires newline at end of file">,
  54. InGroup<CXX98CompatPedantic>, DefaultIgnore;
  55. def ext_dollar_in_identifier : Extension<"'$' in identifier">,
  56. InGroup<DiagGroup<"dollar-in-identifier-extension">>;
  57. def ext_charize_microsoft : Extension<
  58. "charizing operator #@ is a Microsoft extension">,
  59. InGroup<MicrosoftCharize>;
  60. def ext_comment_paste_microsoft : Extension<
  61. "pasting two '/' tokens into a '//' comment is a Microsoft extension">,
  62. InGroup<MicrosoftCommentPaste>;
  63. def ext_ctrl_z_eof_microsoft : Extension<
  64. "treating Ctrl-Z as end-of-file is a Microsoft extension">,
  65. InGroup<MicrosoftEndOfFile>;
  66. def ext_token_used : Extension<"extension used">,
  67. InGroup<DiagGroup<"language-extension-token">>;
  68. def warn_cxx11_keyword : Warning<"'%0' is a keyword in C++11">,
  69. InGroup<CXX11Compat>, DefaultIgnore;
  70. def warn_cxx20_keyword : Warning<"'%0' is a keyword in C++20">,
  71. InGroup<CXX20Compat>, DefaultIgnore;
  72. def ext_unterminated_char_or_string : ExtWarn<
  73. "missing terminating %select{'|'\"'}0 character">, InGroup<InvalidPPToken>;
  74. def ext_empty_character : ExtWarn<"empty character constant">,
  75. InGroup<InvalidPPToken>;
  76. def err_unterminated_block_comment : Error<"unterminated /* comment">;
  77. def err_invalid_character_to_charify : Error<
  78. "invalid argument to convert to character">;
  79. def err_unterminated___pragma : Error<"missing terminating ')' character">;
  80. def err_conflict_marker : Error<"version control conflict marker in file">;
  81. def err_raw_delim_too_long : Error<
  82. "raw string delimiter longer than 16 characters"
  83. "; use PREFIX( )PREFIX to delimit raw string">;
  84. def err_invalid_char_raw_delim : Error<
  85. "invalid character '%0' character in raw string delimiter"
  86. "; use PREFIX( )PREFIX to delimit raw string">;
  87. def err_unterminated_raw_string : Error<
  88. "raw string missing terminating delimiter )%0\"">;
  89. def warn_cxx98_compat_raw_string_literal : Warning<
  90. "raw string literals are incompatible with C++98">,
  91. InGroup<CXX98Compat>, DefaultIgnore;
  92. def warn_multichar_character_literal : Warning<
  93. "multi-character character constant">, InGroup<MultiChar>;
  94. def warn_four_char_character_literal : Warning<
  95. "multi-character character constant">, InGroup<FourByteMultiChar>, DefaultIgnore;
  96. // Unicode and UCNs
  97. def err_invalid_utf8 : Error<
  98. "source file is not valid UTF-8">;
  99. def err_character_not_allowed : Error<
  100. "unexpected character <U+%0>">;
  101. def err_character_not_allowed_identifier : Error<
  102. "character <U+%0> not allowed %select{in|at the start of}1 an identifier">;
  103. def ext_unicode_whitespace : ExtWarn<
  104. "treating Unicode character as whitespace">,
  105. InGroup<DiagGroup<"unicode-whitespace">>;
  106. def warn_utf8_symbol_homoglyph : Warning<
  107. "treating Unicode character <U+%0> as identifier character rather than "
  108. "as '%1' symbol">, InGroup<DiagGroup<"unicode-homoglyph">>;
  109. def warn_utf8_symbol_zero_width : Warning<
  110. "identifier contains Unicode character <U+%0> that is invisible in "
  111. "some environments">, InGroup<DiagGroup<"unicode-zero-width">>;
  112. def ext_delimited_escape_sequence : Extension<
  113. "delimited escape sequences are a Clang extension">,
  114. InGroup<DiagGroup<"delimited-escape-sequence-extension">>;
  115. def err_delimited_escape_empty : Error<
  116. "delimited escape sequence cannot be empty">;
  117. def err_delimited_escape_missing_brace: Error<
  118. "expected '{' after '\\%0' escape sequence">;
  119. def err_delimited_escape_invalid : Error<
  120. "invalid digit '%0' in escape sequence">;
  121. def err_hex_escape_no_digits : Error<
  122. "\\%0 used with no following hex digits">;
  123. def warn_ucn_escape_no_digits : Warning<
  124. "\\%0 used with no following hex digits; "
  125. "treating as '\\' followed by identifier">, InGroup<Unicode>;
  126. def err_ucn_escape_incomplete : Error<
  127. "incomplete universal character name">;
  128. def warn_delimited_ucn_incomplete : Warning<
  129. "incomplete delimited universal character name; "
  130. "treating as '\\' 'u' '{' identifier">, InGroup<Unicode>;
  131. def warn_delimited_ucn_empty : Warning<
  132. "empty delimited universal character name; "
  133. "treating as '\\' 'u' '{' '}'">, InGroup<Unicode>;
  134. def warn_ucn_escape_incomplete : Warning<
  135. "incomplete universal character name; "
  136. "treating as '\\' followed by identifier">, InGroup<Unicode>;
  137. def note_ucn_four_not_eight : Note<"did you mean to use '\\u'?">;
  138. def err_ucn_escape_basic_scs : Error<
  139. "character '%0' cannot be specified by a universal character name">;
  140. def err_ucn_control_character : Error<
  141. "universal character name refers to a control character">;
  142. def err_ucn_escape_invalid : Error<"invalid universal character">;
  143. def warn_ucn_escape_surrogate : Warning<
  144. "universal character name refers to a surrogate character">,
  145. InGroup<Unicode>;
  146. def warn_c99_compat_unicode_id : Warning<
  147. "%select{using this character in an identifier|starting an identifier with "
  148. "this character}0 is incompatible with C99">,
  149. InGroup<C99Compat>, DefaultIgnore;
  150. def warn_cxx98_compat_literal_ucn_escape_basic_scs : Warning<
  151. "specifying character '%0' with a universal character name "
  152. "is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
  153. def warn_cxx98_compat_literal_ucn_control_character : Warning<
  154. "universal character name referring to a control character "
  155. "is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
  156. def warn_ucn_not_valid_in_c89 : Warning<
  157. "universal character names are only valid in C99 or C++; "
  158. "treating as '\\' followed by identifier">, InGroup<Unicode>;
  159. def warn_ucn_not_valid_in_c89_literal : ExtWarn<
  160. "universal character names are only valid in C99 or C++">, InGroup<Unicode>;
  161. // Literal
  162. def ext_nonstandard_escape : Extension<
  163. "use of non-standard escape character '\\%0'">;
  164. def ext_unknown_escape : ExtWarn<"unknown escape sequence '\\%0'">,
  165. InGroup<DiagGroup<"unknown-escape-sequence">>;
  166. def err_invalid_digit : Error<
  167. "invalid digit '%0' in %select{decimal|octal|binary}1 constant">;
  168. def err_invalid_suffix_constant : Error<
  169. "invalid suffix '%0' on %select{integer|floating|fixed-point}1 constant">;
  170. def warn_cxx11_compat_digit_separator : Warning<
  171. "digit separators are incompatible with C++ standards before C++14">,
  172. InGroup<CXXPre14Compat>, DefaultIgnore;
  173. def warn_c2x_compat_digit_separator : Warning<
  174. "digit separators are incompatible with C standards before C2x">,
  175. InGroup<CPre2xCompat>, DefaultIgnore;
  176. def err_digit_separator_not_between_digits : Error<
  177. "digit separator cannot appear at %select{start|end}0 of digit sequence">;
  178. def warn_char_constant_too_large : Warning<
  179. "character constant too long for its type">;
  180. def err_multichar_character_literal : Error<
  181. "%select{wide|Unicode}0 character literals may not contain multiple characters">;
  182. def err_exponent_has_no_digits : Error<"exponent has no digits">;
  183. def err_hex_constant_requires : Error<
  184. "hexadecimal floating %select{constant|literal}0 requires "
  185. "%select{an exponent|a significand}1">;
  186. def ext_hex_constant_invalid : Extension<
  187. "hexadecimal floating constants are a C99 feature">, InGroup<C99>;
  188. def ext_hex_literal_invalid : Extension<
  189. "hexadecimal floating literals are a C++17 feature">, InGroup<CXX17>;
  190. def warn_cxx17_hex_literal : Warning<
  191. "hexadecimal floating literals are incompatible with "
  192. "C++ standards before C++17">,
  193. InGroup<CXXPre17CompatPedantic>, DefaultIgnore;
  194. def ext_binary_literal : Extension<
  195. "binary integer literals are a GNU extension">, InGroup<GNUBinaryLiteral>;
  196. def ext_binary_literal_cxx14 : Extension<
  197. "binary integer literals are a C++14 extension">, InGroup<CXX14BinaryLiteral>;
  198. def warn_cxx11_compat_binary_literal : Warning<
  199. "binary integer literals are incompatible with C++ standards before C++14">,
  200. InGroup<CXXPre14CompatBinaryLiteral>, DefaultIgnore;
  201. def err_pascal_string_too_long : Error<"Pascal string is too long">;
  202. def err_escape_too_large : Error<
  203. "%select{hex|octal}0 escape sequence out of range">;
  204. def ext_string_too_long : Extension<"string literal of length %0 exceeds "
  205. "maximum length %1 that %select{C90|ISO C99|C++}2 compilers are required to "
  206. "support">, InGroup<OverlengthStrings>;
  207. def err_character_too_large : Error<
  208. "character too large for enclosing character literal type">;
  209. def warn_c99_compat_unicode_literal : Warning<
  210. "unicode literals are incompatible with C99">,
  211. InGroup<C99Compat>, DefaultIgnore;
  212. def warn_cxx98_compat_unicode_literal : Warning<
  213. "unicode literals are incompatible with C++98">,
  214. InGroup<CXX98Compat>, DefaultIgnore;
  215. def warn_cxx14_compat_u8_character_literal : Warning<
  216. "unicode literals are incompatible with C++ standards before C++17">,
  217. InGroup<CXXPre17Compat>, DefaultIgnore;
  218. def warn_cxx11_compat_user_defined_literal : Warning<
  219. "identifier after literal will be treated as a user-defined literal suffix "
  220. "in C++11">, InGroup<CXX11Compat>, DefaultIgnore;
  221. def warn_cxx11_compat_reserved_user_defined_literal : Warning<
  222. "identifier after literal will be treated as a reserved user-defined literal "
  223. "suffix in C++11">,
  224. InGroup<CXX11CompatReservedUserDefinedLiteral>, DefaultIgnore;
  225. def ext_reserved_user_defined_literal : ExtWarn<
  226. "invalid suffix on literal; C++11 requires a space between literal and "
  227. "identifier">, InGroup<ReservedUserDefinedLiteral>, DefaultError;
  228. def ext_ms_reserved_user_defined_literal : ExtWarn<
  229. "invalid suffix on literal; C++11 requires a space between literal and "
  230. "identifier">, InGroup<ReservedUserDefinedLiteral>;
  231. def err_unsupported_string_concat : Error<
  232. "unsupported non-standard concatenation of string literals">;
  233. def err_string_concat_mixed_suffix : Error<
  234. "differing user-defined suffixes ('%0' and '%1') in string literal "
  235. "concatenation">;
  236. def err_pp_invalid_udl : Error<
  237. "%select{character|integer}0 literal with user-defined suffix "
  238. "cannot be used in preprocessor constant expression">;
  239. def err_bad_string_encoding : Error<
  240. "illegal character encoding in string literal">;
  241. def warn_bad_string_encoding : ExtWarn<
  242. "illegal character encoding in string literal">,
  243. InGroup<InvalidSourceEncoding>;
  244. def err_bad_character_encoding : Error<
  245. "illegal character encoding in character literal">;
  246. def warn_bad_character_encoding : ExtWarn<
  247. "illegal character encoding in character literal">,
  248. InGroup<InvalidSourceEncoding>;
  249. def err_lexing_string : Error<"failure when lexing a string literal">;
  250. def err_lexing_char : Error<"failure when lexing a character literal">;
  251. def err_lexing_numeric : Error<"failure when lexing a numeric literal">;
  252. def err_placeholder_in_source : Error<"editor placeholder in source file">;
  253. //===----------------------------------------------------------------------===//
  254. // Preprocessor Diagnostics
  255. //===----------------------------------------------------------------------===//
  256. let CategoryName = "User-Defined Issue" in {
  257. def pp_hash_warning : Warning<"%0">,
  258. InGroup<PoundWarning>, ShowInSystemHeader;
  259. def err_pp_hash_error : Error<"%0">;
  260. }
  261. def pp_include_next_in_primary : Warning<
  262. "#include_next in primary source file; "
  263. "will search from start of include path">,
  264. InGroup<DiagGroup<"include-next-outside-header">>;
  265. def pp_include_macros_out_of_predefines : Error<
  266. "the #__include_macros directive is only for internal use by -imacros">;
  267. def pp_include_next_absolute_path : Warning<
  268. "#include_next in file found relative to primary source file or found by "
  269. "absolute path; will search from start of include path">,
  270. InGroup<DiagGroup<"include-next-absolute-path">>;
  271. def ext_c99_whitespace_required_after_macro_name : ExtWarn<
  272. "ISO C99 requires whitespace after the macro name">, InGroup<C99>;
  273. def ext_missing_whitespace_after_macro_name : ExtWarn<
  274. "whitespace required after macro name">;
  275. def warn_missing_whitespace_after_macro_name : Warning<
  276. "whitespace recommended after macro name">;
  277. class NonportablePath : Warning<
  278. "non-portable path to file '%0'; specified path differs in case from file"
  279. " name on disk">;
  280. def pp_nonportable_path : NonportablePath,
  281. InGroup<DiagGroup<"nonportable-include-path">>;
  282. def pp_nonportable_system_path : NonportablePath, DefaultIgnore,
  283. InGroup<DiagGroup<"nonportable-system-include-path">>;
  284. def pp_pragma_once_in_main_file : Warning<"#pragma once in main file">,
  285. InGroup<DiagGroup<"pragma-once-outside-header">>;
  286. def pp_pragma_sysheader_in_main_file : Warning<
  287. "#pragma system_header ignored in main file">,
  288. InGroup<DiagGroup<"pragma-system-header-outside-header">>;
  289. def err_pragma_include_instead_not_sysheader : Error<
  290. "'#pragma clang include_instead' cannot be used outside of system headers">;
  291. def err_pragma_include_instead_system_reserved : Error<
  292. "header '%0' is an implementation detail; #include %select{'%2'|either '%2' "
  293. "or '%3'|one of %2}1 instead">;
  294. def pp_poisoning_existing_macro : Warning<"poisoning existing macro">;
  295. def pp_out_of_date_dependency : Warning<
  296. "current file is older than dependency %0">;
  297. def ext_pp_undef_builtin_macro : ExtWarn<"undefining builtin macro">,
  298. InGroup<BuiltinMacroRedefined>;
  299. def ext_pp_redef_builtin_macro : ExtWarn<"redefining builtin macro">,
  300. InGroup<BuiltinMacroRedefined>;
  301. def pp_disabled_macro_expansion : Warning<
  302. "disabled expansion of recursive macro">, DefaultIgnore,
  303. InGroup<DiagGroup<"disabled-macro-expansion">>;
  304. def pp_macro_not_used : Warning<"macro is not used">, DefaultIgnore,
  305. InGroup<DiagGroup<"unused-macros">>;
  306. def warn_pp_undef_identifier : Warning<
  307. "%0 is not defined, evaluates to 0">,
  308. InGroup<DiagGroup<"undef">>, DefaultIgnore;
  309. def warn_pp_undef_prefix : Warning<
  310. "%0 is not defined, evaluates to 0">,
  311. InGroup<DiagGroup<"undef-prefix">>, DefaultIgnore;
  312. def warn_pp_ambiguous_macro : Warning<
  313. "ambiguous expansion of macro %0">, InGroup<AmbiguousMacro>;
  314. def note_pp_ambiguous_macro_chosen : Note<
  315. "expanding this definition of %0">;
  316. def note_pp_ambiguous_macro_other : Note<
  317. "other definition of %0">;
  318. def warn_pp_macro_hides_keyword : Extension<
  319. "keyword is hidden by macro definition">, InGroup<KeywordAsMacro>;
  320. def warn_pp_macro_is_reserved_id : Warning<
  321. "macro name is a reserved identifier">, DefaultIgnore,
  322. InGroup<ReservedIdAsMacro>;
  323. def warn_pp_objc_macro_redef_ignored : Warning<
  324. "ignoring redefinition of Objective-C qualifier macro">,
  325. InGroup<DiagGroup<"objc-macro-redefinition">>;
  326. def pp_invalid_string_literal : Warning<
  327. "invalid string literal, ignoring final '\\'">;
  328. def warn_pp_expr_overflow : Warning<
  329. "integer overflow in preprocessor expression">;
  330. def warn_pp_convert_to_positive : Warning<
  331. "%select{left|right}0 side of operator converted from negative value to "
  332. "unsigned: %1">;
  333. def ext_pp_import_directive : Extension<"#import is a language extension">,
  334. InGroup<DiagGroup<"import-preprocessor-directive-pedantic">>;
  335. def err_pp_import_directive_ms : Error<
  336. "#import of type library is an unsupported Microsoft feature">;
  337. def ext_pp_include_search_ms : ExtWarn<
  338. "#include resolved using non-portable Microsoft search rules as: %0">,
  339. InGroup<MicrosoftInclude>;
  340. def ext_pp_ident_directive : Extension<"#ident is a language extension">;
  341. def ext_pp_include_next_directive : Extension<
  342. "#include_next is a language extension">, InGroup<GNUIncludeNext>;
  343. def ext_pp_warning_directive : Extension<"#warning is a language extension">;
  344. def ext_pp_extra_tokens_at_eol : ExtWarn<
  345. "extra tokens at end of #%0 directive">, InGroup<ExtraTokens>;
  346. def ext_pp_comma_expr : Extension<"comma operator in operand of #if">;
  347. def ext_pp_bad_vaargs_use : Extension<
  348. "__VA_ARGS__ can only appear in the expansion of a C99 variadic macro">;
  349. def ext_pp_bad_vaopt_use
  350. : ExtWarn<
  351. "__VA_OPT__ can only appear in the expansion of a variadic macro">,
  352. InGroup<VariadicMacros>;
  353. def err_pp_missing_lparen_in_vaopt_use : Error<
  354. "missing '(' following __VA_OPT__">;
  355. def err_pp_vaopt_nested_use : Error<
  356. "__VA_OPT__ cannot be nested within its own replacement tokens">;
  357. def err_vaopt_paste_at_start : Error<
  358. "'##' cannot appear at start of __VA_OPT__ argument">;
  359. def err_vaopt_paste_at_end
  360. : Error<"'##' cannot appear at end of __VA_OPT__ argument">;
  361. def ext_pp_macro_redef : ExtWarn<"%0 macro redefined">, InGroup<MacroRedefined>;
  362. def ext_variadic_macro : Extension<"variadic macros are a C99 feature">,
  363. InGroup<VariadicMacros>;
  364. def warn_cxx98_compat_variadic_macro : Warning<
  365. "variadic macros are incompatible with C++98">,
  366. InGroup<CXX98CompatPedantic>, DefaultIgnore;
  367. def ext_named_variadic_macro : Extension<
  368. "named variadic macros are a GNU extension">, InGroup<VariadicMacros>;
  369. def err_embedded_directive : Error<
  370. "embedding a #%0 directive within macro arguments is not supported">;
  371. def ext_embedded_directive : Extension<
  372. "embedding a directive within macro arguments has undefined behavior">,
  373. InGroup<DiagGroup<"embedded-directive">>;
  374. def ext_missing_varargs_arg : Extension<
  375. "must specify at least one argument for '...' parameter of variadic macro">,
  376. InGroup<GNUZeroVariadicMacroArguments>;
  377. def warn_cxx17_compat_missing_varargs_arg : Warning<
  378. "passing no argument for the '...' parameter of a variadic macro is "
  379. "incompatible with C++ standards before C++20">,
  380. InGroup<CXXPre20Compat>, DefaultIgnore;
  381. def ext_empty_fnmacro_arg : Extension<
  382. "empty macro arguments are a C99 feature">, InGroup<C99>;
  383. def warn_cxx98_compat_empty_fnmacro_arg : Warning<
  384. "empty macro arguments are incompatible with C++98">,
  385. InGroup<CXX98CompatPedantic>, DefaultIgnore;
  386. def note_macro_here : Note<"macro %0 defined here">;
  387. def note_macro_expansion_here : Note<"expansion of macro %0 requested here">;
  388. def ext_pp_opencl_variadic_macros : Extension<
  389. "variadic macros are a Clang extension in OpenCL">;
  390. def err_pp_invalid_directive : Error<"invalid preprocessing directive">;
  391. def err_pp_directive_required : Error<
  392. "%0 must be used within a preprocessing directive">;
  393. def err_pp_file_not_found : Error<"'%0' file not found">, DefaultFatal;
  394. def err_pp_through_header_not_found : Error<
  395. "'%0' required for precompiled header not found">, DefaultFatal;
  396. def err_pp_through_header_not_seen : Error<
  397. "#include of '%0' not seen while attempting to "
  398. "%select{create|use}1 precompiled header">, DefaultFatal;
  399. def err_pp_pragma_hdrstop_not_seen : Error<
  400. "#pragma hdrstop not seen while attempting to use precompiled header">,
  401. DefaultFatal;
  402. def warn_pp_macro_def_mismatch_with_pch : Warning<
  403. "definition of macro %0 does not match definition in precompiled header">,
  404. InGroup<ClangClPch>;
  405. def warn_pp_hdrstop_filename_ignored : Warning<
  406. "#pragma hdrstop filename not supported, "
  407. "/Fp can be used to specify precompiled header filename">,
  408. InGroup<ClangClPch>;
  409. def remark_pp_search_path_usage : Remark<
  410. "search path used: '%0'">,
  411. InGroup<UsedSearchPath>;
  412. def err_pp_file_not_found_angled_include_not_fatal : Error<
  413. "'%0' file not found with <angled> %select{include|import}1; "
  414. "use \"quotes\" instead">;
  415. def err_pp_file_not_found_typo_not_fatal
  416. : Error<"'%0' file not found, did you mean '%1'?">;
  417. def note_pp_framework_without_header : Note<
  418. "did not find header '%0' in framework '%1' (loaded from '%2')">;
  419. def err_pp_error_opening_file : Error<
  420. "error opening file '%0': %1">, DefaultFatal;
  421. def err_pp_including_mainfile_in_preamble : Error<
  422. "main file cannot be included recursively when building a preamble">;
  423. def err_pp_empty_filename : Error<"empty filename">;
  424. def err_pp_include_too_deep : Error<"#include nested too deeply">;
  425. def err_pp_expects_filename : Error<"expected \"FILENAME\" or <FILENAME>">;
  426. def err_pp_macro_not_identifier : Error<"macro name must be an identifier">;
  427. def err_pp_missing_macro_name : Error<"macro name missing">;
  428. def err_pp_missing_rparen_in_macro_def : Error<
  429. "missing ')' in macro parameter list">;
  430. def err_pp_invalid_tok_in_arg_list : Error<
  431. "invalid token in macro parameter list">;
  432. def err_pp_expected_ident_in_arg_list : Error<
  433. "expected identifier in macro parameter list">;
  434. def err_pp_expected_comma_in_arg_list : Error<
  435. "expected comma in macro parameter list">;
  436. def err_pp_duplicate_name_in_arg_list : Error<
  437. "duplicate macro parameter name %0">;
  438. def err_pp_stringize_not_parameter : Error<
  439. "'%select{#|#@}0' is not followed by a macro parameter">;
  440. def err_pp_malformed_ident : Error<"invalid #ident directive">;
  441. def err_pp_unterminated_conditional : Error<
  442. "unterminated conditional directive">;
  443. def pp_err_else_after_else : Error<"#else after #else">;
  444. def pp_err_elif_after_else : Error<
  445. "%select{#elif|#elifdef|#elifndef}0 after #else">;
  446. def pp_err_else_without_if : Error<"#else without #if">;
  447. def pp_err_elif_without_if : Error<
  448. "%select{#elif|#elifdef|#elifndef}0 without #if">;
  449. def err_pp_endif_without_if : Error<"#endif without #if">;
  450. def err_pp_expected_value_in_expr : Error<"expected value in expression">;
  451. def err_pp_expected_rparen : Error<"expected ')' in preprocessor expression">;
  452. def err_pp_expected_eol : Error<
  453. "expected end of line in preprocessor expression">;
  454. def err_pp_expected_after : Error<"missing %1 after %0">;
  455. def err_pp_nested_paren : Error<"nested parentheses not permitted in %0">;
  456. def err_pp_colon_without_question : Error<"':' without preceding '?'">;
  457. def err_pp_division_by_zero : Error<
  458. "division by zero in preprocessor expression">;
  459. def err_pp_remainder_by_zero : Error<
  460. "remainder by zero in preprocessor expression">;
  461. def err_pp_expr_bad_token_binop : Error<
  462. "token is not a valid binary operator in a preprocessor subexpression">;
  463. def err_pp_expr_bad_token_lparen : Error<
  464. "function-like macro %0 is not defined">;
  465. def err_pp_expr_bad_token_start_expr : Error<
  466. "invalid token at start of a preprocessor expression">;
  467. def err_pp_invalid_poison : Error<"can only poison identifier tokens">;
  468. def err_pp_used_poisoned_id : Error<"attempt to use a poisoned identifier">;
  469. def err_feature_check_malformed : Error<
  470. "builtin feature check macro requires a parenthesized identifier">;
  471. def warn_has_warning_invalid_option :
  472. ExtWarn<"__has_warning expected option name (e.g. \"-Wundef\")">,
  473. InGroup<MalformedWarningCheck>;
  474. def err_pp_identifier_arg_not_identifier : Error<
  475. "cannot convert %0 token to an identifier">;
  476. def warn_pragma_include_alias_mismatch_angle :
  477. ExtWarn<"angle-bracketed include <%0> cannot be aliased to double-quoted "
  478. "include \"%1\"">, InGroup<UnknownPragmas>;
  479. def warn_pragma_include_alias_mismatch_quote :
  480. ExtWarn<"double-quoted include \"%0\" cannot be aliased to angle-bracketed "
  481. "include <%1>">, InGroup<UnknownPragmas>;
  482. def warn_pragma_include_alias_expected :
  483. ExtWarn<"pragma include_alias expected '%0'">,
  484. InGroup<UnknownPragmas>;
  485. def warn_pragma_include_alias_expected_filename :
  486. ExtWarn<"pragma include_alias expected include filename">,
  487. InGroup<UnknownPragmas>;
  488. // - #pragma warning(...)
  489. def warn_pragma_warning_expected :
  490. ExtWarn<"#pragma warning expected '%0'">,
  491. InGroup<UnknownPragmas>;
  492. def warn_pragma_warning_spec_invalid :
  493. ExtWarn<"#pragma warning expected 'push', 'pop', 'default', 'disable',"
  494. " 'error', 'once', 'suppress', 1, 2, 3, or 4">,
  495. InGroup<UnknownPragmas>;
  496. def warn_pragma_warning_push_level :
  497. ExtWarn<"#pragma warning(push, level) requires a level between 0 and 4">,
  498. InGroup<UnknownPragmas>;
  499. def warn_pragma_warning_expected_number :
  500. ExtWarn<"#pragma warning expected a warning number">,
  501. InGroup<UnknownPragmas>;
  502. // - #pragma deprecated(...)
  503. def warn_pragma_deprecated_macro_use :
  504. ExtWarn<"macro %0 has been marked as deprecated%select{|: %2}1">,
  505. InGroup<DeprecatedPragma>;
  506. // - #pragma clang restrict_expansion(...)
  507. def warn_pragma_restrict_expansion_macro_use :
  508. ExtWarn<"macro %0 has been marked as unsafe for use in headers"
  509. "%select{|: %2}1">,
  510. InGroup<RestrictExpansionMacro>;
  511. // - Note for macro annotations.
  512. def note_pp_macro_annotation :
  513. Note<"macro marked '%select{deprecated|restrict_expansion|final}0' here">;
  514. // - #pragma clang final(...)
  515. def warn_pragma_final_macro :
  516. ExtWarn<"macro %0 has been marked as final and should not be "
  517. "%select{undefined|redefined}1">,
  518. InGroup<FinalMacro>, ShowInSystemHeader;
  519. // - #pragma execution_character_set(...)
  520. def warn_pragma_exec_charset_expected :
  521. ExtWarn<"#pragma execution_character_set expected '%0'">,
  522. InGroup<UnknownPragmas>;
  523. def warn_pragma_exec_charset_spec_invalid :
  524. ExtWarn<"#pragma execution_character_set expected 'push' or 'pop'">,
  525. InGroup<UnknownPragmas>;
  526. def warn_pragma_exec_charset_push_invalid :
  527. ExtWarn<"#pragma execution_character_set invalid value '%0', only 'UTF-8' is supported">,
  528. InGroup<UnknownPragmas>;
  529. def err__Pragma_malformed : Error<
  530. "_Pragma takes a parenthesized string literal">;
  531. def err_pragma_message_malformed : Error<
  532. "pragma %select{message|warning|error}0 requires parenthesized string">;
  533. def err_pragma_push_pop_macro_malformed : Error<
  534. "pragma %0 requires a parenthesized string">;
  535. def warn_pragma_pop_macro_no_push : Warning<
  536. "pragma pop_macro could not pop '%0', no matching push_macro">,
  537. InGroup<IgnoredPragmas>;
  538. def warn_pragma_message : Warning<"%0">,
  539. InGroup<PoundPragmaMessage>, DefaultWarnNoWerror;
  540. def err_pragma_message : Error<"%0">;
  541. def warn_pragma_ignored : Warning<"unknown pragma ignored">,
  542. InGroup<UnknownPragmas>, DefaultIgnore;
  543. def ext_on_off_switch_syntax :
  544. ExtWarn<"expected 'ON' or 'OFF' or 'DEFAULT' in pragma">,
  545. InGroup<UnknownPragmas>;
  546. def ext_pragma_syntax_eod :
  547. ExtWarn<"expected end of directive in pragma">,
  548. InGroup<UnknownPragmas>;
  549. def warn_pragma_diagnostic_invalid :
  550. ExtWarn<"pragma diagnostic expected 'error', 'warning', 'ignored', 'fatal',"
  551. " 'push', or 'pop'">,
  552. InGroup<UnknownPragmas>;
  553. def warn_pragma_diagnostic_cannot_pop :
  554. ExtWarn<"pragma diagnostic pop could not pop, no matching push">,
  555. InGroup<UnknownPragmas>;
  556. def warn_pragma_diagnostic_invalid_option :
  557. ExtWarn<"pragma diagnostic expected option name (e.g. \"-Wundef\")">,
  558. InGroup<UnknownPragmas>;
  559. def warn_pragma_diagnostic_invalid_token :
  560. ExtWarn<"unexpected token in pragma diagnostic">,
  561. InGroup<UnknownPragmas>;
  562. def warn_pragma_diagnostic_unknown_warning :
  563. ExtWarn<"unknown warning group '%0', ignored">,
  564. InGroup<UnknownWarningOption>;
  565. // - #pragma __debug
  566. def warn_pragma_debug_unexpected_command : Warning<
  567. "unexpected debug command '%0'">, InGroup<IgnoredPragmas>;
  568. def warn_pragma_debug_missing_argument : Warning<
  569. "missing argument to debug command '%0'">, InGroup<IgnoredPragmas>;
  570. def warn_pragma_debug_unknown_module : Warning<
  571. "unknown module '%0'">, InGroup<IgnoredPragmas>;
  572. // #pragma module
  573. def err_pp_expected_module_name : Error<
  574. "expected %select{identifier after '.' in |}0module name">;
  575. def err_pp_module_begin_wrong_module : Error<
  576. "must specify '-fmodule-name=%0' to enter %select{|submodule of }1"
  577. "this module%select{ (current module is %3)|}2">;
  578. def err_pp_module_begin_no_module_map : Error<
  579. "no module map available for module %0">;
  580. def err_pp_module_begin_no_submodule : Error<
  581. "submodule %0.%1 not declared in module map">;
  582. def err_pp_module_begin_without_module_end : Error<
  583. "no matching '#pragma clang module end' for this "
  584. "'#pragma clang module begin'">;
  585. def err_pp_module_end_without_module_begin : Error<
  586. "no matching '#pragma clang module begin' for this "
  587. "'#pragma clang module end'">;
  588. def note_pp_module_begin_here : Note<
  589. "entering module '%0' due to this pragma">;
  590. def err_pp_module_build_missing_end : Error<
  591. "no matching '#pragma clang module endbuild' for this '#pragma clang module build'">;
  592. def err_defined_macro_name : Error<"'defined' cannot be used as a macro name">;
  593. def err_paste_at_start : Error<
  594. "'##' cannot appear at start of macro expansion">;
  595. def err_paste_at_end : Error<"'##' cannot appear at end of macro expansion">;
  596. def ext_paste_comma : Extension<
  597. "token pasting of ',' and __VA_ARGS__ is a GNU extension">, InGroup<GNUZeroVariadicMacroArguments>;
  598. def err_unterm_macro_invoc : Error<
  599. "unterminated function-like macro invocation">;
  600. def err_too_many_args_in_macro_invoc : Error<
  601. "too many arguments provided to function-like macro invocation">;
  602. def note_suggest_parens_for_macro : Note<
  603. "parentheses are required around macro argument containing braced "
  604. "initializer list">;
  605. def note_init_list_at_beginning_of_macro_argument : Note<
  606. "cannot use initializer list at the beginning of a macro argument">;
  607. def err_too_few_args_in_macro_invoc : Error<
  608. "too few arguments provided to function-like macro invocation">;
  609. def err_pp_bad_paste : Error<
  610. "pasting formed '%0', an invalid preprocessing token">;
  611. def ext_pp_bad_paste_ms : ExtWarn<
  612. "pasting formed '%0', an invalid preprocessing token">, DefaultError,
  613. InGroup<DiagGroup<"invalid-token-paste">>;
  614. def err_pp_operator_used_as_macro_name : Error<
  615. "C++ operator %0 (aka %1) used as a macro name">;
  616. def ext_pp_operator_used_as_macro_name : Extension<
  617. err_pp_operator_used_as_macro_name.Text>, InGroup<MicrosoftCppMacro>;
  618. def err_pp_illegal_floating_literal : Error<
  619. "floating point literal in preprocessor expression">;
  620. def err_pp_line_requires_integer : Error<
  621. "#line directive requires a positive integer argument">;
  622. def ext_pp_line_zero : Extension<
  623. "#line directive with zero argument is a GNU extension">,
  624. InGroup<GNUZeroLineDirective>;
  625. def err_pp_line_invalid_filename : Error<
  626. "invalid filename for #line directive">;
  627. def warn_pp_line_decimal : Warning<
  628. "%select{#line|GNU line marker}0 directive interprets number as decimal, not octal">;
  629. def err_pp_line_digit_sequence : Error<
  630. "%select{#line|GNU line marker}0 directive requires a simple digit sequence">;
  631. def err_pp_linemarker_requires_integer : Error<
  632. "line marker directive requires a positive integer argument">;
  633. def err_pp_linemarker_invalid_filename : Error<
  634. "invalid filename for line marker directive">;
  635. def err_pp_linemarker_invalid_flag : Error<
  636. "invalid flag line marker directive">;
  637. def err_pp_linemarker_invalid_pop : Error<
  638. "invalid line marker flag '2': cannot pop empty include stack">;
  639. def ext_pp_line_too_big : Extension<
  640. "C requires #line number to be less than %0, allowed as extension">;
  641. def warn_cxx98_compat_pp_line_too_big : Warning<
  642. "#line number greater than 32767 is incompatible with C++98">,
  643. InGroup<CXX98CompatPedantic>, DefaultIgnore;
  644. def err_pp_visibility_non_macro : Error<"no macro named %0">;
  645. def err_pp_arc_cf_code_audited_syntax : Error<"expected 'begin' or 'end'">;
  646. def err_pp_double_begin_of_arc_cf_code_audited : Error<
  647. "already inside '#pragma clang arc_cf_code_audited'">;
  648. def err_pp_unmatched_end_of_arc_cf_code_audited : Error<
  649. "not currently inside '#pragma clang arc_cf_code_audited'">;
  650. def err_pp_include_in_arc_cf_code_audited : Error<
  651. "cannot %select{#include files|import headers}0 "
  652. "inside '#pragma clang arc_cf_code_audited'">;
  653. def err_pp_eof_in_arc_cf_code_audited : Error<
  654. "'#pragma clang arc_cf_code_audited' was not ended within this file">;
  655. def warn_pp_date_time : Warning<
  656. "expansion of date or time macro is not reproducible">,
  657. ShowInSystemHeader, DefaultIgnore, InGroup<DiagGroup<"date-time">>;
  658. // Module map parsing
  659. def err_mmap_unknown_token : Error<"skipping stray token">;
  660. def err_mmap_expected_module : Error<"expected module declaration">;
  661. def err_mmap_expected_module_name : Error<"expected module name">;
  662. def err_mmap_expected_lbrace : Error<"expected '{' to start module '%0'">;
  663. def err_mmap_expected_rbrace : Error<"expected '}'">;
  664. def note_mmap_lbrace_match : Note<"to match this '{'">;
  665. def err_mmap_expected_rsquare : Error<"expected ']' to close attribute">;
  666. def note_mmap_lsquare_match : Note<"to match this ']'">;
  667. def err_mmap_expected_member : Error<
  668. "expected umbrella, header, submodule, or module export">;
  669. def err_mmap_expected_header : Error<"expected a header name after '%0'">;
  670. def err_mmap_expected_mmap_file : Error<"expected a module map file name">;
  671. def err_mmap_module_redefinition : Error<
  672. "redefinition of module '%0'">;
  673. def note_mmap_prev_definition : Note<"previously defined here">;
  674. def err_mmap_umbrella_clash : Error<
  675. "umbrella for module '%0' already covers this directory">;
  676. def err_mmap_module_id : Error<
  677. "expected a module name or '*'">;
  678. def err_mmap_expected_library_name : Error<
  679. "expected %select{library|framework}0 name as a string">;
  680. def err_mmap_config_macro_submodule : Error<
  681. "configuration macros are only allowed in top-level modules">;
  682. def err_mmap_use_decl_submodule : Error<
  683. "use declarations are only allowed in top-level modules">;
  684. def err_mmap_expected_config_macro : Error<
  685. "expected configuration macro name after ','">;
  686. def err_mmap_expected_conflicts_comma : Error<
  687. "expected ',' after conflicting module name">;
  688. def err_mmap_expected_conflicts_message : Error<
  689. "expected a message describing the conflict with '%0'">;
  690. def err_mmap_missing_module_unqualified : Error<
  691. "no module named '%0' visible from '%1'">;
  692. def err_mmap_missing_module_qualified : Error<
  693. "no module named '%0' in '%1'">;
  694. def err_mmap_missing_parent_module: Error<
  695. "no module named '%0' %select{found|in '%2'}1, "
  696. "parent module must be defined before the submodule">;
  697. def err_mmap_top_level_inferred_submodule : Error<
  698. "only submodules and framework modules may be inferred with wildcard syntax">;
  699. def err_mmap_inferred_no_umbrella : Error<
  700. "inferred submodules require a module with an umbrella">;
  701. def err_mmap_inferred_framework_submodule : Error<
  702. "inferred submodule cannot be a framework submodule">;
  703. def err_mmap_explicit_inferred_framework : Error<
  704. "inferred framework modules cannot be 'explicit'">;
  705. def err_mmap_missing_exclude_name : Error<
  706. "expected excluded module name">;
  707. def err_mmap_inferred_redef : Error<
  708. "redefinition of inferred submodule">;
  709. def err_mmap_expected_lbrace_wildcard : Error<
  710. "expected '{' to start inferred submodule">;
  711. def err_mmap_expected_inferred_member : Error<
  712. "expected %select{module exclusion with 'exclude'|'export *'}0">;
  713. def err_mmap_expected_export_wildcard : Error<
  714. "only '*' can be exported from an inferred submodule">;
  715. def err_mmap_explicit_top_level : Error<
  716. "'explicit' is not permitted on top-level modules">;
  717. def err_mmap_nested_submodule_id : Error<
  718. "qualified module name can only be used to define modules at the top level">;
  719. def err_mmap_expected_feature : Error<"expected a feature name">;
  720. def err_mmap_expected_attribute : Error<"expected an attribute name">;
  721. def warn_mmap_unknown_attribute : Warning<"unknown attribute '%0'">,
  722. InGroup<IgnoredAttributes>;
  723. def warn_mmap_mismatched_private_submodule : Warning<
  724. "private submodule '%0' in private module map, expected top-level module">,
  725. InGroup<PrivateModule>;
  726. def warn_mmap_mismatched_private_module_name : Warning<
  727. "expected canonical name for private module '%0'">,
  728. InGroup<PrivateModule>;
  729. def note_mmap_rename_top_level_private_module : Note<
  730. "rename '%0' to ensure it can be found by name">;
  731. def warn_mmap_incomplete_framework_module_declaration : Warning<
  732. "skipping '%0' because module declaration of '%1' lacks the 'framework' qualifier">,
  733. InGroup<IncompleteFrameworkModuleDeclaration>;
  734. def note_mmap_add_framework_keyword : Note<
  735. "use 'framework module' to declare module '%0'">;
  736. def err_mmap_duplicate_header_attribute : Error<
  737. "header attribute '%0' specified multiple times">;
  738. def err_mmap_invalid_header_attribute_value : Error<
  739. "expected integer literal as value for header attribute '%0'">;
  740. def err_mmap_expected_header_attribute : Error<
  741. "expected a header attribute name ('size' or 'mtime')">;
  742. def err_mmap_conflicting_export_as : Error<
  743. "conflicting re-export of module '%0' as '%1' or '%2'">;
  744. def warn_mmap_redundant_export_as : Warning<
  745. "module '%0' already re-exported as '%1'">,
  746. InGroup<PrivateModule>;
  747. def err_mmap_submodule_export_as : Error<
  748. "only top-level modules can be re-exported as public">;
  749. def warn_quoted_include_in_framework_header : Warning<
  750. "double-quoted include \"%0\" in framework header, "
  751. "expected angle-bracketed instead"
  752. >, InGroup<FrameworkHdrQuotedInclude>, DefaultIgnore;
  753. def warn_framework_include_private_from_public : Warning<
  754. "public framework header includes private framework header '%0'"
  755. >, InGroup<FrameworkIncludePrivateFromPublic>;
  756. def warn_auto_module_import : Warning<
  757. "treating #%select{include|import|include_next|__include_macros}0 as an "
  758. "import of module '%1'">, InGroup<AutoImport>, DefaultIgnore;
  759. def note_implicit_top_level_module_import_here : Note<
  760. "submodule of top-level module '%0' implicitly imported here">;
  761. def warn_uncovered_module_header : Warning<
  762. "umbrella header for module '%0' does not include header '%1'">,
  763. InGroup<IncompleteUmbrella>;
  764. def warn_mmap_umbrella_dir_not_found : Warning<
  765. "umbrella directory '%0' not found">,
  766. InGroup<IncompleteUmbrella>;
  767. def err_expected_id_building_module : Error<
  768. "expected a module name in '__building_module' expression">;
  769. def warn_use_of_private_header_outside_module : Warning<
  770. "use of private header from outside its module: '%0'">,
  771. InGroup<DiagGroup<"private-header">>, DefaultError;
  772. def err_undeclared_use_of_module : Error<
  773. "module %0 does not depend on a module exporting '%1'">;
  774. def warn_non_modular_include_in_framework_module : Warning<
  775. "include of non-modular header inside framework module '%0': '%1'">,
  776. InGroup<NonModularIncludeInFrameworkModule>, DefaultIgnore;
  777. def warn_non_modular_include_in_module : Warning<
  778. "include of non-modular header inside module '%0': '%1'">,
  779. InGroup<NonModularIncludeInModule>, DefaultIgnore;
  780. def warn_module_conflict : Warning<
  781. "module '%0' conflicts with already-imported module '%1': %2">,
  782. InGroup<ModuleConflict>;
  783. // C++20 modules
  784. def err_header_import_semi_in_macro : Error<
  785. "semicolon terminating header import declaration cannot be produced "
  786. "by a macro">;
  787. def err_header_import_not_header_unit : Error<
  788. "header file %0 (aka '%1') cannot be imported because "
  789. "it is not known to be a header unit">;
  790. def warn_header_guard : Warning<
  791. "%0 is used as a header guard here, followed by #define of a different macro">,
  792. InGroup<DiagGroup<"header-guard">>;
  793. def note_header_guard : Note<
  794. "%0 is defined here; did you mean %1?">;
  795. def warn_defined_in_object_type_macro : Warning<
  796. "macro expansion producing 'defined' has undefined behavior">,
  797. InGroup<ExpansionToDefined>;
  798. def warn_defined_in_function_type_macro : Extension<
  799. "macro expansion producing 'defined' has undefined behavior">,
  800. InGroup<ExpansionToDefined>;
  801. let CategoryName = "Nullability Issue" in {
  802. def err_pp_assume_nonnull_syntax : Error<"expected 'begin' or 'end'">;
  803. def err_pp_double_begin_of_assume_nonnull : Error<
  804. "already inside '#pragma clang assume_nonnull'">;
  805. def err_pp_unmatched_end_of_assume_nonnull : Error<
  806. "not currently inside '#pragma clang assume_nonnull'">;
  807. def err_pp_include_in_assume_nonnull : Error<
  808. "cannot %select{#include files|import headers}0 "
  809. "inside '#pragma clang assume_nonnull'">;
  810. def err_pp_eof_in_assume_nonnull : Error<
  811. "'#pragma clang assume_nonnull' was not ended within this file">;
  812. }
  813. let CategoryName = "Dependency Directive Source Minimization Issue" in {
  814. def err_dep_source_minimizer_missing_sema_after_at_import : Error<
  815. "could not find ';' after @import">;
  816. def err_dep_source_minimizer_unexpected_tokens_at_import : Error<
  817. "unexpected extra tokens at end of @import declaration">;
  818. }
  819. }