<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/104189>104189</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang 19 regression matching constrained template to unconstrained template template parameter
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:frontend,
concepts,
regression:19
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
CaseyCarter
</td>
</tr>
</table>
<pre>
Compiling this program fragment:
```c++
template <template <class, class...> class>
constexpr bool f() { return true; }
template <class> class unconstrained {};
static_assert(f<unconstrained>()); // Fine
template <class> concept True = true;
template <True> class constrained {};
static_assert(f<constrained>()); // error: too many template arguments for class template 'constrained'
```
with clang 19.1.0-rc2 under `-std=c++20` diagnoses:
```
repro.cpp:9:17: error: too many template arguments for class template 'constrained'
1 | template <template <class, class...> class>
| ~
2 | constexpr bool f() { return true; }
3 |
4 | template <class> class unconstrained {};
5 | static_assert(f<unconstrained>()); // Fine
6 |
7 | template <class> concept True = true;
8 | template <True> class constrained {};
9 | static_assert(f<constrained>()); // error: too many template arguments for class template 'constrained'
| ^
1 error generated.
```
The `constrained` case should be as well-formed as the `unconstrained` case since [temp.arg.template]/3 says the constraints on the argument should be ignored when the template template parameter is not constrained. Note that the release versions of the "big three" (including Clang 18) compile this fragment without issue (https://godbolt.org/z/qYr8orqz7).
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8VU9z47YP_TTwBRONRFqSddDBsdfH3ymX36lDi7DEjkRqQSpp9tDP3qHkf0nabLfbqUczJik94BF4AJT3prVENeSPkO9Xagqd43qnPL3uFAfi1dHp13rnhtH0xrYYOuNxZNeyGvDEqh3IBpBbSPeQbqFIl6cB8Rif-TTQMPYqEILc3a-bXnkPYofzIkkSkF-WNcgvC7Rx1gf6bWQ8OtfjCcQGRIVQPiJTmNhi4IlAPiKU-zOHDz4vJhfbONnZKitjSUdTESrPXH1QwTS_KO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