[clang] [Clang][NFC] Fix a warning in TransformNestedRequirement (PR #164148)

Younan Zhang via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 18 20:41:14 PDT 2025


https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/164148

The logical or expression should be parenthesized.

Fixes https://github.com/llvm/llvm-project/issues/164104

>From c9216a6fd9dbdc2b7cb10f7d30aed4ed18ff987f Mon Sep 17 00:00:00 2001
From: Younan Zhang <zyn7109 at gmail.com>
Date: Sun, 19 Oct 2025 11:38:26 +0800
Subject: [PATCH] [Clang][NFC] Fix a warning in TransformNestedRequirement

The logical or expression should be parenthesized.

Fixes https://github.com/llvm/llvm-project/issues/164104
---
 clang/lib/Sema/SemaTemplateInstantiate.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp b/clang/lib/Sema/SemaTemplateInstantiate.cpp
index ca7e3b264cec4..038f39633760d 100644
--- a/clang/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiate.cpp
@@ -2864,9 +2864,9 @@ TemplateInstantiator::TransformNestedRequirement(
         TemplateArgs, Constraint->getSourceRange(), Satisfaction,
         /*TopLevelConceptId=*/nullptr, &NewConstraint);
 
-    assert(!Success || !Trap.hasErrorOccurred() &&
-                           "Substitution failures must be handled "
-                           "by CheckConstraintSatisfaction.");
+    assert((!Success || !Trap.hasErrorOccurred()) &&
+           "Substitution failures must be handled "
+           "by CheckConstraintSatisfaction.");
   }
 
   if (!Success || Satisfaction.HasSubstitutionFailure())



More information about the cfe-commits mailing list