[Bug c++/11159] erroneous warning in copy ctor with virtual inheritance

roman dot fietze at telemotive dot de gcc-bugzilla@gcc.gnu.org
Tue Apr 4 12:26:00 GMT 2006



------- Comment #10 from roman dot fietze at telemotive dot de  2006-04-04 12:26 -------
The following snippet also gives me errors, and here, as a developer, I did all
I could do:
-----
#include <sstream>
class MyStream : public std::ostringstream
{
  public:
    inline MyStream() : std::ostringstream() {}
    inline MyStream(const MyStream &ms) : std::ostringstream()
        { std::ostringstream::str(ms.str()); }
};
-----

The result, as before:

$ gcc --version
gcc (GCC) 3.3.5 20050117 (prerelease) (SUSE Linux)
...
$ g++ -W -c mystream.cc
mystream.cc: In copy constructor `MyStream::MyStream(const MyStream&)':
mystream.cc:13: warning: base class `struct std::basic_ios<char, 
   std::char_traits<char> >' should be explicitly initialized in the copy 
   constructor

I do not have access to std::basic_ios from MyStream. Solution here?


-- 

roman dot fietze at telemotive dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |roman dot fietze at
                   |                            |telemotive dot de


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



More information about the Gcc-bugs mailing list