https://gcc.gnu.org/g:ad8c618993682a02b758257e21647de28047c880

commit r15-10091-gad8c618993682a02b758257e21647de28047c880
Author: Iain Sandoe <i...@sandoe.co.uk>
Date:   Fri May 30 20:06:26 2025 +0100

    c++: Add co_await, co_yield and co_return to dump_expr.
    
    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 <i...@sandoe.co.uk>
    (cherry picked from commit 09cac2a833689f2535d6c2c88a67b2169df4e4d7)

Diff:
---
 gcc/cp/error.cc | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/gcc/cp/error.cc b/gcc/cp/error.cc
index 499eb1b15a85..65b4b8de4059 100644
--- a/gcc/cp/error.cc
+++ b/gcc/cp/error.cc
@@ -3217,6 +3217,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.  */

Reply via email to