]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/clang/include/clang/Basic/DiagnosticLexKinds.td
Import zstandard 1.3.1
[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 // Trigraphs.
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">,
39     InGroup<Trigraphs>;
40 def trigraph_converted : Warning<"trigraph converted to '%0' character">,
41     InGroup<Trigraphs>;
42
43 def ext_multi_line_line_comment : Extension<"multi-line // comment">,
44     InGroup<Comment>;
45 def ext_line_comment : Extension<
46   "// comments are not allowed in this language">,
47   InGroup<Comment>;
48 def ext_no_newline_eof : Extension<"no newline at end of file">, 
49   InGroup<NewlineEOF>;
50 def warn_no_newline_eof : Warning<"no newline at end of file">,
51   InGroup<NewlineEOF>, DefaultIgnore;
52
53 def warn_cxx98_compat_no_newline_eof : Warning<
54   "C++98 requires newline at end of file">,
55   InGroup<CXX98CompatPedantic>, DefaultIgnore;
56
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>;
68
69 def ext_token_used : Extension<"extension used">,
70   InGroup<DiagGroup<"language-extension-token">>;
71
72 def warn_cxx11_keyword : Warning<"'%0' is a keyword in C++11">,
73   InGroup<CXX11Compat>, DefaultIgnore;
74
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">;
83
84 def err_conflict_marker : Error<"version control conflict marker in file">;
85
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;
97
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>;
102
103
104 // Unicode and UCNs
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">>;
112
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'?">;
124
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">,
132   InGroup<Unicode>;
133
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;
141
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>;
153
154
155 // Literal
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++17 feature">, InGroup<CXX17>;
185 def warn_cxx1z_hex_literal : Warning<
186   "hexadecimal floating literals are incompatible with "
187   "C++ standards before C++17">,
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++17">,
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 "
218   "suffix in C++11">,
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 "
230   "concatenation">;
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">;
245 def err_placeholder_in_source : Error<"editor placeholder in source file">;
246
247
248 //===----------------------------------------------------------------------===//
249 // PTH Diagnostics
250 //===----------------------------------------------------------------------===//
251 def err_invalid_pth_file : Error<
252     "invalid or corrupt PTH file '%0'">;
253
254 //===----------------------------------------------------------------------===//
255 // Preprocessor Diagnostics
256 //===----------------------------------------------------------------------===//
257
258 let CategoryName = "User-Defined Issue" in {
259 def pp_hash_warning : Warning<"%0">,
260   InGroup<PoundWarning>, ShowInSystemHeader;
261 def err_pp_hash_error : Error<"%0">;
262 }
263
264 def pp_include_next_in_primary : Warning<
265   "#include_next in primary source file">,
266   InGroup<DiagGroup<"include-next-outside-header">>;
267 def pp_include_macros_out_of_predefines : Error<
268   "the #__include_macros directive is only for internal use by -imacros">;
269 def pp_include_next_absolute_path : Warning<
270   "#include_next with absolute path">,
271   InGroup<DiagGroup<"include-next-absolute-path">>;
272 def ext_c99_whitespace_required_after_macro_name : ExtWarn<
273   "ISO C99 requires whitespace after the macro name">, InGroup<C99>;
274 def ext_missing_whitespace_after_macro_name : ExtWarn<
275   "whitespace required after macro name">;
276 def warn_missing_whitespace_after_macro_name : Warning<
277   "whitespace recommended after macro name">;
278
279 class NonportablePath  : Warning<
280   "non-portable path to file '%0'; specified path differs in case from file"
281   " name on disk">;
282 def pp_nonportable_path : NonportablePath,
283   InGroup<DiagGroup<"nonportable-include-path">>;
284 def pp_nonportable_system_path : NonportablePath, DefaultIgnore,
285   InGroup<DiagGroup<"nonportable-system-include-path">>;
286   
287 def pp_pragma_once_in_main_file : Warning<"#pragma once in main file">,
288   InGroup<DiagGroup<"pragma-once-outside-header">>;
289 def pp_pragma_sysheader_in_main_file : Warning<
290   "#pragma system_header ignored in main file">,
291   InGroup<DiagGroup<"pragma-system-header-outside-header">>;
292 def pp_poisoning_existing_macro : Warning<"poisoning existing macro">;
293 def pp_out_of_date_dependency : Warning<
294   "current file is older than dependency %0">;
295 def ext_pp_undef_builtin_macro : ExtWarn<"undefining builtin macro">,
296   InGroup<BuiltinMacroRedefined>;
297 def ext_pp_redef_builtin_macro : ExtWarn<"redefining builtin macro">,
298   InGroup<BuiltinMacroRedefined>;
299 def pp_disabled_macro_expansion : Warning<
300   "disabled expansion of recursive macro">, DefaultIgnore,
301   InGroup<DiagGroup<"disabled-macro-expansion">>;
302 def pp_macro_not_used : Warning<"macro is not used">, DefaultIgnore,
303   InGroup<DiagGroup<"unused-macros">>;
304 def warn_pp_undef_identifier : Warning<
305   "%0 is not defined, evaluates to 0">,
306   InGroup<DiagGroup<"undef">>, DefaultIgnore;
307 def warn_pp_ambiguous_macro : Warning<
308   "ambiguous expansion of macro %0">, InGroup<AmbiguousMacro>;
309 def note_pp_ambiguous_macro_chosen : Note<
310   "expanding this definition of %0">;
311 def note_pp_ambiguous_macro_other : Note<
312   "other definition of %0">;
313 def warn_pp_macro_hides_keyword : Extension<
314   "keyword is hidden by macro definition">, InGroup<KeywordAsMacro>;
315 def warn_pp_macro_is_reserved_id : Warning<
316   "macro name is a reserved identifier">, DefaultIgnore,
317   InGroup<ReservedIdAsMacro>;
318 def warn_pp_objc_macro_redef_ignored : Warning<
319   "ignoring redefinition of Objective-C qualifier macro">,
320   InGroup<DiagGroup<"objc-macro-redefinition">>;
321
322 def pp_invalid_string_literal : Warning<
323   "invalid string literal, ignoring final '\\'">;
324 def warn_pp_expr_overflow : Warning<
325   "integer overflow in preprocessor expression">;
326 def warn_pp_convert_to_positive : Warning<
327   "%select{left|right}0 side of operator converted from negative value to "
328   "unsigned: %1">;
329
330 def ext_pp_import_directive : Extension<"#import is a language extension">,
331   InGroup<DiagGroup<"import-preprocessor-directive-pedantic">>;
332 def err_pp_import_directive_ms : Error<
333   "#import of type library is an unsupported Microsoft feature">;
334 def ext_pp_include_search_ms : ExtWarn<
335   "#include resolved using non-portable Microsoft search rules as: %0">,
336   InGroup<MicrosoftInclude>;
337
338 def ext_pp_ident_directive : Extension<"#ident is a language extension">;
339 def ext_pp_include_next_directive : Extension<
340   "#include_next is a language extension">, InGroup<GNUIncludeNext>;
341 def ext_pp_warning_directive : Extension<"#warning is a language extension">;
342
343 def ext_pp_extra_tokens_at_eol : ExtWarn<
344   "extra tokens at end of #%0 directive">, InGroup<ExtraTokens>;
345   
346 def ext_pp_comma_expr : Extension<"comma operator in operand of #if">;
347 def ext_pp_bad_vaargs_use : Extension<
348   "__VA_ARGS__ can only appear in the expansion of a C99 variadic macro">;
349 def ext_pp_macro_redef : ExtWarn<"%0 macro redefined">, InGroup<MacroRedefined>;
350 def ext_variadic_macro : Extension<"variadic macros are a C99 feature">,
351   InGroup<VariadicMacros>;
352 def warn_cxx98_compat_variadic_macro : Warning<
353   "variadic macros are incompatible with C++98">,
354   InGroup<CXX98CompatPedantic>, DefaultIgnore;
355 def ext_named_variadic_macro : Extension<
356   "named variadic macros are a GNU extension">, InGroup<VariadicMacros>;
357 def err_embedded_directive : Error<
358   "embedding a #%0 directive within macro arguments is not supported">;
359 def ext_embedded_directive : Extension<
360   "embedding a directive within macro arguments has undefined behavior">,
361   InGroup<DiagGroup<"embedded-directive">>;
362 def ext_missing_varargs_arg : Extension<
363   "must specify at least one argument for '...' parameter of variadic macro">,
364   InGroup<GNUZeroVariadicMacroArguments>;
365 def ext_empty_fnmacro_arg : Extension<
366   "empty macro arguments are a C99 feature">, InGroup<C99>;
367 def warn_cxx98_compat_empty_fnmacro_arg : Warning<
368   "empty macro arguments are incompatible with C++98">,
369   InGroup<CXX98CompatPedantic>, DefaultIgnore;
370 def note_macro_here : Note<"macro %0 defined here">;
371
372 def err_pp_opencl_variadic_macros :
373   Error<"variadic macros not supported in OpenCL">;
374
375 def err_pp_invalid_directive : Error<"invalid preprocessing directive">;
376 def err_pp_directive_required : Error<
377   "%0 must be used within a preprocessing directive">;
378 def err_pp_file_not_found : Error<"'%0' file not found">, DefaultFatal;
379 def err_pp_file_not_found_not_fatal : Error<
380   "'%0' file not found with <angled> include; use \"quotes\" instead">;
381 def err_pp_error_opening_file : Error<
382   "error opening file '%0': %1">, DefaultFatal;
383 def err_pp_empty_filename : Error<"empty filename">;
384 def err_pp_include_too_deep : Error<"#include nested too deeply">;
385 def err_pp_expects_filename : Error<"expected \"FILENAME\" or <FILENAME>">;
386 def err_pp_macro_not_identifier : Error<"macro name must be an identifier">;
387 def err_pp_missing_macro_name : Error<"macro name missing">;
388 def err_pp_missing_rparen_in_macro_def : Error<
389   "missing ')' in macro parameter list">;
390 def err_pp_invalid_tok_in_arg_list : Error<
391   "invalid token in macro parameter list">;
392 def err_pp_expected_ident_in_arg_list : Error<
393   "expected identifier in macro parameter list">;
394 def err_pp_expected_comma_in_arg_list : Error<
395   "expected comma in macro parameter list">;
396 def err_pp_duplicate_name_in_arg_list : Error<
397   "duplicate macro parameter name %0">;
398 def err_pp_stringize_not_parameter : Error<
399   "'%select{#|#@}0' is not followed by a macro parameter">;
400 def err_pp_malformed_ident : Error<"invalid #ident directive">;
401 def err_pp_unterminated_conditional : Error<
402   "unterminated conditional directive">;
403 def pp_err_else_after_else : Error<"#else after #else">;
404 def pp_err_elif_after_else : Error<"#elif after #else">;
405 def pp_err_else_without_if : Error<"#else without #if">;
406 def pp_err_elif_without_if : Error<"#elif without #if">;
407 def err_pp_endif_without_if : Error<"#endif without #if">;
408 def err_pp_expected_value_in_expr : Error<"expected value in expression">;
409 def err_pp_expected_rparen : Error<"expected ')' in preprocessor expression">;
410 def err_pp_expected_eol : Error<
411   "expected end of line in preprocessor expression">;
412 def err_pp_expected_after : Error<"missing %1 after %0">;
413 def err_pp_nested_paren : Error<"nested parentheses not permitted in %0">;
414 def err_pp_colon_without_question : Error<"':' without preceding '?'">;
415 def err_pp_division_by_zero : Error<
416   "division by zero in preprocessor expression">;
417 def err_pp_remainder_by_zero : Error<
418   "remainder by zero in preprocessor expression">;
419 def err_pp_expr_bad_token_binop : Error<
420   "token is not a valid binary operator in a preprocessor subexpression">;
421 def err_pp_expr_bad_token_lparen : Error<
422   "function-like macro %0 is not defined">;
423 def err_pp_expr_bad_token_start_expr : Error<
424   "invalid token at start of a preprocessor expression">;
425 def err_pp_invalid_poison : Error<"can only poison identifier tokens">;
426 def err_pp_used_poisoned_id : Error<"attempt to use a poisoned identifier">;
427
428 def err_feature_check_malformed : Error<
429   "builtin feature check macro requires a parenthesized identifier">;
430
431 def warn_has_warning_invalid_option :
432    ExtWarn<"__has_warning expected option name (e.g. \"-Wundef\")">,
433    InGroup<MalformedWarningCheck>;
434
435 def err_pp_identifier_arg_not_identifier : Error<
436   "cannot convert %0 token to an identifier">;
437
438 def warn_pragma_include_alias_mismatch_angle :
439    ExtWarn<"angle-bracketed include <%0> cannot be aliased to double-quoted "
440    "include \"%1\"">, InGroup<UnknownPragmas>;
441 def warn_pragma_include_alias_mismatch_quote :
442    ExtWarn<"double-quoted include \"%0\" cannot be aliased to angle-bracketed "
443    "include <%1>">, InGroup<UnknownPragmas>;
444 def warn_pragma_include_alias_expected :
445    ExtWarn<"pragma include_alias expected '%0'">,
446    InGroup<UnknownPragmas>;
447 def warn_pragma_include_alias_expected_filename :
448    ExtWarn<"pragma include_alias expected include filename">,
449    InGroup<UnknownPragmas>;
450
451 // - #pragma warning(...)
452 def warn_pragma_warning_expected :
453   ExtWarn<"#pragma warning expected '%0'">,
454   InGroup<UnknownPragmas>;
455 def warn_pragma_warning_spec_invalid :
456   ExtWarn<"#pragma warning expected 'push', 'pop', 'default', 'disable',"
457           " 'error', 'once', 'suppress', 1, 2, 3, or 4">,
458   InGroup<UnknownPragmas>;
459 def warn_pragma_warning_push_level :
460   ExtWarn<"#pragma warning(push, level) requires a level between 0 and 4">,
461   InGroup<UnknownPragmas>;
462 def warn_pragma_warning_expected_number :
463   ExtWarn<"#pragma warning expected a warning number">,
464   InGroup<UnknownPragmas>;
465
466 def err__Pragma_malformed : Error<
467   "_Pragma takes a parenthesized string literal">;
468 def err_pragma_message_malformed : Error<
469   "pragma %select{message|warning|error}0 requires parenthesized string">;
470 def err_pragma_push_pop_macro_malformed : Error<
471    "pragma %0 requires a parenthesized string">;
472 def warn_pragma_pop_macro_no_push : Warning<
473    "pragma pop_macro could not pop '%0', no matching push_macro">,
474   InGroup<IgnoredPragmas>;
475 def warn_pragma_message : Warning<"%0">,
476    InGroup<PoundPragmaMessage>, DefaultWarnNoWerror;
477 def err_pragma_message : Error<"%0">;
478 def warn_pragma_ignored : Warning<"unknown pragma ignored">,
479    InGroup<UnknownPragmas>, DefaultIgnore;
480 def ext_stdc_pragma_ignored : ExtWarn<"unknown pragma in STDC namespace">,
481    InGroup<UnknownPragmas>;
482 def ext_on_off_switch_syntax :
483    ExtWarn<"expected 'ON' or 'OFF' or 'DEFAULT' in pragma">,
484    InGroup<UnknownPragmas>;
485 def ext_pragma_syntax_eod :
486    ExtWarn<"expected end of directive in pragma">,
487    InGroup<UnknownPragmas>;
488 def warn_stdc_fenv_access_not_supported :
489    Warning<"pragma STDC FENV_ACCESS ON is not supported, ignoring pragma">,
490    InGroup<UnknownPragmas>;
491 def warn_pragma_diagnostic_invalid :
492    ExtWarn<"pragma diagnostic expected 'error', 'warning', 'ignored', 'fatal',"
493             " 'push', or 'pop'">,
494    InGroup<UnknownPragmas>;
495 def warn_pragma_diagnostic_cannot_pop :
496    ExtWarn<"pragma diagnostic pop could not pop, no matching push">,
497    InGroup<UnknownPragmas>;
498 def warn_pragma_diagnostic_invalid_option :
499    ExtWarn<"pragma diagnostic expected option name (e.g. \"-Wundef\")">,
500    InGroup<UnknownPragmas>;
501 def warn_pragma_diagnostic_invalid_token :
502    ExtWarn<"unexpected token in pragma diagnostic">,
503    InGroup<UnknownPragmas>;
504 def warn_pragma_diagnostic_unknown_warning :
505    ExtWarn<"unknown warning group '%0', ignored">,
506    InGroup<UnknownWarningOption>;
507 // - #pragma __debug
508 def warn_pragma_debug_unexpected_command : Warning<
509   "unexpected debug command '%0'">, InGroup<IgnoredPragmas>;
510 def warn_pragma_debug_missing_argument : Warning<
511   "missing argument to debug command '%0'">, InGroup<IgnoredPragmas>;
512 // #pragma module
513 def err_pp_expected_module_name : Error<
514   "expected %select{identifier after '.' in |}0module name">;
515 def err_pp_module_begin_wrong_module : Error<
516   "must specify '-fmodule-name=%0' to enter %select{|submodule of }1"
517   "this module%select{ (current module is %3)|}2">;
518 def err_pp_module_begin_no_module_map : Error<
519   "no module map available for module %0">;
520 def err_pp_module_begin_no_submodule : Error<
521   "submodule %0.%1 not declared in module map">;
522 def err_pp_module_begin_without_module_end : Error<
523   "no matching '#pragma clang module end' for this "
524   "'#pragma clang module begin'">;
525 def err_pp_module_end_without_module_begin : Error<
526   "no matching '#pragma clang module begin' for this "
527   "'#pragma clang module end'">;
528 def note_pp_module_begin_here : Note<
529   "entering module '%0' due to this pragma">;
530 def err_pp_module_build_pth : Error<
531   "'#pragma clang module build' not supported in pretokenized header">;
532 def err_pp_module_build_missing_end : Error<
533   "no matching '#pragma clang module endbuild' for this '#pragma clang module build'">;
534
535 def err_defined_macro_name : Error<"'defined' cannot be used as a macro name">;
536 def err_paste_at_start : Error<
537   "'##' cannot appear at start of macro expansion">;
538 def err_paste_at_end : Error<"'##' cannot appear at end of macro expansion">;
539 def ext_paste_comma : Extension<
540   "token pasting of ',' and __VA_ARGS__ is a GNU extension">, InGroup<GNUZeroVariadicMacroArguments>;
541 def err_unterm_macro_invoc : Error<
542   "unterminated function-like macro invocation">;
543 def err_too_many_args_in_macro_invoc : Error<
544   "too many arguments provided to function-like macro invocation">;
545 def note_suggest_parens_for_macro : Note<
546   "parentheses are required around macro argument containing braced "
547   "initializer list">;
548 def note_init_list_at_beginning_of_macro_argument : Note<
549   "cannot use initializer list at the beginning of a macro argument">;
550 def err_too_few_args_in_macro_invoc : Error<
551   "too few arguments provided to function-like macro invocation">;
552 def err_pp_bad_paste : Error<
553   "pasting formed '%0', an invalid preprocessing token">;
554 def ext_pp_bad_paste_ms : ExtWarn<
555   "pasting formed '%0', an invalid preprocessing token">, DefaultError,
556   InGroup<DiagGroup<"invalid-token-paste">>;
557 def err_pp_operator_used_as_macro_name : Error<
558   "C++ operator %0 (aka %1) used as a macro name">;
559 def ext_pp_operator_used_as_macro_name : Extension<
560   err_pp_operator_used_as_macro_name.Text>, InGroup<MicrosoftCppMacro>;
561 def err_pp_illegal_floating_literal : Error<
562   "floating point literal in preprocessor expression">;
563 def err_pp_line_requires_integer : Error<
564   "#line directive requires a positive integer argument">;
565 def ext_pp_line_zero : Extension<
566   "#line directive with zero argument is a GNU extension">, 
567   InGroup<GNUZeroLineDirective>;
568 def err_pp_line_invalid_filename : Error<
569   "invalid filename for #line directive">;
570 def warn_pp_line_decimal : Warning<
571   "%select{#line|GNU line marker}0 directive interprets number as decimal, not octal">;
572 def err_pp_line_digit_sequence : Error<
573   "%select{#line|GNU line marker}0 directive requires a simple digit sequence">;
574 def err_pp_linemarker_requires_integer : Error<
575   "line marker directive requires a positive integer argument">;
576 def err_pp_linemarker_invalid_filename : Error<
577   "invalid filename for line marker directive">;
578 def err_pp_linemarker_invalid_flag : Error<
579   "invalid flag line marker directive">;
580 def err_pp_linemarker_invalid_pop : Error<
581   "invalid line marker flag '2': cannot pop empty include stack">;
582 def ext_pp_line_too_big : Extension<
583   "C requires #line number to be less than %0, allowed as extension">;
584 def warn_cxx98_compat_pp_line_too_big : Warning<
585   "#line number greater than 32767 is incompatible with C++98">,
586   InGroup<CXX98CompatPedantic>, DefaultIgnore;
587
588 def err_pp_visibility_non_macro : Error<"no macro named %0">;
589
590 def err_pp_arc_cf_code_audited_syntax : Error<"expected 'begin' or 'end'">;
591 def err_pp_double_begin_of_arc_cf_code_audited : Error<
592   "already inside '#pragma clang arc_cf_code_audited'">;
593 def err_pp_unmatched_end_of_arc_cf_code_audited : Error<
594   "not currently inside '#pragma clang arc_cf_code_audited'">;
595 def err_pp_include_in_arc_cf_code_audited : Error<
596   "cannot #include files inside '#pragma clang arc_cf_code_audited'">;
597 def err_pp_eof_in_arc_cf_code_audited : Error<
598   "'#pragma clang arc_cf_code_audited' was not ended within this file">;
599
600 def warn_pp_date_time : Warning<
601   "expansion of date or time macro is not reproducible">,
602   ShowInSystemHeader, DefaultIgnore, InGroup<DiagGroup<"date-time">>;
603
604 // Module map parsing
605 def err_mmap_unknown_token : Error<"skipping stray token">;
606 def err_mmap_expected_module : Error<"expected module declaration">;
607 def err_mmap_expected_module_name : Error<"expected module name">;
608 def err_mmap_expected_lbrace : Error<"expected '{' to start module '%0'">;
609 def err_mmap_expected_rbrace : Error<"expected '}'">;
610 def note_mmap_lbrace_match : Note<"to match this '{'">;
611 def err_mmap_expected_rsquare : Error<"expected ']' to close attribute">;
612 def note_mmap_lsquare_match : Note<"to match this ']'">;
613 def err_mmap_expected_member : Error<
614   "expected umbrella, header, submodule, or module export">;
615 def err_mmap_expected_header : Error<"expected a header name after '%0'">;
616 def err_mmap_expected_mmap_file : Error<"expected a module map file name">;
617 def err_mmap_module_redefinition : Error<
618   "redefinition of module '%0'">;
619 def note_mmap_prev_definition : Note<"previously defined here">;
620 def err_mmap_umbrella_clash : Error<
621   "umbrella for module '%0' already covers this directory">;
622 def err_mmap_module_id : Error<
623   "expected a module name or '*'">;
624 def err_mmap_expected_library_name : Error<
625   "expected %select{library|framework}0 name as a string">;
626 def err_mmap_config_macro_submodule : Error<
627   "configuration macros are only allowed in top-level modules">;
628 def err_mmap_use_decl_submodule : Error<
629   "use declarations are only allowed in top-level modules">;
630 def err_mmap_expected_config_macro : Error<
631   "expected configuration macro name after ','">;
632 def err_mmap_expected_conflicts_comma : Error<
633   "expected ',' after conflicting module name">;
634 def err_mmap_expected_conflicts_message : Error<
635   "expected a message describing the conflict with '%0'">;
636 def err_mmap_missing_module_unqualified : Error<
637   "no module named '%0' visible from '%1'">;
638 def err_mmap_missing_module_qualified : Error<
639   "no module named '%0' in '%1'">;
640 def err_mmap_top_level_inferred_submodule : Error<
641   "only submodules and framework modules may be inferred with wildcard syntax">;
642 def err_mmap_inferred_no_umbrella : Error<
643   "inferred submodules require a module with an umbrella">;
644 def err_mmap_inferred_framework_submodule : Error<
645   "inferred submodule cannot be a framework submodule">;
646 def err_mmap_explicit_inferred_framework : Error<
647   "inferred framework modules cannot be 'explicit'">;
648 def err_mmap_missing_exclude_name : Error<
649   "expected excluded module name">;
650 def err_mmap_inferred_redef : Error<
651   "redefinition of inferred submodule">;
652 def err_mmap_expected_lbrace_wildcard : Error<
653   "expected '{' to start inferred submodule">;
654 def err_mmap_expected_inferred_member : Error<
655   "expected %select{module exclusion with 'exclude'|'export *'}0">;
656 def err_mmap_expected_export_wildcard : Error<
657   "only '*' can be exported from an inferred submodule">;
658 def err_mmap_explicit_top_level : Error<
659   "'explicit' is not permitted on top-level modules">;
660 def err_mmap_nested_submodule_id : Error<
661   "qualified module name can only be used to define modules at the top level">;
662 def err_mmap_expected_feature : Error<"expected a feature name">;
663 def err_mmap_expected_attribute : Error<"expected an attribute name">;
664 def warn_mmap_unknown_attribute : Warning<"unknown attribute '%0'">,
665   InGroup<IgnoredAttributes>;
666 def warn_mmap_mismatched_top_level_private : Warning<
667   "top-level module '%0' in private module map, expected a submodule of '%1'">,
668   InGroup<PrivateModule>;
669 def note_mmap_rename_top_level_private_as_submodule : Note<
670   "make '%0' a submodule of '%1' to ensure it can be found by name">;
671 def err_mmap_duplicate_header_attribute : Error<
672   "header attribute '%0' specified multiple times">;
673 def err_mmap_invalid_header_attribute_value : Error<
674   "expected integer literal as value for header attribute '%0'">;
675 def err_mmap_expected_header_attribute : Error<
676   "expected a header attribute name ('size' or 'mtime')">;
677
678 def warn_auto_module_import : Warning<
679   "treating #%select{include|import|include_next|__include_macros}0 as an "
680   "import of module '%1'">, InGroup<AutoImport>, DefaultIgnore;
681 def note_implicit_top_level_module_import_here : Note<
682   "submodule of top-level module '%0' implicitly imported here">;
683 def warn_uncovered_module_header : Warning<
684   "umbrella header for module '%0' does not include header '%1'">, 
685   InGroup<IncompleteUmbrella>;
686 def warn_mmap_umbrella_dir_not_found : Warning<
687   "umbrella directory '%0' not found">,
688   InGroup<IncompleteUmbrella>;
689 def err_expected_id_building_module : Error<
690   "expected a module name in '__building_module' expression">;
691 def warn_use_of_private_header_outside_module : Warning<
692   "use of private header from outside its module: '%0'">,
693   InGroup<DiagGroup<"private-header">>, DefaultError;
694 def err_undeclared_use_of_module : Error<
695   "module %0 does not depend on a module exporting '%1'">;
696 def warn_non_modular_include_in_framework_module : Warning<
697   "include of non-modular header inside framework module '%0': '%1'">,
698   InGroup<NonModularIncludeInFrameworkModule>, DefaultIgnore;
699 def warn_non_modular_include_in_module : Warning<
700   "include of non-modular header inside module '%0': '%1'">,
701   InGroup<NonModularIncludeInModule>, DefaultIgnore;
702 def warn_module_conflict : Warning<
703   "module '%0' conflicts with already-imported module '%1': %2">, 
704   InGroup<ModuleConflict>;
705
706 def warn_header_guard : Warning<
707   "%0 is used as a header guard here, followed by #define of a different macro">,
708   InGroup<DiagGroup<"header-guard">>;
709 def note_header_guard : Note<
710   "%0 is defined here; did you mean %1?">;
711
712 def warn_defined_in_object_type_macro : Warning<
713   "macro expansion producing 'defined' has undefined behavior">,
714   InGroup<ExpansionToDefined>;
715 def warn_defined_in_function_type_macro : Extension<
716   "macro expansion producing 'defined' has undefined behavior">,
717   InGroup<ExpansionToDefined>;
718
719 let CategoryName = "Nullability Issue" in {
720
721 def err_pp_assume_nonnull_syntax : Error<"expected 'begin' or 'end'">;
722 def err_pp_double_begin_of_assume_nonnull : Error<
723   "already inside '#pragma clang assume_nonnull'">;
724 def err_pp_unmatched_end_of_assume_nonnull : Error<
725   "not currently inside '#pragma clang assume_nonnull'">;
726 def err_pp_include_in_assume_nonnull : Error<
727   "cannot #include files inside '#pragma clang assume_nonnull'">;
728 def err_pp_eof_in_assume_nonnull : Error<
729   "'#pragma clang assume_nonnull' was not ended within this file">;
730
731 }
732
733 }