[Bug c++/92431] ICE with spaceship in constexpr evaluation
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Nov 9 18:18:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92431
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Further reduced:
namespace std {
enum E { e };
struct strong_ordering {
int c;
constexpr strong_ordering(E) : c () {}
static const strong_ordering less;
static strong_ordering equal;
static strong_ordering greater;
constexpr operator int() {}
};
strong_ordering constexpr strong_ordering::less(e);
}
constexpr int cmp (int d, int e) { return d <=> e; }
auto f = cmp (1, 2);
We have ADDR_EXPR of a SPACESHIP_EXPR originally, the SPACESHIP_EXPR is
constexpr evaluated into a CONSTRUCTOR but the ADDR_EXPR handling code in in
cxx_eval_constant_expression asserts that ADDR_EXPR operand doesn't evaluate
into a CONSTRUCTOR when lval is true.
More information about the Gcc-bugs
mailing list