https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113443

            Bug ID: 113443
           Summary: GCC rejects valid program involving parameter packs
                    with in between class type
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jlame646 at gmail dot com
  Target Milestone: ---

In the following program gcc accepts the call when a built in type object is
passed while rejects the call when a class type object is passed.
https://godbolt.org/z/Ez5oocGrr

```
#include <array>
#include <cstddef>
#include <tuple>
#include <type_traits>
#include <iostream>

struct in_between{};
template <typename... T>
struct args_tag
{

};

template <typename... T>
void bar(args_tag<T...>, std::type_identity_t<T>..., int,
std::type_identity_t<T>...) {}
template <typename... T>
void bar(args_tag<T...>, std::type_identity_t<T>..., in_between,
std::type_identity_t<T>...) {}

// example
int main() { 

     bar(args_tag<int, int>{}, 4, 8, in_between{}, 16, 23); // gcc rejects this 
     //bar(args_tag<int, int>{}, 4, 8, int{}, 16, 23); //GCC accepts this
}
```

Reply via email to