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++/70511] tuple constructor from elements hides copy constructor


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

--- Comment #1 from Ivan Le Lann <ivan.lelann at free dot fr> ---
After a quick look, I'm not sure this can be called a bug.
It looks like a very unfortunate consequence of library specification.

From the mess here 
    http://en.cppreference.com/w/cpp/utility/tuple/tuple 
I understand that 
    template< class... UTypes > explicit tuple( UTypes&&... args );

is legally selected above copy construction, because it does not add "const".

Just adding "const" to original tuple declaration like this :

        const std::tuple<boost::any> tuple_test {val};

makes GCC print intuitive output : 
d
d

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