[cfe-commits] [libcxx] r161192 - in /libcxx/trunk: src/locale.cpp www/results.Linux.html
Howard Hinnant
hhinnant at apple.com
Thu Aug 2 11:35:07 PDT 2012
Author: hhinnant
Date: Thu Aug 2 13:35:07 2012
New Revision: 161192
URL: http://llvm.org/viewvc/llvm-project?rev=161192&view=rev
Log:
Andrew Morrow: 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.
Modified:
libcxx/trunk/src/locale.cpp
libcxx/trunk/www/results.Linux.html
Modified: libcxx/trunk/src/locale.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/locale.cpp?rev=161192&r1=161191&r2=161192&view=diff
==============================================================================
--- libcxx/trunk/src/locale.cpp (original)
+++ libcxx/trunk/src/locale.cpp Thu Aug 2 13:35:07 2012
@@ -1052,17 +1052,17 @@
#ifdef _LIBCPP_WCTYPE_IS_MASK
return static_cast<bool>(iswctype_l(c, m, __l));
#else
- bool result = true;
- if (m & space && !iswspace_l(c, __l)) result = false;
- if (m & print && !iswprint_l(c, __l)) result = false;
- if (m & cntrl && !iswcntrl_l(c, __l)) result = false;
- if (m & upper && !iswupper_l(c, __l)) result = false;
- if (m & lower && !iswlower_l(c, __l)) result = false;
- if (m & alpha && !iswalpha_l(c, __l)) result = false;
- if (m & digit && !iswdigit_l(c, __l)) result = false;
- if (m & punct && !iswpunct_l(c, __l)) result = false;
- if (m & xdigit && !iswxdigit_l(c, __l)) result = false;
- if (m & blank && !iswblank_l(c, __l)) result = false;
+ bool result = false;
+ if (m & space) result |= (iswspace_l(c, __l) != 0);
+ if (m & print) result |= (iswprint_l(c, __l) != 0);
+ if (m & cntrl) result |= (iswcntrl_l(c, __l) != 0);
+ if (m & upper) result |= (iswupper_l(c, __l) != 0);
+ if (m & lower) result |= (iswlower_l(c, __l) != 0);
+ if (m & alpha) result |= (iswalpha_l(c, __l) != 0);
+ if (m & digit) result |= (iswdigit_l(c, __l) != 0);
+ if (m & punct) result |= (iswpunct_l(c, __l) != 0);
+ if (m & xdigit) result |= (iswxdigit_l(c, __l) != 0);
+ if (m & blank) result |= (iswblank_l(c, __l) != 0);
return result;
#endif
}
@@ -1109,17 +1109,16 @@
if (iswctype_l(*low, m, __l))
break;
#else
- if (m & space && !iswspace_l(*low, __l)) continue;
- if (m & print && !iswprint_l(*low, __l)) continue;
- if (m & cntrl && !iswcntrl_l(*low, __l)) continue;
- if (m & upper && !iswupper_l(*low, __l)) continue;
- if (m & lower && !iswlower_l(*low, __l)) continue;
- if (m & alpha && !iswalpha_l(*low, __l)) continue;
- if (m & digit && !iswdigit_l(*low, __l)) continue;
- if (m & punct && !iswpunct_l(*low, __l)) continue;
- if (m & xdigit && !iswxdigit_l(*low, __l)) continue;
- if (m & blank && !iswblank_l(*low, __l)) continue;
- break;
+ if (m & space && iswspace_l(*low, __l)) break;
+ if (m & print && iswprint_l(*low, __l)) break;
+ if (m & cntrl && iswcntrl_l(*low, __l)) break;
+ if (m & upper && iswupper_l(*low, __l)) break;
+ if (m & lower && iswlower_l(*low, __l)) break;
+ if (m & alpha && iswalpha_l(*low, __l)) break;
+ if (m & digit && iswdigit_l(*low, __l)) break;
+ if (m & punct && iswpunct_l(*low, __l)) break;
+ if (m & xdigit && iswxdigit_l(*low, __l)) break;
+ if (m & blank && iswblank_l(*low, __l)) break;
#endif
}
return low;
Modified: libcxx/trunk/www/results.Linux.html
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/www/results.Linux.html?rev=161192&r1=161191&r2=161192&view=diff
==============================================================================
--- libcxx/trunk/www/results.Linux.html (original)
+++ libcxx/trunk/www/results.Linux.html Thu Aug 2 13:35:07 2012
@@ -50,10 +50,6 @@
locale.codecvt/
locale.codecvt.members/
wchar_t_out.pass.cpp: Needs investigation.
- locale.ctype.byname/
- is_1.pass.cpp: Fails because of bug in ctype_byname::do_[scan_]is
- for non is-mask platforms. Patch in progress.
- scan_is.pass.cpp: idem.
widen_1.pass.cpp: Fails due to not converting some out of bounds
characters the same way as expected. Needs investigation.
widen_many.pass.cpp: idem.
More information about the cfe-commits
mailing list