This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR c++/14875: When using 'or' keyword, the error message speaks of a '||' token
2008/8/19 Joseph S. Myers <joseph@codesourcery.com>:
> On Tue, 19 Aug 2008, Manuel López-Ibáñez wrote:
>
>> Bootstrapped and regression tested on x86_64-unknown-linux-gnu with
>> --enable-languages=all,ada
>>
>> OK for trunk?
>>
>> 2008-08-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
>>
>> 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.
>> * include/cpplib.h (cpp_type2name): Update declaration.
>> * init.c (cpp_named_operator2name): New.
>> * internal.h (cpp_named_operator2name): Declare.
>
> Will this handle digraphs? "or" and "<:" are both "alternative tokens" in
> C++; I think the patch ought to handle all the alternative tokens listed
> in the C++ standard, include testcases for all of them, and include C
> testcases for the digraphs as they are present in C as well. (It looks
> like any token has only at most one alternative spelling.)
I don't think it handles digraphs and I don't see why it should. The
bug is talking about named operators which are different and we also
handle them different in CCP. I don't think it is reasonable to ask me
to handle all the alternative tokens listed in the C++ standard in one
single patch. I also don't see how C has anything to do with this
patch.
Can't we fix one thing at a time?
Cheers,
Manuel.