fix spurious warning about shifting more than size of type
authorJacob Lifshay <programmerjake@gmail.com>
Fri, 30 Jun 2017 12:20:01 +0000 (05:20 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Fri, 30 Jun 2017 12:32:18 +0000 (05:32 -0700)
src/util/bitset.h

index ca93b742e5beb05eeedfdad5b3308b0ecae909cd..f61b5c382b691197fc36b18daba9a577ec644fd7 100644 (file)
@@ -187,7 +187,9 @@ public:
     constexpr bitset(unsigned long long val) noexcept
         : Base(bit_count >= std::numeric_limits<unsigned long long>::digits ?
                    val :
-                   val & ((1ULL << bit_count) - 1ULL))
+                   val & ((1ULL << detail::Bitset_nontemplate_base::constexpr_min(
+                               bit_count, std::numeric_limits<unsigned long long>::digits - 1))
+                          - 1ULL))
     {
     }
     class reference final