[clang] [Clang] Reject declaring an alias template with the same name as its template parameter. (PR #123533)

Valentyn Yukhymenko via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 19 15:36:05 PST 2025


================
@@ -65,7 +65,8 @@ namespace InFunctions {
   template<typename...T> struct S3 { // expected-note {{template parameter is declared here}}
     template<typename Z> using T = int; // expected-error {{declaration of 'T' shadows template parameter}}
   };
-  template<typename Z> using Z = Z;
+  template<typename Z> // expected-note {{template parameter is declared here}}
+  using Z = Z; // expected-error {{declaration of 'Z' shadows template parameter}}
----------------
BaLiKfromUA wrote:

I am not sure that `InFunctions` is the correct namespace for this test but it was here before and I adapted this use case to the new behavior.

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


More information about the cfe-commits mailing list