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;
typedef int Int;
int test1(int *a, Int *b) { return a - b; }
+
+int test2(const char *a, char *b) { return b - a; }