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