[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#436175: marked as done (streambuf inheritance problem.)



Your message dated Sat, 11 Aug 2007 15:59:53 +1200
with message-id <46BD3439.1060904@treenet.co.nz>
and subject line closed
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: g++
Version: 4.1.3 20070718 (prerelease)

Creating two classes that inherit from std::ostream and std::streambuf.

When used with setw and characters:
  child << "some text" << std::setw(4) << "!";
only ever stores "some text"

However numerics work:
  child << "some text" << std::setw(4) << "1";
stores the desired "some text   1"

The child class code as written works perfectly in earlier g++ versions,
but fails in 4.1.3+ and 4.2.1+ (both the latest prereleases)

I have experimented by implementing every possible innheritable function
of both ostream and streambuf that I could find. None of the
un-implemented methods appears to be ever called.

The classes as written are:

class StoreEntryStream : public std::ostream
{

public:
    StoreEntryStream(StoreEntry *anEntry) : std::ostream(&_buffer),
 _buffer(anEntry) { this->init(&_buffer);}

private:
    StoreEntryStreamBuf _buffer;

public:
    StoreEntryStreamBuf * rdbuf() const;
};




--- End Message ---
--- Begin Message --- Turned out to be virtual-function type difference, implicitly cast in previous versions. But not in the new gcc.
The absence of a type-mismatch warning is another issue...

Sorry for the noise.

--- End Message ---

Reply to: