| Issue |
175832
|
| Summary |
Refactor raw_ostream to disallowed buffering on ostreams that don't support buffering
|
| Labels |
|
| Assignees |
|
| Reporter |
jurahul
|
`raw_ostream` supports functions like `SetBuffered` and `flush` that make sense only if the ostream is buffered. Specific subclasses of raw_ostream, like raw_string_ostream, are intended to be unbuffered, but existing unit tests and code can call buffering related functions on these streams, leading either to bugs or unnecessary code (like calling flush on raw_string_ostream).
This issue asks for refactoring the raw_ostream class hierarchy so that buffering related functionality is removed from the base raw_ostream class and for unbuffered streams its a compile time error to call flush() or other API that's applicable only to buffered ostreams. As an example, we can have a `raw_ostream_buffered` subclass of `raw_ostream` and move all the buffering members there and use that as a base class for all buffered ostreams.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs