[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
Wed Apr 15 08:51:40 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)))
----------------
PrabbyDD wrote:

Ok I pushed a change that should move the entire check but I am not sure if the check from `diagnoseTautologicalComparisons` should return a QualType or if I should have just kept it the same as it was. Let me know what you think. 

https://github.com/llvm/llvm-project/pull/191101


More information about the cfe-commits mailing list