[PATCH] D29908: Disallow returning a __block variable via a move

2017-02-14 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL295150: [Sema] Disallow returning a __block variable via a move. (authored by ahatanak). Changed prior to commit: https://reviews.llvm.org/D29908?vs=88430=88486#toc Repository: rL LLVM

[PATCH] D29908: Disallow returning a __block variable via a move

2017-02-14 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In https://reviews.llvm.org/D29908#676788, @rjmccall wrote: > Oh, I see. Just to clarify: it doesn't matter that the object "ret" used to > point to has been destructed, what matters is that "ret" now holds a null > reference because it's been moved out of. Yes,

[PATCH] D29908: Disallow returning a __block variable via a move

2017-02-14 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 88430. ahatanak added a comment. Update comment. https://reviews.llvm.org/D29908 Files: lib/Sema/SemaStmt.cpp test/SemaObjCXX/blocks.mm Index: test/SemaObjCXX/blocks.mm === ---

[PATCH] D29908: Disallow returning a __block variable via a move

2017-02-14 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. In https://reviews.llvm.org/D29908#676601, @ahatanak wrote: > In https://reviews.llvm.org/D29908#676589, @ahatanak wrote: > > > Posting John's review comment, which was sent to the review I abandoned: > > > > "Hmm. The behavior I think we actually want here is that we

[PATCH] D29908: Disallow returning a __block variable via a move

2017-02-14 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In https://reviews.llvm.org/D29908#676589, @ahatanak wrote: > Posting John's review comment, which was sent to the review I abandoned: > > "Hmm. The behavior I think we actually want here is that we should move out > of the __block variable but not perform NRVO,

[PATCH] D29908: Disallow returning a __block variable via a move

2017-02-14 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Posting John's review comment, which was sent to the review I abandoned: "Hmm. The behavior I think we actually want here is that we should move out of the __block variable but not perform NRVO, essentially like we would if the variable were a parameter. The block

[PATCH] D29908: Disallow returning a __block variable via a move

2017-02-13 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. This patch disables moving a __block variable to return it from a function, which was causing a crash that occurred when compiling and executing the following code: #include #include #include class A { public: A(int x) : internal(x) {}