From 20c366aa487fe8dc4eb9a0fb80590ceba697aa19 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Wed, 22 Feb 2023 11:52:43 +0100 Subject: [PATCH] UnitTests: Disable self move warnings We want to test self move, so we cannot avoid the warning. Change-Id: Id785690d40cfc5299e65c9f0e69abe6e336ba9ff Reviewed-by: Vikas Pachdha Reviewed-by: Reviewed-by: Tim Jenssen --- tests/unit/unittest/smallstring-test.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/unit/unittest/smallstring-test.cpp b/tests/unit/unittest/smallstring-test.cpp index b822b9cec23..902fd41d1bf 100644 --- a/tests/unit/unittest/smallstring-test.cpp +++ b/tests/unit/unittest/smallstring-test.cpp @@ -1535,6 +1535,11 @@ TEST(SmallString, LongPathStringMoveConstuctor) "text")); } +#if __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wself-move" +#endif + TEST(SmallString, ShortSmallStringMoveConstuctorToSelf) { SmallString text("text"); @@ -1580,6 +1585,10 @@ TEST(SmallString, LongPathStringMoveConstuctorToSelf) "text")); } +#if __clang__ +#pragma clang diagnostic pop +#endif + TEST(SmallString, ShortSmallStringCopyAssignment) { SmallString text("text");