[libcxx][test] explicitly discard bitset::test's return
authorCasey Carter <Casey@Carter.net>
Fri, 29 Jan 2021 18:01:37 +0000 (10:01 -0800)
committerCasey Carter <Casey@Carter.net>
Fri, 29 Jan 2021 18:01:51 +0000 (10:01 -0800)
... just in case some implementation annotates it `[[nodiscard]]`.

libcxx/test/std/utilities/template.bitset/bitset.members/test.out_of_range.pass.cpp

index 1289015..7c05d2a 100644 (file)
 int main(int, char**) {
     {
         std::bitset<0> v;
-        try { v.test(0); assert(false); } catch (std::out_of_range const&) { }
+        try { (void) v.test(0); assert(false); }
+        catch (std::out_of_range const&) { }
     }
     {
         std::bitset<1> v("0");
-        try { v.test(2); assert(false); } catch (std::out_of_range const&) { }
+        try { (void) v.test(2); assert(false); }
+        catch (std::out_of_range const&) { }
     }
     {
         std::bitset<10> v("0000000000");
-        try { v.test(10); assert(false); } catch (std::out_of_range const&) { }
+        try { (void) v.test(10); assert(false); }
+        catch (std::out_of_range const&) { }
     }
 
     return 0;