summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeLib/testString.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-06-03 18:53:54 (GMT)
committerBrad King <brad.king@kitware.com>2021-06-03 18:59:55 (GMT)
commitb6c4d93dcd85b8e2c512abf83c25c2270cead1c8 (patch)
tree77b28ff7c7537d5e4b1fef268e8fdce78618226a /Tests/CMakeLib/testString.cxx
parentc1b575f4d110231617a7cb62187d553d67faad31 (diff)
downloadCMake-b6c4d93dcd85b8e2c512abf83c25c2270cead1c8.zip
CMake-b6c4d93dcd85b8e2c512abf83c25c2270cead1c8.tar.gz
CMake-b6c4d93dcd85b8e2c512abf83c25c2270cead1c8.tar.bz2
clang-analyzer: Suppress warnings in intentional use-after-move cases
Diffstat (limited to 'Tests/CMakeLib/testString.cxx')
-rw-r--r--Tests/CMakeLib/testString.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/Tests/CMakeLib/testString.cxx b/Tests/CMakeLib/testString.cxx
index ad800cf..5a9cad1 100644
--- a/Tests/CMakeLib/testString.cxx
+++ b/Tests/CMakeLib/testString.cxx
@@ -326,12 +326,14 @@ static bool testConstructMove()
std::cout << "testConstructMove()\n";
cm::String s1 = std::string("abc");
cm::String s2 = std::move(s1);
+#ifndef __clang_analyzer__ /* cplusplus.Move */
ASSERT_TRUE(s1.data() == nullptr);
ASSERT_TRUE(s1.size() == 0);
ASSERT_TRUE(s2.size() == 3);
ASSERT_TRUE(std::strncmp(s2.data(), "abc", 3) == 0);
ASSERT_TRUE(s1.is_stable());
ASSERT_TRUE(s2.is_stable());
+#endif
return true;
}
@@ -356,12 +358,14 @@ static bool testAssignMove()
cm::String s1 = std::string("abc");
cm::String s2;
s2 = std::move(s1);
+#ifndef __clang_analyzer__ /* cplusplus.Move */
ASSERT_TRUE(s1.data() == nullptr);
ASSERT_TRUE(s1.size() == 0);
ASSERT_TRUE(s2.size() == 3);
ASSERT_TRUE(std::strncmp(s2.data(), "abc", 3) == 0);
ASSERT_TRUE(s1.is_stable());
ASSERT_TRUE(s2.is_stable());
+#endif
return true;
}