mpark / variant

C++17 `std::variant` for C++11/14/17
https://mpark.github.io/variant
Boost Software License 1.0
659 stars 88 forks source link

Clang V7.1.0 warning #68

Open hkaiser opened 4 years ago

hkaiser commented 4 years ago

We are seeing this warning while #including (V1.4.0) when using Clang 7.1.0:

/hpx/source/libs/datastructures/include/hpx/datastructures/detail/variant.hpp:2243:22: error: constructor accepting a forwarding reference can hide the copy and move constructors [bugprone-forwarding-reference-overload,-warnings-as-errors]
    inline constexpr variant(Arg &&arg) noexcept(
                     ^
/hpx/source/libs/datastructures/include/hpx/datastructures/detail/variant.hpp:2231:5: note: copy constructor declared here
    variant(const variant &) = default;
    ^
/hpx/source/libs/datastructures/include/hpx/datastructures/detail/variant.hpp:2232:5: note: move constructor declared here
    variant(variant &&) = default;

Anything we can do about this?

mpark commented 4 years ago

I think the only thing we could do probably is to #pragma disable the warning.

hkaiser commented 4 years ago

I think the only thing we could do probably is to #pragma disable the warning.

@mpark: yes, I agree.