Skip to content

Commit

Permalink
Silence clang warnings about intentional self-assignment in unit test.
Browse files Browse the repository at this point in the history
  • Loading branch information
zrax committed Nov 15, 2019
1 parent 1cda1c8 commit e21c2da
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/test_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,14 @@ TEST(char_buffer, move)
}
#endif

#if defined(__clang__) && ((__clang_major__ > 3) || (__clang_major__ == 3 && __clang_minor__ > 5))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wself-move"
# if defined(__clang__) && (__clang_major__ > 6)
# pragma GCC diagnostic ignored "-Wself-assign-overloaded"
# endif
#endif

TEST(char_buffer, self_assign)
{
// If this changes, this test may need to be updated to match
Expand Down Expand Up @@ -299,6 +307,10 @@ TEST(char_buffer, self_assign)
#endif
}

#if defined(__clang__) && ((__clang_major__ > 3) || (__clang_major__ == 3 && __clang_minor__ > 5))
# pragma GCC diagnostic pop
#endif

TEST(char_buffer, compare)
{
// Same length, chars
Expand Down

0 comments on commit e21c2da

Please sign in to comment.