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

coroutines: Fix cases where proxy variables are used [PR94879]

There are several places where the handling of a variable
declaration depends on whether it corresponds to a compiler
temporary, or to some other entity.  We were testing that var
decls were artificial in determining this.  However, proxy vars
are also artificial so that this is not sufficient.  The solution
is to exclude variables with a DECL_VALUE_EXPR as well, since
the value variable will not be a temporary.

gcc/cp/ChangeLog:

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

	PR c++/94879
	* coroutines.cc (build_co_await): Account for variables
	with DECL_VALUE_EXPRs.
	(captures_temporary): Likewise.
	(register_awaits): Likewise.

gcc/testsuite/ChangeLog:

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

	PR c++/94879
	* g++.dg/coroutines/pr94879-folly-1.C: New test.
parent 04e88369
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