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

            Bug ID: 125333
           Summary: Pack expansion of using-declaration of conversion
                    operator 'taints' the type pack
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mital at mitalashok dot co.uk
  Target Milestone: ---

<https://godbolt.org/z/Wxc5E3fET>:

    template<typename... T>
    struct X {};

    template <typename U>
    struct Y {
        operator U();
    };

    template <typename... V>
    struct Z : Y<V>... {
        using Y<V>::operator V...;

        X<V...> x;
    };

    Z<int, double> z;

Output:

example.cpp: In instantiation of 'struct Z<operator int, operator double>':
example.cpp16:16:   required from here
   16 | Z<int, double> z;
      |                ^
example.cpp:13:13: error: type/value mismatch at argument 1 in template
parameter list for 'template<class ... T> struct X'
   13 |     X<V...> x;
      |             ^
example.cpp:13:13: note:   expected a type, got 'operator int'
example.cpp:13:13: error: type/value mismatch at argument 1 in template
parameter list for 'template<class ... T> struct X'
example.cpp:13:13: note:   expected a type, got 'operator double'

It seems to have turned T -> operator T?

Potentially related: Bug 108090 and Bug 125284

Reply via email to