Patch by GM: Making implicit conversion to bool explicit in <ios> and <__locale>

llvm-svn: 193085
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: 5b40666c6cb1e91a1749d2aaf75ded474bc35026
diff --git a/include/__locale b/include/__locale
index 3bf617d..2073e1b 100644
--- a/include/__locale
+++ b/include/__locale
@@ -512,7 +512,7 @@
     _LIBCPP_ALWAYS_INLINE
     bool is(mask __m, char_type __c) const
     {
-        return isascii(__c) ? __tab_[static_cast<int>(__c)] & __m : false;
+        return isascii(__c) ? (__tab_[static_cast<int>(__c)] & __m) !=0 : false;
     }
 
     _LIBCPP_ALWAYS_INLINE
diff --git a/include/ios b/include/ios
index 0dd328d..d95f18a 100644
--- a/include/ios
+++ b/include/ios
@@ -535,21 +535,21 @@
 bool
 ios_base::eof() const
 {
-    return __rdstate_ & eofbit;
+    return (__rdstate_ & eofbit) != 0;
 }
 
 inline _LIBCPP_INLINE_VISIBILITY
 bool
 ios_base::fail() const
 {
-    return __rdstate_ & (failbit | badbit);
+    return (__rdstate_ & (failbit | badbit)) != 0;
 }
 
 inline _LIBCPP_INLINE_VISIBILITY
 bool
 ios_base::bad() const
 {
-    return __rdstate_ & badbit;
+    return (__rdstate_ & badbit) != 0;
 }
 
 inline _LIBCPP_INLINE_VISIBILITY