From cfc935327585254eabd5c18f298b1b4bc28a2b02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20L=C3=B3pez-Ib=C3=A1=C3=B1ez?= Date: Wed, 22 Apr 2009 15:32:18 +0000 Subject: re PR c++/14875 (When using 'or' keyword, the error message speaks of a '||' token) 2009-04-22 Manuel Lopez-Ibanez PR c++/14875 * c-common.c (c_parse_error): Take a token_flags parameter. Use token_type for the token type instead. Pass token_flags to cpp_type2name. * c-common.h (c_parse_error): Update declaration. * c-parser.c (c_parser_error): Pass 0 as token flags. libcpp/ * lex.c (cpp_type2name): Take a flags parameter. Call cpp_named_operator2name for named operators and cpp_digraph2name for digraphs. (cpp_digraph2name): New. (cpp_spell_token): Use it. (cpp_output_token): Likewise. * include/cpplib.h (cpp_type2name): Update declaration. * init.c (cpp_named_operator2name): New. * internal.h (cpp_named_operator2name): Declare. cp/ * parser.c (cp_parser_error): Pass token->flags to c_parse_error. testsuite/ * g++.dg/parse/parser-pr14875.C: New. * g++.dg/parse/parser-pr14875-2.C: New. * g++.dg/parse/error6.C: Update match string. From-SVN: r146589 --- libcpp/include/cpplib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libcpp/include') diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h index 3aeb035..b38d9f4 100644 --- a/libcpp/include/cpplib.h +++ b/libcpp/include/cpplib.h @@ -841,7 +841,7 @@ extern void cpp_output_line (cpp_reader *, FILE *); extern unsigned char *cpp_output_line_to_string (cpp_reader *, const unsigned char *); extern void cpp_output_token (const cpp_token *, FILE *); -extern const char *cpp_type2name (enum cpp_ttype); +extern const char *cpp_type2name (enum cpp_ttype, unsigned char flags); /* Returns the value of an escape sequence, truncated to the correct target precision. PSTR points to the input pointer, which is just after the backslash. LIMIT is how much text we have. WIDE is true -- cgit v1.1