diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-11-08 16:22:21 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-11-08 16:22:21 +0000 |
commit | 3ec0e5817815f722774c02ede5b3978b059f039d (patch) | |
tree | 9a2c2ff8200875ea21507a390d66abed02b6242e /libstdc++-v3/config | |
parent | bdb4cd30c7ba5a64b11d1ee71e9d7a7407f5fe0a (diff) | |
download | gcc-3ec0e5817815f722774c02ede5b3978b059f039d.tar.gz |
2007-11-08 Paolo Carlini <pcarlini@suse.de>
* config/io/basic_file_stdio.cc (fopen_mode): Add modes missing
per DR 596.
* testsuite/27_io/basic_filebuf/open/char/4.cc: Extend.
* include/std/fstream: Update comment preceding open.
* docs/html/ext/howto.html: Update.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130004 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/config')
-rw-r--r-- | libstdc++-v3/config/io/basic_file_stdio.cc | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/libstdc++-v3/config/io/basic_file_stdio.cc b/libstdc++-v3/config/io/basic_file_stdio.cc index 41d914ad859..104f88c96f7 100644 --- a/libstdc++-v3/config/io/basic_file_stdio.cc +++ b/libstdc++-v3/config/io/basic_file_stdio.cc @@ -1,6 +1,6 @@ // Wrapper of C-language FILE struct -*- C++ -*- -// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006 +// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006, 2007 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -86,27 +86,31 @@ namespace app = std::ios_base::app, binary = std::ios_base::binary }; - + + // _GLIBCXX_RESOLVE_LIB_DEFECTS + // 596. 27.8.1.3 Table 112 omits "a+" and "a+b" modes. switch (mode & (in|out|trunc|app|binary)) { - case ( out ): return "w"; - case ( out |app ): return "a"; - case ( out|trunc ): return "w"; - case (in ): return "r"; - case (in|out ): return "r+"; - case (in|out|trunc ): return "w+"; - // Extension to Table 92. - case (in|out |app ): return "a+"; - - case ( out |binary): return "wb"; - case ( out |app|binary): return "ab"; - case ( out|trunc |binary): return "wb"; - case (in |binary): return "rb"; + case ( out ): return "w"; + case ( out |app ): return "a"; + case ( app ): return "a"; + case ( out|trunc ): return "w"; + case (in ): return "r"; + case (in|out ): return "r+"; + case (in|out|trunc ): return "w+"; + case (in|out |app ): return "a+"; + case (in |app ): return "a+"; + + case ( out |binary): return "wb"; + case ( out |app|binary): return "ab"; + case ( app|binary): return "ab"; + case ( out|trunc |binary): return "wb"; + case (in |binary): return "rb"; case (in|out |binary): return "r+b"; case (in|out|trunc |binary): return "w+b"; - // Extension to Table 92. case (in|out |app|binary): return "a+b"; - + case (in |app|binary): return "a+b"; + default: return 0; // invalid } } |