1 //==--- DiagnosticLexKinds.td - liblex diagnostics ------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 //===----------------------------------------------------------------------===//
12 //===----------------------------------------------------------------------===//
14 let Component = "Lex", CategoryName = "Lexical or Preprocessor Issue" in {
16 def null_in_string : Warning<"null character(s) preserved in string literal">;
17 def null_in_char : Warning<"null character(s) preserved in character literal">;
18 def null_in_file : Warning<"null character ignored">;
19 def warn_nested_block_comment : Warning<"'/*' within block comment">,
21 def escaped_newline_block_comment_end : Warning<
22 "escaped newline between */ characters at block comment end">,
24 def backslash_newline_space : Warning<
25 "backslash and newline separated by space">;
28 def warn_cxx98_compat_less_colon_colon : Warning<
29 "'<::' is treated as digraph '<:' (aka '[') followed by ':' in C++98">,
30 InGroup<CXX98Compat>, DefaultIgnore;
33 def trigraph_ignored : Warning<"trigraph ignored">, InGroup<Trigraphs>;
34 def trigraph_ignored_block_comment : Warning<
35 "ignored trigraph would end block comment">, InGroup<Trigraphs>;
36 def trigraph_ends_block_comment : Warning<"trigraph ends block comment">,
38 def trigraph_converted : Warning<"trigraph converted to '%0' character">,
41 def ext_multi_line_bcpl_comment : Extension<"multi-line // comment">,
43 def ext_bcpl_comment : Extension<
44 "// comments are not allowed in this language">,
46 def ext_no_newline_eof : Extension<"no newline at end of file">,
47 InGroup<DiagGroup<"newline-eof">>;
48 def ext_dollar_in_identifier : Extension<"'$' in identifier">;
49 def charize_microsoft_ext : Extension<"@# is a microsoft extension">;
51 def ext_token_used : Extension<"extension used">,
52 InGroup<DiagGroup<"language-extension-token">>;
54 def warn_cxx11_keyword : Warning<"'%0' is a keyword in C++11">,
57 def warn_unterminated_string : ExtWarn<"missing terminating '\"' character">;
58 def warn_unterminated_char : ExtWarn<"missing terminating ' character">;
59 def err_empty_character : Error<"empty character constant">;
60 def err_unterminated_block_comment : Error<"unterminated /* comment">;
61 def err_invalid_character_to_charify : Error<
62 "invalid argument to convert to character">;
63 def err_unterminated___pragma : Error<"missing terminating ')' character">;
65 def err_conflict_marker : Error<"version control conflict marker in file">;
67 def err_raw_delim_too_long : Error<
68 "raw string delimiter longer than 16 characters"
69 "; use PREFIX( )PREFIX to delimit raw string">;
70 def err_invalid_char_raw_delim : Error<
71 "invalid character '%0' character in raw string delimiter"
72 "; use PREFIX( )PREFIX to delimit raw string">;
73 def err_unterminated_raw_string : Error<
74 "raw string missing terminating delimiter )%0\"">;
75 def warn_cxx98_compat_raw_string_literal : Warning<
76 "raw string literals are incompatible with C++98">,
77 InGroup<CXX98Compat>, DefaultIgnore;
79 def ext_multichar_character_literal : ExtWarn<
80 "multi-character character constant">, InGroup<MultiChar>;
81 def ext_four_char_character_literal : Extension<
82 "multi-character character constant">, InGroup<FourByteMultiChar>;
86 def ext_nonstandard_escape : Extension<
87 "use of non-standard escape character '\\%0'">;
88 def ext_unknown_escape : ExtWarn<"unknown escape sequence '\\%0'">;
89 def err_hex_escape_no_digits : Error<"\\x used with no following hex digits">;
90 def err_ucn_escape_no_digits : Error<"\\u used with no following hex digits">;
91 def err_ucn_escape_invalid : Error<"invalid universal character">;
92 def err_ucn_escape_incomplete : Error<"incomplete universal character name">;
93 def err_ucn_escape_too_big : Error<"universal character name is too long">;
94 def err_invalid_decimal_digit : Error<"invalid digit '%0' in decimal constant">;
95 def err_invalid_binary_digit : Error<"invalid digit '%0' in binary constant">;
96 def err_invalid_octal_digit : Error<"invalid digit '%0' in octal constant">;
97 def err_invalid_suffix_integer_constant : Error<
98 "invalid suffix '%0' on integer constant">;
99 def err_invalid_suffix_float_constant : Error<
100 "invalid suffix '%0' on floating constant">;
101 def warn_extraneous_char_constant : Warning<
102 "extraneous characters in character constant ignored">;
103 def warn_char_constant_too_large : Warning<
104 "character constant too long for its type">;
105 def err_exponent_has_no_digits : Error<"exponent has no digits">;
106 def ext_imaginary_constant : Extension<"imaginary constants are an extension">;
107 def err_hexconstant_requires_exponent : Error<
108 "hexadecimal floating constants require an exponent">;
109 def ext_hexconstant_invalid : Extension<
110 "hexadecimal floating constants are a C99 feature">;
111 def ext_binary_literal : Extension<
112 "binary integer literals are an extension">;
113 def err_pascal_string_too_long : Error<"Pascal string is too long">;
114 def warn_octal_escape_too_large : ExtWarn<"octal escape sequence out of range">;
115 def warn_hex_escape_too_large : ExtWarn<"hex escape sequence out of range">;
116 def ext_string_too_long : Extension<"string literal of length %0 exceeds "
117 "maximum length %1 that %select{C90|ISO C99|C++}2 compilers are required to "
118 "support">, InGroup<OverlengthStrings>;
119 def warn_ucn_escape_too_large : ExtWarn<
120 "character unicode escape sequence too long for its type">;
121 def warn_ucn_not_valid_in_c89 : ExtWarn<
122 "unicode escape sequences are only valid in C99 or C++">;
123 def warn_cxx98_compat_unicode_literal : Warning<
124 "unicode literals are incompatible with C++98">,
125 InGroup<CXX98Compat>, DefaultIgnore;
126 def err_unsupported_string_concat : Error<
127 "unsupported non-standard concatenation of string literals">;
129 //===----------------------------------------------------------------------===//
131 //===----------------------------------------------------------------------===//
132 def err_pth_cannot_read : Error<
133 "PTH file '%0' could not be read">;
134 def err_invalid_pth_file : Error<
135 "invalid or corrupt PTH file '%0'">;
137 //===----------------------------------------------------------------------===//
138 // Preprocessor Diagnostics
139 //===----------------------------------------------------------------------===//
140 def pp_hash_warning : Warning<"#warning%0">,
141 InGroup<PoundWarning>, DefaultWarnShowInSystemHeader;
142 def pp_include_next_in_primary : Warning<
143 "#include_next in primary source file">;
144 def pp_include_macros_out_of_predefines : Error<
145 "the #__include_macros directive is only for internal use by -imacros">;
146 def pp_include_next_absolute_path : Warning<"#include_next with absolute path">;
147 def ext_c99_whitespace_required_after_macro_name : ExtWarn<
148 "ISO C99 requires whitespace after the macro name">;
149 def ext_missing_whitespace_after_macro_name : ExtWarn<
150 "whitespace required after macro name">;
151 def warn_missing_whitespace_after_macro_name : Warning<
152 "whitespace recommended after macro name">;
154 def pp_pragma_once_in_main_file : Warning<"#pragma once in main file">;
155 def pp_pragma_sysheader_in_main_file : Warning<
156 "#pragma system_header ignored in main file">;
157 def pp_poisoning_existing_macro : Warning<"poisoning existing macro">;
158 def pp_out_of_date_dependency : Warning<
159 "current file is older than dependency %0">;
160 def pp_undef_builtin_macro : Warning<"undefining builtin macro">;
161 def pp_redef_builtin_macro : Warning<"redefining builtin macro">,
162 InGroup<DiagGroup<"builtin-macro-redefined">>;
163 def pp_macro_not_used : Warning<"macro is not used">, DefaultIgnore,
164 InGroup<DiagGroup<"unused-macros">>;
165 def warn_pp_undef_identifier : Warning<
166 "%0 is not defined, evaluates to 0">,
167 InGroup<DiagGroup<"undef">>, DefaultIgnore;
169 def pp_invalid_string_literal : Warning<
170 "invalid string literal, ignoring final '\\'">;
171 def warn_pp_expr_overflow : Warning<
172 "integer overflow in preprocessor expression">;
173 def warn_pp_convert_lhs_to_positive : Warning<
174 "left side of operator converted from negative value to unsigned: %0">;
175 def warn_pp_convert_rhs_to_positive : Warning<
176 "right side of operator converted from negative value to unsigned: %0">;
178 def ext_pp_import_directive : Extension<"#import is a language extension">;
179 def ext_pp_ident_directive : Extension<"#ident is a language extension">;
180 def ext_pp_include_next_directive : Extension<
181 "#include_next is a language extension">;
182 def ext_pp_warning_directive : Extension<"#warning is a language extension">;
184 def ext_pp_extra_tokens_at_eol : ExtWarn<
185 "extra tokens at end of #%0 directive">, InGroup<ExtraTokens>;
187 def ext_pp_comma_expr : Extension<"comma operator in operand of #if">;
188 def ext_pp_bad_vaargs_use : Extension<
189 "__VA_ARGS__ can only appear in the expansion of a C99 variadic macro">;
190 def ext_pp_macro_redef : ExtWarn<"%0 macro redefined">;
191 def ext_variadic_macro : Extension<"variadic macros were introduced in C99">,
192 InGroup<VariadicMacros>;
193 def warn_cxx98_compat_variadic_macro : Warning<
194 "variadic macros are incompatible with C++98">,
195 InGroup<CXX98CompatPedantic>, DefaultIgnore;
196 def ext_named_variadic_macro : Extension<
197 "named variadic macros are a GNU extension">, InGroup<VariadicMacros>;
198 def ext_embedded_directive : Extension<
199 "embedding a directive within macro arguments is not portable">;
200 def ext_missing_varargs_arg : Extension<
201 "varargs argument missing, but tolerated as an extension">;
202 def ext_empty_fnmacro_arg : Extension<
203 "empty macro arguments were standardized in C99">;
204 def warn_cxx98_compat_empty_fnmacro_arg : Warning<
205 "empty macro argument list is incompatible with C++98">,
206 InGroup<CXX98CompatPedantic>, DefaultIgnore;
208 def err_pp_invalid_directive : Error<"invalid preprocessing directive">;
209 def err_pp_hash_error : Error<"#error%0">;
210 def err_pp_file_not_found : Error<"'%0' file not found">, DefaultFatal;
211 def err_pp_error_opening_file : Error<
212 "error opening file '%0': %1">, DefaultFatal;
213 def err_pp_empty_filename : Error<"empty filename">;
214 def err_pp_include_too_deep : Error<"#include nested too deeply">;
215 def err_pp_expects_filename : Error<"expected \"FILENAME\" or <FILENAME>">;
216 def err_pp_macro_not_identifier : Error<"macro names must be identifiers">;
217 def err_pp_missing_macro_name : Error<"macro name missing">;
218 def err_pp_missing_rparen_in_macro_def : Error<
219 "missing ')' in macro parameter list">;
220 def err_pp_invalid_tok_in_arg_list : Error<
221 "invalid token in macro parameter list">;
222 def err_pp_expected_ident_in_arg_list : Error<
223 "expected identifier in macro parameter list">;
224 def err_pp_expected_comma_in_arg_list : Error<
225 "expected comma in macro parameter list">;
226 def err_pp_duplicate_name_in_arg_list : Error<
227 "duplicate macro parameter name %0">;
228 def err_pp_stringize_not_parameter : Error<
229 "'#' is not followed by a macro parameter">;
230 def err_pp_malformed_ident : Error<"invalid #ident directive">;
231 def err_pp_unterminated_conditional : Error<
232 "unterminated conditional directive">;
233 def pp_err_else_after_else : Error<"#else after #else">;
234 def pp_err_elif_after_else : Error<"#elif after #else">;
235 def pp_err_else_without_if : Error<"#else without #if">;
236 def pp_err_elif_without_if : Error<"#elif without #if">;
237 def err_pp_endif_without_if : Error<"#endif without #if">;
238 def err_pp_expected_value_in_expr : Error<"expected value in expression">;
239 def err_pp_missing_val_before_operator : Error<"missing value before operator">;
240 def err_pp_expected_rparen : Error<"expected ')' in preprocessor expression">;
241 def err_pp_expected_eol : Error<
242 "expected end of line in preprocessor expression">;
243 def err_pp_defined_requires_identifier : Error<
244 "operator 'defined' requires an identifier">;
245 def err_pp_missing_lparen : Error<"missing '(' after '%0'">;
246 def err_pp_missing_rparen : Error<"missing ')' after '%0'">;
247 def err_pp_colon_without_question : Error<"':' without preceding '?'">;
248 def err_pp_division_by_zero : Error<
249 "division by zero in preprocessor expression">;
250 def err_pp_remainder_by_zero : Error<
251 "remainder by zero in preprocessor expression">;
252 def err_pp_expr_bad_token_binop : Error<
253 "token is not a valid binary operator in a preprocessor subexpression">;
254 def err_pp_expr_bad_token_start_expr : Error<
255 "invalid token at start of a preprocessor expression">;
256 def err_pp_invalid_poison : Error<"can only poison identifier tokens">;
257 def err_pp_used_poisoned_id : Error<"attempt to use a poisoned identifier">;
259 def err_feature_check_malformed : Error<
260 "builtin feature check macro requires a parenthesized identifier">;
262 def err_warning_check_malformed : Error<
263 "builtin warning check macro requires a parenthesized string">,
264 InGroup<MalformedWarningCheck>;
265 def warn_has_warning_invalid_option :
266 ExtWarn<"__has_warning expected option name (e.g. \"-Wundef\")">,
267 InGroup<MalformedWarningCheck>;
269 def err__Pragma_malformed : Error<
270 "_Pragma takes a parenthesized string literal">;
271 def err_pragma_comment_malformed : Error<
272 "pragma comment requires parenthesized identifier and optional string">;
273 def err_pragma_message_malformed : Error<
274 "pragma message requires parenthesized string">;
275 def err_pragma_push_pop_macro_malformed : Error<
276 "pragma %0 requires a parenthesized string">;
277 def warn_pragma_pop_macro_no_push : Warning<
278 "pragma pop_macro could not pop '%0', no matching push_macro">;
279 def warn_pragma_message : Warning<"%0">,
280 InGroup<PoundPragmaMessage>, DefaultWarnNoWerror;
281 def warn_pragma_ignored : Warning<"unknown pragma ignored">,
282 InGroup<UnknownPragmas>, DefaultIgnore;
283 def ext_stdc_pragma_ignored : ExtWarn<"unknown pragma in STDC namespace">,
284 InGroup<UnknownPragmas>;
285 def ext_on_off_switch_syntax :
286 ExtWarn<"expected 'ON' or 'OFF' or 'DEFAULT' in pragma">,
287 InGroup<UnknownPragmas>;
288 def ext_pragma_syntax_eod :
289 ExtWarn<"expected end of directive in pragma">,
290 InGroup<UnknownPragmas>;
291 def warn_stdc_fenv_access_not_supported :
292 Warning<"pragma STDC FENV_ACCESS ON is not supported, ignoring pragma">,
293 InGroup<UnknownPragmas>;
294 def warn_pragma_diagnostic_invalid :
295 ExtWarn<"pragma diagnostic expected 'error', 'warning', 'ignored', 'fatal',"
296 " 'push', or 'pop'">,
297 InGroup<UnknownPragmas>;
298 def warn_pragma_diagnostic_cannot_pop :
299 ExtWarn<"pragma diagnostic pop could not pop, no matching push">,
300 InGroup<UnknownPragmas>;
301 def warn_pragma_diagnostic_invalid_option :
302 ExtWarn<"pragma diagnostic expected option name (e.g. \"-Wundef\")">,
303 InGroup<UnknownPragmas>;
304 def warn_pragma_diagnostic_invalid_token :
305 ExtWarn<"unexpected token in pragma diagnostic">,
306 InGroup<UnknownPragmas>;
307 def warn_pragma_diagnostic_unknown_warning :
308 ExtWarn<"unknown warning group '%0', ignored">,
309 InGroup<UnknownPragmas>;
311 def warn_pragma_debug_unexpected_command : Warning<
312 "unexpected debug command '%0'">;
314 def err_pragma_comment_unknown_kind : Error<"unknown kind of pragma comment">;
315 def err_defined_macro_name : Error<"'defined' cannot be used as a macro name">;
316 def err_paste_at_start : Error<
317 "'##' cannot appear at start of macro expansion">;
318 def err_paste_at_end : Error<"'##' cannot appear at end of macro expansion">;
319 def ext_paste_comma : Extension<
320 "Use of comma pasting extension is non-portable">;
321 def err_unterm_macro_invoc : Error<
322 "unterminated function-like macro invocation">;
323 def err_too_many_args_in_macro_invoc : Error<
324 "too many arguments provided to function-like macro invocation">;
325 def err_too_few_args_in_macro_invoc : Error<
326 "too few arguments provided to function-like macro invocation">;
327 def err_pp_bad_paste : Error<
328 "pasting formed '%0', an invalid preprocessing token">;
329 def err_pp_bad_paste_ms : Warning<
330 "pasting formed '%0', an invalid preprocessing token">, DefaultError,
331 InGroup<DiagGroup<"invalid-token-paste">>;
332 def err_pp_operator_used_as_macro_name : Error<
333 "C++ operator '%0' cannot be used as a macro name">;
334 def err_pp_illegal_floating_literal : Error<
335 "floating point literal in preprocessor expression">;
336 def err_pp_line_requires_integer : Error<
337 "#line directive requires a positive integer argument">;
338 def err_pp_line_invalid_filename : Error<
339 "invalid filename for #line directive">;
340 def warn_pp_line_decimal : Warning<
341 "#line directive interprets number as decimal, not octal">;
342 def err_pp_line_digit_sequence : Error<
343 "#line directive requires a simple digit sequence">;
344 def err_pp_linemarker_requires_integer : Error<
345 "line marker directive requires a positive integer argument">;
346 def err_pp_linemarker_invalid_filename : Error<
347 "invalid filename for line marker directive">;
348 def err_pp_linemarker_invalid_flag : Error<
349 "invalid flag line marker directive">;
350 def err_pp_linemarker_invalid_pop : Error<
351 "invalid line marker flag '2': cannot pop empty include stack">;
352 def ext_pp_line_too_big : Extension<
353 "C requires #line number to be less than %0, allowed as extension">;
354 def warn_cxx98_compat_pp_line_too_big : Warning<
355 "#line number greater than 32767 is incompatible with C++98">,
356 InGroup<CXX98CompatPedantic>, DefaultIgnore;
358 def err_pp_export_non_macro : Error<"no macro named %0 to export">;
360 def err_pp_arc_cf_code_audited_syntax : Error<"expected 'begin' or 'end'">;
361 def err_pp_double_begin_of_arc_cf_code_audited : Error<
362 "already inside '#pragma clang arc_cf_code_audited'">;
363 def err_pp_unmatched_end_of_arc_cf_code_audited : Error<
364 "not currently inside '#pragma clang arc_cf_code_audited'">;
365 def err_pp_include_in_arc_cf_code_audited : Error<
366 "cannot #include files inside '#pragma clang arc_cf_code_audited'">;
367 def err_pp_eof_in_arc_cf_code_audited : Error<
368 "'#pragma clang arc_cf_code_audited' was not ended within this file">;