Handle type deduction of auto and decltype(auto) with reference expression
authorJunMa <JunMa@linux.alibaba.com>
Tue, 21 Jan 2020 10:18:09 +0000 (18:18 +0800)
committerJunMa <JunMa@linux.alibaba.com>
Wed, 5 Feb 2020 00:54:46 +0000 (08:54 +0800)
commit3ef39186b61939da7c658561b97f04b62973bf92
tree5766772318711e97df9aabf30eabd54e9ac9b609
parent81d73774ed6ee26876052c8cb915e73152ffca3a
Handle type deduction of auto and decltype(auto) with reference expression

gcc/cp
    * coroutines.cc (build_co_await): Call convert_from_reference
    to wrap co_await_expr with indirect_ref which avoid
    reference/non-reference type confusion.

    (co_await_expander):  Sink to call_expr if await_resume
    is wrapped by indirect_ref.

gcc/testsuite
    * g++.dg/coroutines/co-await-14-return-ref-to-auto.C: New test.
gcc/cp/ChangeLog
gcc/cp/coroutines.cc
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/coroutines/torture/co-await-14-return-ref-to-auto.C [new file with mode: 0644]