Skip to content

Commit

Permalink
Add version checks to -Wself-move suppressions
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-craig-cs committed Jan 16, 2025
1 parent 2d14b0b commit 9840c66
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions radiant/TotallyRad.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@

#if defined(__clang__) && __clang__
#define RAD_CLANG_VERSION \
(__clang_major__ * 10000 + __clang_minor__ + 100 + __clang_patchlevel__)
(__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
#endif

#if !defined(__clang__) && defined(__GNUC__) && __GNUC__
#define RAD_GCC_VERSION \
(__GNUC__ * 10000 + __GNUC__MINOR__ + 100 + __GNUC_PATCHLEVEL__)
(__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
#endif

#if defined(_MSC_VER) && _MSC_VER
Expand Down
4 changes: 2 additions & 2 deletions test/test_List.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ TEST(ListTest, MoveAssign)
ListEqual(one, { 101 });
ListEqual(move_from_one, { 1, 201 });
}
#ifdef RAD_GCC_VERSION
#if defined(RAD_GCC_VERSION) && RAD_GCC_VERSION >= 130000
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wself-move"
#endif
Expand All @@ -472,7 +472,7 @@ TEST(ListTest, MoveAssign)
#ifdef RAD_CLANG_VERSION
#pragma clang diagnostic pop
#endif
#ifdef RAD_GCC_VERSION
#if defined(RAD_GCC_VERSION) && RAD_GCC_VERSION >= 130000
#pragma GCC diagnostic pop
#endif
}
Expand Down
4 changes: 2 additions & 2 deletions test/test_Vector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@ TEST_F(TestVectorIntegral, Move)
EXPECT_EQ(other.Front(), 1);
EXPECT_EQ(other.Back(), 3);

#ifdef RAD_GCC_VERSION
#if defined(RAD_GCC_VERSION) && RAD_GCC_VERSION >= 130000
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wself-move"
#endif
Expand All @@ -1022,7 +1022,7 @@ TEST_F(TestVectorIntegral, Move)
#ifdef RAD_CLANG_VERSION
#pragma clang diagnostic pop
#endif
#ifdef RAD_GCC_VERSION
#if defined(RAD_GCC_VERSION) && RAD_GCC_VERSION >= 130000
#pragma GCC diagnostic pop
#endif
}
Expand Down

0 comments on commit 9840c66

Please sign in to comment.