ut icon indicating copy to clipboard operation
ut copied to clipboard

Avoid C4702 "unreachable code" in MSVC release mode.

Open Sebanisu opened this issue 4 years ago • 0 comments

Problem:

  • compiler-warning-level-4-c4702 would trigger on the default/second return statement in MSVC when compiling in release mode. At first I tried just moving the return statement to inside the try block, but the error still occurred.

Solution:

  • Single return statement using a bool variable that gets toggled to true/false depending on if any catch statements are ran.

fixes: https://github.com/boost-ext/ut/issues/443

Reviewers: @

Sebanisu avatar Jun 25 '21 00:06 Sebanisu