------- 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
