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

            Bug ID: 87001
           Summary: False error "expansion pattern 'x' contains no
                    argument packs"
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: v.reshetnikov at gmail dot com
  Target Milestone: ---

/******************* BEGIN SOURCE *******************/
template<class... T>
struct X {
    template<template<typeof(void(T))... x> class U>
    struct Y {
        template<typeof(void(T))... f>
        using type = U<f...>;
    };
};
/******************** END SOURCE ********************/

Or, without using the `typeof` extension, it can be written:

/******************* BEGIN SOURCE *******************/
template<class... T>
struct X {
    template<template<void(...x)(T)> class U>
    struct Y {
        template<void(...f)(T)>
        using type = U<f...>;
    };
};
/******************** END SOURCE ********************/


There is an unexpected error:

<source>:6:28: error: expansion pattern 'x' contains no parameter packs
6 |         using type = U<f...>;
  |                            ^
Compiler returned: 1

For comparison, it compiles fine with Clang.

Reply via email to