blob: 6965698964461d2278066b13fa8d421edd35abc3 [file] [log] [blame]
//==--- DiagnosticLexKinds.def - liblex diagnostics -------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//===----------------------------------------------------------------------===//
// Lexer Diagnostics
//===----------------------------------------------------------------------===//
#ifdef LEXSTART
__LEXSTART = DIAG_START_LEX,
#undef LEXSTART
#endif
DIAG(null_in_string, WARNING,
"null character(s) preserved in string literal")
DIAG(null_in_char , WARNING,
"null character(s) preserved in character literal")
DIAG(null_in_file , WARNING,
"null character ignored")
DIAG(warn_nested_block_comment, WARNING,
"'/*' within block comment")
DIAG(escaped_newline_block_comment_end, WARNING,
"escaped newline between */ characters at block comment end")
DIAG(backslash_newline_space, WARNING,
"backslash and newline separated by space")
// Trigraphs.
DIAG(trigraph_ignored, WARNING, "trigraph ignored")
DIAG(trigraph_ignored_block_comment, WARNING,
"ignored trigraph would end block comment")
DIAG(trigraph_ends_block_comment, WARNING,
"trigraph ends block comment")
DIAG(trigraph_converted, WARNING,
"trigraph converted to '%0' character")
DIAG(ext_multi_line_bcpl_comment, EXTENSION,
"multi-line // comment")
DIAG(ext_bcpl_comment, EXTENSION,
"// comments are not allowed in this language")
DIAG(ext_no_newline_eof, EXTENSION,
"no newline at end of file")
DIAG(ext_backslash_newline_eof, EXTENSION,
"backslash-newline at end of file")
DIAG(ext_dollar_in_identifier, EXTENSION,
"'$' in identifier")
DIAG(charize_microsoft_ext, EXTENSION,
"@# is a microsoft extension")
DIAG(ext_token_used, EXTENSION,
"extension used")
DIAG(err_unterminated_string, ERROR,
"missing terminating \" character")
DIAG(err_unterminated_char, ERROR,
"missing terminating ' character")
DIAG(err_empty_character, ERROR,
"empty character constant")
DIAG(err_unterminated_block_comment, ERROR,
"unterminated /* comment")
DIAG(err_invalid_character_to_charify, ERROR,
"invalid argument to convert to character")
// Literal
DIAG(ext_nonstandard_escape, EXTENSION,
"use of non-standard escape character '\\%0'")
DIAG(ext_unknown_escape, EXTENSION,
"unknown escape sequence '\\%0'")
DIAG(err_hex_escape_no_digits, ERROR,
"\\x used with no following hex digits")
DIAG(err_invalid_decimal_digit, ERROR,
"invalid digit '%0' in decimal constant")
DIAG(err_invalid_binary_digit, ERROR,
"invalid digit '%0' in binary constant")
DIAG(err_invalid_octal_digit, ERROR,
"invalid digit '%0' in octal constant")
DIAG(err_invalid_suffix_integer_constant, ERROR,
"invalid suffix '%0' on integer constant")
DIAG(err_invalid_suffix_float_constant, ERROR,
"invalid suffix '%0' on floating constant")
DIAG(warn_extraneous_wide_char_constant, WARNING,
"extraneous characters in wide character constant ignored")
DIAG(warn_char_constant_too_large, WARNING,
"character constant too long for its type")
DIAG(err_exponent_has_no_digits, ERROR,
"exponent has no digits")
DIAG(ext_imaginary_constant, EXTENSION,
"imaginary constants are an extension")
DIAG(err_hexconstant_requires_exponent, ERROR,
"hexadecimal floating constants require an exponent")
DIAG(ext_hexconstant_invalid, EXTENSION,
"hexadecimal floating constants are a C99 feature")
DIAG(ext_binary_literal, EXTENSION,
"binary integer literals are an extension")
DIAG(err_pascal_string_too_long, ERROR,
"Pascal string is too long")
//===----------------------------------------------------------------------===//
// Preprocessor Diagnostics
//===----------------------------------------------------------------------===//
DIAG(pp_hash_warning, WARNING,
"#warning%0")
DIAG(pp_include_next_in_primary, WARNING,
"#include_next in primary source file")
DIAG(pp_include_next_absolute_path, WARNING,
"#include_next with absolute path")
DIAG(ext_c99_whitespace_required_after_macro_name, WARNING,
"ISO C99 requires whitespace after the macro name")
DIAG(pp_pragma_once_in_main_file, WARNING,
"#pragma once in main file")
DIAG(pp_pragma_sysheader_in_main_file, WARNING,
"#pragma system_header ignored in main file")
DIAG(pp_poisoning_existing_macro, WARNING,
"poisoning existing macro")
DIAG(pp_out_of_date_dependency, WARNING,
"current file is older than dependency %0")
DIAG(pp_undef_builtin_macro, WARNING,
"undefining builtin macro")
DIAG(pp_redef_builtin_macro, WARNING,
"redefining builtin macro")
DIAG(pp_invalid_string_literal, WARNING,
"invalid string literal, ignoring final '\\'")
DIAG(warn_pp_expr_overflow, WARNING,
"integer overflow in preprocessor expression")
DIAG(warn_pp_convert_lhs_to_positive, WARNING,
"left side of operator converted from negative value to unsigned: %0")
DIAG(warn_pp_convert_rhs_to_positive, WARNING,
"right side of operator converted from negative value to unsigned: %0")
DIAG(ext_pp_import_directive, EXTENSION,
"#import is a language extension")
DIAG(ext_pp_ident_directive, EXTENSION,
"#ident is a language extension")
DIAG(ext_pp_include_next_directive, EXTENSION,
"#include_next is a language extension")
DIAG(ext_pp_warning_directive, EXTENSION,
"#warning is a language extension")
DIAG(ext_pp_extra_tokens_at_eol, EXTENSION,
"extra tokens at end of %0 directive")
DIAG(ext_pp_comma_expr, EXTENSION,
"comma operator in operand of #if")
DIAG(ext_pp_bad_vaargs_use, EXTENSION,
"__VA_ARGS__ can only appear in the expansion of a C99 variadic macro")
DIAG(ext_pp_macro_redef, EXTENSION,
"%0 macro redefined")
DIAG(ext_variadic_macro, EXTENSION,
"variadic macros were introduced in C99")
DIAG(ext_named_variadic_macro, EXTENSION,
"named variadic macros are a GNU extension")
DIAG(ext_embedded_directive, EXTENSION,
"embedding a directive within macro arguments is not portable")
DIAG(ext_missing_varargs_arg, EXTENSION,
"varargs argument missing, but tolerated as an extension")
DIAG(ext_empty_fnmacro_arg, EXTENSION,
"empty macro arguments were standardized in C99")
DIAG(ext_pp_base_file, EXTENSION,
"__BASE_FILE__ is a language extension")
DIAG(ext_pp_include_level, EXTENSION,
"__INCLUDE_LEVEL__ is a language extension")
DIAG(ext_pp_timestamp, EXTENSION,
"__TIMESTAMP__ is a language extension")
DIAG(err_pp_invalid_directive, ERROR,
"invalid preprocessing directive")
DIAG(err_pp_hash_error, ERROR,
"#error%0")
DIAG(err_pp_file_not_found, ERROR,
"'%0' file not found")
DIAG(err_pp_empty_filename, ERROR,
"empty filename")
DIAG(err_pp_include_too_deep, ERROR,
"#include nested too deeply")
DIAG(err_pp_expects_filename, ERROR,
"expected \"FILENAME\" or <FILENAME>")
DIAG(err_pp_macro_not_identifier, ERROR,
"macro names must be identifiers")
DIAG(err_pp_missing_macro_name, ERROR,
"macro name missing")
DIAG(err_pp_missing_rparen_in_macro_def, ERROR,
"missing ')' in macro parameter list")
DIAG(err_pp_invalid_tok_in_arg_list, ERROR,
"invalid token in macro parameter list")
DIAG(err_pp_expected_ident_in_arg_list, ERROR,
"expected identifier in macro parameter list")
DIAG(err_pp_expected_comma_in_arg_list, ERROR,
"expected comma in macro parameter list")
DIAG(err_pp_duplicate_name_in_arg_list, ERROR,
"duplicate macro parameter name %0")
DIAG(err_pp_stringize_not_parameter, ERROR,
"'#' is not followed by a macro parameter")
DIAG(err_pp_malformed_ident, ERROR,
"invalid #ident directive")
DIAG(err_pp_unterminated_conditional, ERROR,
"unterminated conditional directive")
DIAG(pp_err_else_after_else, ERROR,
"#else after #else")
DIAG(pp_err_elif_after_else, ERROR,
"#elif after #else")
DIAG(pp_err_else_without_if, ERROR,
"#else without #if")
DIAG(pp_err_elif_without_if, ERROR,
"#elif without #if")
DIAG(err_pp_endif_without_if, ERROR,
"#endif without #if")
DIAG(err_pp_expected_value_in_expr, ERROR,
"expected value in expression")
DIAG(err_pp_missing_val_before_operator, ERROR,
"missing value before operator")
DIAG(err_pp_expected_rparen, ERROR,
"expected ')' in preprocessor expression")
DIAG(err_pp_expected_eol, ERROR,
"expected end of line in preprocessor expression")
DIAG(err_pp_defined_requires_identifier, ERROR,
"operator 'defined' requires an identifier")
DIAG(err_pp_missing_rparen, ERROR,
"missing ')' after 'defined'")
DIAG(err_pp_colon_without_question, ERROR,
"':' without preceding '?'")
DIAG(err_pp_division_by_zero, ERROR,
"division by zero in preprocessor expression")
DIAG(err_pp_remainder_by_zero, ERROR,
"remainder by zero in preprocessor expression")
DIAG(err_pp_expr_bad_token_binop, ERROR,
"token is not a valid binary operator in a preprocessor subexpression")
DIAG(err_pp_expr_bad_token_start_expr, ERROR,
"invalid token at start of a preprocessor expression")
DIAG(err_pp_invalid_poison, ERROR,
"can only poison identifier tokens")
DIAG(err_pp_used_poisoned_id, ERROR,
"attempt to use a poisoned identifier")
DIAG(err__Pragma_malformed, ERROR,
"_Pragma takes a parenthesized string literal")
DIAG(err_pragma_comment_malformed, ERROR,
"pragma comment requires parenthesized identifier and optional string")
DIAG(err_pragma_comment_unknown_kind, ERROR,
"unknown kind of pragma comment")
DIAG(err_defined_macro_name, ERROR,
"'defined' cannot be used as a macro name")
DIAG(err_paste_at_start, ERROR,
"'##' cannot appear at start of macro expansion")
DIAG(err_paste_at_end, ERROR,
"'##' cannot appear at end of macro expansion")
DIAG(ext_paste_comma, EXTENSION,
"Use of comma pasting extension is non-portable")
DIAG(err_unterm_macro_invoc, ERROR,
"unterminated function-like macro invocation")
DIAG(err_too_many_args_in_macro_invoc, ERROR,
"too many arguments provided to function-like macro invocation")
DIAG(err_too_few_args_in_macro_invoc, ERROR,
"too few arguments provided to function-like macro invocation")
DIAG(err_pp_bad_paste, ERROR,
"pasting formed '%0', an invalid preprocessing token")
DIAG(err_pp_operator_used_as_macro_name, ERROR,
"C++ operator '%0' cannot be used as a macro name")
DIAG(err_pp_illegal_floating_literal, ERROR,
"floating point literal in preprocessor expression")
DIAG(err_pp_line_requires_integer, ERROR,
"#line directive requires a positive integer argument")
DIAG(err_pp_line_invalid_filename, ERROR,
"invalid filename for #line directive")
DIAG(err_pp_linemarker_requires_integer, ERROR,
"line marker directive requires a positive integer argument")
DIAG(err_pp_linemarker_invalid_filename, ERROR,
"invalid filename for line marker directive")
DIAG(err_pp_linemarker_invalid_flag, ERROR,
"invalid flag line marker directive")
DIAG(ext_pp_line_too_big, EXTENSION,
"C requires #line number to be less than %0, allowed as extension")