[clang] [Clang][Parser] Fix name lookup of template parameters for out-of-line specializations (PR #101020)

via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 30 00:35:48 PDT 2024


================
@@ -151,4 +152,25 @@ namespace SearchClassBetweenTemplateParameterLists {
   void A<T>::B<BB>::k(V) { // expected-error {{does not match}}
     BB bb; // expected-error {{incomplete type}}
   }
+
+  int CC;
+  template <typename> struct C;
+#if __cplusplus >= 202003L
+  template <typename> struct D;
+  template <class> concept True = true;
+#endif
 }
+
+template <typename CC>
+struct SearchClassBetweenTemplateParameterLists::C {
+  void foo(CC) {} // This should find the template type parameter.
+};
+
+#if __cplusplus >= 202003L
+
+template <True CC>
+struct SearchClassBetweenTemplateParameterLists::D<CC> {
+  void foo(CC);
+};
+
----------------
cor3ntin wrote:

- Can you add a test with NTTP template params?
- Do we have tests for that sort of lookup in requires clause / return types?
- Maybe a test that check that if both names are a `typename` we find the correct one

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


More information about the cfe-commits mailing list