Fix dangling else clause. Bug found and fixed by Dimitry Andric.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@157779 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/__bit_reference b/include/__bit_reference
index 28dedfd..21ce11f 100644
--- a/include/__bit_reference
+++ b/include/__bit_reference
@@ -950,11 +950,15 @@
__storage_type __ddn = _VSTD::min<__storage_type>(__dn, __clz_r);
__m = (~__storage_type(0) << __first2.__ctz_) & (~__storage_type(0) >> (__clz_r - __ddn));
if (__first2.__ctz_ > __first1.__ctz_)
+ {
if ((*__first2.__seg_ & __m) != (__b << (__first2.__ctz_ - __first1.__ctz_)))
return false;
+ }
else
+ {
if ((*__first2.__seg_ & __m) != (__b >> (__first1.__ctz_ - __first2.__ctz_)))
return false;
+ }
__first2.__seg_ += (__ddn + __first2.__ctz_) / __bits_per_word;
__first2.__ctz_ = static_cast<unsigned>((__ddn + __first2.__ctz_) % __bits_per_word);
__dn -= __ddn;