diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2010-06-10 10:24:46 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2010-06-10 10:24:46 +0000 |
commit | 87b2e74657cad904e532f17010c4ed6da098bebf (patch) | |
tree | 863e86bc39ab1b61eb9718477af80edf384da1de /libstdc++-v3/testsuite/20_util/tuple/cons/44487.cc | |
parent | cefab2e4825e2e5dd8bfdf79ed78372ec6462f1e (diff) | |
download | gcc-87b2e74657cad904e532f17010c4ed6da098bebf.tar.gz |
re PR libstdc++/44487 ([C++0x] pair of references doesn't work)
2010-06-10 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/44487
* include/bits/stl_pair.h (pair(pair&&)): Remove.
(pair(pair<_U1, _U2>&&): Use forward, consistently with Bullet 5
of LWG 1326.
* include/std/tuple (tuple(pair<_U1, _U2>&&)): Likewise.
* testsuite/20_util/pair/44487.cc: Add.
* testsuite/20_util/tuple/cons/44487.cc: Likewise.
* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Adjust dg-warning
line numbers.
From-SVN: r160528
Diffstat (limited to 'libstdc++-v3/testsuite/20_util/tuple/cons/44487.cc')
-rw-r--r-- | libstdc++-v3/testsuite/20_util/tuple/cons/44487.cc | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/20_util/tuple/cons/44487.cc b/libstdc++-v3/testsuite/20_util/tuple/cons/44487.cc new file mode 100644 index 00000000000..dade58de8bc --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/tuple/cons/44487.cc @@ -0,0 +1,51 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2010 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 3, 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 COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <tuple> + +int x, y; + +std::tuple<int&, int&> +foo1() +{ + std::pair<int&, int&> blah(x, y); + return blah; +} + +std::tuple<int&, int&> +foo2() +{ + const std::pair<int&, int&> blah(x, y); + return blah; +} + +std::tuple<int&, int&> +foo3() +{ + std::pair<int&, int&> blah(x, y); + return std::tuple<int&, int&>(std::move(blah)); +} + +std::tuple<int&, int&> +foo4() +{ + const std::pair<int&, int&> blah(x, y); + return std::tuple<int&, int&>(std::move(blah)); +} |