[Bug libstdc++/60724] New: std::ostream o; gives protected errors

jmichae3 at yahoo dot com gcc-bugzilla@gcc.gnu.org
Tue Apr 1 01:50:00 GMT 2014


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

            Bug ID: 60724
           Summary: std::ostream o; gives protected errors
           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 32506
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32506&action=edit
ostream-bug.ii

std::ostream o; gives protected errors - this about sums it up.

COLLECT_GCC=f:\x86_64-4.9.0-snapshot-20140219-rev207854-win32-sjlj-rt_v4\mingw64\bin\g++.exe
COLLECT_LTO_WRAPPER=f:/x86_64-4.9.0-snapshot-20140219-rev207854-win32-sjlj-rt_v4/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/4.9.0
/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../../../src/gcc-trunk/configure --host=x86_64-w64-mingw32
--build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 -
-prefix=/mingw64
--with-sysroot=/d/mingwtrunk/x86_64-trunk-win32-sjlj-rt_v4/mingw64
--with-gxx-include-dir=/mingw64/x86_64-w64-mingw
32/include/c++ --enable-shared --enable-static --enable-targets=all
--enable-multilib --enable-languages=c,c++,lto --enable-libstdcx
x-time=yes --enable-threads=win32 --enable-libgomp --enable-lto
--enable-graphite --enable-checking=release --enable-fully-dynamic-s
tring --enable-version-specific-runtime-libs --enable-sjlj-exceptions
--disable-isl-version-check --disable-cloog-version-check --di
sable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap
--disable-rpath --disable-win32-registry --disable-nls --disable-we
rror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch-32=i686
--with-arch-64=nocona --with-tune-32=generic --with-tune-64=c
ore2 --with-libiconv --with-system-zlib
--with-gmp=/d/mingwtrunk/prerequisites/x86_64-w64-mingw32-static
--with-mpfr=/d/mingwtrunk/p
rerequisites/x86_64-w64-mingw32-static
--with-mpc=/d/mingwtrunk/prerequisites/x86_64-w64-mingw32-static
--with-isl=/d/mingwtrunk/pre
requisites/x86_64-w64-mingw32-static
--with-cloog=/d/mingwtrunk/prerequisites/x86_64-w64-mingw32-static
--enable-cloog-backend=isl -
-with-pkgversion='x86_64-win32-sjlj, Built by MinGW-W64 project'
--with-bugurl=http://sourceforge.net/projects/mingw-w64 CFLAGS='-O2
 -pipe -I/d/mingwtrunk/x86_64-trunk-win32-sjlj-rt_v4/mingw64/opt/include
-I/d/mingwtrunk/prerequisites/x86_64-zlib-static/include -I
/d/mingwtrunk/prerequisites/x86_64-w64-mingw32-static/include' CXXFLAGS='-O2
-pipe -I/d/mingwtrunk/x86_64-trunk-win32-sjlj-rt_v4/min
gw64/opt/include -I/d/mingwtrunk/prerequisites/x86_64-zlib-static/include
-I/d/mingwtrunk/prerequisites/x86_64-w64-mingw32-static/in
clude' CPPFLAGS= LDFLAGS='-pipe
-L/d/mingwtrunk/x86_64-trunk-win32-sjlj-rt_v4/mingw64/opt/lib
-L/d/mingwtrunk/prerequisites/x86_64-z
lib-static/lib -L/d/mingwtrunk/prerequisites/x86_64-w64-mingw32-static/lib'
Thread model: win32
gcc version 4.9.0 20140218 (experimental) (x86_64-win32-sjlj, Built by
MinGW-W64 project)
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-fno-strict-aliasing' '-fwrapv' '-Wall'
'-Wextra' '-std=c++11' '-Ofast' '-o' 'ostream-bug.ex
e' '-shared-libgcc' '-mtune=core2' '-march=nocona'

