[c++17] P0135R1: Guaranteed copy elision.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 6 Dec 2016 23:52:28 +0000 (23:52 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 6 Dec 2016 23:52:28 +0000 (23:52 +0000)
commit122f88d481971b68d05ba12395c3b73ab4b31ab3
treec59ee8196c104634ee39555cc8b9d97ee5d75b5c
parent2187bb8a89cdbe529ee222bf56d1b7415337cb20
[c++17] P0135R1: Guaranteed copy elision.

When an object of class type is initialized from a prvalue of the same type
(ignoring cv qualifications), use the prvalue to initialize the object directly
instead of inserting a redundant elidable call to a copy constructor.

llvm-svn: 288866
18 files changed:
clang/include/clang/AST/Expr.h
clang/lib/AST/Expr.cpp
clang/lib/AST/ExprConstant.cpp
clang/lib/CodeGen/CGExpr.cpp
clang/lib/CodeGen/CGExprAgg.cpp
clang/lib/CodeGen/CGExprConstant.cpp
clang/lib/Sema/SemaExprCXX.cpp
clang/lib/Sema/SemaInit.cpp
clang/lib/Sema/SemaOverload.cpp
clang/test/CXX/drs/dr0xx.cpp
clang/test/CXX/drs/dr10xx.cpp
clang/test/CXX/drs/dr1xx.cpp
clang/test/CXX/drs/dr4xx.cpp
clang/test/CodeGenCXX/cxx1z-copy-omission.cpp [new file with mode: 0644]
clang/test/SemaCXX/aggregate-initialization.cpp
clang/test/SemaCXX/cxx1z-copy-omission.cpp [new file with mode: 0644]
clang/www/cxx_dr_status.html
clang/www/cxx_status.html