Hi -

Among the various libc++ tests that currently don't pass on Linux are
localization/locale.categories/category.collate/category.ctype/locale.ctype.byname/is_1.pass.cpp
and scan_is.pass.cpp. The tests fail when the character class being
tested is compound, like ctype_base::alnum or ctype_base::graph,
because the existing series of conditionals in do_is an do_scan_is
will abort too early. For instance, if the character class being
tested is alnum, and the character is numeric, do_is will return false
because iswalpha_l will return false, 'result' becomes false, and the
'true' result from the later call to iswdigit_l ends up being ignored
. A similar problem exists in do_scan_is.

My confidence in this patch is much lower than usual, because I'm not
particularly familiar with wchar_t, the intended semantics of
ctype_byname::do_is and ctype_byname::do_scan_is, the character
classes, etc. So this patch is more sort of a suggestion. Though the
patch does make the broken tests pass and doesn't appear to break any
others, so that is some evidence in its favor.

Thanks,
Andrew

Attachment: libcxx.ctype_byname.do_is.patch
Description: Binary data

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to