This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/69853] An inheriting constructor of the class that inherited std::tuple isn't called correctly


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]