diff options
| author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-12-09 23:02:18 +0000 |
|---|---|---|
| committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-12-09 23:02:18 +0000 |
| commit | 1042d6196471d7ee6cd16c628d169757d014e57a (patch) | |
| tree | 211332ea49f0a2c35da093cec00b3333cffe71c3 /libstdc++-v3/include/std/fstream | |
| parent | ff3208462a1e26541618fda083d85caf391f5cab (diff) | |
| download | ppe42-gcc-1042d6196471d7ee6cd16c628d169757d014e57a.tar.gz ppe42-gcc-1042d6196471d7ee6cd16c628d169757d014e57a.zip | |
2013-12-09 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/59427
* include/bits/fstream.tcc (basic_filebuf<>::overflow,
basic_filebuf<>::xsputn): Per lwg/596, ios_base::app implies
ios_base:out.
* include/std/fstream (basic_filebuf<>::_M_set_buffer): Likewise.
* testsuite/27_io/basic_filebuf/sputc/char/59427.cc: New.
* testsuite/27_io/basic_filebuf/sputn/char/59427.cc: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205837 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/std/fstream')
| -rw-r--r-- | libstdc++-v3/include/std/fstream | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libstdc++-v3/include/std/fstream b/libstdc++-v3/include/std/fstream index 701247a9cc3..ce27eb61a08 100644 --- a/libstdc++-v3/include/std/fstream +++ b/libstdc++-v3/include/std/fstream @@ -397,8 +397,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _M_set_buffer(streamsize __off) { const bool __testin = _M_mode & ios_base::in; - const bool __testout = _M_mode & ios_base::out; - + const bool __testout = (_M_mode & ios_base::out + || _M_mode & ios_base::app); + if (__testin && __off > 0) this->setg(_M_buf, _M_buf, _M_buf + __off); else |

