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