Skip to content

P0088R3_variant: Investigate possible Clang bugs #6156

Description

In #4713, I disabled these parts of P0088R3_variant, but never investigated:

#ifdef __clang__ // TRANSITION, not yet investigated
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wundefined-inline"
#endif // ^^^ workaround ^^^
struct HasFullOrdering {
constexpr bool operator==(const HasFullOrdering&) const;
constexpr std::weak_ordering operator<=>(const HasFullOrdering&) const;
};
#ifdef __clang__ // TRANSITION, not yet investigated
#pragma clang diagnostic pop
#endif // ^^^ workaround ^^^

void test_no_narrowing_check_for_class_types() {
#ifndef __clang__ // TRANSITION, not yet investigated
using V = std::variant<int, BoomOnAnything>;
V v(42);
assert(v.index() == 0);
assert(std::get<0>(v) == 42);
#endif // ^^^ no workaround ^^^
}

I commented that these appeared to be mirrored in libcxx/expected_results.txt, which are also unsolved mysteries:

# Not analyzed. Clang instantiates BoomOnAnything during template argument substitution.
std/utilities/variant/variant.variant/variant.ctor/T.pass.cpp:2 FAIL

# Not analyzed. Clang emits a -Wundefined-inline warning.
std/utilities/variant/variant.relops/three_way.pass.cpp:2 FAIL

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    testRelated to test code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions