]> granicus.if.org Git - clang/commitdiff
Use the right cast kind when comparing null to member pointers.
authorAnders Carlsson <andersca@mac.com>
Mon, 24 Aug 2009 18:03:14 +0000 (18:03 +0000)
committerAnders Carlsson <andersca@mac.com>
Mon, 24 Aug 2009 18:03:14 +0000 (18:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79927 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExpr.cpp

index 59502c4edbf9407da7bef4be123d0d6f69b16a68..d9add06ee145188d44ff276342062baf2384e45d 100644 (file)
@@ -4292,13 +4292,13 @@ QualType Sema::CheckCompareOperands(Expr *&lex, Expr *&rex, SourceLocation Loc,
     if (RHSIsNull && 
         (lType->isPointerType() ||
          (!isRelational && lType->isMemberPointerType()))) {
-      ImpCastExprToType(rex, lType);
+      ImpCastExprToType(rex, lType, CastExpr::CK_NullToMemberPointer);
       return ResultTy;
     }
     if (LHSIsNull &&
         (rType->isPointerType() ||
          (!isRelational && rType->isMemberPointerType()))) {
-      ImpCastExprToType(lex, rType);
+      ImpCastExprToType(lex, rType, CastExpr::CK_NullToMemberPointer);
       return ResultTy;
     }