diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-06-01 15:12:24 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-06-01 15:12:24 +0000 |
commit | 17e37c7959d60d8bfcbc8cb5630d3101ae583be5 (patch) | |
tree | f49adbbb2f87372ebd93cff21d76293e0208ef72 /lib/Sema/SemaExpr.cpp | |
parent | 4e1ff2b6c9bdffd1cc202a2c9a38393d78f4bca5 (diff) |
Implement comparisons between nullptr and Objective-C object
pointers. Fixes PR10052.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132397 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index e75af910bd..9afd5f8ccd 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -7536,7 +7536,7 @@ QualType Sema::CheckCompareOperands(ExprResult &lex, ExprResult &rex, SourceLoca // Comparison of pointers with null pointer constants and equality // comparisons of member pointers to null pointer constants. if (RHSIsNull && - ((lType->isPointerType() || lType->isNullPtrType()) || + ((lType->isAnyPointerType() || lType->isNullPtrType()) || (!isRelational && lType->isMemberPointerType()))) { rex = ImpCastExprToType(rex.take(), lType, lType->isMemberPointerType() @@ -7545,7 +7545,7 @@ QualType Sema::CheckCompareOperands(ExprResult &lex, ExprResult &rex, SourceLoca return ResultTy; } if (LHSIsNull && - ((rType->isPointerType() || rType->isNullPtrType()) || + ((rType->isAnyPointerType() || rType->isNullPtrType()) || (!isRelational && rType->isMemberPointerType()))) { lex = ImpCastExprToType(lex.take(), rType, rType->isMemberPointerType() |