[Bug libstdc++/69853] An inheriting constructor of the class that inherited std::tuple isn't called correctly
ville.voutilainen at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Feb 17 18:15:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69853
Ville Voutilainen <ville.voutilainen at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |SUSPENDED
--- Comment #2 from Ville Voutilainen <ville.voutilainen at gmail dot com> ---
The fix for http://cplusplus.github.io/LWG/lwg-active.html#2549 breaks
this code. But that breakage looks sane, because it prevents implicit
base-to-derived conversions that create temporaries. Consider the following
code,
which is valid on 5.x but ill-formed on 6:
#include <tuple>
#include <iostream>
using std::tuple;
template <class... Args> struct mytuple : tuple<Args...>
{
using tuple<Args...>::tuple;
};
void f(const mytuple<int, int>& ft)
{
std::cout << "address of ft: " << (void*)(&ft) << std::endl;
}
int main()
{
tuple<int, int> t;
std::cout << "address of t: " << (void*)(&t) << std::endl;
f(t);
}
I'll add this as additional motivation for LWG 2549. Suspending the bug for
now, until LWG gives guidance.
More information about the Gcc-bugs
mailing list