]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: Add co_await, co_yield and co_return to dump_expr.
authorIain Sandoe <iain@sandoe.co.uk>
Fri, 30 May 2025 19:06:26 +0000 (20:06 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Mon, 2 Jun 2025 18:28:43 +0000 (19:28 +0100)
These were omitted there as an oversight, most of the error handling
for the coroutines code is specific rather than using generic %qE etc.

gcc/cp/ChangeLog:

* error.cc (dump_expr): Add co_await, co_yield and co_return.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/cp/error.cc

index 63643456177507cab747a84001b5327b84308236..69da381a355b16696cb7881f610b4b6042034a21 100644 (file)
@@ -3269,6 +3269,27 @@ dump_expr (cxx_pretty_printer *pp, tree t, int flags)
        break;
       }
 
+    case CO_AWAIT_EXPR:
+      pp_cxx_ws_string (pp, "co_await");
+      pp_cxx_whitespace (pp);
+      dump_expr (pp, TREE_OPERAND (t, 0), flags);
+      break;
+
+    case CO_YIELD_EXPR:
+      pp_cxx_ws_string (pp, "co_yield");
+      pp_cxx_whitespace (pp);
+      dump_expr (pp, TREE_OPERAND (t, 0), flags);
+      break;
+
+    case CO_RETURN_EXPR:
+      pp_cxx_ws_string (pp, "co_return");
+      if (TREE_OPERAND (t, 0))
+       {
+         pp_cxx_whitespace (pp);
+         dump_expr (pp, TREE_OPERAND (t, 0), flags);
+       }
+      break;
+
       /*  This list is incomplete, but should suffice for now.
          It is very important that `sorry' does not call
          `report_error_function'.  That could cause an infinite loop.  */