[coroutines] Fix co_return statement for initializer list arguments
authorEric Fiselier <eric@efcs.ca>
Thu, 6 Oct 2016 21:23:38 +0000 (21:23 +0000)
committerEric Fiselier <eric@efcs.ca>
Thu, 6 Oct 2016 21:23:38 +0000 (21:23 +0000)
commit98131319364b2e0d2c0a9e64e385906158be8128
tree76d668fba1fd86adc3f1ed387644ff78fa52242c
parent4fa098a5c0223dab6ae10da6f01541e943cc0bbf
[coroutines] Fix co_return statement for initializer list arguments

Summary:
Previously the statement `co_return {42}` would be transformed into `P.return_void()`, since the type of `{42}` is represented as `void` by Clang.

This patch fixes the bug by checking for `InitListExpr` arguments and transforming them accordingly.

Reviewers: majnemer, GorNishanov, rsmith

Subscribers: mehdi_amini, cfe-commits

Differential Revision: https://reviews.llvm.org/D25296

llvm-svn: 283495
clang/lib/Sema/SemaCoroutine.cpp
clang/test/SemaCXX/coroutines.cpp