public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/59427] New: Opening with ios::in | ios::app does not allow appending
@ 2013-12-09 11:01 rguenth at gcc dot gnu.org
  2013-12-09 13:20 ` [Bug libstdc++/59427] " paolo.carlini at oracle dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-12-09 11:01 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59427

            Bug ID: 59427
           Summary: Opening with ios::in | ios::app does not allow
                    appending
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org

#include <cstdlib>
#include <fstream>

int main ()
{
  typedef ::std ::filebuf filebuf;
  typedef filebuf :: traits_type traits; typedef ::std ::ios_base ios;
  filebuf a_f;
  return ! a_f .open  ("/dev/null", ios ::in | ios ::app) 
      || traits ::eq_int_type (traits ::eof (), a_f .sputc (0))
      || ! a_f .close () ? EXIT_FAILURE : EXIT_SUCCESS;
}

fails as std::basic_streambuf<char, std::char_traits<char> >::sputc(char)
falls to the overflow case.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libstdc++/59427] Opening with ios::in | ios::app does not allow appending
  2013-12-09 11:01 [Bug libstdc++/59427] New: Opening with ios::in | ios::app does not allow appending rguenth at gcc dot gnu.org
@ 2013-12-09 13:20 ` paolo.carlini at oracle dot com
  2013-12-09 23:02 ` paolo at gcc dot gnu.org
  2013-12-09 23:03 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-12-09 13:20 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59427

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2013-12-09
     Ever confirmed|0                           |1

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Uhhm, looks like that in 2007 (!) when I implemented the resolution of DR 596 I
failed to also update the behavior of overflow and xsputn to the effect that,
essentially, ios_base::app implies ios_base::out. Seems easy to fix.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libstdc++/59427] Opening with ios::in | ios::app does not allow appending
  2013-12-09 11:01 [Bug libstdc++/59427] New: Opening with ios::in | ios::app does not allow appending rguenth at gcc dot gnu.org
  2013-12-09 13:20 ` [Bug libstdc++/59427] " paolo.carlini at oracle dot com
@ 2013-12-09 23:02 ` paolo at gcc dot gnu.org
  2013-12-09 23:03 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: paolo at gcc dot gnu.org @ 2013-12-09 23:02 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59427

--- Comment #2 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> ---
Author: paolo
Date: Mon Dec  9 23:02:18 2013
New Revision: 205837

URL: http://gcc.gnu.org/viewcvs?rev=205837&root=gcc&view=rev
Log:
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.

Added:
    trunk/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/59427.cc
    trunk/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/59427.cc
Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/bits/fstream.tcc
    trunk/libstdc++-v3/include/std/fstream


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libstdc++/59427] Opening with ios::in | ios::app does not allow appending
  2013-12-09 11:01 [Bug libstdc++/59427] New: Opening with ios::in | ios::app does not allow appending rguenth at gcc dot gnu.org
  2013-12-09 13:20 ` [Bug libstdc++/59427] " paolo.carlini at oracle dot com
  2013-12-09 23:02 ` paolo at gcc dot gnu.org
@ 2013-12-09 23:03 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-12-09 23:03 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59427

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |4.9.0

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Fixed for 4.9.0.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-12-09 23:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-09 11:01 [Bug libstdc++/59427] New: Opening with ios::in | ios::app does not allow appending rguenth at gcc dot gnu.org
2013-12-09 13:20 ` [Bug libstdc++/59427] " paolo.carlini at oracle dot com
2013-12-09 23:02 ` paolo at gcc dot gnu.org
2013-12-09 23:03 ` paolo.carlini at oracle dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).