]> granicus.if.org Git - clang/commitdiff
Fix MSVC warning:
authorFrancois Pichet <pichet2000@gmail.com>
Mon, 6 Jun 2011 02:42:06 +0000 (02:42 +0000)
committerFrancois Pichet <pichet2000@gmail.com>
Mon, 6 Jun 2011 02:42:06 +0000 (02:42 +0000)
"unsafe mix of type 'int' and type 'bool' in operation"

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132674 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Sema/Sema.h

index 4156d6704e5865f3d3a3c8371af54956d751e8a6..87379d73ebbe7bfcb1e81110a8a9e2907760a2ed 100644 (file)
@@ -624,10 +624,14 @@ public:
     void setMethod(CXXMethodDecl *MD) { Pair.setPointer(MD); }
 
     bool hasSuccess() const { return Pair.getInt() & 0x1; }
-    void setSuccess(bool B) { Pair.setInt(B | hasConstParamMatch() << 1); }
+    void setSuccess(bool B) {
+      Pair.setInt(unsigned(B) | hasConstParamMatch() << 1);
+    }
 
     bool hasConstParamMatch() const { return Pair.getInt() & 0x2; }
-    void setConstParamMatch(bool B) { Pair.setInt(B << 1 | hasSuccess()); }
+    void setConstParamMatch(bool B) {
+      Pair.setInt(unsigned(B) << 1 | hasSuccess());
+    }
   };
 
   /// \brief A cache of special member function overload resolution results