Skip to content

Commit 4e627a3

Browse files
committed
[test] Disable the -Wself-move warning that triggers on exactly what is being tested (NFC)
/Users/jiefu/llvm-project/llvm/unittests/Option/OptionParsingTest.cpp:251:6: error: explicitly moving variable of type 'InputArgList' to itself [-Werror,-Wself-move] AL = std::move(AL); ~~ ^ ~~ 1 error generated.
1 parent d2c37fc commit 4e627a3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

llvm/unittests/Option/OptionParsingTest.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,12 @@ TYPED_TEST(OptTableTest, IgnoreCase) {
238238
EXPECT_TRUE(AL.hasArg(OPT_B));
239239
}
240240

241+
#if defined(__clang__)
242+
// Disable the warning that triggers on exactly what is being tested.
243+
#pragma clang diagnostic push
244+
#pragma clang diagnostic ignored "-Wself-move"
245+
#endif
246+
241247
TYPED_TEST(OptTableTest, InputArgListSelfAssign) {
242248
TypeParam T;
243249
unsigned MAI, MAC;
@@ -255,6 +261,10 @@ TYPED_TEST(OptTableTest, InputArgListSelfAssign) {
255261
EXPECT_FALSE(AL.hasArg(OPT_SLASH_C));
256262
}
257263

264+
#if defined(__clang__)
265+
#pragma clang diagnostic pop
266+
#endif
267+
258268
TYPED_TEST(OptTableTest, DoNotIgnoreCase) {
259269
TypeParam T;
260270
unsigned MAI, MAC;

0 commit comments

Comments
 (0)