aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2019-12-13 00:05:51 -0500
committerJason Merrill <jason@gcc.gnu.org>2019-12-13 00:05:51 -0500
commita1af2dd9c3a5f6b4885db739f6fc3d80ed80007a (patch)
tree1ba6cbab3fbf39561b0736e3375da640835ccfc3 /gcc/cp
parent0fec7ca1980a23a212790dee04fcf1f7e12d0417 (diff)
downloadgcc-a1af2dd9c3a5f6b4885db739f6fc3d80ed80007a.zip
gcc-a1af2dd9c3a5f6b4885db739f6fc3d80ed80007a.tar.gz
gcc-a1af2dd9c3a5f6b4885db739f6fc3d80ed80007a.tar.bz2
PR c++/92496 - ICE with <=> and no #include <compare>.
* typeck.c (cp_build_binary_op): Handle error from spaceship_type. From-SVN: r279331
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/typeck.c6
2 files changed, 10 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 202bb6c..dd7da14 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+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
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index d0f7398..d381458 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -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)
{