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

Fix Wunused-variable warning for MinGW

Closes #2132
Commit
3bd0c58878bb4d413a4ef9ed701ec08e407420ab
Author
Martin Hořeňovský ·
Parents
a63ad7455471

Files · Download .tar.gz

Changes

 src/catch2/internal/catch_run_context.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/catch2/internal/catch_run_context.cpp b/src/catch2/internal/catch_run_context.cpp
index e31f8a3f..c8b0b30e 100644
--- a/src/catch2/internal/catch_run_context.cpp
+++ b/src/catch2/internal/catch_run_context.cpp
@@ -500,6 +500,11 @@ namespace Catch {
         // before running the tests themselves, or the binary can crash
         // without failed test being reported.
         FatalConditionHandlerGuard _(&m_fatalConditionhandler);
+        // We keep having issue where some compilers warn about an unused
+        // variable, even though the type has non-trivial constructor and
+        // destructor. This is annoying and ugly, but it makes them stfu.
+        (void)_;
+
         m_activeTestCase->invoke();
     }