Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Document issue with spaceship operator in assertion and MSVC

Commit
2e1b02a0e2cba7ce4acb615a3dd77c085ed7a712
Author
Martin Hořeňovský ·
Parents
82e9b9b5f2b6

Files · Download .tar.gz

Changes

 docs/limitations.md | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/docs/limitations.md b/docs/limitations.md
index 099dd82a..f5f60ba8 100644
--- a/docs/limitations.md
+++ b/docs/limitations.md
@@ -173,3 +173,19 @@ TEST_CASE("b") {
 
 If you are seeing a problem like this, i.e. weird test paths that trigger only under Clang with `libc++`, or only under very specific version of `libstdc++`, it is very likely you are seeing this. The only known workaround is to use a fixed version of your standard library.
 
+
+### Visual Studio 2022 -- can't compile assertion with the spaceship operator
+
+[The C++ standard requires that `std::foo_ordering` is only comparable with
+a literal 0](https://eel.is/c++draft/cmp#categories.pre-3). There are
+multiple strategies a stdlib implementation can take to achieve this, and
+MSVC's STL has changed the strategy they use between two releases of VS 2022.
+
+With the new strategy, `REQUIRE((a <=> b) == 0)` no longer compiles under
+MSVC. Note that Catch2 can compile code using MSVC STL's new strategy,
+but only when compiled with a C++20 conforming compiler. MSVC is currently
+not conformant enough, but `clang-cl` will compile the assertion above
+using MSVC STL without problem.
+
+This change got in with MSVC v19.37](https://godbolt.org/z/KG9obzdvE).
+