This is an archive of the discontinued LLVM Phabricator instance.

[Sema] Emit correct warning when copy-elision is not possible.
ClosedPublic

Authored by davide on Jul 17 2015, 11:26 AM.

Diff Detail

Event Timeline

davide updated this revision to Diff 30019.Jul 17 2015, 11:26 AM
davide retitled this revision from to [Sema] Emit correct warning when copy-elision is not possible..
davide updated this object.
davide added reviewers: rsmith, rtrieu.
davide set the repository for this revision to rL LLVM.
davide added a subscriber: cfe-commits.
rsmith added inline comments.Jul 17 2015, 1:07 PM
lib/Sema/SemaInit.cpp
5991–6001

Can you just check isa<ParmVarDecl>(VD)?

davide updated this revision to Diff 30031.Jul 17 2015, 1:37 PM
davide removed rL LLVM as the repository for this revision.

Indeed.

rsmith accepted this revision.Jul 17 2015, 1:38 PM
rsmith edited edge metadata.

LGTM

This revision is now accepted and ready to land.Jul 17 2015, 1:38 PM
rsmith added inline comments.Jul 17 2015, 1:39 PM
test/SemaCXX/warn-pessmizing-move.cpp
158

Do we have more macro tests that test cases where the warning is produced? If not, please change the tests to use a local variable.

This revision was automatically updated to reflect the committed changes.
davide marked an inline comment as done.
davide added inline comments.Jul 17 2015, 6:17 PM
test/SemaCXX/warn-pessmizing-move.cpp
158

No, we do not. Therefore I changed as you recommended. Thanks for noticing and the review in general.