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. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@161192 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
403f91ad2c
commit
ef793f2513
@ -1052,17 +1052,17 @@ ctype_byname<wchar_t>::do_is(mask m, char_type c) const
|
||||
#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 @@ ctype_byname<wchar_t>::do_scan_is(mask m, const char_type* low, const char_type*
|
||||
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;
|
||||
|
@ -50,10 +50,6 @@ localization/
|
||||
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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user