rttrorg / rttr

C++ Reflection Library
https://www.rttr.org
MIT License
3.11k stars 429 forks source link

self assignment problem in build #334

Open tr8dr opened 2 years ago

tr8dr commented 2 years ago

I am attempting to build master on osx. It seems that the choice of flags used by the build are such that one of the unit tests does not compile:

rttr/src/unit_tests/variant/variant_assign_test.cpp:156:11: error: explicitly assigning value of variable of type 'rttr::variant' to itself [-Werror,-Wself-assign-overloaded]
        a = a;

This comes from the unit tests:

TEST_CASE("variant::operator=() - self assignment", "[variant]")
{
    SECTION("self assign - empty")
    {
        variant a;
        a = a;

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

    SECTION("self assign - full")
    {
        variant a = 1;
        a = a;

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

This is on: Apple clang version 12.0.5 (clang-1205.0.22.9) Target: x86_64-apple-darwin21.3.0.

Should I be concerned with this, or just skip the test?