* typeck.c (cp_build_binary_op): Handle error from spaceship_type.
From-SVN: r279331
+2019-12-12 Jason Merrill <jason@redhat.com>
+
+ PR c++/92496 - ICE with <=> and no #include <compare>.
+ * typeck.c (cp_build_binary_op): Handle error from spaceship_type.
+
2019-12-11 David Malcolm <dmalcolm@redhat.com>
* cxx-pretty-print.c (cxx_pretty_printer::clone): New vfunc
result_type = NULL_TREE;
if (result_type)
- build_type = spaceship_type (result_type, complain);
+ {
+ build_type = spaceship_type (result_type, complain);
+ if (build_type == error_mark_node)
+ return error_mark_node;
+ }
if (result_type && arithmetic_types_p)
{
--- /dev/null
+// PR c++/92496
+// { dg-do compile { target c++2a } }
+
+template<auto V>
+struct A {};
+
+struct B {
+ constexpr auto operator<=>(const B&) const = default; // { dg-error "" }
+ int value;
+};
+
+A<B{}> t;