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

            Bug ID: 109291
           Summary: type alias template rejects pack
           Product: gcc
           Version: 12.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ncm at cantrip dot org
  Target Milestone: ---

template <typename T>
struct type_identity { using type = T; };

template <typename T>
using type_identity_t = typename type_identity<T>::type;

template <typename ...Ts>
struct S1 { using alias1 = typename type_identity<Ts...>::type; };

template <typename ...Ts>
struct S2 { using alias2 = typename type_identity_t<Ts...>; };

int main() {
  S1<int>::alias1 a; // OK
  S2<int>::alias2 b; // Fails
}

// Here, alias1 is fine, but alias2, the same type, is not.
// MSVC accepts both declarations. Clang matches Gcc.

// error: pack expansion argument for non-pack parameter ‘T’ of alias template
// error: expected nested-name-specifier

Reply via email to