On Wed, Oct 1, 2025 at 2:42 PM Jonathan Wakely <[email protected]> wrote:
> On Wed, 1 Oct 2025 at 13:38, Jonathan Wakely wrote:
> >
> > These tests are currently evaluated as (err == failbit)|eofbit which is
> > not what we want. It should be err == (failbit|eofbit).
> >
> > libstdc++-v3/ChangeLog:
> >
> > * testsuite/22_locale/time_get/get/char/3.cc: Add parentheses to
> > x == y|z expression.
> > * testsuite/28_regex/algorithms/regex_match/multiline.cc:
> > Likewise.
>
>
> There's another case of the same bug:
>
> --- a/libstdc++-v3/testsuite/22_locale/time_get/get/wchar_t/3.cc
> +++ b/libstdc++-v3/testsuite/22_locale/time_get/get/wchar_t/3.cc
> @@ -226,7 +226,7 @@ test01()
> format = L"%e";
> ret = tget.get(iter(iss), end, iss, err, &time,
> format.data(), format.data()+format.size());
> - VERIFY( err == ios_base::failbit|ios_base::eofbit );
> + VERIFY( err == (ios_base::failbit|ios_base::eofbit) );
> VERIFY( ret == end );
>
> iss.str(L"35");
>
> I've fixed that locally.
>
LGTM. I was encountering that a lot when combining _ChronoParts flags.
>
>
>
>
>
> >
> > ---
> >
> > Tested powerpc64le-linux.
> >
> > libstdc++-v3/testsuite/22_locale/time_get/get/char/3.cc | 2 +-
> > .../testsuite/28_regex/algorithms/regex_match/multiline.cc | 4 ++--
> > 2 files changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get/char/3.cc
> b/libstdc++-v3/testsuite/22_locale/time_get/get/char/3.cc
> > index 48a5f12e26e8..49bcd2adbcb1 100644
> > --- a/libstdc++-v3/testsuite/22_locale/time_get/get/char/3.cc
> > +++ b/libstdc++-v3/testsuite/22_locale/time_get/get/char/3.cc
> > @@ -226,7 +226,7 @@ test01()
> > format = "%e";
> > ret = tget.get(iter(iss), end, iss, err, &time,
> > format.data(), format.data()+format.size());
> > - VERIFY( err == ios_base::failbit|ios_base::eofbit );
> > + VERIFY( err == (ios_base::failbit|ios_base::eofbit) );
> > VERIFY( ret == end );
> >
> > iss.str("35");
> > diff --git
> a/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/multiline.cc
> b/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/multiline.cc
> > index a1982fc8f786..f4b3cf03a225 100644
> > --- a/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/multiline.cc
> > +++ b/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/multiline.cc
> > @@ -27,11 +27,11 @@ test01()
> > VERIFY(std::regex_search("x\nab\nx", ml));
> >
> > ml.assign("a$\n^b$\n^c", ECMAScript|__multiline);
> > - VERIFY( ml.flags() == ECMAScript|__multiline );
> > + VERIFY( ml.flags() == (ECMAScript|__multiline) );
> > VERIFY( regex_search("a\nb\nc", ml) );
> >
> > ml.assign("a$\n^b$\n^c", ECMAScript|__multiline|icase);
> > - VERIFY( ml.flags() == ECMAScript|__multiline|icase );
> > + VERIFY( ml.flags() == (ECMAScript|__multiline|icase) );
> > VERIFY( regex_search("A\nB\nC", ml) );
> > }
> >
> > --
> > 2.51.0
> >
>
>