diff options
author | Paolo Carlini <pcarlini@suse.de> | 2005-01-20 02:13:49 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2005-01-20 02:13:49 +0000 |
commit | 9634af02387e5fcc5f98192b57037649a185bae9 (patch) | |
tree | 012cd47451c8831656f0d1c4bb9b3c09818ad8d4 | |
parent | b3b35f14b0e4ea66542d9b60556027c6487c2641 (diff) | |
download | gcc-9634af02387e5fcc5f98192b57037649a185bae9.zip gcc-9634af02387e5fcc5f98192b57037649a185bae9.tar.gz gcc-9634af02387e5fcc5f98192b57037649a185bae9.tar.bz2 |
re PR libstdc++/19535 (Wrong return types for __pair_get<1>)
2005-01-19 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/19535
* include/tr1/utility (struct __pair_get<1>::__get, __const_get):
Fix typo in the return type.
* testsuite/tr1/6_containers/utility/19535.cc: New.
From-SVN: r93940
-rw-r--r-- | libstdc++-v3/ChangeLog | 7 | ||||
-rw-r--r-- | libstdc++-v3/include/tr1/utility | 6 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/tr1/6_containers/utility/19535.cc | 42 |
3 files changed, 52 insertions, 3 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 3c29b43..f8cb182 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2005-01-19 Paolo Carlini <pcarlini@suse.de> + + PR libstdc++/19535 + * include/tr1/utility (struct __pair_get<1>::__get, __const_get): + Fix typo in the return type. + * testsuite/tr1/6_containers/utility/19535.cc: New. + 2005-01-19 Loren J. Rittle <ljrittle@acm.org> * include/ext/array_allocator.h (array_allocator<>::allocate): diff --git a/libstdc++-v3/include/tr1/utility b/libstdc++-v3/include/tr1/utility index c987d04..6a74dfa 100644 --- a/libstdc++-v3/include/tr1/utility +++ b/libstdc++-v3/include/tr1/utility @@ -1,6 +1,6 @@ // TR1 utility -*- C++ -*- -// Copyright (C) 2004 Free Software Foundation, Inc. +// Copyright (C) 2004, 2005 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -66,11 +66,11 @@ namespace tr1 struct __pair_get<1> { template<typename _Tp1, typename _Tp2> - static _Tp1& __get(std::pair<_Tp1, _Tp2>& __pair) + static _Tp2& __get(std::pair<_Tp1, _Tp2>& __pair) { return __pair.second; } template<typename _Tp1, typename _Tp2> - static const _Tp1& __const_get(const std::pair<_Tp1, _Tp2>& __pair) + static const _Tp2& __const_get(const std::pair<_Tp1, _Tp2>& __pair) { return __pair.second; } }; diff --git a/libstdc++-v3/testsuite/tr1/6_containers/utility/19535.cc b/libstdc++-v3/testsuite/tr1/6_containers/utility/19535.cc new file mode 100644 index 0000000..28ac426 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/utility/19535.cc @@ -0,0 +1,42 @@ +// 2005-01-19 Petur Runolfsson <peturr02@ru.is> + +// Copyright (C) 2005 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// tr1 additions to pair + +#include <tr1/utility> + +struct A { }; +struct B { }; + +// libstdc++/19535 +void test01() +{ + std::pair<A, B> p; + std::tr1::get<1>(p); + + const std::pair<B, A> q; + std::tr1::get<1>(q); +} + +int main() +{ + test01(); + return 0; +} |