https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84676

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Untested fix:

--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -5591,6 +5591,10 @@ build_new_op_1 (location_t loc, enum tree_code code, int
flags, tree arg1,
       || error_operand_p (arg3))
     return error_mark_node;

+  if (TREE_TYPE (arg1) == NULL_TREE
+      || TREE_TYPE (arg2) == NULL_TREE)
+    return error_mark_node;
+
   bool ismodop = code == MODIFY_EXPR;
   if (ismodop)
     {

Reply via email to