diff options
author | Yvan Roux <yvan.roux@linaro.org> | 2017-07-07 16:01:24 +0200 |
---|---|---|
committer | Yvan Roux <yvan.roux@linaro.org> | 2017-07-07 16:01:24 +0200 |
commit | 6b949707cb585a4acced74a912739f26dea33820 (patch) | |
tree | f913afb9b3f6cd17f124d2e69f7e01d1273b3507 /libstdc++-v3/testsuite/27_io | |
parent | 0c7d6c4a218b7802e62cadce6e42f9c2544abd67 (diff) | |
download | gcc-6b949707cb585a4acced74a912739f26dea33820.tar.gz |
Merge branches/gcc-7-branch rev 250046.
Change-Id: Iab4acacc1408cb2f8e03dd1d07ec9241c762f83a
Diffstat (limited to 'libstdc++-v3/testsuite/27_io')
-rw-r--r-- | libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/12.cc | 2 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/27_io/rvalue_streams-2.cc | 53 |
2 files changed, 54 insertions, 1 deletions
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/12.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/12.cc index 24cd2f5d4be..7e3b7737285 100644 --- a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/12.cc +++ b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/12.cc @@ -50,7 +50,7 @@ void test12_aux(bool integer_type) VERIFY(is.fail()); } -bool test12() +void test12() { test12_aux<short>(true); test12_aux<int>(true); diff --git a/libstdc++-v3/testsuite/27_io/rvalue_streams-2.cc b/libstdc++-v3/testsuite/27_io/rvalue_streams-2.cc index 2b46aa1cc69..9c20274d541 100644 --- a/libstdc++-v3/testsuite/27_io/rvalue_streams-2.cc +++ b/libstdc++-v3/testsuite/27_io/rvalue_streams-2.cc @@ -24,11 +24,64 @@ struct A {}; void operator<<(std::ostream&, const A&) { } void operator>>(std::istream&, A&) { } +class MyStream : private std::ostream, private std::istream +{ +public: + MyStream& operator <<(const char*) + { + return *this; + } + MyStream& operator >>(int&) + { + return *this; + } +}; + +class MyStream2 +{ +public: + MyStream2& operator <<(const char*) + { + return *this; + } + MyStream2& operator >>(int&) + { + return *this; + } +private: + operator std::ostream&(); + operator std::istream&(); +}; + +struct X { }; + +std::ostream& operator<<(std::ostream& os, const X&) { return os; } +std::istream& operator>>(std::istream& is, X&&) { return is; } + +struct O : std::ostream { }; + +void operator<<(O&, X) = delete; + +struct I : std::istream { }; + +void operator>>(I&, X) = delete; + // PR libstdc++/65543 +// PR libstdc++/80675 +// PR libstdc++/80940 int main() { A a; std::ostringstream() << a; std::istringstream() >> a; + MyStream stream{}; + stream << "aaa"; + int msi; + stream >> msi; + MyStream2 stream2{}; + stream2 << "aaa"; + stream2 >> msi; + O{} << X{}; + I{} >> X{}; } |