Skip to content

warning C4702: unreachable code when compiled with latest MSVC #3007

@toughengineer

Description

@toughengineer

Describe the bug
Catch version 3.9.0 causes warning C4702: unreachable code at

This causes compilation error when warnings are treated as error.

Expected behavior
The whole thing worked before version 3.9.0.
There should be no warning, or warning should be disabled in the source,
i.e. it should work as before out of the box.

Reproduction steps
Try to use anything that uses "unreachable" functionality, e.g. SKIP() or FAIL() macros:

#include "catch_amalgamated.hpp"

TEST_CASE("dummy", "") {
  FAIL();
  SKIP();
}

Compiler flags: /W4 /WX

Compiler output:

1>D:\dev\catch_test\catch_amalgamated.hpp(6246): error C2220: the following warning is treated as an error
1>D:\dev\catch_test\catch_amalgamated.hpp(6246): warning C4702: unreachable code
1>D:\dev\catch_test\main.cpp(5): warning C4702: unreachable code

Platform information:

  • OS: Windows 10
  • Compiler+version: MSVC 19.44.35213 (the one that comes with MS Visual Studio 17.14.9)
  • Catch version: v3.9.0

Additional context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions