diff mbox series

[pushed] coroutines: Mark the gro as artificial.

Message ID D48F03AA-9CBB-4161-9F71-495EA86BE18A@sandoe.co.uk
State New
Headers show
Series [pushed] coroutines: Mark the gro as artificial. | expand

Commit Message

Iain Sandoe May 4, 2020, 7:55 p.m. UTC
Hi

This corrects an oversight; the coro.gro object is a a compiler-generated
entity and should be marked as artificial and ignored.

tested on x86_64-darwin16,
applied to master as obvious,
thanks
Iain

gcc/cp/ChangeLog:

2020-05-04  Iain Sandoe  <iain@sandoe.co.uk>

	* coroutines.cc (morph_fn_to_coro): Mark the coro.gro variable
	as artificial and ignored.
---
 gcc/cp/ChangeLog     | 5 +++++
 gcc/cp/coroutines.cc | 2 ++
 2 files changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/gcc/cp/coroutines.cc b/gcc/cp/coroutines.cc
index e90d3d5a3b3..bc08b1de0ac 100644
--- a/gcc/cp/coroutines.cc
+++ b/gcc/cp/coroutines.cc
@@ -4234,6 +4234,8 @@  morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer)
       gro = build_lang_decl (VAR_DECL, get_identifier ("coro.gro"),
 			      TREE_TYPE (get_ro));
       DECL_CONTEXT (gro) = current_scope ();
+      DECL_ARTIFICIAL (gro) = true;
+      DECL_IGNORED_P (gro) = true;
       add_decl_expr (gro);
       gro_bind_vars = gro;