[libcxx-commits] [libcxx] 9f8ca86 - [libcxx][test] explicitly discard bitset::test's return

Casey Carter via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jan 29 10:02:07 PST 2021


Author: Casey Carter
Date: 2021-01-29T10:01:51-08:00
New Revision: 9f8ca86a87a73c4fba6f8f229008117f7d0f35ab

URL: https://github.com/llvm/llvm-project/commit/9f8ca86a87a73c4fba6f8f229008117f7d0f35ab
DIFF: https://github.com/llvm/llvm-project/commit/9f8ca86a87a73c4fba6f8f229008117f7d0f35ab.diff

LOG: [libcxx][test] explicitly discard bitset::test's return

... just in case some implementation annotates it `[[nodiscard]]`.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/utilities/template.bitset/bitset.members/test.out_of_range.pass.cpp b/libcxx/test/std/utilities/template.bitset/bitset.members/test.out_of_range.pass.cpp
index 12890159b7b9..7c05d2abfec9 100644
--- a/libcxx/test/std/utilities/template.bitset/bitset.members/test.out_of_range.pass.cpp
+++ b/libcxx/test/std/utilities/template.bitset/bitset.members/test.out_of_range.pass.cpp
@@ -19,15 +19,18 @@
 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;


        


More information about the libcxx-commits mailing list