+2019-12-10 Jason Merrill <jason@redhat.com>
+
+ PR c++/92560 - ICE with decltype and rewritten operator.
+ * call.c (build_new_op_1): Clear tf_decltype on inner call.
+
2019-12-09 David Malcolm <dmalcolm@redhat.com>
* error.c (range_label_for_type_mismatch::get_text): Replace
result = error_mark_node;
else
{
+ tsubst_flags_t ocomplain = complain;
+ if (cand->rewritten ())
+ /* We'll wrap this call in another one. */
+ ocomplain &= ~tf_decltype;
if (cand->reversed ())
{
/* We swapped these in add_candidate, swap them back now. */
"current function recursively with reversed "
"arguments");
}
- result = build_over_call (cand, LOOKUP_NORMAL, complain);
+ result = build_over_call (cand, LOOKUP_NORMAL, ocomplain);
}
if (trivial_fn_p (cand->fn))
--- /dev/null
+// PR c++/92560
+// { dg-do compile { target c++2a } }
+
+#include <compare>
+
+struct X
+{
+ friend std::strong_ordering operator<=>(X, X);
+} x;
+
+using T = decltype(x < x);