[Bug c++/96497] Compare std::variant with int using C++20 <=> is not a constant expression

barry.revzin at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Aug 6 13:58:30 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96497

Barry Revzin <barry.revzin at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |barry.revzin at gmail dot com

--- Comment #1 from Barry Revzin <barry.revzin at gmail dot com> ---
Reduced (https://godbolt.org/z/1bY545):

#include <compare>

// this one is okay
static_assert(std::partial_ordering(std::strong_ordering::less) < 0);

// this one fails with non-constant condition
static_assert(std::partial_ordering(1 <=> 2) < 0);


More information about the Gcc-bugs mailing list