https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104326
Bug ID: 104326
Summary: Deduction failure for parameter pack in template
template non-type parameter
Product: gcc
Version: 11.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: colavitam at gmail dot com
Target Milestone: ---
Consider the following code:
```
template <typename... Args>
struct tuple {};
template <typename>
struct Test;
template <
typename... Types,
template <Types> typename... Outer,
Types... Inner
>
struct Test<tuple<Outer<Inner>...>> {};
template <long T> struct O1 {};
template <long T> struct O2 {};
template <unsigned T> struct O3 {};
Test<tuple<O1<1>, O2<2>>> test1;
Test<tuple<O1<1>, O2<2>, O3<3>>> test2;
```
This code is rejected by gcc and accepted by clang.
gcc accepts the definition of test1 but rejects test2. It appears as though
Types is not being correctly expanded with the template template parameter.