public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/45228]  New: Can't copy-construct "tuple<int,int,int>" from "const tuple<int,int,int>" rvalue
@ 2010-08-07 20:03 jorrit at jorrit dot de
  2010-08-07 20:25 ` [Bug libstdc++/45228] " jorrit at jorrit dot de
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: jorrit at jorrit dot de @ 2010-08-07 20:03 UTC (permalink / raw)
  To: gcc-bugs

The following program fails to compile:
======================================================================
#include <tuple>

typedef std::tuple<int,int,int> Tuple;
//typedef std::tuple<int,int> Tuple;

      Tuple A() { return Tuple(); }
const Tuple B() { return Tuple(); }

int main()
{
  Tuple test(B());
  //Tuple test(A());
}
======================================================================
The program compiles successfully when A() is used instead of B() to
initialize the "test", or when a two-element tuple is used instead of a
three-element tuple.

This has happened with an svn snapshot of of g++-4.6 (Debians gcc-snapshot
version 20100702-1) and with g++-4.4 (Debians g++-4.4 version 4.4.4-7).

The compiler output is
======================================================================
export PATH=/usr/lib/gcc-snapshot/bin:$PATH && cd
~/src/dune2/dune-pdelab/dune/pdelab/test && g++ --version && g++ --std=c++0x
-O0 -Wall tupletest.cc -o tupletest
g++ (Debian 20100702-1) 4.6.0 20100702 (experimental) [trunk revision 161740]
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

In file included from tupletest.cc:1:0:
/usr/lib/gcc-snapshot/lib/gcc/i486-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:
In constructor 'std::_Head_base<_Idx, _Head, false>::_Head_base(_UHead&&) [with
_UHead = const std::tuple<int, int, int>, unsigned int _Idx = 0u, _Head =
int]':
/usr/lib/gcc-snapshot/lib/gcc/i486-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:161:38:
  instantiated from 'std::_Tuple_impl<_Idx, _Head, _Tail
...>::_Tuple_impl(_UHead&&, _UTail&& ...) [with _UHead = const std::tuple<int,
int, int>, _UTail = {}, unsigned int _Idx = 0u, _Head = int, _Tail = {int,
int}]'
/usr/lib/gcc-snapshot/lib/gcc/i486-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:239:54:
  instantiated from 'std::tuple< <template-parameter-1-1> >::tuple(_UElements&&
...) [with _UElements = {const std::tuple<int, int, int>}, _Elements = {int,
int, int}]'
tupletest.cc:11:17:   instantiated from here
/usr/lib/gcc-snapshot/lib/gcc/i486-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:94:42:
error: cannot convert 'const std::tuple<int, int, int>' to 'int' in
initialization
======================================================================


-- 
           Summary: Can't copy-construct "tuple<int,int,int>" from "const
                    tuple<int,int,int>" rvalue
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jorrit at jorrit dot de
 GCC build triplet: i486-linux-gnu
  GCC host triplet: i486-linux-gnu
GCC target triplet: i486-linux-gnu


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


^ permalink raw reply	[flat|nested] 10+ messages in thread
[parent not found: <bug-45228-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2011-03-30 10:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-07 20:03 [Bug libstdc++/45228] New: Can't copy-construct "tuple<int,int,int>" from "const tuple<int,int,int>" rvalue jorrit at jorrit dot de
2010-08-07 20:25 ` [Bug libstdc++/45228] " jorrit at jorrit dot de
2010-08-07 22:19 ` [Bug libstdc++/45228] [C++0x] " paolo dot carlini at oracle dot com
2010-08-09 13:22 ` jason at redhat dot com
2010-08-09 13:31 ` paolo dot carlini at oracle dot com
2010-08-09 13:39 ` jason at redhat dot com
2010-08-09 13:45 ` paolo dot carlini at oracle dot com
2010-08-10  7:18 ` paolo at gcc dot gnu dot org
2010-08-10  7:23 ` paolo dot carlini at oracle dot com
     [not found] <bug-45228-4@http.gcc.gnu.org/bugzilla/>
2011-03-30 10:48 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).