diff options
Diffstat (limited to 'clang/CodeGen/CGExprScalar.cpp')
-rw-r--r-- | clang/CodeGen/CGExprScalar.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/clang/CodeGen/CGExprScalar.cpp b/clang/CodeGen/CGExprScalar.cpp index f20c43f5228..81a0cedf4e9 100644 --- a/clang/CodeGen/CGExprScalar.cpp +++ b/clang/CodeGen/CGExprScalar.cpp @@ -756,10 +756,7 @@ Value *ScalarExprEmitter::VisitBinSub(const BinaryOperator *E) { Value *RHS = Visit(E->getRHS()); const QualType LHSType = E->getLHS()->getType().getCanonicalType(); - const QualType RHSType = E->getRHS()->getType().getCanonicalType(); - assert(LHSType == RHSType && "Can't subtract different pointer types"); - - QualType LHSElementType = cast<PointerType>(LHSType)->getPointeeType(); + const QualType LHSElementType = cast<PointerType>(LHSType)->getPointeeType(); uint64_t ElementSize = CGF.getContext().getTypeSize(LHSElementType, SourceLocation()) / 8; |