]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Add missing parentheses to tests with wrong precedence
authorJonathan Wakely <jwakely@redhat.com>
Tue, 30 Sep 2025 16:10:42 +0000 (17:10 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 1 Oct 2025 12:55:04 +0000 (13:55 +0100)
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/22_locale/time_get/get/wchar_t/3.cc: Likewise.
* testsuite/28_regex/algorithms/regex_match/multiline.cc:
Likewise.

Reviewed-by: Tomasz KamiƄski <tkaminsk@redhat.com>
libstdc++-v3/testsuite/22_locale/time_get/get/char/3.cc
libstdc++-v3/testsuite/22_locale/time_get/get/wchar_t/3.cc
libstdc++-v3/testsuite/28_regex/algorithms/regex_match/multiline.cc

index 48a5f12e26e8415f8ea97ede2c31bdb36cd15347..49bcd2adbcb1c133402c601269dc083298c06c93 100644 (file)
@@ -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");
index b7eb5bcb204ad9cd444413c7f710eeb048bf7ced..4b1b6e4924e60576ab3eefbadca963eff02ccf87 100644 (file)
@@ -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");
index a1982fc8f786de6806ee9d6fe033c1fbd1ad2a6d..f4b3cf03a2250d55f7ed9aaaf63e33faac0a7ad0 100644 (file)
@@ -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) );
 }