diff --git a/llvm/unittests/Option/OptionParsingTest.cpp b/llvm/unittests/Option/OptionParsingTest.cpp index a7075e6eea230..804a8016414db 100644 --- a/llvm/unittests/Option/OptionParsingTest.cpp +++ b/llvm/unittests/Option/OptionParsingTest.cpp @@ -238,6 +238,12 @@ TYPED_TEST(OptTableTest, IgnoreCase) { EXPECT_TRUE(AL.hasArg(OPT_B)); } +#if defined(__clang__) +// Disable the warning that triggers on exactly what is being tested. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wself-move" +#endif + TYPED_TEST(OptTableTest, InputArgListSelfAssign) { TypeParam T; unsigned MAI, MAC; @@ -255,6 +261,10 @@ TYPED_TEST(OptTableTest, InputArgListSelfAssign) { EXPECT_FALSE(AL.hasArg(OPT_SLASH_C)); } +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + TYPED_TEST(OptTableTest, DoNotIgnoreCase) { TypeParam T; unsigned MAI, MAC;