10b57cec5SDimitry Andric//==--- DiagnosticLexKinds.td - liblex diagnostics ------------------------===//
20b57cec5SDimitry Andric//
30b57cec5SDimitry Andric// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric// See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric//
70b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric
90b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
100b57cec5SDimitry Andric// Lexer Diagnostics
110b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
120b57cec5SDimitry Andric
130b57cec5SDimitry Andriclet Component = "Lex", CategoryName = "Lexical or Preprocessor Issue" in {
140b57cec5SDimitry Andric
150b57cec5SDimitry Andricdef null_in_char_or_string : Warning<
160b57cec5SDimitry Andric  "null character(s) preserved in %select{char|string}0 literal">,
170b57cec5SDimitry Andric  InGroup<NullCharacter>;
180b57cec5SDimitry Andricdef null_in_file : Warning<"null character ignored">, InGroup<NullCharacter>;
190b57cec5SDimitry Andricdef warn_nested_block_comment : Warning<"'/*' within block comment">,
200b57cec5SDimitry Andric  InGroup<Comment>;
210b57cec5SDimitry Andricdef escaped_newline_block_comment_end : Warning<
220b57cec5SDimitry Andric  "escaped newline between */ characters at block comment end">,
230b57cec5SDimitry Andric  InGroup<Comment>;
240b57cec5SDimitry Andricdef backslash_newline_space : Warning<
250b57cec5SDimitry Andric  "backslash and newline separated by space">,
260b57cec5SDimitry Andric  InGroup<DiagGroup<"backslash-newline-escape">>;
270b57cec5SDimitry Andric
280b57cec5SDimitry Andric// Digraphs.
290b57cec5SDimitry Andricdef warn_cxx98_compat_less_colon_colon : Warning<
300b57cec5SDimitry Andric  "'<::' is treated as digraph '<:' (aka '[') followed by ':' in C++98">,
310b57cec5SDimitry Andric  InGroup<CXX98Compat>, DefaultIgnore;
320b57cec5SDimitry Andric
330b57cec5SDimitry Andricdef warn_cxx17_compat_spaceship : Warning<
3447395794SDimitry Andric  "'<=>' operator is incompatible with C++ standards before C++20">,
3547395794SDimitry Andric  InGroup<CXXPre20Compat>, DefaultIgnore;
365ffd83dbSDimitry Andricdef warn_cxx20_compat_spaceship : Warning<
3747395794SDimitry Andric  "'<=>' is a single token in C++20; "
380b57cec5SDimitry Andric  "add a space to avoid a change in behavior">,
3947395794SDimitry Andric  InGroup<CXX20Compat>;
400b57cec5SDimitry Andric
410b57cec5SDimitry Andric// Trigraphs.
420b57cec5SDimitry Andricdef trigraph_ignored : Warning<"trigraph ignored">, InGroup<Trigraphs>;
430b57cec5SDimitry Andricdef trigraph_ignored_block_comment : Warning<
440b57cec5SDimitry Andric  "ignored trigraph would end block comment">, InGroup<Trigraphs>;
450b57cec5SDimitry Andricdef trigraph_ends_block_comment : Warning<"trigraph ends block comment">,
460b57cec5SDimitry Andric    InGroup<Trigraphs>;
470b57cec5SDimitry Andricdef trigraph_converted : Warning<"trigraph converted to '%0' character">,
480b57cec5SDimitry Andric    InGroup<Trigraphs>;
490b57cec5SDimitry Andric
500b57cec5SDimitry Andricdef ext_multi_line_line_comment : Extension<"multi-line // comment">,
510b57cec5SDimitry Andric    InGroup<Comment>;
520b57cec5SDimitry Andricdef ext_line_comment : Extension<
530b57cec5SDimitry Andric  "// comments are not allowed in this language">,
540b57cec5SDimitry Andric  InGroup<Comment>;
550b57cec5SDimitry Andricdef ext_no_newline_eof : Extension<"no newline at end of file">,
560b57cec5SDimitry Andric  InGroup<NewlineEOF>;
570b57cec5SDimitry Andricdef warn_no_newline_eof : Warning<"no newline at end of file">,
580b57cec5SDimitry Andric  InGroup<NewlineEOF>, DefaultIgnore;
590b57cec5SDimitry Andric
600b57cec5SDimitry Andricdef warn_cxx98_compat_no_newline_eof : Warning<
610b57cec5SDimitry Andric  "C++98 requires newline at end of file">,
620b57cec5SDimitry Andric  InGroup<CXX98CompatPedantic>, DefaultIgnore;
630b57cec5SDimitry Andric
640b57cec5SDimitry Andricdef ext_dollar_in_identifier : Extension<"'$' in identifier">,
650b57cec5SDimitry Andric  InGroup<DiagGroup<"dollar-in-identifier-extension">>;
660b57cec5SDimitry Andricdef ext_charize_microsoft : Extension<
670b57cec5SDimitry Andric  "charizing operator #@ is a Microsoft extension">,
680b57cec5SDimitry Andric  InGroup<MicrosoftCharize>;
690b57cec5SDimitry Andricdef ext_comment_paste_microsoft : Extension<
700b57cec5SDimitry Andric  "pasting two '/' tokens into a '//' comment is a Microsoft extension">,
710b57cec5SDimitry Andric  InGroup<MicrosoftCommentPaste>;
720b57cec5SDimitry Andricdef ext_ctrl_z_eof_microsoft : Extension<
730b57cec5SDimitry Andric  "treating Ctrl-Z as end-of-file is a Microsoft extension">,
740b57cec5SDimitry Andric  InGroup<MicrosoftEndOfFile>;
750b57cec5SDimitry Andric
760b57cec5SDimitry Andricdef ext_token_used : Extension<"extension used">,
770b57cec5SDimitry Andric  InGroup<DiagGroup<"language-extension-token">>;
780b57cec5SDimitry Andric
790b57cec5SDimitry Andricdef warn_cxx11_keyword : Warning<"'%0' is a keyword in C++11">,
800b57cec5SDimitry Andric  InGroup<CXX11Compat>, DefaultIgnore;
815ffd83dbSDimitry Andricdef warn_cxx20_keyword : Warning<"'%0' is a keyword in C++20">,
8247395794SDimitry Andric  InGroup<CXX20Compat>, DefaultIgnore;
83bdd1243dSDimitry Andricdef warn_c99_keyword : Warning<"'%0' is a keyword in C99">,
84bdd1243dSDimitry Andric  InGroup<C99Compat>, DefaultIgnore;
855f757f3fSDimitry Andricdef warn_c23_keyword : Warning<"'%0' is a keyword in C23">,
865f757f3fSDimitry Andric  InGroup<C23Compat>, DefaultIgnore;
870b57cec5SDimitry Andric
880b57cec5SDimitry Andricdef ext_unterminated_char_or_string : ExtWarn<
890b57cec5SDimitry Andric  "missing terminating %select{'|'\"'}0 character">, InGroup<InvalidPPToken>;
900b57cec5SDimitry Andricdef ext_empty_character : ExtWarn<"empty character constant">,
910b57cec5SDimitry Andric  InGroup<InvalidPPToken>;
920b57cec5SDimitry Andricdef err_unterminated_block_comment : Error<"unterminated /* comment">;
930b57cec5SDimitry Andricdef err_invalid_character_to_charify : Error<
940b57cec5SDimitry Andric  "invalid argument to convert to character">;
950b57cec5SDimitry Andricdef err_unterminated___pragma : Error<"missing terminating ')' character">;
960b57cec5SDimitry Andric
970b57cec5SDimitry Andricdef err_conflict_marker : Error<"version control conflict marker in file">;
980b57cec5SDimitry Andric
990b57cec5SDimitry Andricdef err_raw_delim_too_long : Error<
1000b57cec5SDimitry Andric  "raw string delimiter longer than 16 characters"
1010b57cec5SDimitry Andric  "; use PREFIX( )PREFIX to delimit raw string">;
1020b57cec5SDimitry Andricdef err_invalid_char_raw_delim : Error<
1030b57cec5SDimitry Andric  "invalid character '%0' character in raw string delimiter"
1040b57cec5SDimitry Andric  "; use PREFIX( )PREFIX to delimit raw string">;
1050b57cec5SDimitry Andricdef err_unterminated_raw_string : Error<
1060b57cec5SDimitry Andric  "raw string missing terminating delimiter )%0\"">;
1070b57cec5SDimitry Andricdef warn_cxx98_compat_raw_string_literal : Warning<
1080b57cec5SDimitry Andric  "raw string literals are incompatible with C++98">,
1090b57cec5SDimitry Andric  InGroup<CXX98Compat>, DefaultIgnore;
1100b57cec5SDimitry Andric
111e8d8bef9SDimitry Andricdef warn_multichar_character_literal : Warning<
1120b57cec5SDimitry Andric  "multi-character character constant">, InGroup<MultiChar>;
113e8d8bef9SDimitry Andricdef warn_four_char_character_literal : Warning<
114e8d8bef9SDimitry Andric  "multi-character character constant">, InGroup<FourByteMultiChar>, DefaultIgnore;
1150b57cec5SDimitry Andric
1160b57cec5SDimitry Andric
1170b57cec5SDimitry Andric// Unicode and UCNs
1180b57cec5SDimitry Andricdef err_invalid_utf8 : Error<
1190b57cec5SDimitry Andric  "source file is not valid UTF-8">;
120753f127fSDimitry Andricdef warn_invalid_utf8_in_comment : Extension<
121753f127fSDimitry Andric  "invalid UTF-8 in comment">, InGroup<DiagGroup<"invalid-utf8">>;
122349cc55cSDimitry Andricdef err_character_not_allowed : Error<
123349cc55cSDimitry Andric  "unexpected character <U+%0>">;
124349cc55cSDimitry Andricdef err_character_not_allowed_identifier : Error<
125349cc55cSDimitry Andric  "character <U+%0> not allowed %select{in|at the start of}1 an identifier">;
1260b57cec5SDimitry Andricdef ext_unicode_whitespace : ExtWarn<
1270b57cec5SDimitry Andric  "treating Unicode character as whitespace">,
1280b57cec5SDimitry Andric  InGroup<DiagGroup<"unicode-whitespace">>;
1290b57cec5SDimitry Andricdef warn_utf8_symbol_homoglyph : Warning<
130bdd1243dSDimitry Andric  "treating Unicode character <U+%0> as an identifier character rather than "
1310b57cec5SDimitry Andric  "as '%1' symbol">, InGroup<DiagGroup<"unicode-homoglyph">>;
1320b57cec5SDimitry Andricdef warn_utf8_symbol_zero_width : Warning<
1330b57cec5SDimitry Andric  "identifier contains Unicode character <U+%0> that is invisible in "
1340b57cec5SDimitry Andric  "some environments">, InGroup<DiagGroup<"unicode-zero-width">>;
135bdd1243dSDimitry Andricdef ext_mathematical_notation : ExtWarn<
136bdd1243dSDimitry Andric  "mathematical notation character <U+%0> in an identifier is a Clang extension">,
137bdd1243dSDimitry Andric  InGroup<DiagGroup<"mathematical-notation-identifier-extension">>;
1380b57cec5SDimitry Andric
139349cc55cSDimitry Andricdef ext_delimited_escape_sequence : Extension<
140753f127fSDimitry Andric  "%select{delimited|named}0 escape sequences are a "
14106c3fb27SDimitry Andric  "%select{Clang|C++23}1 extension">,
142349cc55cSDimitry Andric  InGroup<DiagGroup<"delimited-escape-sequence-extension">>;
143753f127fSDimitry Andric
14406c3fb27SDimitry Andricdef warn_cxx23_delimited_escape_sequence : Warning<
145753f127fSDimitry Andric  "%select{delimited|named}0 escape sequences are "
14606c3fb27SDimitry Andric  "incompatible with C++ standards before C++23">,
14706c3fb27SDimitry Andric  InGroup<CXXPre23Compat>, DefaultIgnore;
148753f127fSDimitry Andric
149349cc55cSDimitry Andricdef err_delimited_escape_empty : Error<
150349cc55cSDimitry Andric  "delimited escape sequence cannot be empty">;
151349cc55cSDimitry Andricdef err_delimited_escape_missing_brace: Error<
152349cc55cSDimitry Andric  "expected '{' after '\\%0' escape sequence">;
153349cc55cSDimitry Andricdef err_delimited_escape_invalid : Error<
154349cc55cSDimitry Andric  "invalid digit '%0' in escape sequence">;
1550b57cec5SDimitry Andricdef err_hex_escape_no_digits : Error<
1560b57cec5SDimitry Andric  "\\%0 used with no following hex digits">;
15781ad6265SDimitry Andricdef err_invalid_ucn_name : Error<
15881ad6265SDimitry Andric  "'%0' is not a valid Unicode character name">;
15981ad6265SDimitry Andricdef note_invalid_ucn_name_loose_matching : Note<
16081ad6265SDimitry Andric  "characters names in Unicode escape sequences are sensitive to case and whitespaces">;
16181ad6265SDimitry Andricdef note_invalid_ucn_name_candidate : Note<
16281ad6265SDimitry Andric  "did you mean %0 ('%2' U+%1)?">;
16381ad6265SDimitry Andric
1640b57cec5SDimitry Andricdef warn_ucn_escape_no_digits : Warning<
1650b57cec5SDimitry Andric  "\\%0 used with no following hex digits; "
1660b57cec5SDimitry Andric  "treating as '\\' followed by identifier">, InGroup<Unicode>;
1670b57cec5SDimitry Andricdef err_ucn_escape_incomplete : Error<
1680b57cec5SDimitry Andric  "incomplete universal character name">;
169349cc55cSDimitry Andricdef warn_delimited_ucn_incomplete : Warning<
170349cc55cSDimitry Andric  "incomplete delimited universal character name; "
17181ad6265SDimitry Andric  "treating as '\\' '%0' '{' identifier">, InGroup<Unicode>;
172349cc55cSDimitry Andricdef warn_delimited_ucn_empty : Warning<
173349cc55cSDimitry Andric  "empty delimited universal character name; "
17481ad6265SDimitry Andric  "treating as '\\' '%0' '{' '}'">, InGroup<Unicode>;
1750b57cec5SDimitry Andricdef warn_ucn_escape_incomplete : Warning<
1760b57cec5SDimitry Andric  "incomplete universal character name; "
1770b57cec5SDimitry Andric  "treating as '\\' followed by identifier">, InGroup<Unicode>;
1780b57cec5SDimitry Andricdef note_ucn_four_not_eight : Note<"did you mean to use '\\u'?">;
1790b57cec5SDimitry Andric
1800b57cec5SDimitry Andricdef err_ucn_escape_basic_scs : Error<
1810b57cec5SDimitry Andric  "character '%0' cannot be specified by a universal character name">;
1820b57cec5SDimitry Andricdef err_ucn_control_character : Error<
1830b57cec5SDimitry Andric  "universal character name refers to a control character">;
1840b57cec5SDimitry Andricdef err_ucn_escape_invalid : Error<"invalid universal character">;
1850b57cec5SDimitry Andricdef warn_ucn_escape_surrogate : Warning<
1860b57cec5SDimitry Andric  "universal character name refers to a surrogate character">,
1870b57cec5SDimitry Andric  InGroup<Unicode>;
1880b57cec5SDimitry Andric
1890b57cec5SDimitry Andricdef warn_c99_compat_unicode_id : Warning<
1900b57cec5SDimitry Andric  "%select{using this character in an identifier|starting an identifier with "
1910b57cec5SDimitry Andric  "this character}0 is incompatible with C99">,
1920b57cec5SDimitry Andric  InGroup<C99Compat>, DefaultIgnore;
1930b57cec5SDimitry Andric
1940b57cec5SDimitry Andricdef warn_cxx98_compat_literal_ucn_escape_basic_scs : Warning<
1950b57cec5SDimitry Andric  "specifying character '%0' with a universal character name "
1960b57cec5SDimitry Andric  "is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
1970b57cec5SDimitry Andricdef warn_cxx98_compat_literal_ucn_control_character : Warning<
1980b57cec5SDimitry Andric  "universal character name referring to a control character "
1990b57cec5SDimitry Andric  "is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
2005f757f3fSDimitry Andricdef warn_c23_compat_literal_ucn_escape_basic_scs : Warning<
20106c3fb27SDimitry Andric  "specifying character '%0' with a universal character name is "
2025f757f3fSDimitry Andric  "incompatible with C standards before C23">,
2035f757f3fSDimitry Andric  InGroup<CPre23Compat>, DefaultIgnore;
2045f757f3fSDimitry Andricdef warn_c23_compat_literal_ucn_control_character : Warning<
20506c3fb27SDimitry Andric  "universal character name referring to a control character "
2065f757f3fSDimitry Andric  "is incompatible with C standards before C23">,
2075f757f3fSDimitry Andric  InGroup<CPre23Compat>, DefaultIgnore;
2080b57cec5SDimitry Andricdef warn_ucn_not_valid_in_c89 : Warning<
2090b57cec5SDimitry Andric  "universal character names are only valid in C99 or C++; "
2100b57cec5SDimitry Andric  "treating as '\\' followed by identifier">, InGroup<Unicode>;
2110b57cec5SDimitry Andricdef warn_ucn_not_valid_in_c89_literal : ExtWarn<
2120b57cec5SDimitry Andric  "universal character names are only valid in C99 or C++">, InGroup<Unicode>;
2130b57cec5SDimitry Andric
2140b57cec5SDimitry Andric
2150b57cec5SDimitry Andric// Literal
2160b57cec5SDimitry Andricdef ext_nonstandard_escape : Extension<
2170b57cec5SDimitry Andric  "use of non-standard escape character '\\%0'">;
2180b57cec5SDimitry Andricdef ext_unknown_escape : ExtWarn<"unknown escape sequence '\\%0'">,
2190b57cec5SDimitry Andric  InGroup<DiagGroup<"unknown-escape-sequence">>;
2200b57cec5SDimitry Andricdef err_invalid_digit : Error<
2210b57cec5SDimitry Andric  "invalid digit '%0' in %select{decimal|octal|binary}1 constant">;
2220b57cec5SDimitry Andricdef err_invalid_suffix_constant : Error<
2235ffd83dbSDimitry Andric  "invalid suffix '%0' on %select{integer|floating|fixed-point}1 constant">;
2240b57cec5SDimitry Andricdef warn_cxx11_compat_digit_separator : Warning<
2250b57cec5SDimitry Andric  "digit separators are incompatible with C++ standards before C++14">,
2260b57cec5SDimitry Andric  InGroup<CXXPre14Compat>, DefaultIgnore;
2275f757f3fSDimitry Andricdef warn_c23_compat_digit_separator : Warning<
2285f757f3fSDimitry Andric  "digit separators are incompatible with C standards before C23">,
2295f757f3fSDimitry Andric  InGroup<CPre23Compat>, DefaultIgnore;
2300b57cec5SDimitry Andricdef err_digit_separator_not_between_digits : Error<
2310b57cec5SDimitry Andric  "digit separator cannot appear at %select{start|end}0 of digit sequence">;
2320b57cec5SDimitry Andricdef warn_char_constant_too_large : Warning<
2330b57cec5SDimitry Andric  "character constant too long for its type">;
234349cc55cSDimitry Andricdef err_multichar_character_literal : Error<
235349cc55cSDimitry Andric  "%select{wide|Unicode}0 character literals may not contain multiple characters">;
2360b57cec5SDimitry Andricdef err_exponent_has_no_digits : Error<"exponent has no digits">;
2370b57cec5SDimitry Andricdef err_hex_constant_requires : Error<
2380b57cec5SDimitry Andric  "hexadecimal floating %select{constant|literal}0 requires "
2390b57cec5SDimitry Andric  "%select{an exponent|a significand}1">;
2400b57cec5SDimitry Andricdef ext_hex_constant_invalid : Extension<
2410b57cec5SDimitry Andric  "hexadecimal floating constants are a C99 feature">, InGroup<C99>;
2420b57cec5SDimitry Andricdef ext_hex_literal_invalid : Extension<
2430b57cec5SDimitry Andric  "hexadecimal floating literals are a C++17 feature">, InGroup<CXX17>;
2440b57cec5SDimitry Andricdef warn_cxx17_hex_literal : Warning<
2450b57cec5SDimitry Andric  "hexadecimal floating literals are incompatible with "
2460b57cec5SDimitry Andric  "C++ standards before C++17">,
2470b57cec5SDimitry Andric  InGroup<CXXPre17CompatPedantic>, DefaultIgnore;
2480b57cec5SDimitry Andricdef ext_binary_literal : Extension<
2490b57cec5SDimitry Andric  "binary integer literals are a GNU extension">, InGroup<GNUBinaryLiteral>;
2500b57cec5SDimitry Andricdef ext_binary_literal_cxx14 : Extension<
2510b57cec5SDimitry Andric  "binary integer literals are a C++14 extension">, InGroup<CXX14BinaryLiteral>;
2520b57cec5SDimitry Andricdef warn_cxx11_compat_binary_literal : Warning<
2530b57cec5SDimitry Andric  "binary integer literals are incompatible with C++ standards before C++14">,
2540b57cec5SDimitry Andric  InGroup<CXXPre14CompatBinaryLiteral>, DefaultIgnore;
2550b57cec5SDimitry Andricdef err_pascal_string_too_long : Error<"Pascal string is too long">;
2560b57cec5SDimitry Andricdef err_escape_too_large : Error<
2570b57cec5SDimitry Andric  "%select{hex|octal}0 escape sequence out of range">;
2580b57cec5SDimitry Andricdef ext_string_too_long : Extension<"string literal of length %0 exceeds "
2590b57cec5SDimitry Andric  "maximum length %1 that %select{C90|ISO C99|C++}2 compilers are required to "
2600b57cec5SDimitry Andric  "support">, InGroup<OverlengthStrings>;
2610b57cec5SDimitry Andricdef err_character_too_large : Error<
2620b57cec5SDimitry Andric  "character too large for enclosing character literal type">;
2630b57cec5SDimitry Andricdef warn_c99_compat_unicode_literal : Warning<
2640b57cec5SDimitry Andric  "unicode literals are incompatible with C99">,
2650b57cec5SDimitry Andric  InGroup<C99Compat>, DefaultIgnore;
2660b57cec5SDimitry Andricdef warn_cxx98_compat_unicode_literal : Warning<
2670b57cec5SDimitry Andric  "unicode literals are incompatible with C++98">,
2680b57cec5SDimitry Andric  InGroup<CXX98Compat>, DefaultIgnore;
2690b57cec5SDimitry Andricdef warn_cxx14_compat_u8_character_literal : Warning<
2700b57cec5SDimitry Andric  "unicode literals are incompatible with C++ standards before C++17">,
2710b57cec5SDimitry Andric  InGroup<CXXPre17Compat>, DefaultIgnore;
2720b57cec5SDimitry Andricdef warn_cxx11_compat_user_defined_literal : Warning<
2730b57cec5SDimitry Andric  "identifier after literal will be treated as a user-defined literal suffix "
2740b57cec5SDimitry Andric  "in C++11">, InGroup<CXX11Compat>, DefaultIgnore;
2750b57cec5SDimitry Andricdef warn_cxx11_compat_reserved_user_defined_literal : Warning<
2760b57cec5SDimitry Andric  "identifier after literal will be treated as a reserved user-defined literal "
2770b57cec5SDimitry Andric  "suffix in C++11">,
2780b57cec5SDimitry Andric  InGroup<CXX11CompatReservedUserDefinedLiteral>, DefaultIgnore;
2790b57cec5SDimitry Andricdef ext_reserved_user_defined_literal : ExtWarn<
2800b57cec5SDimitry Andric  "invalid suffix on literal; C++11 requires a space between literal and "
2810b57cec5SDimitry Andric  "identifier">, InGroup<ReservedUserDefinedLiteral>, DefaultError;
2820b57cec5SDimitry Andricdef ext_ms_reserved_user_defined_literal : ExtWarn<
2830b57cec5SDimitry Andric  "invalid suffix on literal; C++11 requires a space between literal and "
2840b57cec5SDimitry Andric  "identifier">, InGroup<ReservedUserDefinedLiteral>;
2850b57cec5SDimitry Andricdef err_unsupported_string_concat : Error<
2860b57cec5SDimitry Andric  "unsupported non-standard concatenation of string literals">;
28706c3fb27SDimitry Andric
2888a4dda33SDimitry Andricdef warn_unevaluated_string_prefix : Warning<
2898a4dda33SDimitry Andric  "encoding prefix '%0' on an unevaluated string literal has no effect"
2908a4dda33SDimitry Andric  "%select{| and is incompatible with c++2c}1">,
2918a4dda33SDimitry Andric  InGroup<DiagGroup<"invalid-unevaluated-string">>;
29206c3fb27SDimitry Andricdef err_unevaluated_string_prefix : Error<
29306c3fb27SDimitry Andric  "an unevaluated string literal cannot have an encoding prefix">;
29406c3fb27SDimitry Andricdef err_unevaluated_string_udl : Error<
29506c3fb27SDimitry Andric  "an unevaluated string literal cannot be a user-defined literal">;
29606c3fb27SDimitry Andricdef err_unevaluated_string_invalid_escape_sequence : Error<
29706c3fb27SDimitry Andric  "invalid escape sequence '%0' in an unevaluated string literal">;
2980b57cec5SDimitry Andricdef err_string_concat_mixed_suffix : Error<
2990b57cec5SDimitry Andric  "differing user-defined suffixes ('%0' and '%1') in string literal "
3000b57cec5SDimitry Andric  "concatenation">;
3010b57cec5SDimitry Andricdef err_pp_invalid_udl : Error<
3020b57cec5SDimitry Andric  "%select{character|integer}0 literal with user-defined suffix "
3030b57cec5SDimitry Andric  "cannot be used in preprocessor constant expression">;
3040b57cec5SDimitry Andricdef err_bad_string_encoding : Error<
3050b57cec5SDimitry Andric  "illegal character encoding in string literal">;
3060b57cec5SDimitry Andricdef warn_bad_string_encoding : ExtWarn<
3070b57cec5SDimitry Andric  "illegal character encoding in string literal">,
3080b57cec5SDimitry Andric  InGroup<InvalidSourceEncoding>;
3090b57cec5SDimitry Andricdef err_bad_character_encoding : Error<
3100b57cec5SDimitry Andric  "illegal character encoding in character literal">;
3110b57cec5SDimitry Andricdef warn_bad_character_encoding : ExtWarn<
3120b57cec5SDimitry Andric  "illegal character encoding in character literal">,
3130b57cec5SDimitry Andric  InGroup<InvalidSourceEncoding>;
314349cc55cSDimitry Andricdef err_lexing_string : Error<"failure when lexing a string literal">;
315349cc55cSDimitry Andricdef err_lexing_char : Error<"failure when lexing a character literal">;
316349cc55cSDimitry Andricdef err_lexing_numeric : Error<"failure when lexing a numeric literal">;
3170b57cec5SDimitry Andricdef err_placeholder_in_source : Error<"editor placeholder in source file">;
3180b57cec5SDimitry Andric
3190b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
3200b57cec5SDimitry Andric// Preprocessor Diagnostics
3210b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
3220b57cec5SDimitry Andric
3230b57cec5SDimitry Andriclet CategoryName = "User-Defined Issue" in {
3240b57cec5SDimitry Andricdef pp_hash_warning : Warning<"%0">,
3250b57cec5SDimitry Andric  InGroup<PoundWarning>, ShowInSystemHeader;
3260b57cec5SDimitry Andricdef err_pp_hash_error : Error<"%0">;
3270b57cec5SDimitry Andric}
3280b57cec5SDimitry Andric
3290b57cec5SDimitry Andricdef pp_include_next_in_primary : Warning<
3300b57cec5SDimitry Andric  "#include_next in primary source file; "
3310b57cec5SDimitry Andric  "will search from start of include path">,
3320b57cec5SDimitry Andric  InGroup<DiagGroup<"include-next-outside-header">>;
3330b57cec5SDimitry Andricdef pp_include_macros_out_of_predefines : Error<
3340b57cec5SDimitry Andric  "the #__include_macros directive is only for internal use by -imacros">;
3350b57cec5SDimitry Andricdef pp_include_next_absolute_path : Warning<
3360b57cec5SDimitry Andric  "#include_next in file found relative to primary source file or found by "
3370b57cec5SDimitry Andric  "absolute path; will search from start of include path">,
3380b57cec5SDimitry Andric  InGroup<DiagGroup<"include-next-absolute-path">>;
3390b57cec5SDimitry Andricdef ext_c99_whitespace_required_after_macro_name : ExtWarn<
3400b57cec5SDimitry Andric  "ISO C99 requires whitespace after the macro name">, InGroup<C99>;
3410b57cec5SDimitry Andricdef ext_missing_whitespace_after_macro_name : ExtWarn<
3420b57cec5SDimitry Andric  "whitespace required after macro name">;
3430b57cec5SDimitry Andricdef warn_missing_whitespace_after_macro_name : Warning<
3440b57cec5SDimitry Andric  "whitespace recommended after macro name">;
3450b57cec5SDimitry Andric
3460b57cec5SDimitry Andricclass NonportablePath  : Warning<
3470b57cec5SDimitry Andric  "non-portable path to file '%0'; specified path differs in case from file"
3480b57cec5SDimitry Andric  " name on disk">;
3490b57cec5SDimitry Andricdef pp_nonportable_path : NonportablePath,
3500b57cec5SDimitry Andric  InGroup<DiagGroup<"nonportable-include-path">>;
3510b57cec5SDimitry Andricdef pp_nonportable_system_path : NonportablePath, DefaultIgnore,
3520b57cec5SDimitry Andric  InGroup<DiagGroup<"nonportable-system-include-path">>;
3530b57cec5SDimitry Andric
3540b57cec5SDimitry Andricdef pp_pragma_once_in_main_file : Warning<"#pragma once in main file">,
3550b57cec5SDimitry Andric  InGroup<DiagGroup<"pragma-once-outside-header">>;
3560b57cec5SDimitry Andricdef pp_pragma_sysheader_in_main_file : Warning<
3570b57cec5SDimitry Andric  "#pragma system_header ignored in main file">,
3580b57cec5SDimitry Andric  InGroup<DiagGroup<"pragma-system-header-outside-header">>;
3596e75b2fbSDimitry Andric
36081ad6265SDimitry Andricdef err_illegal_use_of_flt_eval_macro : Error<
36181ad6265SDimitry Andric  "'__FLT_EVAL_METHOD__' cannot be expanded inside a scope containing "
36281ad6265SDimitry Andric  "'#pragma clang fp eval_method'">;
3636e75b2fbSDimitry Andric
3640b57cec5SDimitry Andricdef pp_poisoning_existing_macro : Warning<"poisoning existing macro">;
3650b57cec5SDimitry Andricdef pp_out_of_date_dependency : Warning<
3660b57cec5SDimitry Andric  "current file is older than dependency %0">;
3670b57cec5SDimitry Andricdef ext_pp_undef_builtin_macro : ExtWarn<"undefining builtin macro">,
3680b57cec5SDimitry Andric  InGroup<BuiltinMacroRedefined>;
3690b57cec5SDimitry Andricdef ext_pp_redef_builtin_macro : ExtWarn<"redefining builtin macro">,
3700b57cec5SDimitry Andric  InGroup<BuiltinMacroRedefined>;
3710b57cec5SDimitry Andricdef pp_disabled_macro_expansion : Warning<
3720b57cec5SDimitry Andric  "disabled expansion of recursive macro">, DefaultIgnore,
3730b57cec5SDimitry Andric  InGroup<DiagGroup<"disabled-macro-expansion">>;
3740b57cec5SDimitry Andricdef pp_macro_not_used : Warning<"macro is not used">, DefaultIgnore,
3750b57cec5SDimitry Andric  InGroup<DiagGroup<"unused-macros">>;
3760b57cec5SDimitry Andricdef warn_pp_undef_identifier : Warning<
3770b57cec5SDimitry Andric  "%0 is not defined, evaluates to 0">,
3780b57cec5SDimitry Andric  InGroup<DiagGroup<"undef">>, DefaultIgnore;
3795ffd83dbSDimitry Andricdef warn_pp_undef_prefix : Warning<
3805ffd83dbSDimitry Andric  "%0 is not defined, evaluates to 0">,
3815ffd83dbSDimitry Andric  InGroup<DiagGroup<"undef-prefix">>, DefaultIgnore;
3820b57cec5SDimitry Andricdef warn_pp_ambiguous_macro : Warning<
3830b57cec5SDimitry Andric  "ambiguous expansion of macro %0">, InGroup<AmbiguousMacro>;
3840b57cec5SDimitry Andricdef note_pp_ambiguous_macro_chosen : Note<
3850b57cec5SDimitry Andric  "expanding this definition of %0">;
3860b57cec5SDimitry Andricdef note_pp_ambiguous_macro_other : Note<
3870b57cec5SDimitry Andric  "other definition of %0">;
3880b57cec5SDimitry Andricdef warn_pp_macro_hides_keyword : Extension<
3890b57cec5SDimitry Andric  "keyword is hidden by macro definition">, InGroup<KeywordAsMacro>;
3900b57cec5SDimitry Andricdef warn_pp_macro_is_reserved_id : Warning<
3910b57cec5SDimitry Andric  "macro name is a reserved identifier">, DefaultIgnore,
3920b57cec5SDimitry Andric  InGroup<ReservedIdAsMacro>;
3930b57cec5SDimitry Andricdef warn_pp_objc_macro_redef_ignored : Warning<
3940b57cec5SDimitry Andric  "ignoring redefinition of Objective-C qualifier macro">,
3950b57cec5SDimitry Andric  InGroup<DiagGroup<"objc-macro-redefinition">>;
3960b57cec5SDimitry Andric
3970b57cec5SDimitry Andricdef pp_invalid_string_literal : Warning<
3980b57cec5SDimitry Andric  "invalid string literal, ignoring final '\\'">;
3990b57cec5SDimitry Andricdef warn_pp_expr_overflow : Warning<
4000b57cec5SDimitry Andric  "integer overflow in preprocessor expression">;
4010b57cec5SDimitry Andricdef warn_pp_convert_to_positive : Warning<
4020b57cec5SDimitry Andric  "%select{left|right}0 side of operator converted from negative value to "
4030b57cec5SDimitry Andric  "unsigned: %1">;
4040b57cec5SDimitry Andric
4050b57cec5SDimitry Andricdef ext_pp_import_directive : Extension<"#import is a language extension">,
4060b57cec5SDimitry Andric  InGroup<DiagGroup<"import-preprocessor-directive-pedantic">>;
4070b57cec5SDimitry Andricdef err_pp_import_directive_ms : Error<
4080b57cec5SDimitry Andric  "#import of type library is an unsupported Microsoft feature">;
4090b57cec5SDimitry Andricdef ext_pp_include_search_ms : ExtWarn<
4100b57cec5SDimitry Andric  "#include resolved using non-portable Microsoft search rules as: %0">,
4110b57cec5SDimitry Andric  InGroup<MicrosoftInclude>;
4120b57cec5SDimitry Andric
4130b57cec5SDimitry Andricdef ext_pp_ident_directive : Extension<"#ident is a language extension">;
4140b57cec5SDimitry Andricdef ext_pp_include_next_directive : Extension<
4150b57cec5SDimitry Andric  "#include_next is a language extension">, InGroup<GNUIncludeNext>;
416fcaf7f86SDimitry Andric
417fcaf7f86SDimitry Andricdef ext_pp_warning_directive : Extension<
4185f757f3fSDimitry Andric  "#warning is a %select{C23|C++23}0 extension">;
41906c3fb27SDimitry Andricdef warn_cxx23_compat_warning_directive : Warning<
42006c3fb27SDimitry Andric  "#warning is incompatible with C++ standards before C++23">,
42106c3fb27SDimitry Andric  InGroup<CXXPre23Compat>, DefaultIgnore;
4225f757f3fSDimitry Andricdef warn_c23_compat_warning_directive : Warning<
4235f757f3fSDimitry Andric  "#warning is incompatible with C standards before C23">,
4245f757f3fSDimitry Andric  InGroup<CPre23Compat>, DefaultIgnore;
4250b57cec5SDimitry Andric
4260b57cec5SDimitry Andricdef ext_pp_extra_tokens_at_eol : ExtWarn<
4270b57cec5SDimitry Andric  "extra tokens at end of #%0 directive">, InGroup<ExtraTokens>;
4280b57cec5SDimitry Andric
4290b57cec5SDimitry Andricdef ext_pp_comma_expr : Extension<"comma operator in operand of #if">;
4300b57cec5SDimitry Andricdef ext_pp_bad_vaargs_use : Extension<
4310b57cec5SDimitry Andric  "__VA_ARGS__ can only appear in the expansion of a C99 variadic macro">;
4320b57cec5SDimitry Andric
4330b57cec5SDimitry Andricdef ext_pp_bad_vaopt_use
4340b57cec5SDimitry Andric    : ExtWarn<
4350b57cec5SDimitry Andric          "__VA_OPT__ can only appear in the expansion of a variadic macro">,
4360b57cec5SDimitry Andric      InGroup<VariadicMacros>;
4370b57cec5SDimitry Andric
4380b57cec5SDimitry Andricdef err_pp_missing_lparen_in_vaopt_use : Error<
4390b57cec5SDimitry Andric  "missing '(' following __VA_OPT__">;
4400b57cec5SDimitry Andricdef err_pp_vaopt_nested_use : Error<
4410b57cec5SDimitry Andric  "__VA_OPT__ cannot be nested within its own replacement tokens">;
4420b57cec5SDimitry Andric
4430b57cec5SDimitry Andricdef err_vaopt_paste_at_start : Error<
4440b57cec5SDimitry Andric  "'##' cannot appear at start of __VA_OPT__ argument">;
4450b57cec5SDimitry Andric
4460b57cec5SDimitry Andricdef err_vaopt_paste_at_end
4470b57cec5SDimitry Andric    : Error<"'##' cannot appear at end of __VA_OPT__ argument">;
4480b57cec5SDimitry Andric
4490b57cec5SDimitry Andricdef ext_pp_macro_redef : ExtWarn<"%0 macro redefined">, InGroup<MacroRedefined>;
4500b57cec5SDimitry Andricdef ext_variadic_macro : Extension<"variadic macros are a C99 feature">,
4510b57cec5SDimitry Andric  InGroup<VariadicMacros>;
4520b57cec5SDimitry Andricdef warn_cxx98_compat_variadic_macro : Warning<
4530b57cec5SDimitry Andric  "variadic macros are incompatible with C++98">,
4540b57cec5SDimitry Andric  InGroup<CXX98CompatPedantic>, DefaultIgnore;
4550b57cec5SDimitry Andricdef ext_named_variadic_macro : Extension<
4560b57cec5SDimitry Andric  "named variadic macros are a GNU extension">, InGroup<VariadicMacros>;
4570b57cec5SDimitry Andricdef err_embedded_directive : Error<
4580b57cec5SDimitry Andric  "embedding a #%0 directive within macro arguments is not supported">;
4590b57cec5SDimitry Andricdef ext_embedded_directive : Extension<
4600b57cec5SDimitry Andric  "embedding a directive within macro arguments has undefined behavior">,
4610b57cec5SDimitry Andric  InGroup<DiagGroup<"embedded-directive">>;
4620b57cec5SDimitry Andricdef ext_missing_varargs_arg : Extension<
4630b57cec5SDimitry Andric  "must specify at least one argument for '...' parameter of variadic macro">,
4640b57cec5SDimitry Andric  InGroup<GNUZeroVariadicMacroArguments>;
465349cc55cSDimitry Andricdef warn_cxx17_compat_missing_varargs_arg : Warning<
466349cc55cSDimitry Andric  "passing no argument for the '...' parameter of a variadic macro is "
467349cc55cSDimitry Andric  "incompatible with C++ standards before C++20">,
468349cc55cSDimitry Andric  InGroup<CXXPre20Compat>, DefaultIgnore;
4690b57cec5SDimitry Andricdef ext_empty_fnmacro_arg : Extension<
4700b57cec5SDimitry Andric  "empty macro arguments are a C99 feature">, InGroup<C99>;
4710b57cec5SDimitry Andricdef warn_cxx98_compat_empty_fnmacro_arg : Warning<
4720b57cec5SDimitry Andric  "empty macro arguments are incompatible with C++98">,
4730b57cec5SDimitry Andric  InGroup<CXX98CompatPedantic>, DefaultIgnore;
4740b57cec5SDimitry Andricdef note_macro_here : Note<"macro %0 defined here">;
4750b57cec5SDimitry Andricdef note_macro_expansion_here : Note<"expansion of macro %0 requested here">;
4760b57cec5SDimitry Andric
4770b57cec5SDimitry Andricdef ext_pp_opencl_variadic_macros : Extension<
4780b57cec5SDimitry Andric  "variadic macros are a Clang extension in OpenCL">;
4790b57cec5SDimitry Andric
48081ad6265SDimitry Andricdef ext_pp_gnu_line_directive : Extension<
48181ad6265SDimitry Andric  "this style of line directive is a GNU extension">,
48281ad6265SDimitry Andric  InGroup<GNULineMarker>;
48381ad6265SDimitry Andricdef err_pp_invalid_directive : Error<
48481ad6265SDimitry Andric  "invalid preprocessing directive%select{|, did you mean '#%1'?}0">;
48581ad6265SDimitry Andricdef warn_pp_invalid_directive : Warning<
486bdd1243dSDimitry Andric  err_pp_invalid_directive.Summary>, InGroup<DiagGroup<"unknown-directives">>;
4870b57cec5SDimitry Andricdef err_pp_directive_required : Error<
4880b57cec5SDimitry Andric  "%0 must be used within a preprocessing directive">;
4890b57cec5SDimitry Andricdef err_pp_file_not_found : Error<"'%0' file not found">, DefaultFatal;
4900b57cec5SDimitry Andricdef err_pp_through_header_not_found : Error<
4910b57cec5SDimitry Andric  "'%0' required for precompiled header not found">, DefaultFatal;
4920b57cec5SDimitry Andricdef err_pp_through_header_not_seen : Error<
4930b57cec5SDimitry Andric  "#include of '%0' not seen while attempting to "
4940b57cec5SDimitry Andric  "%select{create|use}1 precompiled header">, DefaultFatal;
4950b57cec5SDimitry Andricdef err_pp_pragma_hdrstop_not_seen : Error<
4960b57cec5SDimitry Andric  "#pragma hdrstop not seen while attempting to use precompiled header">,
4970b57cec5SDimitry Andric  DefaultFatal;
4980b57cec5SDimitry Andricdef warn_pp_macro_def_mismatch_with_pch : Warning<
4990b57cec5SDimitry Andric  "definition of macro %0 does not match definition in precompiled header">,
5000b57cec5SDimitry Andric  InGroup<ClangClPch>;
5010b57cec5SDimitry Andricdef warn_pp_hdrstop_filename_ignored : Warning<
5020b57cec5SDimitry Andric  "#pragma hdrstop filename not supported, "
5030b57cec5SDimitry Andric  "/Fp can be used to specify precompiled header filename">,
5040b57cec5SDimitry Andric  InGroup<ClangClPch>;
505349cc55cSDimitry Andricdef remark_pp_search_path_usage : Remark<
506349cc55cSDimitry Andric  "search path used: '%0'">,
507349cc55cSDimitry Andric  InGroup<UsedSearchPath>;
5080b57cec5SDimitry Andricdef err_pp_file_not_found_angled_include_not_fatal : Error<
5090b57cec5SDimitry Andric  "'%0' file not found with <angled> %select{include|import}1; "
5100b57cec5SDimitry Andric  "use \"quotes\" instead">;
5110b57cec5SDimitry Andricdef err_pp_file_not_found_typo_not_fatal
5120b57cec5SDimitry Andric    : Error<"'%0' file not found, did you mean '%1'?">;
5130b57cec5SDimitry Andricdef note_pp_framework_without_header : Note<
5140b57cec5SDimitry Andric  "did not find header '%0' in framework '%1' (loaded from '%2')">;
5150b57cec5SDimitry Andricdef err_pp_error_opening_file : Error<
5160b57cec5SDimitry Andric  "error opening file '%0': %1">, DefaultFatal;
5170b57cec5SDimitry Andricdef err_pp_including_mainfile_in_preamble : Error<
5180b57cec5SDimitry Andric  "main file cannot be included recursively when building a preamble">;
5190b57cec5SDimitry Andricdef err_pp_empty_filename : Error<"empty filename">;
5200b57cec5SDimitry Andricdef err_pp_include_too_deep : Error<"#include nested too deeply">;
5210b57cec5SDimitry Andricdef err_pp_expects_filename : Error<"expected \"FILENAME\" or <FILENAME>">;
5220b57cec5SDimitry Andricdef err_pp_macro_not_identifier : Error<"macro name must be an identifier">;
5230b57cec5SDimitry Andricdef err_pp_missing_macro_name : Error<"macro name missing">;
5240b57cec5SDimitry Andricdef err_pp_missing_rparen_in_macro_def : Error<
5250b57cec5SDimitry Andric  "missing ')' in macro parameter list">;
5260b57cec5SDimitry Andricdef err_pp_invalid_tok_in_arg_list : Error<
5270b57cec5SDimitry Andric  "invalid token in macro parameter list">;
5280b57cec5SDimitry Andricdef err_pp_expected_ident_in_arg_list : Error<
5290b57cec5SDimitry Andric  "expected identifier in macro parameter list">;
5300b57cec5SDimitry Andricdef err_pp_expected_comma_in_arg_list : Error<
5310b57cec5SDimitry Andric  "expected comma in macro parameter list">;
5320b57cec5SDimitry Andricdef err_pp_duplicate_name_in_arg_list : Error<
5330b57cec5SDimitry Andric  "duplicate macro parameter name %0">;
5340b57cec5SDimitry Andricdef err_pp_stringize_not_parameter : Error<
5350b57cec5SDimitry Andric  "'%select{#|#@}0' is not followed by a macro parameter">;
5360b57cec5SDimitry Andricdef err_pp_malformed_ident : Error<"invalid #ident directive">;
5370b57cec5SDimitry Andricdef err_pp_unterminated_conditional : Error<
5380b57cec5SDimitry Andric  "unterminated conditional directive">;
5390b57cec5SDimitry Andricdef pp_err_else_after_else : Error<"#else after #else">;
540fe6060f1SDimitry Andricdef pp_err_elif_after_else : Error<
541fe6060f1SDimitry Andric  "%select{#elif|#elifdef|#elifndef}0 after #else">;
5420b57cec5SDimitry Andricdef pp_err_else_without_if : Error<"#else without #if">;
543fe6060f1SDimitry Andricdef pp_err_elif_without_if : Error<
544fe6060f1SDimitry Andric  "%select{#elif|#elifdef|#elifndef}0 without #if">;
5450b57cec5SDimitry Andricdef err_pp_endif_without_if : Error<"#endif without #if">;
5460b57cec5SDimitry Andricdef err_pp_expected_value_in_expr : Error<"expected value in expression">;
5470b57cec5SDimitry Andricdef err_pp_expected_rparen : Error<"expected ')' in preprocessor expression">;
5480b57cec5SDimitry Andricdef err_pp_expected_eol : Error<
5490b57cec5SDimitry Andric  "expected end of line in preprocessor expression">;
5500b57cec5SDimitry Andricdef err_pp_expected_after : Error<"missing %1 after %0">;
5510b57cec5SDimitry Andricdef err_pp_nested_paren : Error<"nested parentheses not permitted in %0">;
5520b57cec5SDimitry Andricdef err_pp_colon_without_question : Error<"':' without preceding '?'">;
5530b57cec5SDimitry Andricdef err_pp_division_by_zero : Error<
5540b57cec5SDimitry Andric  "division by zero in preprocessor expression">;
5550b57cec5SDimitry Andricdef err_pp_remainder_by_zero : Error<
5560b57cec5SDimitry Andric  "remainder by zero in preprocessor expression">;
5570b57cec5SDimitry Andricdef err_pp_expr_bad_token_binop : Error<
5580b57cec5SDimitry Andric  "token is not a valid binary operator in a preprocessor subexpression">;
5590b57cec5SDimitry Andricdef err_pp_expr_bad_token_lparen : Error<
5600b57cec5SDimitry Andric  "function-like macro %0 is not defined">;
5610b57cec5SDimitry Andricdef err_pp_expr_bad_token_start_expr : Error<
5620b57cec5SDimitry Andric  "invalid token at start of a preprocessor expression">;
5630b57cec5SDimitry Andricdef err_pp_invalid_poison : Error<"can only poison identifier tokens">;
5640b57cec5SDimitry Andricdef err_pp_used_poisoned_id : Error<"attempt to use a poisoned identifier">;
5650b57cec5SDimitry Andric
5660b57cec5SDimitry Andricdef err_feature_check_malformed : Error<
5670b57cec5SDimitry Andric  "builtin feature check macro requires a parenthesized identifier">;
5680b57cec5SDimitry Andric
5690b57cec5SDimitry Andricdef warn_has_warning_invalid_option :
5700b57cec5SDimitry Andric   ExtWarn<"__has_warning expected option name (e.g. \"-Wundef\")">,
5710b57cec5SDimitry Andric   InGroup<MalformedWarningCheck>;
5720b57cec5SDimitry Andric
5730b57cec5SDimitry Andricdef err_pp_identifier_arg_not_identifier : Error<
5740b57cec5SDimitry Andric  "cannot convert %0 token to an identifier">;
5750b57cec5SDimitry Andric
5760b57cec5SDimitry Andricdef warn_pragma_include_alias_mismatch_angle :
5770b57cec5SDimitry Andric   ExtWarn<"angle-bracketed include <%0> cannot be aliased to double-quoted "
5780b57cec5SDimitry Andric   "include \"%1\"">, InGroup<UnknownPragmas>;
5790b57cec5SDimitry Andricdef warn_pragma_include_alias_mismatch_quote :
5800b57cec5SDimitry Andric   ExtWarn<"double-quoted include \"%0\" cannot be aliased to angle-bracketed "
5810b57cec5SDimitry Andric   "include <%1>">, InGroup<UnknownPragmas>;
5820b57cec5SDimitry Andricdef warn_pragma_include_alias_expected :
5830b57cec5SDimitry Andric   ExtWarn<"pragma include_alias expected '%0'">,
5840b57cec5SDimitry Andric   InGroup<UnknownPragmas>;
5850b57cec5SDimitry Andricdef warn_pragma_include_alias_expected_filename :
5860b57cec5SDimitry Andric   ExtWarn<"pragma include_alias expected include filename">,
5870b57cec5SDimitry Andric   InGroup<UnknownPragmas>;
5880b57cec5SDimitry Andric
5890b57cec5SDimitry Andric// - #pragma warning(...)
5900b57cec5SDimitry Andricdef warn_pragma_warning_expected :
5910b57cec5SDimitry Andric  ExtWarn<"#pragma warning expected '%0'">,
5920b57cec5SDimitry Andric  InGroup<UnknownPragmas>;
5930b57cec5SDimitry Andricdef warn_pragma_warning_spec_invalid :
5940b57cec5SDimitry Andric  ExtWarn<"#pragma warning expected 'push', 'pop', 'default', 'disable',"
5950b57cec5SDimitry Andric          " 'error', 'once', 'suppress', 1, 2, 3, or 4">,
5960b57cec5SDimitry Andric  InGroup<UnknownPragmas>;
5970b57cec5SDimitry Andricdef warn_pragma_warning_push_level :
5980b57cec5SDimitry Andric  ExtWarn<"#pragma warning(push, level) requires a level between 0 and 4">,
5990b57cec5SDimitry Andric  InGroup<UnknownPragmas>;
6000b57cec5SDimitry Andricdef warn_pragma_warning_expected_number :
6010b57cec5SDimitry Andric  ExtWarn<"#pragma warning expected a warning number">,
6020b57cec5SDimitry Andric  InGroup<UnknownPragmas>;
6030b57cec5SDimitry Andric
604349cc55cSDimitry Andric// - #pragma deprecated(...)
605349cc55cSDimitry Andricdef warn_pragma_deprecated_macro_use :
606349cc55cSDimitry Andric  ExtWarn<"macro %0 has been marked as deprecated%select{|: %2}1">,
607349cc55cSDimitry Andric  InGroup<DeprecatedPragma>;
608349cc55cSDimitry Andric
609349cc55cSDimitry Andric// - #pragma clang restrict_expansion(...)
610349cc55cSDimitry Andricdef warn_pragma_restrict_expansion_macro_use :
611349cc55cSDimitry Andric  ExtWarn<"macro %0 has been marked as unsafe for use in headers"
612349cc55cSDimitry Andric          "%select{|: %2}1">,
613349cc55cSDimitry Andric  InGroup<RestrictExpansionMacro>;
614349cc55cSDimitry Andric
615349cc55cSDimitry Andric// - Note for macro annotations.
616349cc55cSDimitry Andricdef note_pp_macro_annotation :
617349cc55cSDimitry Andric  Note<"macro marked '%select{deprecated|restrict_expansion|final}0' here">;
618349cc55cSDimitry Andric
619349cc55cSDimitry Andric// - #pragma clang final(...)
620349cc55cSDimitry Andricdef warn_pragma_final_macro :
621349cc55cSDimitry Andric  ExtWarn<"macro %0 has been marked as final and should not be "
622349cc55cSDimitry Andric          "%select{undefined|redefined}1">,
623349cc55cSDimitry Andric  InGroup<FinalMacro>,  ShowInSystemHeader;
624349cc55cSDimitry Andric
6250b57cec5SDimitry Andric// - #pragma execution_character_set(...)
6260b57cec5SDimitry Andricdef warn_pragma_exec_charset_expected :
6270b57cec5SDimitry Andric  ExtWarn<"#pragma execution_character_set expected '%0'">,
6280b57cec5SDimitry Andric  InGroup<UnknownPragmas>;
6290b57cec5SDimitry Andricdef warn_pragma_exec_charset_spec_invalid :
6300b57cec5SDimitry Andric  ExtWarn<"#pragma execution_character_set expected 'push' or 'pop'">,
6310b57cec5SDimitry Andric  InGroup<UnknownPragmas>;
6320b57cec5SDimitry Andricdef warn_pragma_exec_charset_push_invalid :
6330b57cec5SDimitry Andric   ExtWarn<"#pragma execution_character_set invalid value '%0', only 'UTF-8' is supported">,
6340b57cec5SDimitry Andric   InGroup<UnknownPragmas>;
6350b57cec5SDimitry Andric
6360b57cec5SDimitry Andricdef err__Pragma_malformed : Error<
6370b57cec5SDimitry Andric  "_Pragma takes a parenthesized string literal">;
6380b57cec5SDimitry Andricdef err_pragma_message_malformed : Error<
6390b57cec5SDimitry Andric  "pragma %select{message|warning|error}0 requires parenthesized string">;
6400b57cec5SDimitry Andricdef err_pragma_push_pop_macro_malformed : Error<
6410b57cec5SDimitry Andric   "pragma %0 requires a parenthesized string">;
6420b57cec5SDimitry Andricdef warn_pragma_pop_macro_no_push : Warning<
6430b57cec5SDimitry Andric   "pragma pop_macro could not pop '%0', no matching push_macro">,
6440b57cec5SDimitry Andric  InGroup<IgnoredPragmas>;
6450b57cec5SDimitry Andricdef warn_pragma_message : Warning<"%0">,
6460b57cec5SDimitry Andric   InGroup<PoundPragmaMessage>, DefaultWarnNoWerror;
6470b57cec5SDimitry Andricdef err_pragma_message : Error<"%0">;
6480b57cec5SDimitry Andricdef warn_pragma_ignored : Warning<"unknown pragma ignored">,
6490b57cec5SDimitry Andric   InGroup<UnknownPragmas>, DefaultIgnore;
6500b57cec5SDimitry Andricdef ext_on_off_switch_syntax :
6510b57cec5SDimitry Andric   ExtWarn<"expected 'ON' or 'OFF' or 'DEFAULT' in pragma">,
6520b57cec5SDimitry Andric   InGroup<UnknownPragmas>;
6530b57cec5SDimitry Andricdef ext_pragma_syntax_eod :
6540b57cec5SDimitry Andric   ExtWarn<"expected end of directive in pragma">,
6550b57cec5SDimitry Andric   InGroup<UnknownPragmas>;
6560b57cec5SDimitry Andricdef warn_pragma_diagnostic_invalid :
6570b57cec5SDimitry Andric   ExtWarn<"pragma diagnostic expected 'error', 'warning', 'ignored', 'fatal',"
6580b57cec5SDimitry Andric            " 'push', or 'pop'">,
6590b57cec5SDimitry Andric   InGroup<UnknownPragmas>;
6600b57cec5SDimitry Andricdef warn_pragma_diagnostic_cannot_pop :
6610b57cec5SDimitry Andric   ExtWarn<"pragma diagnostic pop could not pop, no matching push">,
6620b57cec5SDimitry Andric   InGroup<UnknownPragmas>;
6630b57cec5SDimitry Andricdef warn_pragma_diagnostic_invalid_option :
6640b57cec5SDimitry Andric   ExtWarn<"pragma diagnostic expected option name (e.g. \"-Wundef\")">,
6650b57cec5SDimitry Andric   InGroup<UnknownPragmas>;
6660b57cec5SDimitry Andricdef warn_pragma_diagnostic_invalid_token :
6670b57cec5SDimitry Andric   ExtWarn<"unexpected token in pragma diagnostic">,
6680b57cec5SDimitry Andric   InGroup<UnknownPragmas>;
6690b57cec5SDimitry Andricdef warn_pragma_diagnostic_unknown_warning :
6700b57cec5SDimitry Andric   ExtWarn<"unknown warning group '%0', ignored">,
6710b57cec5SDimitry Andric   InGroup<UnknownWarningOption>;
6720b57cec5SDimitry Andric// - #pragma __debug
673bdd1243dSDimitry Andricdef warn_pragma_debug_missing_command : Warning<
674bdd1243dSDimitry Andric  "missing debug command">, InGroup<IgnoredPragmas>;
6750b57cec5SDimitry Andricdef warn_pragma_debug_unexpected_command : Warning<
6760b57cec5SDimitry Andric  "unexpected debug command '%0'">, InGroup<IgnoredPragmas>;
6770b57cec5SDimitry Andricdef warn_pragma_debug_unknown_module : Warning<
6780b57cec5SDimitry Andric  "unknown module '%0'">, InGroup<IgnoredPragmas>;
6790b57cec5SDimitry Andric// #pragma module
6800b57cec5SDimitry Andricdef err_pp_expected_module_name : Error<
6810b57cec5SDimitry Andric  "expected %select{identifier after '.' in |}0module name">;
6820b57cec5SDimitry Andricdef err_pp_module_begin_wrong_module : Error<
6830b57cec5SDimitry Andric  "must specify '-fmodule-name=%0' to enter %select{|submodule of }1"
6840b57cec5SDimitry Andric  "this module%select{ (current module is %3)|}2">;
6850b57cec5SDimitry Andricdef err_pp_module_begin_no_module_map : Error<
6860b57cec5SDimitry Andric  "no module map available for module %0">;
6870b57cec5SDimitry Andricdef err_pp_module_begin_no_submodule : Error<
6880b57cec5SDimitry Andric  "submodule %0.%1 not declared in module map">;
6890b57cec5SDimitry Andricdef err_pp_module_begin_without_module_end : Error<
6900b57cec5SDimitry Andric  "no matching '#pragma clang module end' for this "
6910b57cec5SDimitry Andric  "'#pragma clang module begin'">;
6920b57cec5SDimitry Andricdef err_pp_module_end_without_module_begin : Error<
6930b57cec5SDimitry Andric  "no matching '#pragma clang module begin' for this "
6940b57cec5SDimitry Andric  "'#pragma clang module end'">;
6950b57cec5SDimitry Andricdef note_pp_module_begin_here : Note<
6960b57cec5SDimitry Andric  "entering module '%0' due to this pragma">;
6970b57cec5SDimitry Andricdef err_pp_module_build_missing_end : Error<
6980b57cec5SDimitry Andric  "no matching '#pragma clang module endbuild' for this '#pragma clang module build'">;
6990b57cec5SDimitry Andric
7000b57cec5SDimitry Andricdef err_defined_macro_name : Error<"'defined' cannot be used as a macro name">;
7010b57cec5SDimitry Andricdef err_paste_at_start : Error<
7020b57cec5SDimitry Andric  "'##' cannot appear at start of macro expansion">;
7030b57cec5SDimitry Andricdef err_paste_at_end : Error<"'##' cannot appear at end of macro expansion">;
7040b57cec5SDimitry Andricdef ext_paste_comma : Extension<
7050b57cec5SDimitry Andric  "token pasting of ',' and __VA_ARGS__ is a GNU extension">, InGroup<GNUZeroVariadicMacroArguments>;
7060b57cec5SDimitry Andricdef err_unterm_macro_invoc : Error<
7070b57cec5SDimitry Andric  "unterminated function-like macro invocation">;
7080b57cec5SDimitry Andricdef err_too_many_args_in_macro_invoc : Error<
7090b57cec5SDimitry Andric  "too many arguments provided to function-like macro invocation">;
7100b57cec5SDimitry Andricdef note_suggest_parens_for_macro : Note<
7110b57cec5SDimitry Andric  "parentheses are required around macro argument containing braced "
7120b57cec5SDimitry Andric  "initializer list">;
7130b57cec5SDimitry Andricdef note_init_list_at_beginning_of_macro_argument : Note<
7140b57cec5SDimitry Andric  "cannot use initializer list at the beginning of a macro argument">;
7150b57cec5SDimitry Andricdef err_too_few_args_in_macro_invoc : Error<
7160b57cec5SDimitry Andric  "too few arguments provided to function-like macro invocation">;
7170b57cec5SDimitry Andricdef err_pp_bad_paste : Error<
7180b57cec5SDimitry Andric  "pasting formed '%0', an invalid preprocessing token">;
7190b57cec5SDimitry Andricdef ext_pp_bad_paste_ms : ExtWarn<
7200b57cec5SDimitry Andric  "pasting formed '%0', an invalid preprocessing token">, DefaultError,
7210b57cec5SDimitry Andric  InGroup<DiagGroup<"invalid-token-paste">>;
7220b57cec5SDimitry Andricdef err_pp_operator_used_as_macro_name : Error<
7230b57cec5SDimitry Andric  "C++ operator %0 (aka %1) used as a macro name">;
7240b57cec5SDimitry Andricdef ext_pp_operator_used_as_macro_name : Extension<
725bdd1243dSDimitry Andric  err_pp_operator_used_as_macro_name.Summary>, InGroup<MicrosoftCppMacro>;
7260b57cec5SDimitry Andricdef err_pp_illegal_floating_literal : Error<
7270b57cec5SDimitry Andric  "floating point literal in preprocessor expression">;
7280b57cec5SDimitry Andricdef err_pp_line_requires_integer : Error<
7290b57cec5SDimitry Andric  "#line directive requires a positive integer argument">;
7300b57cec5SDimitry Andricdef ext_pp_line_zero : Extension<
7310b57cec5SDimitry Andric  "#line directive with zero argument is a GNU extension">,
7320b57cec5SDimitry Andric  InGroup<GNUZeroLineDirective>;
7330b57cec5SDimitry Andricdef err_pp_line_invalid_filename : Error<
7340b57cec5SDimitry Andric  "invalid filename for #line directive">;
7350b57cec5SDimitry Andricdef warn_pp_line_decimal : Warning<
7360b57cec5SDimitry Andric  "%select{#line|GNU line marker}0 directive interprets number as decimal, not octal">;
7370b57cec5SDimitry Andricdef err_pp_line_digit_sequence : Error<
7380b57cec5SDimitry Andric  "%select{#line|GNU line marker}0 directive requires a simple digit sequence">;
7390b57cec5SDimitry Andricdef err_pp_linemarker_requires_integer : Error<
7400b57cec5SDimitry Andric  "line marker directive requires a positive integer argument">;
7410b57cec5SDimitry Andricdef err_pp_linemarker_invalid_filename : Error<
7420b57cec5SDimitry Andric  "invalid filename for line marker directive">;
7430b57cec5SDimitry Andricdef err_pp_linemarker_invalid_flag : Error<
7440b57cec5SDimitry Andric  "invalid flag line marker directive">;
7450b57cec5SDimitry Andricdef err_pp_linemarker_invalid_pop : Error<
7460b57cec5SDimitry Andric  "invalid line marker flag '2': cannot pop empty include stack">;
7470b57cec5SDimitry Andricdef ext_pp_line_too_big : Extension<
7480b57cec5SDimitry Andric  "C requires #line number to be less than %0, allowed as extension">;
7490b57cec5SDimitry Andricdef warn_cxx98_compat_pp_line_too_big : Warning<
7500b57cec5SDimitry Andric  "#line number greater than 32767 is incompatible with C++98">,
7510b57cec5SDimitry Andric  InGroup<CXX98CompatPedantic>, DefaultIgnore;
7520b57cec5SDimitry Andric
7535f757f3fSDimitry Andricdef warn_c23_compat_pp_directive : Warning<
75481ad6265SDimitry Andric  "use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive "
7555f757f3fSDimitry Andric  "is incompatible with C standards before C23">,
7565f757f3fSDimitry Andric  InGroup<CPre23Compat>, DefaultIgnore;
7575f757f3fSDimitry Andricdef ext_c23_pp_directive : ExtWarn<
75881ad6265SDimitry Andric  "use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive "
7595f757f3fSDimitry Andric  "is a C23 extension">,
7605f757f3fSDimitry Andric  InGroup<C23>;
76106c3fb27SDimitry Andricdef warn_cxx23_compat_pp_directive : Warning<
76281ad6265SDimitry Andric  "use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive "
76306c3fb27SDimitry Andric  "is incompatible with C++ standards before C++23">,
76406c3fb27SDimitry Andric  InGroup<CXXPre23Compat>, DefaultIgnore;
76506c3fb27SDimitry Andricdef ext_cxx23_pp_directive : ExtWarn<
76681ad6265SDimitry Andric  "use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive "
76706c3fb27SDimitry Andric  "is a C++23 extension">,
76806c3fb27SDimitry Andric  InGroup<CXX23>;
76981ad6265SDimitry Andric
7700b57cec5SDimitry Andricdef err_pp_visibility_non_macro : Error<"no macro named %0">;
7710b57cec5SDimitry Andric
7720b57cec5SDimitry Andricdef err_pp_arc_cf_code_audited_syntax : Error<"expected 'begin' or 'end'">;
7730b57cec5SDimitry Andricdef err_pp_double_begin_of_arc_cf_code_audited : Error<
7740b57cec5SDimitry Andric  "already inside '#pragma clang arc_cf_code_audited'">;
7750b57cec5SDimitry Andricdef err_pp_unmatched_end_of_arc_cf_code_audited : Error<
7760b57cec5SDimitry Andric  "not currently inside '#pragma clang arc_cf_code_audited'">;
7770b57cec5SDimitry Andricdef err_pp_include_in_arc_cf_code_audited : Error<
7780b57cec5SDimitry Andric  "cannot %select{#include files|import headers}0 "
7790b57cec5SDimitry Andric  "inside '#pragma clang arc_cf_code_audited'">;
7800b57cec5SDimitry Andricdef err_pp_eof_in_arc_cf_code_audited : Error<
7810b57cec5SDimitry Andric  "'#pragma clang arc_cf_code_audited' was not ended within this file">;
7820b57cec5SDimitry Andric
7830b57cec5SDimitry Andricdef warn_pp_date_time : Warning<
7840b57cec5SDimitry Andric  "expansion of date or time macro is not reproducible">,
7850b57cec5SDimitry Andric  ShowInSystemHeader, DefaultIgnore, InGroup<DiagGroup<"date-time">>;
7860b57cec5SDimitry Andric
7870b57cec5SDimitry Andric// Module map parsing
7880b57cec5SDimitry Andricdef err_mmap_unknown_token : Error<"skipping stray token">;
7890b57cec5SDimitry Andricdef err_mmap_expected_module : Error<"expected module declaration">;
7900b57cec5SDimitry Andricdef err_mmap_expected_module_name : Error<"expected module name">;
7910b57cec5SDimitry Andricdef err_mmap_expected_lbrace : Error<"expected '{' to start module '%0'">;
7920b57cec5SDimitry Andricdef err_mmap_expected_rbrace : Error<"expected '}'">;
7930b57cec5SDimitry Andricdef note_mmap_lbrace_match : Note<"to match this '{'">;
7940b57cec5SDimitry Andricdef err_mmap_expected_rsquare : Error<"expected ']' to close attribute">;
7950b57cec5SDimitry Andricdef note_mmap_lsquare_match : Note<"to match this ']'">;
7960b57cec5SDimitry Andricdef err_mmap_expected_member : Error<
7970b57cec5SDimitry Andric  "expected umbrella, header, submodule, or module export">;
7980b57cec5SDimitry Andricdef err_mmap_expected_header : Error<"expected a header name after '%0'">;
7990b57cec5SDimitry Andricdef err_mmap_expected_mmap_file : Error<"expected a module map file name">;
8000b57cec5SDimitry Andricdef err_mmap_module_redefinition : Error<
8010b57cec5SDimitry Andric  "redefinition of module '%0'">;
8020b57cec5SDimitry Andricdef note_mmap_prev_definition : Note<"previously defined here">;
8030b57cec5SDimitry Andricdef err_mmap_umbrella_clash : Error<
8040b57cec5SDimitry Andric  "umbrella for module '%0' already covers this directory">;
8050b57cec5SDimitry Andricdef err_mmap_module_id : Error<
8060b57cec5SDimitry Andric  "expected a module name or '*'">;
8070b57cec5SDimitry Andricdef err_mmap_expected_library_name : Error<
8080b57cec5SDimitry Andric  "expected %select{library|framework}0 name as a string">;
8090b57cec5SDimitry Andricdef err_mmap_config_macro_submodule : Error<
8100b57cec5SDimitry Andric  "configuration macros are only allowed in top-level modules">;
8110b57cec5SDimitry Andricdef err_mmap_use_decl_submodule : Error<
8120b57cec5SDimitry Andric  "use declarations are only allowed in top-level modules">;
8130b57cec5SDimitry Andricdef err_mmap_expected_config_macro : Error<
8140b57cec5SDimitry Andric  "expected configuration macro name after ','">;
8150b57cec5SDimitry Andricdef err_mmap_expected_conflicts_comma : Error<
8160b57cec5SDimitry Andric  "expected ',' after conflicting module name">;
8170b57cec5SDimitry Andricdef err_mmap_expected_conflicts_message : Error<
8180b57cec5SDimitry Andric  "expected a message describing the conflict with '%0'">;
8190b57cec5SDimitry Andricdef err_mmap_missing_module_unqualified : Error<
8200b57cec5SDimitry Andric  "no module named '%0' visible from '%1'">;
8210b57cec5SDimitry Andricdef err_mmap_missing_module_qualified : Error<
8220b57cec5SDimitry Andric  "no module named '%0' in '%1'">;
823e8d8bef9SDimitry Andricdef err_mmap_missing_parent_module: Error<
824e8d8bef9SDimitry Andric  "no module named '%0' %select{found|in '%2'}1, "
825e8d8bef9SDimitry Andric  "parent module must be defined before the submodule">;
8260b57cec5SDimitry Andricdef err_mmap_top_level_inferred_submodule : Error<
8270b57cec5SDimitry Andric  "only submodules and framework modules may be inferred with wildcard syntax">;
8280b57cec5SDimitry Andricdef err_mmap_inferred_no_umbrella : Error<
8290b57cec5SDimitry Andric  "inferred submodules require a module with an umbrella">;
8300b57cec5SDimitry Andricdef err_mmap_inferred_framework_submodule : Error<
8310b57cec5SDimitry Andric  "inferred submodule cannot be a framework submodule">;
8320b57cec5SDimitry Andricdef err_mmap_explicit_inferred_framework : Error<
8330b57cec5SDimitry Andric  "inferred framework modules cannot be 'explicit'">;
8340b57cec5SDimitry Andricdef err_mmap_missing_exclude_name : Error<
8350b57cec5SDimitry Andric  "expected excluded module name">;
8360b57cec5SDimitry Andricdef err_mmap_inferred_redef : Error<
8370b57cec5SDimitry Andric  "redefinition of inferred submodule">;
8380b57cec5SDimitry Andricdef err_mmap_expected_lbrace_wildcard : Error<
8390b57cec5SDimitry Andric  "expected '{' to start inferred submodule">;
8400b57cec5SDimitry Andricdef err_mmap_expected_inferred_member : Error<
8410b57cec5SDimitry Andric  "expected %select{module exclusion with 'exclude'|'export *'}0">;
8420b57cec5SDimitry Andricdef err_mmap_expected_export_wildcard : Error<
8430b57cec5SDimitry Andric  "only '*' can be exported from an inferred submodule">;
8440b57cec5SDimitry Andricdef err_mmap_explicit_top_level : Error<
8450b57cec5SDimitry Andric  "'explicit' is not permitted on top-level modules">;
8460b57cec5SDimitry Andricdef err_mmap_nested_submodule_id : Error<
8470b57cec5SDimitry Andric  "qualified module name can only be used to define modules at the top level">;
8480b57cec5SDimitry Andricdef err_mmap_expected_feature : Error<"expected a feature name">;
8490b57cec5SDimitry Andricdef err_mmap_expected_attribute : Error<"expected an attribute name">;
8500b57cec5SDimitry Andricdef warn_mmap_unknown_attribute : Warning<"unknown attribute '%0'">,
8510b57cec5SDimitry Andric  InGroup<IgnoredAttributes>;
8520b57cec5SDimitry Andricdef warn_mmap_mismatched_private_submodule : Warning<
8530b57cec5SDimitry Andric  "private submodule '%0' in private module map, expected top-level module">,
8540b57cec5SDimitry Andric  InGroup<PrivateModule>;
8550b57cec5SDimitry Andricdef warn_mmap_mismatched_private_module_name : Warning<
8560b57cec5SDimitry Andric  "expected canonical name for private module '%0'">,
8570b57cec5SDimitry Andric  InGroup<PrivateModule>;
8580b57cec5SDimitry Andricdef note_mmap_rename_top_level_private_module : Note<
8590b57cec5SDimitry Andric  "rename '%0' to ensure it can be found by name">;
8600b57cec5SDimitry Andricdef warn_mmap_incomplete_framework_module_declaration : Warning<
8610b57cec5SDimitry Andric  "skipping '%0' because module declaration of '%1' lacks the 'framework' qualifier">,
8620b57cec5SDimitry Andric  InGroup<IncompleteFrameworkModuleDeclaration>;
8630b57cec5SDimitry Andricdef note_mmap_add_framework_keyword : Note<
8640b57cec5SDimitry Andric  "use 'framework module' to declare module '%0'">;
8650b57cec5SDimitry Andric
8660b57cec5SDimitry Andricdef err_mmap_duplicate_header_attribute : Error<
8670b57cec5SDimitry Andric  "header attribute '%0' specified multiple times">;
8680b57cec5SDimitry Andricdef err_mmap_invalid_header_attribute_value : Error<
8690b57cec5SDimitry Andric  "expected integer literal as value for header attribute '%0'">;
8700b57cec5SDimitry Andricdef err_mmap_expected_header_attribute : Error<
8710b57cec5SDimitry Andric  "expected a header attribute name ('size' or 'mtime')">;
8720b57cec5SDimitry Andricdef err_mmap_conflicting_export_as : Error<
8730b57cec5SDimitry Andric  "conflicting re-export of module '%0' as '%1' or '%2'">;
8740b57cec5SDimitry Andricdef warn_mmap_redundant_export_as : Warning<
8750b57cec5SDimitry Andric  "module '%0' already re-exported as '%1'">,
8760b57cec5SDimitry Andric  InGroup<PrivateModule>;
8770b57cec5SDimitry Andricdef err_mmap_submodule_export_as : Error<
8780b57cec5SDimitry Andric  "only top-level modules can be re-exported as public">;
8790b57cec5SDimitry Andric
8800b57cec5SDimitry Andricdef warn_quoted_include_in_framework_header : Warning<
8810b57cec5SDimitry Andric  "double-quoted include \"%0\" in framework header, "
8820b57cec5SDimitry Andric  "expected angle-bracketed instead"
8830b57cec5SDimitry Andric  >, InGroup<FrameworkHdrQuotedInclude>, DefaultIgnore;
8840b57cec5SDimitry Andricdef warn_framework_include_private_from_public : Warning<
8850b57cec5SDimitry Andric  "public framework header includes private framework header '%0'"
8860b57cec5SDimitry Andric  >, InGroup<FrameworkIncludePrivateFromPublic>;
8875f757f3fSDimitry Andricdef warn_deprecated_module_dot_map : Warning<
8885f757f3fSDimitry Andric  "'%0' as a module map name is deprecated, rename it to %select{module.modulemap|module.private.modulemap}1%select{| in the 'Modules' directory of the framework}2">,
8895f757f3fSDimitry Andric  InGroup<DeprecatedModuleDotMap>;
8900b57cec5SDimitry Andric
891fcaf7f86SDimitry Andricdef remark_pp_include_directive_modular_translation : Remark<
8920b57cec5SDimitry Andric  "treating #%select{include|import|include_next|__include_macros}0 as an "
893fcaf7f86SDimitry Andric  "import of module '%1'">, InGroup<ModuleIncludeDirectiveTranslation>;
8940b57cec5SDimitry Andricdef note_implicit_top_level_module_import_here : Note<
8950b57cec5SDimitry Andric  "submodule of top-level module '%0' implicitly imported here">;
8960b57cec5SDimitry Andricdef warn_uncovered_module_header : Warning<
8970b57cec5SDimitry Andric  "umbrella header for module '%0' does not include header '%1'">,
8980b57cec5SDimitry Andric  InGroup<IncompleteUmbrella>;
8990b57cec5SDimitry Andricdef warn_mmap_umbrella_dir_not_found : Warning<
9000b57cec5SDimitry Andric  "umbrella directory '%0' not found">,
9010b57cec5SDimitry Andric  InGroup<IncompleteUmbrella>;
9020b57cec5SDimitry Andricdef err_expected_id_building_module : Error<
9030b57cec5SDimitry Andric  "expected a module name in '__building_module' expression">;
9040b57cec5SDimitry Andricdef warn_use_of_private_header_outside_module : Warning<
9050b57cec5SDimitry Andric  "use of private header from outside its module: '%0'">,
9060b57cec5SDimitry Andric  InGroup<DiagGroup<"private-header">>, DefaultError;
9070b57cec5SDimitry Andricdef err_undeclared_use_of_module : Error<
9080b57cec5SDimitry Andric  "module %0 does not depend on a module exporting '%1'">;
90906c3fb27SDimitry Andricdef err_undeclared_use_of_module_indirect : Error<
91006c3fb27SDimitry Andric  "module %0 does not directly depend on a module exporting '%1', which is part of indirectly-used module %2">;
9110b57cec5SDimitry Andricdef warn_non_modular_include_in_framework_module : Warning<
9120b57cec5SDimitry Andric  "include of non-modular header inside framework module '%0': '%1'">,
9130b57cec5SDimitry Andric  InGroup<NonModularIncludeInFrameworkModule>, DefaultIgnore;
9140b57cec5SDimitry Andricdef warn_non_modular_include_in_module : Warning<
9150b57cec5SDimitry Andric  "include of non-modular header inside module '%0': '%1'">,
9160b57cec5SDimitry Andric  InGroup<NonModularIncludeInModule>, DefaultIgnore;
9170b57cec5SDimitry Andricdef warn_module_conflict : Warning<
9180b57cec5SDimitry Andric  "module '%0' conflicts with already-imported module '%1': %2">,
9190b57cec5SDimitry Andric  InGroup<ModuleConflict>;
9200b57cec5SDimitry Andric
9210b57cec5SDimitry Andric// C++20 modules
9220b57cec5SDimitry Andricdef err_header_import_semi_in_macro : Error<
9230b57cec5SDimitry Andric  "semicolon terminating header import declaration cannot be produced "
9240b57cec5SDimitry Andric  "by a macro">;
9250b57cec5SDimitry Andricdef err_header_import_not_header_unit : Error<
9260b57cec5SDimitry Andric  "header file %0 (aka '%1') cannot be imported because "
9270b57cec5SDimitry Andric  "it is not known to be a header unit">;
9285f757f3fSDimitry Andricdef warn_pp_include_angled_in_module_purview : Warning<
9295f757f3fSDimitry Andric  "'#include <filename>' attaches the declarations to the named module '%0'"
9305f757f3fSDimitry Andric  ", which is not usually intended; consider moving that directive before "
9315f757f3fSDimitry Andric  "the module declaration">,
9325f757f3fSDimitry Andric  InGroup<DiagGroup<"include-angled-in-module-purview">>;
9330b57cec5SDimitry Andric
9340b57cec5SDimitry Andricdef warn_header_guard : Warning<
9350b57cec5SDimitry Andric  "%0 is used as a header guard here, followed by #define of a different macro">,
9360b57cec5SDimitry Andric  InGroup<DiagGroup<"header-guard">>;
9370b57cec5SDimitry Andricdef note_header_guard : Note<
9380b57cec5SDimitry Andric  "%0 is defined here; did you mean %1?">;
9390b57cec5SDimitry Andric
9400b57cec5SDimitry Andricdef warn_defined_in_object_type_macro : Warning<
9410b57cec5SDimitry Andric  "macro expansion producing 'defined' has undefined behavior">,
9420b57cec5SDimitry Andric  InGroup<ExpansionToDefined>;
9430b57cec5SDimitry Andricdef warn_defined_in_function_type_macro : Extension<
9440b57cec5SDimitry Andric  "macro expansion producing 'defined' has undefined behavior">,
9450b57cec5SDimitry Andric  InGroup<ExpansionToDefined>;
9460b57cec5SDimitry Andric
9470b57cec5SDimitry Andriclet CategoryName = "Nullability Issue" in {
9480b57cec5SDimitry Andric
9490b57cec5SDimitry Andricdef err_pp_assume_nonnull_syntax : Error<"expected 'begin' or 'end'">;
9500b57cec5SDimitry Andricdef err_pp_double_begin_of_assume_nonnull : Error<
9510b57cec5SDimitry Andric  "already inside '#pragma clang assume_nonnull'">;
9520b57cec5SDimitry Andricdef err_pp_unmatched_end_of_assume_nonnull : Error<
9530b57cec5SDimitry Andric  "not currently inside '#pragma clang assume_nonnull'">;
9540b57cec5SDimitry Andricdef err_pp_include_in_assume_nonnull : Error<
9550b57cec5SDimitry Andric  "cannot %select{#include files|import headers}0 "
9560b57cec5SDimitry Andric  "inside '#pragma clang assume_nonnull'">;
9570b57cec5SDimitry Andricdef err_pp_eof_in_assume_nonnull : Error<
9580b57cec5SDimitry Andric  "'#pragma clang assume_nonnull' was not ended within this file">;
9590b57cec5SDimitry Andric
9600b57cec5SDimitry Andric}
9610b57cec5SDimitry Andric
96281ad6265SDimitry Andriclet CategoryName = "Dependency Directive Source Scanner Issue" in {
9630b57cec5SDimitry Andric
96481ad6265SDimitry Andricdef err_dep_source_scanner_missing_semi_after_at_import : Error<
9650b57cec5SDimitry Andric  "could not find ';' after @import">;
96681ad6265SDimitry Andricdef err_dep_source_scanner_unexpected_tokens_at_import : Error<
9670b57cec5SDimitry Andric  "unexpected extra tokens at end of @import declaration">;
9680b57cec5SDimitry Andric
9690b57cec5SDimitry Andric}
9700b57cec5SDimitry Andric
97106c3fb27SDimitry Andricdef err_pp_double_begin_pragma_unsafe_buffer_usage :
97206c3fb27SDimitry AndricError<"already inside '#pragma unsafe_buffer_usage'">;
97306c3fb27SDimitry Andric
97406c3fb27SDimitry Andricdef err_pp_unmatched_end_begin_pragma_unsafe_buffer_usage :
97506c3fb27SDimitry AndricError<"not currently inside '#pragma unsafe_buffer_usage'">;
97606c3fb27SDimitry Andric
97706c3fb27SDimitry Andricdef err_pp_unclosed_pragma_unsafe_buffer_usage :
97806c3fb27SDimitry AndricError<"'#pragma unsafe_buffer_usage' was not ended">;
97906c3fb27SDimitry Andric
98006c3fb27SDimitry Andricdef err_pp_pragma_unsafe_buffer_usage_syntax :
98106c3fb27SDimitry AndricError<"Expected 'begin' or 'end'">;
9820b57cec5SDimitry Andric}
983