https://github.com/zyn0217 updated 
https://github.com/llvm/llvm-project/pull/184771

>From 176953dc466bb82e85d6d4973de086a5390d2f33 Mon Sep 17 00:00:00 2001
From: Younan Zhang <[email protected]>
Date: Thu, 5 Mar 2026 18:52:34 +0800
Subject: [PATCH 1/2] [Clang] Fix a concept cache bug on DependentNameType

The default RAV implementation refuses to traverse NNS's typeloc recursively,
and template parameters inside DependentNameType are overlooked
inadvertently.

No release note as what regression patches always do.
---
 clang/lib/Sema/SemaConcept.cpp                |  5 +--
 .../instantiate-requires-expr.cpp             | 31 +++++++++++++++++++
 2 files changed, 34 insertions(+), 2 deletions(-)

diff --git a/clang/lib/Sema/SemaConcept.cpp b/clang/lib/Sema/SemaConcept.cpp
index 38791940247cb..b4816bcbd0ee8 100644
--- a/clang/lib/Sema/SemaConcept.cpp
+++ b/clang/lib/Sema/SemaConcept.cpp
@@ -381,9 +381,10 @@ class HashParameterMapping : public 
RecursiveASTVisitor<HashParameterMapping> {
     return true;
   }
 
-  bool TraverseTypeLoc(TypeLoc TL, bool TraverseQualifier = true) {
+  bool TraverseTypeLoc(TypeLoc TL, bool /*TraverseQualifier*/ = true) {
     // We don't care about TypeLocs. So traverse Types instead.
-    return TraverseType(TL.getType().getCanonicalType(), TraverseQualifier);
+    return TraverseType(TL.getType().getCanonicalType(),
+                        /*TraverseQualifier=*/true);
   }
 
   bool TraverseTagType(const TagType *T, bool TraverseQualifier) {
diff --git a/clang/test/SemaTemplate/instantiate-requires-expr.cpp 
b/clang/test/SemaTemplate/instantiate-requires-expr.cpp
index 32ad5374f46a7..b89cab615f997 100644
--- a/clang/test/SemaTemplate/instantiate-requires-expr.cpp
+++ b/clang/test/SemaTemplate/instantiate-requires-expr.cpp
@@ -278,3 +278,34 @@ namespace sugared_instantiation {
   static_assert(requires { { f() } -> C; });
   static_assert(requires { { f() } -> D; });
 } // namespace sugared_instantiation
+
+namespace GH184562 {
+
+template <typename T>
+struct tid {
+  using type = T;
+};
+template <typename T>
+using tid_t = tid<T>::type;
+
+template <class T, int N = ::tid_t<T>::value>
+concept req = N < 3 || requires { typename T::template as_two<3>; };
+
+struct two {
+  static constexpr int value = 2;
+};
+
+struct three {
+  static constexpr int value = 3;
+  template <int>
+  using as_two = two;
+};
+
+template <req T>
+struct test {
+  using type = test<typename T::template as_two<1>>;
+};
+
+test<three> x;
+
+}

>From cb8510d7b6fda6c2a0edbc68c11cda51f65504e5 Mon Sep 17 00:00:00 2001
From: Younan Zhang <[email protected]>
Date: Thu, 5 Mar 2026 19:14:37 +0800
Subject: [PATCH 2/2] Fix CI

---
 clang/test/SemaTemplate/instantiate-requires-expr.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/test/SemaTemplate/instantiate-requires-expr.cpp 
b/clang/test/SemaTemplate/instantiate-requires-expr.cpp
index b89cab615f997..0b73a9176da8b 100644
--- a/clang/test/SemaTemplate/instantiate-requires-expr.cpp
+++ b/clang/test/SemaTemplate/instantiate-requires-expr.cpp
@@ -288,7 +288,7 @@ struct tid {
 template <typename T>
 using tid_t = tid<T>::type;
 
-template <class T, int N = ::tid_t<T>::value>
+template <class T, int N = tid_t<T>::value>
 concept req = N < 3 || requires { typename T::template as_two<3>; };
 
 struct two {

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to