Issue 71811
Summary `substitution failure` for template argument pack in template argument
Labels new issue
Assignees
Reporter rroohhh
    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)
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to