[Bug c++/96499] New: Compare std::variant with int using C++20 <=> occurs internal compiler error
hewillk at gmail dot com
gcc-bugzilla@gcc.gnu.org
Thu Aug 6 13:54:37 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96499
Bug ID: 96499
Summary: Compare std::variant with int using C++20 <=> occurs
internal compiler error
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: hewillk at gmail dot com
Target Milestone: ---
#include <variant>
constexpr auto operator<=>(const auto& v, const auto& u) {
return std::visit([&u](const auto& t) { return t <=> u; }, v);
}
constexpr std::variant<double, int> v{1};
static_assert(v < 2);
This will occurs internal compiler error for gcc-trunk.
godbolt link:
https://godbolt.org/z/EcGKc3
More information about the Gcc-bugs
mailing list