<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/71811>71811</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
`substitution failure` for template argument pack in template argument
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
rroohhh
</td>
</tr>
</table>
<pre>
The following code
```cpp
#include <utility>
#include <variant>
#include <vector>
template <class T>
class Wrap {};
template <
template <typename>
class Prefix,
template <typename>
typename OuterType,
typename... InnerTypes>
auto prefix_inner_types_helper(OuterType<InnerTypes...> v) -> OuterType<Prefix<InnerTypes>...>;
using ReadResult = std::variant<std::monostate, std::vector<int>>;
using PromiseType =
decltype(prefix_inner_types_helper<Wrap>(std::declval<ReadResult>()));
```
gives the following error:
```
<source>:21:14: error: no matching function for call to 'prefix_inner_types_helper'
21 | decltype(prefix_inner_types_helper<Wrap>(std::declval<ReadResult>()));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<source>:15:6: note: candidate template ignored: substitution failure [with Prefix = Wrap]: template template argument has different template parameters than its corresponding template template parameter
21 | auto prefix_inner_types_helper(OuterType<InnerTypes...> v) -> OuterType<Prefix<InnerTypes>...>;
| ^
22 |
23 |
24 | using ReadResult = std::variant<std::monostate, std::vector<int>>;
25 |
26 | using PromiseType =
27 | decltype(prefix_inner_types_helper<Wrap>(std::declval<ReadResult>()));
| ~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Compiler returned: 1
```
while `gcc` accepts it without any complaints.
(See https://godbolt.org/z/7qoWsWe4a)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEVkGTqzYM_jXORfMYsEMIBw7Z7Gamp7553Zk97jhGgFtjU1vsdnvob-8YsiRvk_faS_sYJmBJn2TpkxxkCLq1iBXL71h-v5Ijdc5X3jvXdd3q6Oq36rFDaJwx7lXbFpSrka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