boostorg / iostreams

Boost.org iostreams module
http://boost.org/libs/iostreams
Boost Software License 1.0
43 stars 116 forks source link

Disable msvc warning that can occur under some versions+settings #161

Closed balagansky-work closed 1 year ago

balagansky-work commented 1 year ago

This warning has been observed under more than one version. One specific example, as described in issue #138, is on indirect_streambuf.hpp(440) when Whole Program Optimization is off. In this case, the line before is seen by the optimizer as always throwing for particular instantiations of the template, and therefore the line in question is flagged as not reachable.

MSVC team has stated this is is expected behavior. (https://developercommunity.visualstudio.com/t/Unexpected-C4702-Unreachable-code-in-boo/10410775)

This is a simple and hopefully good-enough fix.