Promote the static getNRVOCandidate() function, which computed the
commite7176814c8d70d608e10c228b2d3beddff0bb50b
authorDouglas Gregor <doug.gregor@gmail.com>
Fri, 21 Jan 2011 18:05:27 +0000 (21 18:05 +0000)
committerDouglas Gregor <doug.gregor@gmail.com>
Fri, 21 Jan 2011 18:05:27 +0000 (21 18:05 +0000)
tree52fd20cb43a74996551e5b3e164c1bf87ff7f881
parent2bd9bb0e6cf8cf57d0964512ef2d327d8d610171
Promote the static getNRVOCandidate() function, which computed the
NRVO candidate for a return statement, to
Sema::getCopyElisionCandidate(), and teach it enough to also determine
the NRVO candidate for a throw expression. We still don't use the
latter information, however.

Along the way, implement core issue 1148, which eliminates copy
elision from catch parameters and clarifies that copy elision cannot
occur from function parameters (which we already implemented).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123982 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Sema/Sema.h
lib/Sema/SemaExprCXX.cpp
lib/Sema/SemaInit.cpp
lib/Sema/SemaStmt.cpp
test/CodeGenCXX/nrvo.cpp