зеркало из https://github.com/microsoft/clang-1.git
Remove broken assert from CodeGen. Better check is done in Sema.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45358 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
4c92b43383
Коммит
9bb947adc5
|
@ -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;
|
||||
|
||||
|
|
|
@ -3,3 +3,5 @@
|
|||
typedef int Int;
|
||||
|
||||
int test1(int *a, Int *b) { return a - b; }
|
||||
|
||||
int test2(const char *a, char *b) { return b - a; }
|
||||
|
|
Загрузка…
Ссылка в новой задаче