[Sema] Emit correct warning when copy-elision is not possible.
authorDavide Italiano <davide@freebsd.org>
Sat, 18 Jul 2015 01:15:19 +0000 (01:15 +0000)
committerDavide Italiano <davide@freebsd.org>
Sat, 18 Jul 2015 01:15:19 +0000 (01:15 +0000)
commit7842c3fceadaa1fcef7c91c59d822a572a17c8e2
treee55503b0d4c4565f6d80c814b93ccd568e9803bd
parent857a43c70a95efbb76b5d90e38e166cf802507a5
[Sema] Emit correct warning when copy-elision is not possible.

If we're returning a function parameter, copy elision isn't possible,
so we now warn for redundant move.

PR: 23819
Differential Revision:  http://reviews.llvm.org/D11305

llvm-svn: 242600
clang/lib/Sema/SemaInit.cpp
clang/test/SemaCXX/warn-pessmizing-move.cpp
clang/test/SemaCXX/warn-redundant-move.cpp