public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/60711] New: basic_ostringstream,basic_ostream,u16string,char16_t do not work together
@ 2014-03-30 16:15 jmichae3 at yahoo dot com
  2014-03-30 16:26 ` [Bug libstdc++/60711] " jmichae3 at yahoo dot com
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: jmichae3 at yahoo dot com @ 2014-03-30 16:15 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60711
           Summary: basic_ostringstream,basic_ostream,u16string,char16_t
                    do not work together
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jmichae3 at yahoo dot com

Created attachment 32487
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32487&action=edit
.ii file

#include <ostream>
#include <sstream>
#include <vector>
#include <string>
#include <ios>
#include <initializer_list>
#include <uchar.h>
#include <wchar.h>
namespace std {
typedef std::vector<std::u16string> Vu16S;
typedef std::basic_ostringstream<char16_t,std::char_traits<char16_t> >
uostringstream;
typedef std::basic_ostringstream<char32_t,std::char_traits<char32_t> >
u32ostringstream;
typedef std::basic_ostream<char16_t,std::char_traits<char16_t> > uostream;
typedef std::basic_ostream<char32_t,std::char_traits<char32_t> > u32ostream;
/*
In file included from ostream2a.cpp:2:0:
f:\x86_64-4.9.0-snapshot-20140219-rev207854-win32-sjlj-rt_v4\mingw64\x86_64-w64-mingw32\include\c++\ostream:384:7:
error: 'std::basic_ostream<_CharT, _Traits>::
basic_ostream() [with _CharT = char16_t; _Traits = std::char_traits<char16_t>]'
is protected
       basic_ostream()
       ^
ostream2a.cpp:16:10: error: within this context
 uostream ucout;
          ^
In file included from ostream2a.cpp:2:0:
f:\x86_64-4.9.0-snapshot-20140219-rev207854-win32-sjlj-rt_v4\mingw64\x86_64-w64-mingw32\include\c++\ostream:384:7:
error: 'std::basic_ostream<_CharT, _Traits>::
basic_ostream() [with _CharT = char32_t; _Traits = std::char_traits<char32_t>]'
is protected
       basic_ostream()
       ^
ostream2a.cpp:17:12: error: within this context
 u32ostream u32cout;
            ^
ostream2a.cpp:27:1: error: expected '}' at end of input
 }
 ^
I saw this later on and this matched my implementation (but I did not know
about dropping the 16):
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2035.pdf
but this doesn't work, even apparently with the microsoft compiler. something
funny with the standard?

so: what is wrong in the first error? I don't understand why something is
protected. somebody said something about
fstream containing the implementation of ostream in gcc (not sure if this is
stil true). apparently, msvc++ has this problem too.
seems like something I ought to be able to do simply, but it just breaks. not
sure why this is protected.
there is no wstring_convert. I grepped for it.
*/
-municode doesn't help.


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

end of thread, other threads:[~2014-04-01  9:06 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-30 16:15 [Bug libstdc++/60711] New: basic_ostringstream,basic_ostream,u16string,char16_t do not work together jmichae3 at yahoo dot com
2014-03-30 16:26 ` [Bug libstdc++/60711] " jmichae3 at yahoo dot com
2014-03-30 16:41 ` jmichae3 at yahoo dot com
2014-03-30 16:47 ` jmichae3 at yahoo dot com
2014-03-30 17:29 ` glisse at gcc dot gnu.org
2014-03-30 19:30 ` jmichae3 at yahoo dot com
2014-03-30 20:08 ` redi at gcc dot gnu.org
2014-03-30 20:24 ` jmichae3 at yahoo dot com
2014-03-30 20:25 ` jmichae3 at yahoo dot com
2014-03-30 21:20 ` jmichae3 at yahoo dot com
2014-03-30 22:32 ` redi at gcc dot gnu.org
2014-04-01  1:35 ` jmichae3 at yahoo dot com
2014-04-01  5:34 ` jmichae3 at yahoo dot com
2014-04-01  5:47 ` glisse at gcc dot gnu.org
2014-04-01  6:08 ` jmichae3 at yahoo dot com
2014-04-01  9:06 ` redi at gcc dot gnu.org

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).