[RFA] cpplib/C/C++: Unify character constant interpretation
Neil Booth
neil@daikokuya.demon.co.uk
Mon Mar 5 23:24:00 GMT 2001
John Marshall wrote:-
> > /* In C, a character constant has type 'int'; in C++, 'char'. */
> > - if (chars_seen <= 1 && c_language == clk_cplusplus)
> > + if (c_language == clk_cplusplus)
> > TREE_TYPE (value) = char_type_node;
> > else
> > TREE_TYPE (value) = integer_type_node;
>
> This is incorrect. Whatever their values might happen to be, C++ char
> literals containing more than one char have type int (section 2.13.2).
Thanks - I don't have a C++ standard; I guess I should buy one:-)
I'll revert this; the main reason I changed this was that the "chars_seen"
variable no longer exists (in this routine, at least) and I didn't think
anyone used it, but clearly they do.
Neil.
More information about the Gcc-patches
mailing list