[clang] [clang] visit constraint of NTTP (PR #91842)

Younan Zhang via cfe-commits cfe-commits at lists.llvm.org
Sat May 11 02:41:37 PDT 2024


================
@@ -79,14 +79,14 @@ template<C     T, int I> struct Y2<T*, I, I+1+1> {}; // expected-note {{partial
 template<C T, C auto I, int W, A S, template<typename, auto, int, A, typename...> class U, typename... Z>
 struct Y3 { Y3()=delete; };
 template<C T, D auto I, int W, A S, template<typename, auto, int, A, typename...> class U, typename... Z>
-struct Y3<T, I, W, S, U, Z...> { Y3()=delete; };
+struct Y3<T, I, W, S, U, Z...> { Y3()=delete; }; // expected-note {{partial specialization matches [with T = int, I = 1, W = 1, S = A{}, U = S, Z = <int>]}}
 template<C T, E auto I, int W, A S, template<typename, auto, int, A, typename...> class U, typename... Z>
-struct Y3<T, I, W, S, U, Z...> {};
+struct Y3<T, I, W, S, U, Z...> {}; // expected-note {{partial specialization matches [with T = int, I = 1, W = 1, S = A{}, U = S, Z = <int>]}}
 
 void f() {
   Y1<int, 2> a;
   Y2<char*, 1, 3> b; // expected-error {{ambiguous partial specializations}}
-  Y3<int, 1, 1, A{}, S, int> c;
+  Y3<int, 1, 1, A{}, S, int> c; // expected-error {{ambiguous partial specializations of 'Y3<int, 1, 1, A{}, S, int>'}}
----------------
zyn0217 wrote:

[[temp.over.link]p6.3](https://eel.is/c++draft/temp.over.link#6.3)

> Two template-parameters are equivalent under the following conditions:

> if they declare non-type template parameters, they have equivalent types *ignoring* the use of type-constraints for placeholder types

Oops, I forgot I posted the standard wording on that issue, and therefore this seems reasonable..?

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


More information about the cfe-commits mailing list