Skip to content

Commit

Permalink
variant self assignment test: suppress clang diagnostic
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyG authored and yjiao-cgnx committed Oct 27, 2021
1 parent 5561dea commit af1a1b8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/unit_tests/variant/variant_assign_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ TEST_CASE("move assignment", "[variant]")

TEST_CASE("variant::operator=() - self assignment", "[variant]")
{
#if RTTR_COMPILER == RTTR_COMPILER_CLANG || RTTR_COMPILER == RTTR_COMPILER_APPLECLANG
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wself-assign"
#endif

SECTION("self assign - empty")
{
variant a;
Expand All @@ -165,6 +170,10 @@ TEST_CASE("variant::operator=() - self assignment", "[variant]")

CHECK(a.is_valid() == true);
}

#if RTTR_COMPILER == RTTR_COMPILER_CLANG || RTTR_COMPILER == RTTR_COMPILER_APPLECLANG
#pragma clang diagnostic pop
#endif
}

/////////////////////////////////////////////////////////////////////////////////////////

0 comments on commit af1a1b8

Please sign in to comment.