[clang] [Clang] Correctly construct template arguments for template template parameters (PR #76811)

Younan Zhang via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 23 21:46:24 PDT 2026


================
@@ -59,3 +59,32 @@ struct Nothing {};
 
 // FIXME: Wait the standard to clarify the intent.
 template<> template<> Z<Nothing> S5<Z>::V<Nothing>;
+
+namespace GH57410 {
+
+template<typename T>
+concept True = true;
+
+template<typename T>
+concept False = false; // #False
+
+template <class> struct S {};
+
+template<template<True T> typename Wrapper>
+using Test = Wrapper<int>;
+
+template<template<False T> typename Wrapper> // #TTP-Wrapper
+using Test = Wrapper<int>; // expected-error {{constraints not satisfied for template template parameter 'Wrapper' [with T = int]}}
+
+// expected-note@#TTP-Wrapper {{'int' does not satisfy 'False'}}
+// expected-note@#False {{evaluated to false}}
+
+template <typename U, template<False> typename T>
+void foo(T<U>); // #foo
+
+void bar() {
+  foo<int>(S<int>{}); // expected-error {{no matching function for call to 'foo'}}
----------------
zyn0217 wrote:

@mizvekov Can you submit an issue? Thanks!

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


More information about the cfe-commits mailing list