[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#592153: /usr/include/c++/4.4/tuple: Can't copy-construct "tuple<int, int, int>" from "const tuple<int, int, int>" rvalue



Package: libstdc++6-4.4-dev
Version: 4.4.4-7
Severity: normal
File: /usr/include/c++/4.4/tuple
Forwarded: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45228

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.

In addition to the compiler above, this has also happened with gcc-snapshot
20100702-1.

The compiler output is
======================================================================
cd ~/src/dune2/dune-pdelab/dune/pdelab/test && g++ --version && g++ --std=c++0x -O0 -Wall tupletest.cc -o tupletest
g++ (Debian 4.4.4-7) 4.4.4
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:
/usr/include/c++/4.4/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/include/c++/4.4/tuple:161:   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/include/c++/4.4/tuple:241:   instantiated from ‘std::tuple<_Elements>::tuple(_UElements&& ...) [with _UElements = const Tuple, _Elements = int, int, int]’
tupletest.cc:11:   instantiated from here
/usr/include/c++/4.4/tuple:94: error: cannot convert ‘const std::tuple<int, int, int>’ to ‘int’ in initialization
======================================================================

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing-proposed-updates
  APT policy: (500, 'testing-proposed-updates'), (500, 'testing')
Architecture: i386 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libstdc++6-4.4-dev depends on:
ii  g++-4.4                       4.4.4-7    The GNU C++ compiler
ii  gcc-4.4-base                  4.4.4-7    The GNU Compiler Collection (base 
ii  libc6-dev                     2.11.2-2   Embedded GNU C Library: Developmen
ii  libstdc++6                    4.4.4-7    The GNU Standard C++ Library v3

libstdc++6-4.4-dev recommends no packages.

Versions of packages libstdc++6-4.4-dev suggests:
ii  libstdc++6-4.4-doc            4.4.4-7    The GNU Standard C++ Library v3 (d

-- no debconf information

-- 
Interpunktion, Orthographie und Grammatik der Email ist frei erfunden.
Eine Übereinstimmung mit aktuellen oder ehemaligen Regeln wäre rein
zufällig und ist nicht beabsichtigt.

Attachment: signature.asc
Description: Digital signature


Reply to: