This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by arphaman on Apr 4 2017, 6:46 AM.

Details

Summary

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 patch fixes the conversion by avoiding copy elision for the capture that captures the lambda that's used in the block created by lambda to block conversion process.

Diff Detail

Repository
rL LLVM

Event Timeline

arphaman created this revision.Apr 4 2017, 6:46 AM
aprantl added a subscriber: aprantl.Apr 4 2017, 8:38 AM
aprantl added inline comments.
include/clang/Sema/Initialization.h
122 ↗(On Diff #94067)

No need to use \brief any more. LLVM uses autobrief.

rjmccall added inline comments.Apr 4 2017, 9:35 AM
include/clang/Sema/Initialization.h
124 ↗(On Diff #94067)

It seems less invasive to just give this a new EntityKind.

arphaman updated this revision to Diff 94177.Apr 5 2017, 2:29 AM
arphaman marked 2 inline comments as done.

Use a new EntityKind and improve test.

rjmccall edited edge metadata.Apr 5 2017, 8:58 AM

Looks good, thanks.

This revision was automatically updated to reflect the committed changes.