[Bug c++/56319] implicit copy constructor is not deleted when it is ill formed

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Feb 14 12:37:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56319

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2013-02-14 12:36:56 UTC ---
Reduced to remove <tuple> dependency

template<typename T>
struct tuple
{
    T t;
};

template<class... Types>
tuple<Types&&...> forward_as_tuple(Types&&... t) noexcept
{
    return tuple<Types&&...>{ static_cast<Types&&>(t)... };
}

template <typename... Args>
void fooImpl(tuple<Args...> args)
{
}

template <typename... Args>
void foo(tuple<Args...> args)
{
    fooImpl(args);
}

enum E { id };

int main()
{
    foo(forward_as_tuple(id));
    return 0;
}



More information about the Gcc-bugs mailing list