[Bug libstdc++/11740] ctype<wchar_t>::do_is(mask, wchar_t) doesn't handle multiple bits in mask.

peturr02 at ru dot is gcc-bugzilla@gcc.gnu.org
Mon Oct 6 18:53:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11740



------- Additional Comments From peturr02 at ru dot is  2003-10-06 18:53 -------
Paolo Carlini wrote:
> Pétur, could you please detail a little more your reading? In 22.2.1.1.2
> I don't see any "any" ;), only an "&" in p2...

This is the relevant text:
> Returns: The first form returns the result of the expression
> (M & m) != 0; i.e., true if the character has the characteristics
> specified. The second form returns high. 

(M & m) != 0 is true if any bit is set in both M and m. This is
also consistent with the specialization for char.
The current implementation returns true if (M & m) == m && m != 0.

The sentence "true if the character has the characteristics specified"
implies the current implementation. I suspect that it should read
"true if the character has any of the characteristics specified".



More information about the Gcc-bugs mailing list