]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - contrib/llvm/tools/clang/include/clang/Basic/DiagnosticLexKinds.td
Copy head to stable/9 as part of 9.0-RELEASE release cycle.
[FreeBSD/stable/9.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_string : Warning<"null character(s) preserved in string literal">;
17 def null_in_char : Warning<"null character(s) preserved in character literal">;
18 def null_in_file : Warning<"null character ignored">;
19 def warn_nested_block_comment : Warning<"'/*' within block comment">,
20   InGroup<Comment>;
21 def escaped_newline_block_comment_end : Warning<
22   "escaped newline between */ characters at block comment end">,
23   InGroup<Comment>;
24 def backslash_newline_space : Warning<
25   "backslash and newline separated by space">;
26
27 // Trigraphs.
28 def trigraph_ignored : Warning<"trigraph ignored">, InGroup<Trigraphs>;
29 def trigraph_ignored_block_comment : Warning<
30   "ignored trigraph would end block comment">, InGroup<Trigraphs>;
31 def trigraph_ends_block_comment : Warning<"trigraph ends block comment">,
32     InGroup<Trigraphs>;
33 def trigraph_converted : Warning<"trigraph converted to '%0' character">,
34     InGroup<Trigraphs>;
35
36 def ext_multi_line_bcpl_comment : Extension<"multi-line // comment">,
37     InGroup<Comment>;
38 def ext_bcpl_comment : Extension<
39   "// comments are not allowed in this language">,
40   InGroup<Comment>;
41 def ext_no_newline_eof : Extension<"no newline at end of file">;
42 def ext_backslash_newline_eof : Extension<"backslash-newline at end of file">;
43 def ext_dollar_in_identifier : Extension<"'$' in identifier">;
44 def charize_microsoft_ext : Extension<"@# is a microsoft extension">;
45
46 def ext_token_used : Extension<"extension used">;
47
48 def warn_unterminated_string : ExtWarn<"missing terminating '\"' character">;
49 def warn_unterminated_char : ExtWarn<"missing terminating ' character">;
50 def err_empty_character : Error<"empty character constant">;
51 def err_unterminated_block_comment : Error<"unterminated /* comment">;
52 def err_invalid_character_to_charify : Error<
53   "invalid argument to convert to character">;
54 def err_unterminated___pragma : Error<"missing terminating ')' character">;
55
56 def err_conflict_marker : Error<"version control conflict marker in file">;
57
58 def ext_multichar_character_literal : ExtWarn<
59   "multi-character character constant">, InGroup<MultiChar>;
60 def ext_four_char_character_literal : Extension<
61   "multi-character character constant">, InGroup<FourByteMultiChar>;
62   
63
64 // Literal
65 def ext_nonstandard_escape : Extension<
66   "use of non-standard escape character '\\%0'">;
67 def ext_unknown_escape : ExtWarn<"unknown escape sequence '\\%0'">;
68 def err_hex_escape_no_digits : Error<"\\x used with no following hex digits">;
69 def err_ucn_escape_no_digits : Error<"\\u used with no following hex digits">;
70 def err_ucn_escape_invalid : Error<"invalid universal character">;
71 def err_ucn_escape_incomplete : Error<"incomplete universal character name">;
72 def err_ucn_escape_too_big : Error<"universal character name is too long">;
73 def err_invalid_decimal_digit : Error<"invalid digit '%0' in decimal constant">;
74 def err_invalid_binary_digit : Error<"invalid digit '%0' in binary constant">;
75 def err_invalid_octal_digit : Error<"invalid digit '%0' in octal constant">;
76 def err_invalid_suffix_integer_constant : Error<
77   "invalid suffix '%0' on integer constant">;
78 def err_invalid_suffix_float_constant : Error<
79   "invalid suffix '%0' on floating constant">;
80 def warn_extraneous_wide_char_constant : Warning<
81   "extraneous characters in wide character constant ignored">;
82 def warn_char_constant_too_large : Warning<
83   "character constant too long for its type">;
84 def err_exponent_has_no_digits : Error<"exponent has no digits">;
85 def ext_imaginary_constant : Extension<"imaginary constants are an extension">;
86 def err_hexconstant_requires_exponent : Error<
87   "hexadecimal floating constants require an exponent">;
88 def ext_hexconstant_cplusplus : Extension<
89   "hexadecimal floating constants are a C99 feature that is incompatible with "
90   "C++0x">, InGroup<CXXHexFloats>;
91 def ext_hexconstant_invalid : Extension<
92   "hexadecimal floating constants are a C99 feature">;
93 def ext_binary_literal : Extension<
94   "binary integer literals are an extension">;
95 def err_pascal_string_too_long : Error<"Pascal string is too long">;
96 def warn_octal_escape_too_large : ExtWarn<"octal escape sequence out of range">;
97 def warn_hex_escape_too_large : ExtWarn<"hex escape sequence out of range">;
98 def ext_string_too_long : Extension<"string literal of length %0 exceeds "
99   "maximum length %1 that %select{C90|ISO C99|C++}2 compilers are required to "
100   "support">, InGroup<OverlengthStrings>;
101 def warn_ucn_escape_too_large : ExtWarn<
102   "character unicode escape sequence too long for its type">;
103 def warn_ucn_not_valid_in_c89 : ExtWarn<
104   "unicode escape sequences are only valid in C99 or C++">;
105   
106 //===----------------------------------------------------------------------===//
107 // PTH Diagnostics
108 //===----------------------------------------------------------------------===//
109 def err_pth_cannot_read : Error<
110     "PTH file '%0' could not be read">;
111 def err_invalid_pth_file : Error<
112     "invalid or corrupt PTH file '%0'">;
113
114 //===----------------------------------------------------------------------===//
115 // Preprocessor Diagnostics
116 //===----------------------------------------------------------------------===//
117 def pp_hash_warning : Warning<"#warning%0">,
118   InGroup<PoundWarning>, DefaultWarnShowInSystemHeader;
119 def pp_include_next_in_primary : Warning<
120   "#include_next in primary source file">;
121 def pp_include_macros_out_of_predefines : Error<
122   "the #__include_macros directive is only for internal use by -imacros">;
123 def pp_include_next_absolute_path : Warning<"#include_next with absolute path">;
124 def ext_c99_whitespace_required_after_macro_name : ExtWarn<
125   "ISO C99 requires whitespace after the macro name">;
126 def ext_missing_whitespace_after_macro_name : ExtWarn<
127   "whitespace required after macro name">;
128 def warn_missing_whitespace_after_macro_name : Warning<
129   "whitespace recommended after macro name">;
130   
131 def pp_pragma_once_in_main_file : Warning<"#pragma once in main file">;
132 def pp_pragma_sysheader_in_main_file : Warning<
133   "#pragma system_header ignored in main file">;
134 def pp_poisoning_existing_macro : Warning<"poisoning existing macro">;
135 def pp_out_of_date_dependency : Warning<
136   "current file is older than dependency %0">;
137 def pp_undef_builtin_macro : Warning<"undefining builtin macro">;
138 def pp_redef_builtin_macro : Warning<"redefining builtin macro">,
139   InGroup<DiagGroup<"builtin-macro-redefined">>;
140 def pp_macro_not_used : Warning<"macro is not used">, DefaultIgnore,
141   InGroup<DiagGroup<"unused-macros">>;
142 def warn_pp_undef_identifier : Warning<
143   "%0 is not defined, evaluates to 0">,
144   InGroup<DiagGroup<"undef">>, DefaultIgnore;
145
146 def pp_invalid_string_literal : Warning<
147   "invalid string literal, ignoring final '\\'">;
148 def warn_pp_expr_overflow : Warning<
149   "integer overflow in preprocessor expression">;
150 def warn_pp_convert_lhs_to_positive : Warning<
151   "left side of operator converted from negative value to unsigned: %0">;
152 def warn_pp_convert_rhs_to_positive : Warning<
153   "right side of operator converted from negative value to unsigned: %0">;
154
155 def ext_pp_import_directive : Extension<"#import is a language extension">;
156 def ext_pp_ident_directive : Extension<"#ident is a language extension">;
157 def ext_pp_include_next_directive : Extension<
158   "#include_next is a language extension">;
159 def ext_pp_warning_directive : Extension<"#warning is a language extension">;
160
161 def ext_pp_extra_tokens_at_eol : ExtWarn<
162   "extra tokens at end of #%0 directive">, InGroup<ExtraTokens>;
163   
164 def ext_pp_comma_expr : Extension<"comma operator in operand of #if">;
165 def ext_pp_bad_vaargs_use : Extension<
166   "__VA_ARGS__ can only appear in the expansion of a C99 variadic macro">;
167 def ext_pp_macro_redef : ExtWarn<"%0 macro redefined">;
168 def ext_variadic_macro : Extension<"variadic macros were introduced in C99">,
169   InGroup<VariadicMacros>;
170 def ext_named_variadic_macro : Extension<
171   "named variadic macros are a GNU extension">, InGroup<VariadicMacros>;
172 def ext_embedded_directive : Extension<
173   "embedding a directive within macro arguments is not portable">;
174 def ext_missing_varargs_arg : Extension<
175   "varargs argument missing, but tolerated as an extension">;
176 def ext_empty_fnmacro_arg : Extension<
177   "empty macro arguments were standardized in C99">;
178
179 def err_pp_invalid_directive : Error<"invalid preprocessing directive">;
180 def err_pp_hash_error : Error<"#error%0">;
181 def warn_pp_file_not_found : Warning<"'%0' file not found">, DefaultFatal;
182 def err_pp_error_opening_file : Error<
183   "error opening file '%0': %1">, DefaultFatal;
184 def err_pp_empty_filename : Error<"empty filename">;
185 def err_pp_include_too_deep : Error<"#include nested too deeply">;
186 def err_pp_expects_filename : Error<"expected \"FILENAME\" or <FILENAME>">;
187 def err_pp_macro_not_identifier : Error<"macro names must be identifiers">;
188 def err_pp_missing_macro_name : Error<"macro name missing">;
189 def err_pp_missing_rparen_in_macro_def : Error<
190   "missing ')' in macro parameter list">;
191 def err_pp_invalid_tok_in_arg_list : Error<
192   "invalid token in macro parameter list">;
193 def err_pp_expected_ident_in_arg_list : Error<
194   "expected identifier in macro parameter list">;
195 def err_pp_expected_comma_in_arg_list : Error<
196   "expected comma in macro parameter list">;
197 def err_pp_duplicate_name_in_arg_list : Error<
198   "duplicate macro parameter name %0">;
199 def err_pp_stringize_not_parameter : Error<
200   "'#' is not followed by a macro parameter">;
201 def err_pp_malformed_ident : Error<"invalid #ident directive">;
202 def err_pp_unterminated_conditional : Error<
203   "unterminated conditional directive">;
204 def pp_err_else_after_else : Error<"#else after #else">;
205 def pp_err_elif_after_else : Error<"#elif after #else">;
206 def pp_err_else_without_if : Error<"#else without #if">;
207 def pp_err_elif_without_if : Error<"#elif without #if">;
208 def err_pp_endif_without_if : Error<"#endif without #if">;
209 def err_pp_expected_value_in_expr : Error<"expected value in expression">;
210 def err_pp_missing_val_before_operator : Error<"missing value before operator">;
211 def err_pp_expected_rparen : Error<"expected ')' in preprocessor expression">;
212 def err_pp_expected_eol : Error<
213   "expected end of line in preprocessor expression">;
214 def err_pp_defined_requires_identifier : Error<
215   "operator 'defined' requires an identifier">;
216 def err_pp_missing_lparen : Error<"missing '(' after '%0'">;
217 def err_pp_missing_rparen : Error<"missing ')' after '%0'">;
218 def err_pp_colon_without_question : Error<"':' without preceding '?'">;
219 def err_pp_division_by_zero : Error<
220   "division by zero in preprocessor expression">;
221 def err_pp_remainder_by_zero : Error<
222   "remainder by zero in preprocessor expression">;
223 def err_pp_expr_bad_token_binop : Error<
224   "token is not a valid binary operator in a preprocessor subexpression">;
225 def err_pp_expr_bad_token_start_expr : Error<
226   "invalid token at start of a preprocessor expression">;
227 def err_pp_invalid_poison : Error<"can only poison identifier tokens">;
228 def err_pp_used_poisoned_id : Error<"attempt to use a poisoned identifier">;
229
230 def err_feature_check_malformed : Error<
231   "builtin feature check macro requires a parenthesized identifier">;
232
233 def err__Pragma_malformed : Error<
234   "_Pragma takes a parenthesized string literal">;
235 def err_pragma_comment_malformed : Error<
236   "pragma comment requires parenthesized identifier and optional string">;
237 def err_pragma_message_malformed : Error<
238   "pragma message requires parenthesized string">;
239 def err_pragma_push_pop_macro_malformed : Error<
240    "pragma %0 requires a parenthesized string">;
241 def warn_pragma_pop_macro_no_push : Warning<
242    "pragma pop_macro could not pop '%0', no matching push_macro">;
243 def warn_pragma_message : Warning<"%0">,
244    InGroup<PoundPragmaMessage>, DefaultWarnNoWerror;
245 def warn_pragma_ignored : Warning<"unknown pragma ignored">,
246    InGroup<UnknownPragmas>, DefaultIgnore;
247 def ext_stdc_pragma_ignored : ExtWarn<"unknown pragma in STDC namespace">,
248    InGroup<UnknownPragmas>;
249 def ext_on_off_switch_syntax :
250    ExtWarn<"expected 'ON' or 'OFF' or 'DEFAULT' in pragma">,
251    InGroup<UnknownPragmas>;
252 def ext_pragma_syntax_eod :
253    ExtWarn<"expected end of directive in pragma">,
254    InGroup<UnknownPragmas>;
255 def warn_stdc_fenv_access_not_supported :
256    Warning<"pragma STDC FENV_ACCESS ON is not supported, ignoring pragma">,
257    InGroup<UnknownPragmas>;
258 def warn_pragma_diagnostic_invalid :
259    ExtWarn<"pragma diagnostic expected 'error', 'warning', 'ignored', 'fatal',"
260             " 'push', or 'pop'">,
261    InGroup<UnknownPragmas>;
262 def warn_pragma_diagnostic_cannot_pop :
263    ExtWarn<"pragma diagnostic pop could not pop, no matching push">,
264    InGroup<UnknownPragmas>;
265 def warn_pragma_diagnostic_invalid_option :
266    ExtWarn<"pragma diagnostic expected option name (e.g. \"-Wundef\")">,
267    InGroup<UnknownPragmas>;
268 def warn_pragma_diagnostic_invalid_token :
269    ExtWarn<"unexpected token in pragma diagnostic">,
270    InGroup<UnknownPragmas>;
271 def warn_pragma_diagnostic_unknown_warning :
272    ExtWarn<"unknown warning group '%0', ignored">,
273    InGroup<UnknownPragmas>;
274 // - #pragma __debug
275 def warn_pragma_debug_unexpected_command : Warning<
276   "unexpected debug command '%0'">;
277
278 def err_pragma_comment_unknown_kind : Error<"unknown kind of pragma comment">;
279 def err_defined_macro_name : Error<"'defined' cannot be used as a macro name">;
280 def err_paste_at_start : Error<
281   "'##' cannot appear at start of macro expansion">;
282 def err_paste_at_end : Error<"'##' cannot appear at end of macro expansion">;
283 def ext_paste_comma : Extension<
284   "Use of comma pasting extension is non-portable">;
285 def err_unterm_macro_invoc : Error<
286   "unterminated function-like macro invocation">;
287 def err_too_many_args_in_macro_invoc : Error<
288   "too many arguments provided to function-like macro invocation">;
289 def err_too_few_args_in_macro_invoc : Error<
290   "too few arguments provided to function-like macro invocation">;
291 def err_pp_bad_paste : Error<
292   "pasting formed '%0', an invalid preprocessing token">;
293 def err_pp_bad_paste_ms : Warning<
294   "pasting formed '%0', an invalid preprocessing token">, DefaultError,
295   InGroup<DiagGroup<"invalid-token-paste">>;
296 def err_pp_operator_used_as_macro_name : Error<
297   "C++ operator '%0' cannot be used as a macro name">;
298 def err_pp_illegal_floating_literal : Error<
299   "floating point literal in preprocessor expression">;
300 def err_pp_line_requires_integer : Error<
301   "#line directive requires a positive integer argument">;
302 def err_pp_line_invalid_filename : Error<
303   "invalid filename for #line directive">;
304 def warn_pp_line_decimal : Warning<
305   "#line directive interprets number as decimal, not octal">;
306 def err_pp_line_digit_sequence : Error<
307   "#line directive requires a simple digit sequence">;
308 def err_pp_linemarker_requires_integer : Error<
309   "line marker directive requires a positive integer argument">;
310 def err_pp_linemarker_invalid_filename : Error<
311   "invalid filename for line marker directive">;
312 def err_pp_linemarker_invalid_flag : Error<
313   "invalid flag line marker directive">;
314 def err_pp_linemarker_invalid_pop : Error<
315   "invalid line marker flag '2': cannot pop empty include stack">;
316 def ext_pp_line_too_big : Extension<
317   "C requires #line number to be less than %0, allowed as extension">;
318
319 }