[clang] [clang] Reject array comparisons in C++26 for unknown/dependent types in templates (PR #191101)
Younan Zhang via cfe-commits
cfe-commits at lists.llvm.org
Sat Apr 11 20:25:57 PDT 2026
================
@@ -12488,8 +12488,7 @@ static void diagnoseTautologicalComparison(Sema &S, SourceLocation Loc,
QualType LHSType = LHS->getType();
QualType RHSType = RHS->getType();
if (LHSType->hasFloatingRepresentation() ||
- (LHSType->isBlockPointerType() && !BinaryOperator::isEqualityOp(Opc)) ||
- S.inTemplateInstantiation())
+ (LHSType->isBlockPointerType() && !BinaryOperator::isEqualityOp(Opc)))
----------------
zyn0217 wrote:
This is incorrect, see our discussion in the issue.
I think you should follow @Sirraide 's opinion and move the checking out of this function.
https://github.com/llvm/llvm-project/pull/191101
More information about the cfe-commits
mailing list