[clang] [clang] Fix const eval of constexpr-unknown relational comparisons. (PR #150088)
Shafik Yaghmour via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 22 13:53:17 PDT 2025
================
@@ -14631,8 +14631,9 @@ EvaluateComparisonBinaryOperator(EvalInfo &Info, const BinaryOperator *E,
// - Otherwise pointer comparisons are unspecified.
if (!LHSDesignator.Invalid && !RHSDesignator.Invalid && IsRelational) {
bool WasArrayIndex;
- unsigned Mismatch = FindDesignatorMismatch(
- getType(LHSValue.Base), LHSDesignator, RHSDesignator, WasArrayIndex);
+ unsigned Mismatch =
+ FindDesignatorMismatch(getType(LHSValue.Base).getNonReferenceType(),
----------------
shafik wrote:
I think it makes sense to create a local and set it to the result of `getType(LHSValue.Base).getNonReferenceType()`, comment it and then use that in the two locations you just modified.
https://github.com/llvm/llvm-project/pull/150088
More information about the cfe-commits
mailing list