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