Fix bad APInt compare.
APInt comparison require both to have the same bitwidth. Since only the value
is needed, use the compare function APInt::isSameValue instead.
llvm-svn: 372454
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp
index b5fb7fa..c9394bb 100644
--- a/clang/lib/AST/Expr.cpp
+++ b/clang/lib/AST/Expr.cpp
@@ -3983,7 +3983,8 @@
const auto Integer1 = dyn_cast<IntegerLiteral>(Idx1);
const auto Integer2 = dyn_cast<IntegerLiteral>(Idx2);
if (Integer1 && Integer2) {
- if (Integer1->getValue() != Integer2->getValue())
+ if (!llvm::APInt::isSameValue(Integer1->getValue(),
+ Integer2->getValue()))
return false;
} else {
if (!isSameComparisonOperand(Idx1, Idx2))