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 clang warning on self-assignment

Commit
71fce429afcebba7c32b6c46aced1013c6df9c0b
Author
Phil Nash ·
Parents
d13e0945983e

Files · Download .tar.gz

Changes

 projects/SelfTest/IntrospectiveTests/String.tests.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/projects/SelfTest/IntrospectiveTests/String.tests.cpp b/projects/SelfTest/IntrospectiveTests/String.tests.cpp
index 1a3bf6d2..8bf2ffb3 100644
--- a/projects/SelfTest/IntrospectiveTests/String.tests.cpp
+++ b/projects/SelfTest/IntrospectiveTests/String.tests.cpp
@@ -94,7 +94,7 @@ TEST_CASE( "StringRef", "[Strings][StringRef]" ) {
             REQUIRE( ss.currentData() != s.currentData() ); // different pointer value
 
             SECTION( "Self-assignment after substring" ) {
-                ss = ss;
+                ss = *&ss; // the *& are there to suppress warnings (see: "Improvements to Clang's diagnostics" in https://rev.ng/gitlab/revng-bar-2019/clang/raw/master/docs/ReleaseNotes.rst)
                 REQUIRE(isOwned(ss) == true);
             }
         }