[llvm] 4e627a3 - [test] Disable the -Wself-move warning that triggers on exactly what is being tested (NFC)

Jie Fu via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 24 16:41:53 PDT 2023


Author: Jie Fu
Date: 2023-08-25T07:40:42+08:00
New Revision: 4e627a3a9b9d5fad0e46681182d015ee66ea3d59

URL: https://github.com/llvm/llvm-project/commit/4e627a3a9b9d5fad0e46681182d015ee66ea3d59
DIFF: https://github.com/llvm/llvm-project/commit/4e627a3a9b9d5fad0e46681182d015ee66ea3d59.diff

LOG: [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.

Added: 
    

Modified: 
    llvm/unittests/Option/OptionParsingTest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/Option/OptionParsingTest.cpp b/llvm/unittests/Option/OptionParsingTest.cpp
index a7075e6eea2303..804a8016414dbc 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;


        


More information about the llvm-commits mailing list