f:/x86_64-4.9.0-snapshot-20140219-rev207854-win32-sjlj-rt_v4/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/4.9.0/cc1plus.exe
-E -qu
iet -v -iprefix
f:\x86_64-4.9.0-snapshot-20140219-rev207854-win32-sjlj-rt_v4\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.9.0/
-U_REE
NTRANT ostream-bug.cpp -mtune=core2 -march=nocona -std=c++11 -Wall -Wextra
-fno-strict-aliasing -fwrapv -Ofast -fpch-preprocess -o o
stream-bug.ii
ignoring duplicate directory
"f:/x86_64-4.9.0-snapshot-20140219-rev207854-win32-sjlj-rt_v4/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-
mingw32/4.9.0/include"
ignoring nonexistent directory
"D:/mingwtrunk/x86_64-trunk-win32-sjlj-rt_v4/mingw64D:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/4.9.
0/../../../../include"
ignoring duplicate directory
"f:/x86_64-4.9.0-snapshot-20140219-rev207854-win32-sjlj-rt_v4/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-
mingw32/4.9.0/include-fixed"
ignoring duplicate directory
"f:/x86_64-4.9.0-snapshot-20140219-rev207854-win32-sjlj-rt_v4/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-
mingw32/4.9.0/../../../../x86_64-w64-mingw32/include"
ignoring nonexistent directory
"D:/mingwtrunk/x86_64-trunk-win32-sjlj-rt_v4/mingw64/mingw/include"
#include "..." search starts here:
#include <...> search starts here:

f:\x86_64-4.9.0-snapshot-20140219-rev207854-win32-sjlj-rt_v4\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.9.0/include

f:\x86_64-4.9.0-snapshot-20140219-rev207854-win32-sjlj-rt_v4\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.9.0/include-fixed

f:\x86_64-4.9.0-snapshot-20140219-rev207854-win32-sjlj-rt_v4\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.9.0/../../../../x86_64-w64
-mingw32/include

f:/x86_64-4.9.0-snapshot-20140219-rev207854-win32-sjlj-rt_v4/mingw64/lib/gcc/../../x86_64-w64-mingw32/include/c++

f:/x86_64-4.9.0-snapshot-20140219-rev207854-win32-sjlj-rt_v4/mingw64/lib/gcc/../../x86_64-w64-mingw32/include/c++/x86_64-w64-mingw3
2

f:/x86_64-4.9.0-snapshot-20140219-rev207854-win32-sjlj-rt_v4/mingw64/lib/gcc/../../x86_64-w64-mingw32/include/c++/backward
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-fno-strict-aliasing' '-fwrapv' '-Wall'
'-Wextra' '-std=c++11' '-Ofast' '-o' 'ostream-bug.ex
e' '-shared-libgcc' '-mtune=core2' '-march=nocona'

f:/x86_64-4.9.0-snapshot-20140219-rev207854-win32-sjlj-rt_v4/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/4.9.0/cc1plus.exe
-fprep
rocessed ostream-bug.ii -quiet -dumpbase ostream-bug.cpp -mtune=core2
-march=nocona -auxbase ostream-bug -Ofast -Wall -Wextra -std=c
++11 -version -fno-strict-aliasing -fwrapv -o ostream-bug.s
GNU C++ (x86_64-win32-sjlj, Built by MinGW-W64 project) version 4.9.0 20140218
(experimental) (x86_64-w64-mingw32)
        compiled by GNU C version 4.9.0 20140218 (experimental), GMP version
5.1.3, MPFR version 3.1.2-p5, MPC version 1.0.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++ (x86_64-win32-sjlj, Built by MinGW-W64 project) version 4.9.0 20140218
(experimental) (x86_64-w64-mingw32)
        compiled by GNU C version 4.9.0 20140218 (experimental), GMP version
5.1.3, MPFR version 3.1.2-p5, MPC version 1.0.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 3d656286c2fbf9376b6c665d39c3c502
In file included from
f:\x86_64-4.9.0-snapshot-20140219-rev207854-win32-sjlj-rt_v4\mingw64\x86_64-w64-mingw32\include\c++\iostream:3
9:0,
                 from ostream-bug.cpp:1:
f:\x86_64-4.9.0-snapshot-20140219-rev207854-win32-sjlj-rt_v4\mingw64\x86_64-w64-mingw32\include\c++\ostream:
In function 'int main()
':
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::basi
c_ostream<_CharT, _Traits>::basic_ostream() [with _CharT = char; _Traits =
std::char_traits<char>]' is protected
       basic_ostream()
       ^
ostream-bug.cpp:3:18: error: within this context
     std::ostream o;
                  ^
did the c++ standard change drastically for iostreams in the last month?

if you are going to quote me to use a streambuf or stringbuf, those are
protected too. if you are going to quote an example using a filebuf, I am not
working with a file at this point. I just want to output strings.



More information about the Gcc-bugs mailing list