Issue 130362
Summary Variadic template template parameter of another template template parameter causes spurious error upon instantiation
Labels new issue
Assignees
Reporter ednolan
    Given the following code:

```cpp
template <template <template <typename...> typename> typename>
struct foo {};

template <template <typename> typename>
struct bar {};

using baz = foo<bar>;
```

Clang 20 produces the following error:

```
<source>:1:52: error: too few template parameters in template template parameter redeclaration
    1 | template <template <template <typename...> typename> typename>
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
    2 | struct foo {};
      | ~~~~~~~~~~~~~~
    3 | 
    4 | template <template <typename> typename>
 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<source>:7:17: note: template template argument is incompatible with its corresponding template template parameter
 7 | using baz = foo<bar>;
      |                 ^
<source>:4:39: note: template parameter is declared here
    4 | template <template <typename> typename>
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
<source>:7:17: note: template template argument is incompatible with its corresponding template template parameter
    7 | using baz = foo<bar>;
      | ^
<source>:1:62: note: template parameter is declared here
    1 | template <template <template <typename...> typename> typename>
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
```

Compiler explorer link: https://godbolt.org/z/7q7n459E1

This code was accepted by Clang 19, and is accepted by GCC, MSVC, and EDG.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to