Commit a1af2dd9 by Jason Merrill Committed by Jason Merrill

PR c++/92496 - ICE with <=> and no #include <compare>.

	* typeck.c (cp_build_binary_op): Handle error from spaceship_type.

From-SVN: r279331
parent 0fec7ca1
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
......
......@@ -5418,7 +5418,11 @@ cp_build_binary_op (const op_location_t &location,
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)
{
......
// 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;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment