ut
ut copied to clipboard
Avoid C4702 "unreachable code" in MSVC release mode.
Problem:
- compiler-warning-level-4-c4702 would trigger on the default/second
returnstatement in MSVC when compiling in release mode. At first I tried just moving thereturnstatement to inside thetryblock, but the error still occurred.
Solution:
- Single
returnstatement using aboolvariable that gets toggled totrue/falsedepending on if anycatchstatements are ran.
fixes: https://github.com/boost-ext/ut/issues/443
Reviewers: @