Skip to content
Snippets Groups Projects
Commit 15a176a8 authored by Iain Sandoe's avatar Iain Sandoe
Browse files

c++, coroutines: Make sure our temporaries are in a bind expr [PR105287]


There are a few cases where we can generate a temporary that does not need
to be added to the coroutine frame (i.e. these are genuinely ephemeral).  The
intent was that unnamed temporaries should not be 'promoted' to coroutine
frame entries.  However there was a thinko and these were not actually ever
added to the bind expressions being generated for the expanded awaits.  This
meant that they were showing in the global namspace, leading to an empty
DECL_CONTEXT and the ICE reported.

Signed-off-by: default avatarIain Sandoe <iain@sandoe.co.uk>

	PR c++/105287

gcc/cp/ChangeLog:

	* coroutines.cc (maybe_promote_temps): Ensure generated temporaries
	are added to the bind expr.
	(add_var_to_bind): Fix local var naming to use portable punctuation.
	(register_local_var_uses): Do not add synthetic names to unnamed
	temporaries.

gcc/testsuite/ChangeLog:

	* g++.dg/coroutines/pr105287.C: New test.
parent 9cb1f565
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment