diff options
| author | Anders Schau Knatten | 2021-09-29 13:54:42 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2021-09-29 18:19:31 +0200 |
| commit | eb452e9b356de09bdb96273c035c40a8f4cb2ad3 (patch) | |
| tree | cc34aa8fc6231e1c179a8304be98868e74ac0c12 /src | |
| parent | 2deafc33e923fb2bf6f4c0ffb1772c109001d5b9 (diff) | |
| download | catch3-eb452e9b356de09bdb96273c035c40a8f4cb2ad3.tar.gz | |
Bring back useful comment
In b7b346c3e56030 this conditional was simplified to just
`while( false)` rather than the current one. Then in 3a33315ff8e04, that
change was reverted. I found it hard to understand this
complicated conditional, but after some digging in history I found this
comment which used to be here. It was removed in b7b346c3e56030, but not
restored together with the revert in 3a33315ff8e04. Let's revive it.
Diffstat (limited to 'src')
| -rw-r--r-- | src/catch2/internal/catch_test_macro_impl.hpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/catch2/internal/catch_test_macro_impl.hpp b/src/catch2/internal/catch_test_macro_impl.hpp index 357e114d..37a7c8f8 100644 --- a/src/catch2/internal/catch_test_macro_impl.hpp +++ b/src/catch2/internal/catch_test_macro_impl.hpp @@ -57,7 +57,8 @@ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \ } INTERNAL_CATCH_CATCH( catchAssertionHandler ) \ INTERNAL_CATCH_REACT( catchAssertionHandler ) \ - } while( (void)0, (false) && static_cast<const bool&>( !!(__VA_ARGS__) ) ) + } while( (void)0, (false) && static_cast<const bool&>( !!(__VA_ARGS__) ) ) // the expression here is never evaluated at runtime but it forces the compiler to give it a look + // The double negation silences MSVC's C4800 warning, the static_cast forces short-circuit evaluation if the type has overloaded &&. /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_IF( macroName, resultDisposition, ... ) \ |