You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following snippet fails on clang with :
"static_assert failed "std::visit requires the visitor to be exhaustive."
Both gcc and vc++ accept non-const lvalue references.
Extended Description
The following snippet fails on clang with :
"static_assert failed "
std::visit
requires the visitor to be exhaustive."Both gcc and vc++ accept non-const lvalue references.
#include
#include
struct A { int x = 33; };
struct Visitor
{
void operator()(A &node) { std::cout << node.x; }
};
int main()
{
std::variant var = A{};
std::visit(Visitor{}, var);
}
The text was updated successfully, but these errors were encountered: