[PATCH] D68845: Don't emit unwanted constructor calls in co_return statements
Arthur O'Dwyer via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 10 21:56:12 PDT 2019
Quuxplusone added a comment.
Oh, and can you please make sure there are test cases for all the various cases covered in P1155 <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1155r2.html>? Specifically, I would expect all three of the following test cases to compile successfully. It looks like they compile successfully in trunk right now (Godbolt <https://coro.godbolt.org/z/YQ0saN>), so we're just testing that they don't get broken in the future.
struct Widget { Widget(); Widget(const Widget&) = delete; Widget(Widget&&); };
struct To { operator Widget() &&; };
task<Widget> nine() { To t; co_return t; }
struct Fowl { Fowl(Widget); };
task<Fowl> eleven() { Widget w; co_return w; }
struct Base { Base(); Base(const Base&) = delete; Base(Base&&); };
struct Derived : Base {};
task<Base> thirteen() { Derived result; co_return result; }
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D68845/new/
https://reviews.llvm.org/D68845
More information about the cfe-commits
mailing list