diff options
| author | Martin Hořeňovský | 2024-02-16 21:54:25 +0100 |
|---|---|---|
| committer | Martin Hořeňovský | 2024-02-19 15:02:10 +0100 |
| commit | 2e1b02a0e2cba7ce4acb615a3dd77c085ed7a712 (patch) | |
| tree | 8016783f29a1e7f753008dd76bcd4a6f449d8a62 /docs | |
| parent | 82e9b9b5f2b62f5eb7b0381d65e69da2b974100b (diff) | |
| download | catch3-2e1b02a0e2cba7ce4acb615a3dd77c085ed7a712.tar.gz | |
Document issue with spaceship operator in assertion and MSVC
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/limitations.md | 16 |
1 files changed, 16 insertions, 0 deletions
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). + |