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