[clang] [clang] Reject array comparisons in C++26 for unknown/dependent types in templates (PR #191101)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 17 09:13:41 PDT 2026
================
@@ -12487,10 +12487,6 @@ 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())
- return;
----------------
PrabbyDD wrote:
In an earlier comment you mentioned to move this check out of `diagnoseTautologicalComparison()`. Is that not still true? Or am I misunderstanding which check we were talking about? This one made the most sense because its directly referencing the templating.
https://github.com/llvm/llvm-project/pull/191101
More information about the cfe-commits
mailing list