c++: co_await and move-only type [PR105406]
commitd0ed0690f1e86621a5cb62eec1d144036feb16f8
authorJason Merrill <jason@redhat.com>
Wed, 15 Mar 2023 21:02:15 +0000 (15 17:02 -0400)
committerJason Merrill <jason@redhat.com>
Thu, 16 Mar 2023 11:58:30 +0000 (16 07:58 -0400)
treea3b71fc7d8d1f8039392fe63d97e6d06d7f2a5b8
parent46c4be98d1e759a406069487e5dbaad0346e7e7d
c++: co_await and move-only type [PR105406]

Here we were building a temporary MoveOnlyAwaitable to hold the result of
evaluating 'o', but since 'o' is an lvalue we should build a reference
instead.

PR c++/105406

gcc/cp/ChangeLog:

* coroutines.cc (build_co_await): Handle lvalue 'o'.

gcc/testsuite/ChangeLog:

* g++.dg/coroutines/co-await-moveonly1.C: New test.
gcc/cp/coroutines.cc
gcc/testsuite/g++.dg/coroutines/co-await-moveonly1.C [new file with mode: 0644]