diff options
| author | Martin Hořeňovský | 2020-02-01 20:55:42 +0100 |
|---|---|---|
| committer | Martin Hořeňovský | 2020-02-16 16:02:31 +0100 |
| commit | f8794634c286810ee97544e1e4ea0cbd1555d66d (patch) | |
| tree | 54f9ff713fbc957c5e996b40ad43bf5fb47c2e0a /docs | |
| parent | d6b2a3793b6693ac8f51283f6e22cfed9f1eb230 (diff) | |
| download | catch3-f8794634c286810ee97544e1e4ea0cbd1555d66d.tar.gz | |
Fix significant bug with storing composed matchers
Given that in the 2 or so years that matchers are thing nobody complained,
it seems that people do not actually write this sort of code, and the
possibility will be removed in v3. However, to avoid correctness bugs,
we will have to support this weird code in v2.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/deprecations.md | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/docs/deprecations.md b/docs/deprecations.md index c416ad6d..ca277d7e 100644 --- a/docs/deprecations.md +++ b/docs/deprecations.md @@ -9,6 +9,35 @@ either of these is a breaking change, and thus will not happen until at least the next major release. +### Composing lvalues of already composed matchers + +Because a significant bug in this use case has persisted for 2+ years +without a bug report, and to simplify the implementation, code that +composes lvalues of composed matchers will not compile. That is, +this code will no longer work: + +```cpp + auto m1 = Contains("string"); + auto m2 = Contains("random"); + auto composed1 = m1 || m2; + auto m3 = Contains("different"); + auto composed2 = composed1 || m3; + REQUIRE_THAT(foo(), !composed1); + REQUIRE_THAT(foo(), composed2); +``` + +Instead you will have to write this: + +```cpp + auto m1 = Contains("string"); + auto m2 = Contains("random"); + auto m3 = Contains("different"); + REQUIRE_THAT(foo(), !(m1 || m2)); + REQUIRE_THAT(foo(), m1 || m2 || m3); +``` + + + ## Planned changes ### `CHECKED_IF` and `CHECKED_ELSE` |