[Bug libstdc++/19535] Wrong return types for __pair_get<1>
peturr02 at ru dot is
gcc-bugzilla@gcc.gnu.org
Wed Jan 19 17:07:00 GMT 2005
------- Additional Comments From peturr02 at ru dot is 2005-01-19 17:06 -------
Created an attachment (id=7993)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7993&action=view)
Test case
Compiling this fails with:
g++0116 -Wall -static 1.cc -o 1
/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/include/c++/tr1/utility: In function
Âtypename std::tr1::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&
std::tr1::get(std::pair<_Tp1, _Tp2>&) [with int _Int = 1, _Tp1 = A, _Tp2 = B]Â:
1.cc:9: instantiated from here
/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/include/c++/tr1/utility:80: error:
invalid initialization of reference of type ÂB&Â from expression of type ÂAÂ
/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/include/c++/tr1/utility: In function
Âconst typename std::tr1::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&
std::tr1::get(const std::pair<_Tp1, _Tp2>&) [with int _Int = 1, _Tp1 = B, _Tp2
= A]Â:
1.cc:12: instantiated from here
/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/include/c++/tr1/utility:85: error:
invalid initialization of reference of type Âconst A&Â from expression of type
Âconst BÂ
/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/include/c++/tr1/utility: In static
member function Âstatic _Tp1& std::tr1::__pair_get<1>::__get(std::pair<_T1,
_T2>&) [with _Tp1 = A, _Tp2 = B]Â:
/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/include/c++/tr1/utility:80:
instantiated from Âtypename std::tr1::tuple_element<_Int, std::pair<_Tp1, _Tp2>
>::type& std::tr1::get(std::pair<_Tp1, _Tp2>&) [with int _Int = 1, _Tp1 = A,
_Tp2 = B]Â
1.cc:9: instantiated from here
/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/include/c++/tr1/utility:70: error:
invalid initialization of reference of type ÂA&Â from expression of type ÂBÂ
/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/include/c++/tr1/utility: In static
member function Âstatic const _Tp1& std::tr1::__pair_get<1>::__const_get(const
std::pair<_T1, _T2>&) [with _Tp1 = B, _Tp2 = A]Â:
/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/include/c++/tr1/utility:85:
instantiated from Âconst typename std::tr1::tuple_element<_Int, std::pair<_Tp1,
_Tp2> >::type& std::tr1::get(const std::pair<_Tp1, _Tp2>&) [with int _Int = 1,
_Tp1 = B, _Tp2 = A]Â
1.cc:12: instantiated from here
/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/include/c++/tr1/utility:74: error:
invalid initialization of reference of type Âconst B&Â from expression of type
Âconst AÂ
make: *** [1] Error 1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19535
More information about the Gcc-bugs
mailing list