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_char_or_string : Warning<
17 "null character(s) preserved in %select{char|string}0 literal">,
18 InGroup<NullCharacter>;
19 def null_in_file : Warning<"null character ignored">, InGroup<NullCharacter>;
20 def warn_nested_block_comment : Warning<"'/*' within block comment">,
22 def escaped_newline_block_comment_end : Warning<
23 "escaped newline between */ characters at block comment end">,
25 def backslash_newline_space : Warning<
26 "backslash and newline separated by space">,
27 InGroup<DiagGroup<"backslash-newline-escape">>;
30 def warn_cxx98_compat_less_colon_colon : Warning<
31 "'<::' is treated as digraph '<:' (aka '[') followed by ':' in C++98">,
32 InGroup<CXX98Compat>, DefaultIgnore;
35 def trigraph_ignored : Warning<"trigraph ignored">, InGroup<Trigraphs>;
36 def trigraph_ignored_block_comment : Warning<
37 "ignored trigraph would end block comment">, InGroup<Trigraphs>;
38 def trigraph_ends_block_comment : Warning<"trigraph ends block comment">,
40 def trigraph_converted : Warning<"trigraph converted to '%0' character">,
43 def ext_multi_line_line_comment : Extension<"multi-line // comment">,
45 def ext_line_comment : Extension<
46 "// comments are not allowed in this language">,
48 def ext_no_newline_eof : Extension<"no newline at end of file">,
50 def warn_no_newline_eof : Warning<"no newline at end of file">,
51 InGroup<NewlineEOF>, DefaultIgnore;
53 def warn_cxx98_compat_no_newline_eof : Warning<
54 "C++98 requires newline at end of file">,
55 InGroup<CXX98CompatPedantic>, DefaultIgnore;
57 def ext_dollar_in_identifier : Extension<"'$' in identifier">,
58 InGroup<DiagGroup<"dollar-in-identifier-extension">>;
59 def ext_charize_microsoft : Extension<
60 "charizing operator #@ is a Microsoft extension">,
61 InGroup<MicrosoftCharize>;
62 def ext_comment_paste_microsoft : Extension<
63 "pasting two '/' tokens into a '//' comment is a Microsoft extension">,
64 InGroup<MicrosoftCommentPaste>;
65 def ext_ctrl_z_eof_microsoft : Extension<
66 "treating Ctrl-Z as end-of-file is a Microsoft extension">,
67 InGroup<MicrosoftEndOfFile>;
69 def ext_token_used : Extension<"extension used">,
70 InGroup<DiagGroup<"language-extension-token">>;
72 def warn_cxx11_keyword : Warning<"'%0' is a keyword in C++11">,
73 InGroup<CXX11Compat>, DefaultIgnore;
75 def ext_unterminated_char_or_string : ExtWarn<
76 "missing terminating %select{'|'\"'}0 character">, InGroup<InvalidPPToken>;
77 def ext_empty_character : ExtWarn<"empty character constant">,
78 InGroup<InvalidPPToken>;
79 def err_unterminated_block_comment : Error<"unterminated /* comment">;
80 def err_invalid_character_to_charify : Error<
81 "invalid argument to convert to character">;
82 def err_unterminated___pragma : Error<"missing terminating ')' character">;
84 def err_conflict_marker : Error<"version control conflict marker in file">;
86 def err_raw_delim_too_long : Error<
87 "raw string delimiter longer than 16 characters"
88 "; use PREFIX( )PREFIX to delimit raw string">;
89 def err_invalid_char_raw_delim : Error<
90 "invalid character '%0' character in raw string delimiter"
91 "; use PREFIX( )PREFIX to delimit raw string">;
92 def err_unterminated_raw_string : Error<
93 "raw string missing terminating delimiter )%0\"">;
94 def warn_cxx98_compat_raw_string_literal : Warning<
95 "raw string literals are incompatible with C++98">,
96 InGroup<CXX98Compat>, DefaultIgnore;
98 def ext_multichar_character_literal : ExtWarn<
99 "multi-character character constant">, InGroup<MultiChar>;
100 def ext_four_char_character_literal : Extension<
101 "multi-character character constant">, InGroup<FourByteMultiChar>;
105 def err_invalid_utf8 : Error<
106 "source file is not valid UTF-8">;
107 def err_non_ascii : Error<
108 "non-ASCII characters are not allowed outside of literals and identifiers">;
109 def ext_unicode_whitespace : ExtWarn<
110 "treating Unicode character as whitespace">,
111 InGroup<DiagGroup<"unicode-whitespace">>;
113 def err_hex_escape_no_digits : Error<
114 "\\%0 used with no following hex digits">;
115 def warn_ucn_escape_no_digits : Warning<
116 "\\%0 used with no following hex digits; "
117 "treating as '\\' followed by identifier">, InGroup<Unicode>;
118 def err_ucn_escape_incomplete : Error<
119 "incomplete universal character name">;
120 def warn_ucn_escape_incomplete : Warning<
121 "incomplete universal character name; "
122 "treating as '\\' followed by identifier">, InGroup<Unicode>;
123 def note_ucn_four_not_eight : Note<"did you mean to use '\\u'?">;
125 def err_ucn_escape_basic_scs : Error<
126 "character '%0' cannot be specified by a universal character name">;
127 def err_ucn_control_character : Error<
128 "universal character name refers to a control character">;
129 def err_ucn_escape_invalid : Error<"invalid universal character">;
130 def warn_ucn_escape_surrogate : Warning<
131 "universal character name refers to a surrogate character">,
134 def warn_c99_compat_unicode_id : Warning<
135 "%select{using this character in an identifier|starting an identifier with "
136 "this character}0 is incompatible with C99">,
137 InGroup<C99Compat>, DefaultIgnore;
138 def warn_cxx98_compat_unicode_id : Warning<
139 "using this character in an identifier is incompatible with C++98">,
140 InGroup<CXX98Compat>, DefaultIgnore;
142 def warn_cxx98_compat_literal_ucn_escape_basic_scs : Warning<
143 "specifying character '%0' with a universal character name "
144 "is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
145 def warn_cxx98_compat_literal_ucn_control_character : Warning<
146 "universal character name referring to a control character "
147 "is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
148 def warn_ucn_not_valid_in_c89 : Warning<
149 "universal character names are only valid in C99 or C++; "
150 "treating as '\\' followed by identifier">, InGroup<Unicode>;
151 def warn_ucn_not_valid_in_c89_literal : ExtWarn<
152 "universal character names are only valid in C99 or C++">, InGroup<Unicode>;
156 def ext_nonstandard_escape : Extension<
157 "use of non-standard escape character '\\%0'">;
158 def ext_unknown_escape : ExtWarn<"unknown escape sequence '\\%0'">,
159 InGroup<DiagGroup<"unknown-escape-sequence">>;
160 def err_invalid_digit : Error<
161 "invalid digit '%0' in %select{decimal|octal|binary}1 constant">;
162 def err_invalid_suffix_constant : Error<
163 "invalid suffix '%0' on %select{integer|floating}1 constant">;
164 def warn_cxx11_compat_digit_separator : Warning<
165 "digit separators are incompatible with C++ standards before C++14">,
166 InGroup<CXXPre14Compat>, DefaultIgnore;
167 def err_digit_separator_not_between_digits : Error<
168 "digit separator cannot appear at %select{start|end}0 of digit sequence">;
169 def warn_extraneous_char_constant : Warning<
170 "extraneous characters in character constant ignored">;
171 def warn_char_constant_too_large : Warning<
172 "character constant too long for its type">;
173 def err_multichar_utf_character_literal : Error<
174 "Unicode character literals may not contain multiple characters">;
175 def err_exponent_has_no_digits : Error<"exponent has no digits">;
176 def ext_imaginary_constant : Extension<
177 "imaginary constants are a GNU extension">, InGroup<GNUImaginaryConstant>;
178 def err_hex_constant_requires : Error<
179 "hexadecimal floating %select{constant|literal}0 requires "
180 "%select{an exponent|a significand}1">;
181 def ext_hex_constant_invalid : Extension<
182 "hexadecimal floating constants are a C99 feature">, InGroup<C99>;
183 def ext_hex_literal_invalid : Extension<
184 "hexadecimal floating literals are a C++1z feature">, InGroup<CXX1z>;
185 def warn_cxx1z_hex_literal : Warning<
186 "hexadecimal floating literals are incompatible with "
187 "C++ standards before C++1z">,
188 InGroup<CXXPre1zCompatPedantic>, DefaultIgnore;
189 def ext_binary_literal : Extension<
190 "binary integer literals are a GNU extension">, InGroup<GNUBinaryLiteral>;
191 def ext_binary_literal_cxx14 : Extension<
192 "binary integer literals are a C++14 extension">, InGroup<CXX14BinaryLiteral>;
193 def warn_cxx11_compat_binary_literal : Warning<
194 "binary integer literals are incompatible with C++ standards before C++14">,
195 InGroup<CXXPre14CompatPedantic>, DefaultIgnore;
196 def err_pascal_string_too_long : Error<"Pascal string is too long">;
197 def err_escape_too_large : Error<
198 "%select{hex|octal}0 escape sequence out of range">;
199 def ext_string_too_long : Extension<"string literal of length %0 exceeds "
200 "maximum length %1 that %select{C90|ISO C99|C++}2 compilers are required to "
201 "support">, InGroup<OverlengthStrings>;
202 def err_character_too_large : Error<
203 "character too large for enclosing character literal type">;
204 def warn_c99_compat_unicode_literal : Warning<
205 "unicode literals are incompatible with C99">,
206 InGroup<C99Compat>, DefaultIgnore;
207 def warn_cxx98_compat_unicode_literal : Warning<
208 "unicode literals are incompatible with C++98">,
209 InGroup<CXX98Compat>, DefaultIgnore;
210 def warn_cxx14_compat_u8_character_literal : Warning<
211 "unicode literals are incompatible with C++ standards before C++1z">,
212 InGroup<CXXPre1zCompat>, DefaultIgnore;
213 def warn_cxx11_compat_user_defined_literal : Warning<
214 "identifier after literal will be treated as a user-defined literal suffix "
215 "in C++11">, InGroup<CXX11Compat>, DefaultIgnore;
216 def warn_cxx11_compat_reserved_user_defined_literal : Warning<
217 "identifier after literal will be treated as a reserved user-defined literal "
219 InGroup<CXX11CompatReservedUserDefinedLiteral>, DefaultIgnore;
220 def ext_reserved_user_defined_literal : ExtWarn<
221 "invalid suffix on literal; C++11 requires a space between literal and "
222 "identifier">, InGroup<ReservedUserDefinedLiteral>, DefaultError;
223 def ext_ms_reserved_user_defined_literal : ExtWarn<
224 "invalid suffix on literal; C++11 requires a space between literal and "
225 "identifier">, InGroup<ReservedUserDefinedLiteral>;
226 def err_unsupported_string_concat : Error<
227 "unsupported non-standard concatenation of string literals">;
228 def err_string_concat_mixed_suffix : Error<
229 "differing user-defined suffixes ('%0' and '%1') in string literal "
231 def err_pp_invalid_udl : Error<
232 "%select{character|integer}0 literal with user-defined suffix "
233 "cannot be used in preprocessor constant expression">;
234 def err_bad_string_encoding : Error<
235 "illegal character encoding in string literal">;
236 def warn_bad_string_encoding : ExtWarn<
237 "illegal character encoding in string literal">,
238 InGroup<InvalidSourceEncoding>;
239 def err_bad_character_encoding : Error<
240 "illegal character encoding in character literal">;
241 def warn_bad_character_encoding : ExtWarn<
242 "illegal character encoding in character literal">,
243 InGroup<InvalidSourceEncoding>;
244 def err_lexing_string : Error<"failure when lexing a string">;
247 //===----------------------------------------------------------------------===//
249 //===----------------------------------------------------------------------===//
250 def err_invalid_pth_file : Error<
251 "invalid or corrupt PTH file '%0'">;
253 //===----------------------------------------------------------------------===//
254 // Preprocessor Diagnostics
255 //===----------------------------------------------------------------------===//
257 let CategoryName = "User-Defined Issue" in {
258 def pp_hash_warning : Warning<"%0">,
259 InGroup<PoundWarning>, ShowInSystemHeader;
260 def err_pp_hash_error : Error<"%0">;
263 def pp_include_next_in_primary : Warning<
264 "#include_next in primary source file">,
265 InGroup<DiagGroup<"include-next-outside-header">>;
266 def pp_include_macros_out_of_predefines : Error<
267 "the #__include_macros directive is only for internal use by -imacros">;
268 def pp_include_next_absolute_path : Warning<
269 "#include_next with absolute 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">;
278 class NonportablePath : Warning<
279 "non-portable path to file '%0'; specified path differs in case from file"
281 def pp_nonportable_path : NonportablePath,
282 InGroup<DiagGroup<"nonportable-include-path">>;
283 def pp_nonportable_system_path : NonportablePath, DefaultIgnore,
284 InGroup<DiagGroup<"nonportable-system-include-path">>;
286 def pp_pragma_once_in_main_file : Warning<"#pragma once in main file">,
287 InGroup<DiagGroup<"pragma-once-outside-header">>;
288 def pp_pragma_sysheader_in_main_file : Warning<
289 "#pragma system_header ignored in main file">,
290 InGroup<DiagGroup<"pragma-system-header-outside-header">>;
291 def pp_poisoning_existing_macro : Warning<"poisoning existing macro">;
292 def pp_out_of_date_dependency : Warning<
293 "current file is older than dependency %0">;
294 def ext_pp_undef_builtin_macro : ExtWarn<"undefining builtin macro">,
295 InGroup<BuiltinMacroRedefined>;
296 def ext_pp_redef_builtin_macro : ExtWarn<"redefining builtin macro">,
297 InGroup<BuiltinMacroRedefined>;
298 def pp_disabled_macro_expansion : Warning<
299 "disabled expansion of recursive macro">, DefaultIgnore,
300 InGroup<DiagGroup<"disabled-macro-expansion">>;
301 def pp_macro_not_used : Warning<"macro is not used">, DefaultIgnore,
302 InGroup<DiagGroup<"unused-macros">>;
303 def warn_pp_undef_identifier : Warning<
304 "%0 is not defined, evaluates to 0">,
305 InGroup<DiagGroup<"undef">>, DefaultIgnore;
306 def warn_pp_ambiguous_macro : Warning<
307 "ambiguous expansion of macro %0">, InGroup<AmbiguousMacro>;
308 def note_pp_ambiguous_macro_chosen : Note<
309 "expanding this definition of %0">;
310 def note_pp_ambiguous_macro_other : Note<
311 "other definition of %0">;
312 def warn_pp_macro_hides_keyword : Extension<
313 "keyword is hidden by macro definition">, InGroup<KeywordAsMacro>;
314 def warn_pp_macro_is_reserved_id : Warning<
315 "macro name is a reserved identifier">, DefaultIgnore,
316 InGroup<ReservedIdAsMacro>;
317 def warn_pp_objc_macro_redef_ignored : Warning<
318 "ignoring redefinition of Objective-C qualifier macro">,
319 InGroup<DiagGroup<"objc-macro-redefinition">>;
321 def pp_invalid_string_literal : Warning<
322 "invalid string literal, ignoring final '\\'">;
323 def warn_pp_expr_overflow : Warning<
324 "integer overflow in preprocessor expression">;
325 def warn_pp_convert_to_positive : Warning<
326 "%select{left|right}0 side of operator converted from negative value to "
329 def ext_pp_import_directive : Extension<"#import is a language extension">,
330 InGroup<DiagGroup<"import-preprocessor-directive-pedantic">>;
331 def err_pp_import_directive_ms : Error<
332 "#import of type library is an unsupported Microsoft feature">;
333 def ext_pp_include_search_ms : ExtWarn<
334 "#include resolved using non-portable Microsoft search rules as: %0">,
335 InGroup<MicrosoftInclude>;
337 def ext_pp_ident_directive : Extension<"#ident is a language extension">;
338 def ext_pp_include_next_directive : Extension<
339 "#include_next is a language extension">, InGroup<GNUIncludeNext>;
340 def ext_pp_warning_directive : Extension<"#warning is a language extension">;
342 def ext_pp_extra_tokens_at_eol : ExtWarn<
343 "extra tokens at end of #%0 directive">, InGroup<ExtraTokens>;
345 def ext_pp_comma_expr : Extension<"comma operator in operand of #if">;
346 def ext_pp_bad_vaargs_use : Extension<
347 "__VA_ARGS__ can only appear in the expansion of a C99 variadic macro">;
348 def ext_pp_macro_redef : ExtWarn<"%0 macro redefined">, InGroup<MacroRedefined>;
349 def ext_variadic_macro : Extension<"variadic macros are a C99 feature">,
350 InGroup<VariadicMacros>;
351 def warn_cxx98_compat_variadic_macro : Warning<
352 "variadic macros are incompatible with C++98">,
353 InGroup<CXX98CompatPedantic>, DefaultIgnore;
354 def ext_named_variadic_macro : Extension<
355 "named variadic macros are a GNU extension">, InGroup<VariadicMacros>;
356 def err_embedded_directive : Error<
357 "embedding a #%0 directive within macro arguments is not supported">;
358 def ext_embedded_directive : Extension<
359 "embedding a directive within macro arguments has undefined behavior">,
360 InGroup<DiagGroup<"embedded-directive">>;
361 def ext_missing_varargs_arg : Extension<
362 "must specify at least one argument for '...' parameter of variadic macro">,
363 InGroup<GNUZeroVariadicMacroArguments>;
364 def ext_empty_fnmacro_arg : Extension<
365 "empty macro arguments are a C99 feature">, InGroup<C99>;
366 def warn_cxx98_compat_empty_fnmacro_arg : Warning<
367 "empty macro arguments are incompatible with C++98">,
368 InGroup<CXX98CompatPedantic>, DefaultIgnore;
369 def note_macro_here : Note<"macro %0 defined here">;
371 def err_pp_opencl_variadic_macros :
372 Error<"variadic macros not supported in OpenCL">;
374 def err_pp_invalid_directive : Error<"invalid preprocessing directive">;
375 def err_pp_directive_required : Error<
376 "%0 must be used within a preprocessing directive">;
377 def err_pp_file_not_found : Error<"'%0' file not found">, DefaultFatal;
378 def err_pp_file_not_found_not_fatal : Error<
379 "'%0' file not found with <angled> include; use \"quotes\" instead">;
380 def err_pp_error_opening_file : Error<
381 "error opening file '%0': %1">, DefaultFatal;
382 def err_pp_empty_filename : Error<"empty filename">;
383 def err_pp_include_too_deep : Error<"#include nested too deeply">;
384 def err_pp_expects_filename : Error<"expected \"FILENAME\" or <FILENAME>">;
385 def err_pp_macro_not_identifier : Error<"macro name must be an identifier">;
386 def err_pp_missing_macro_name : Error<"macro name missing">;
387 def err_pp_missing_rparen_in_macro_def : Error<
388 "missing ')' in macro parameter list">;
389 def err_pp_invalid_tok_in_arg_list : Error<
390 "invalid token in macro parameter list">;
391 def err_pp_expected_ident_in_arg_list : Error<
392 "expected identifier in macro parameter list">;
393 def err_pp_expected_comma_in_arg_list : Error<
394 "expected comma in macro parameter list">;
395 def err_pp_duplicate_name_in_arg_list : Error<
396 "duplicate macro parameter name %0">;
397 def err_pp_stringize_not_parameter : Error<
398 "'%select{#|#@}0' is not followed by a macro parameter">;
399 def err_pp_malformed_ident : Error<"invalid #ident directive">;
400 def err_pp_unterminated_conditional : Error<
401 "unterminated conditional directive">;
402 def pp_err_else_after_else : Error<"#else after #else">;
403 def pp_err_elif_after_else : Error<"#elif after #else">;
404 def pp_err_else_without_if : Error<"#else without #if">;
405 def pp_err_elif_without_if : Error<"#elif without #if">;
406 def err_pp_endif_without_if : Error<"#endif without #if">;
407 def err_pp_expected_value_in_expr : Error<"expected value in expression">;
408 def err_pp_expected_rparen : Error<"expected ')' in preprocessor expression">;
409 def err_pp_expected_eol : Error<
410 "expected end of line in preprocessor expression">;
411 def err_pp_expected_after : Error<"missing %1 after %0">;
412 def err_pp_nested_paren : Error<"nested parentheses not permitted in %0">;
413 def err_pp_colon_without_question : Error<"':' without preceding '?'">;
414 def err_pp_division_by_zero : Error<
415 "division by zero in preprocessor expression">;
416 def err_pp_remainder_by_zero : Error<
417 "remainder by zero in preprocessor expression">;
418 def err_pp_expr_bad_token_binop : Error<
419 "token is not a valid binary operator in a preprocessor subexpression">;
420 def err_pp_expr_bad_token_lparen : Error<
421 "function-like macro %0 is not defined">;
422 def err_pp_expr_bad_token_start_expr : Error<
423 "invalid token at start of a preprocessor expression">;
424 def err_pp_invalid_poison : Error<"can only poison identifier tokens">;
425 def err_pp_used_poisoned_id : Error<"attempt to use a poisoned identifier">;
427 def err_feature_check_malformed : Error<
428 "builtin feature check macro requires a parenthesized identifier">;
430 def warn_has_warning_invalid_option :
431 ExtWarn<"__has_warning expected option name (e.g. \"-Wundef\")">,
432 InGroup<MalformedWarningCheck>;
434 def err_pp_identifier_arg_not_identifier : Error<
435 "cannot convert %0 token to an identifier">;
437 def warn_pragma_include_alias_mismatch_angle :
438 ExtWarn<"angle-bracketed include <%0> cannot be aliased to double-quoted "
439 "include \"%1\"">, InGroup<UnknownPragmas>;
440 def warn_pragma_include_alias_mismatch_quote :
441 ExtWarn<"double-quoted include \"%0\" cannot be aliased to angle-bracketed "
442 "include <%1>">, InGroup<UnknownPragmas>;
443 def warn_pragma_include_alias_expected :
444 ExtWarn<"pragma include_alias expected '%0'">,
445 InGroup<UnknownPragmas>;
446 def warn_pragma_include_alias_expected_filename :
447 ExtWarn<"pragma include_alias expected include filename">,
448 InGroup<UnknownPragmas>;
450 // - #pragma warning(...)
451 def warn_pragma_warning_expected :
452 ExtWarn<"#pragma warning expected '%0'">,
453 InGroup<UnknownPragmas>;
454 def warn_pragma_warning_spec_invalid :
455 ExtWarn<"#pragma warning expected 'push', 'pop', 'default', 'disable',"
456 " 'error', 'once', 'suppress', 1, 2, 3, or 4">,
457 InGroup<UnknownPragmas>;
458 def warn_pragma_warning_push_level :
459 ExtWarn<"#pragma warning(push, level) requires a level between 0 and 4">,
460 InGroup<UnknownPragmas>;
461 def warn_pragma_warning_expected_number :
462 ExtWarn<"#pragma warning expected a warning number">,
463 InGroup<UnknownPragmas>;
465 def err__Pragma_malformed : Error<
466 "_Pragma takes a parenthesized string literal">;
467 def err_pragma_message_malformed : Error<
468 "pragma %select{message|warning|error}0 requires parenthesized string">;
469 def err_pragma_push_pop_macro_malformed : Error<
470 "pragma %0 requires a parenthesized string">;
471 def warn_pragma_pop_macro_no_push : Warning<
472 "pragma pop_macro could not pop '%0', no matching push_macro">,
473 InGroup<IgnoredPragmas>;
474 def warn_pragma_message : Warning<"%0">,
475 InGroup<PoundPragmaMessage>, DefaultWarnNoWerror;
476 def err_pragma_message : Error<"%0">;
477 def warn_pragma_ignored : Warning<"unknown pragma ignored">,
478 InGroup<UnknownPragmas>, DefaultIgnore;
479 def ext_stdc_pragma_ignored : ExtWarn<"unknown pragma in STDC namespace">,
480 InGroup<UnknownPragmas>;
481 def ext_on_off_switch_syntax :
482 ExtWarn<"expected 'ON' or 'OFF' or 'DEFAULT' in pragma">,
483 InGroup<UnknownPragmas>;
484 def ext_pragma_syntax_eod :
485 ExtWarn<"expected end of directive in pragma">,
486 InGroup<UnknownPragmas>;
487 def warn_stdc_fenv_access_not_supported :
488 Warning<"pragma STDC FENV_ACCESS ON is not supported, ignoring pragma">,
489 InGroup<UnknownPragmas>;
490 def warn_pragma_diagnostic_invalid :
491 ExtWarn<"pragma diagnostic expected 'error', 'warning', 'ignored', 'fatal',"
492 " 'push', or 'pop'">,
493 InGroup<UnknownPragmas>;
494 def warn_pragma_diagnostic_cannot_pop :
495 ExtWarn<"pragma diagnostic pop could not pop, no matching push">,
496 InGroup<UnknownPragmas>;
497 def warn_pragma_diagnostic_invalid_option :
498 ExtWarn<"pragma diagnostic expected option name (e.g. \"-Wundef\")">,
499 InGroup<UnknownPragmas>;
500 def warn_pragma_diagnostic_invalid_token :
501 ExtWarn<"unexpected token in pragma diagnostic">,
502 InGroup<UnknownPragmas>;
503 def warn_pragma_diagnostic_unknown_warning :
504 ExtWarn<"unknown warning group '%0', ignored">,
505 InGroup<UnknownPragmas>;
507 def warn_pragma_debug_unexpected_command : Warning<
508 "unexpected debug command '%0'">, InGroup<IgnoredPragmas>;
509 def warn_pragma_debug_missing_argument : Warning<
510 "missing argument to debug command '%0'">, InGroup<IgnoredPragmas>;
512 def err_defined_macro_name : Error<"'defined' cannot be used as a macro name">;
513 def err_paste_at_start : Error<
514 "'##' cannot appear at start of macro expansion">;
515 def err_paste_at_end : Error<"'##' cannot appear at end of macro expansion">;
516 def ext_paste_comma : Extension<
517 "token pasting of ',' and __VA_ARGS__ is a GNU extension">, InGroup<GNUZeroVariadicMacroArguments>;
518 def err_unterm_macro_invoc : Error<
519 "unterminated function-like macro invocation">;
520 def err_too_many_args_in_macro_invoc : Error<
521 "too many arguments provided to function-like macro invocation">;
522 def note_suggest_parens_for_macro : Note<
523 "parentheses are required around macro argument containing braced "
525 def note_init_list_at_beginning_of_macro_argument : Note<
526 "cannot use initializer list at the beginning of a macro argument">;
527 def err_too_few_args_in_macro_invoc : Error<
528 "too few arguments provided to function-like macro invocation">;
529 def err_pp_bad_paste : Error<
530 "pasting formed '%0', an invalid preprocessing token">;
531 def ext_pp_bad_paste_ms : ExtWarn<
532 "pasting formed '%0', an invalid preprocessing token">, DefaultError,
533 InGroup<DiagGroup<"invalid-token-paste">>;
534 def err_pp_operator_used_as_macro_name : Error<
535 "C++ operator %0 (aka %1) used as a macro name">;
536 def ext_pp_operator_used_as_macro_name : Extension<
537 err_pp_operator_used_as_macro_name.Text>, InGroup<MicrosoftCppMacro>;
538 def err_pp_illegal_floating_literal : Error<
539 "floating point literal in preprocessor expression">;
540 def err_pp_line_requires_integer : Error<
541 "#line directive requires a positive integer argument">;
542 def ext_pp_line_zero : Extension<
543 "#line directive with zero argument is a GNU extension">,
544 InGroup<GNUZeroLineDirective>;
545 def err_pp_line_invalid_filename : Error<
546 "invalid filename for #line directive">;
547 def warn_pp_line_decimal : Warning<
548 "%select{#line|GNU line marker}0 directive interprets number as decimal, not octal">;
549 def err_pp_line_digit_sequence : Error<
550 "%select{#line|GNU line marker}0 directive requires a simple digit sequence">;
551 def err_pp_linemarker_requires_integer : Error<
552 "line marker directive requires a positive integer argument">;
553 def err_pp_linemarker_invalid_filename : Error<
554 "invalid filename for line marker directive">;
555 def err_pp_linemarker_invalid_flag : Error<
556 "invalid flag line marker directive">;
557 def err_pp_linemarker_invalid_pop : Error<
558 "invalid line marker flag '2': cannot pop empty include stack">;
559 def ext_pp_line_too_big : Extension<
560 "C requires #line number to be less than %0, allowed as extension">;
561 def warn_cxx98_compat_pp_line_too_big : Warning<
562 "#line number greater than 32767 is incompatible with C++98">,
563 InGroup<CXX98CompatPedantic>, DefaultIgnore;
565 def err_pp_visibility_non_macro : Error<"no macro named %0">;
567 def err_pp_arc_cf_code_audited_syntax : Error<"expected 'begin' or 'end'">;
568 def err_pp_double_begin_of_arc_cf_code_audited : Error<
569 "already inside '#pragma clang arc_cf_code_audited'">;
570 def err_pp_unmatched_end_of_arc_cf_code_audited : Error<
571 "not currently inside '#pragma clang arc_cf_code_audited'">;
572 def err_pp_include_in_arc_cf_code_audited : Error<
573 "cannot #include files inside '#pragma clang arc_cf_code_audited'">;
574 def err_pp_eof_in_arc_cf_code_audited : Error<
575 "'#pragma clang arc_cf_code_audited' was not ended within this file">;
577 def warn_pp_date_time : Warning<
578 "expansion of date or time macro is not reproducible">,
579 ShowInSystemHeader, DefaultIgnore, InGroup<DiagGroup<"date-time">>;
581 // Module map parsing
582 def err_mmap_unknown_token : Error<"skipping stray token">;
583 def err_mmap_expected_module : Error<"expected module declaration">;
584 def err_mmap_expected_module_name : Error<"expected module name">;
585 def err_mmap_expected_lbrace : Error<"expected '{' to start module '%0'">;
586 def err_mmap_expected_rbrace : Error<"expected '}'">;
587 def note_mmap_lbrace_match : Note<"to match this '{'">;
588 def err_mmap_expected_rsquare : Error<"expected ']' to close attribute">;
589 def note_mmap_lsquare_match : Note<"to match this ']'">;
590 def err_mmap_expected_member : Error<
591 "expected umbrella, header, submodule, or module export">;
592 def err_mmap_expected_header : Error<"expected a header name after '%0'">;
593 def err_mmap_expected_mmap_file : Error<"expected a module map file name">;
594 def err_mmap_module_redefinition : Error<
595 "redefinition of module '%0'">;
596 def note_mmap_prev_definition : Note<"previously defined here">;
597 def err_mmap_umbrella_dir_not_found : Error<
598 "umbrella directory '%0' not found">;
599 def err_mmap_umbrella_clash : Error<
600 "umbrella for module '%0' already covers this directory">;
601 def err_mmap_module_id : Error<
602 "expected a module name or '*'">;
603 def err_mmap_expected_library_name : Error<
604 "expected %select{library|framework}0 name as a string">;
605 def err_mmap_config_macro_submodule : Error<
606 "configuration macros are only allowed in top-level modules">;
607 def err_mmap_use_decl_submodule : Error<
608 "use declarations are only allowed in top-level modules">;
609 def err_mmap_expected_config_macro : Error<
610 "expected configuration macro name after ','">;
611 def err_mmap_expected_conflicts_comma : Error<
612 "expected ',' after conflicting module name">;
613 def err_mmap_expected_conflicts_message : Error<
614 "expected a message describing the conflict with '%0'">;
615 def err_mmap_missing_module_unqualified : Error<
616 "no module named '%0' visible from '%1'">;
617 def err_mmap_missing_module_qualified : Error<
618 "no module named '%0' in '%1'">;
619 def err_mmap_top_level_inferred_submodule : Error<
620 "only submodules and framework modules may be inferred with wildcard syntax">;
621 def err_mmap_inferred_no_umbrella : Error<
622 "inferred submodules require a module with an umbrella">;
623 def err_mmap_inferred_framework_submodule : Error<
624 "inferred submodule cannot be a framework submodule">;
625 def err_mmap_explicit_inferred_framework : Error<
626 "inferred framework modules cannot be 'explicit'">;
627 def err_mmap_missing_exclude_name : Error<
628 "expected excluded module name">;
629 def err_mmap_inferred_redef : Error<
630 "redefinition of inferred submodule">;
631 def err_mmap_expected_lbrace_wildcard : Error<
632 "expected '{' to start inferred submodule">;
633 def err_mmap_expected_inferred_member : Error<
634 "expected %select{module exclusion with 'exclude'|'export *'}0">;
635 def err_mmap_expected_export_wildcard : Error<
636 "only '*' can be exported from an inferred submodule">;
637 def err_mmap_explicit_top_level : Error<
638 "'explicit' is not permitted on top-level modules">;
639 def err_mmap_nested_submodule_id : Error<
640 "qualified module name can only be used to define modules at the top level">;
641 def err_mmap_expected_feature : Error<"expected a feature name">;
642 def err_mmap_expected_attribute : Error<"expected an attribute name">;
643 def warn_mmap_unknown_attribute : Warning<"unknown attribute '%0'">,
644 InGroup<IgnoredAttributes>;
645 def warn_mmap_mismatched_top_level_private : Warning<
646 "top-level module '%0' in private module map, expected a submodule of '%1'">,
647 InGroup<PrivateModule>;
648 def note_mmap_rename_top_level_private_as_submodule : Note<
649 "make '%0' a submodule of '%1' to ensure it can be found by name">;
651 def warn_auto_module_import : Warning<
652 "treating #%select{include|import|include_next|__include_macros}0 as an "
653 "import of module '%1'">, InGroup<AutoImport>, DefaultIgnore;
654 def note_implicit_top_level_module_import_here : Note<
655 "submodule of top-level module '%0' implicitly imported here">;
656 def warn_uncovered_module_header : Warning<
657 "umbrella header for module '%0' does not include header '%1'">,
658 InGroup<IncompleteUmbrella>;
659 def err_expected_id_building_module : Error<
660 "expected a module name in '__building_module' expression">;
661 def warn_use_of_private_header_outside_module : Warning<
662 "use of private header from outside its module: '%0'">,
663 InGroup<DiagGroup<"private-header">>, DefaultError;
664 def err_undeclared_use_of_module : Error<
665 "module %0 does not depend on a module exporting '%1'">;
666 def warn_non_modular_include_in_framework_module : Warning<
667 "include of non-modular header inside framework module '%0': '%1'">,
668 InGroup<NonModularIncludeInFrameworkModule>, DefaultIgnore;
669 def warn_non_modular_include_in_module : Warning<
670 "include of non-modular header inside module '%0': '%1'">,
671 InGroup<NonModularIncludeInModule>, DefaultIgnore;
672 def warn_module_conflict : Warning<
673 "module '%0' conflicts with already-imported module '%1': %2">,
674 InGroup<ModuleConflict>;
676 def warn_header_guard : Warning<
677 "%0 is used as a header guard here, followed by #define of a different macro">,
678 InGroup<DiagGroup<"header-guard">>;
679 def note_header_guard : Note<
680 "%0 is defined here; did you mean %1?">;
682 def warn_defined_in_object_type_macro : Warning<
683 "macro expansion producing 'defined' has undefined behavior">,
684 InGroup<ExpansionToDefined>;
685 def warn_defined_in_function_type_macro : Extension<
686 "macro expansion producing 'defined' has undefined behavior">,
687 InGroup<ExpansionToDefined>;
689 let CategoryName = "Nullability Issue" in {
691 def err_pp_assume_nonnull_syntax : Error<"expected 'begin' or 'end'">;
692 def err_pp_double_begin_of_assume_nonnull : Error<
693 "already inside '#pragma clang assume_nonnull'">;
694 def err_pp_unmatched_end_of_assume_nonnull : Error<
695 "not currently inside '#pragma clang assume_nonnull'">;
696 def err_pp_include_in_assume_nonnull : Error<
697 "cannot #include files inside '#pragma clang assume_nonnull'">;
698 def err_pp_eof_in_assume_nonnull : Error<
699 "'#pragma clang assume_nonnull' was not ended within this file">;