[Bug c++/80871] Template partial ordering considered non-ambiguous with deduced and non-deduced parameter packs

vittorio.romeo at outlook dot com gcc-bugzilla@gcc.gnu.org
Sat Nov 11 08:51:00 GMT 2017


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

Vittorio Romeo <vittorio.romeo at outlook dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vittorio.romeo at outlook dot com

--- Comment #1 from Vittorio Romeo <vittorio.romeo at outlook dot com> ---
Got hit again today, while trying to write an `overload(...)` class:

    template <typename... Ts>
    struct overload : Ts...
    {
        template <typename... TFwds>
        constexpr overload(TFwds&&... xs) 
            : Ts{FWD(xs)}...
        {
        }

        using Ts::operator()...;
    };

    template <typename... TFwds>
    overload(TFwds&&...) -> overload<std::decay_t<TFwds>...>;

With the code above

    auto o = overload{[]{}};

fails to compile. See: https://godbolt.org/g/Rb3ZKt


More information about the Gcc-bugs mailing list