Fix lambda to block conversion in C++17 by avoiding copy elision for the
lambda capture used by the created block

The commit r288866 introduced guaranteed copy elision to C++ 17. This
unfortunately broke the lambda to block conversion in C++17 (the compiler
crashes when performing IRGen). This commit fixes the conversion by avoiding
copy elision for the capture that captures the lambda that's used in the block
created by the lambda to block conversion process.

rdar://31385153

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299646 91177308-0d34-0410-b5e6-96231b3b80d8
(cherry picked from commit 25d97408b5320d0c238e7e4e80204ac3017b0571)
5 files changed