summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/27_io
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2015-03-25 09:57:06 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2015-03-25 09:57:06 +0000
commit45c6b4ca28c2341103e81da3c93a2f0c1f00bb83 (patch)
treed7759bc38009521bb22033d00f4537a6f506d17f /libstdc++-v3/testsuite/27_io
parent20617a2b9e27b442cb973ccb37b9347bf495306c (diff)
downloadgcc-45c6b4ca28c2341103e81da3c93a2f0c1f00bb83.tar.gz
2015-03-25 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/65543 * include/std/istream (operator>>(basic_istream<>&&, _Tp&): Revert thinko in r150387. * include/std/ostream (operator<<(basic_ostream<>&&, const _Tp&): Likewise. * testsuite/27_io/rvalue_streams-2.cc: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221655 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/testsuite/27_io')
-rw-r--r--libstdc++-v3/testsuite/27_io/rvalue_streams-2.cc35
1 files changed, 35 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/27_io/rvalue_streams-2.cc b/libstdc++-v3/testsuite/27_io/rvalue_streams-2.cc
new file mode 100644
index 00000000000..d9b61464b58
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/rvalue_streams-2.cc
@@ -0,0 +1,35 @@
+// { dg-options "-std=gnu++11" }
+// { dg-do compile }
+
+// Copyright (C) 2015 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 <sstream>
+
+struct A {};
+
+void operator<<(std::ostream&, const A&) { }
+void operator>>(std::istream&, A&) { }
+
+// PR libstdc++/65543
+int main()
+{
+ A a;
+
+ std::ostringstream() << a;
+ std::istringstream() >> a;
+}