Improve ManagedStreams (#7367)
authorGereon Kremer <nafur42@gmail.com>
Thu, 14 Oct 2021 22:16:58 +0000 (15:16 -0700)
committerGitHub <noreply@github.com>
Thu, 14 Oct 2021 22:16:58 +0000 (22:16 +0000)
commitb2329e04d3269587f968378db5fcdc0487dbbdb7
tree6abc32443a6a4a01f430bd50b4377d51f5c66423
parent4affc8f76d443e453de62151979567e702da431e
Improve ManagedStreams (#7367)

This PR addresses #7361, but also a more general issue about regular-output-channel being able to hold stderr and diagnostic-output-channel being able to hold stdout.
It therefore changes how non-owned streams are stored: beforehand, an explicit stream would always be owned by the ManagedStream (through a std::shared_ptr) and a nullptr implicitly stood for stdout, stderr or stdin. Now we explicitly hold a pointer to a non-owned stream for these special values.

Fixes #7361.
src/options/managed_streams.cpp
src/options/managed_streams.h
test/regress/CMakeLists.txt
test/regress/regress0/options/stream-printing.smt2 [new file with mode: 0644]