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