summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/cxx1z-copy-omission.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [c++17] Refine resolution of constructor / conversion function disambiguation.Richard Smith2017-11-011-0/+9
| | | | | | | | | | | | Given a choice between a constructor call and a conversion function in C++17, we prefer the constructor for direct-initialization and the conversion function for copy-initialization, matching the behavior in C++14 and before. The guaranteed copy elision rules were not intended to change the meaning of such code (other than by removing unnecessary copy constructor calls). This tweak will be raised with CWG. llvm-svn: 317066
* Resolve a defect in C++17 copy omission.Richard Smith2017-09-261-2/+30
| | | | | | | | | | | | When selecting constructors for initializing an object of type T from a single expression of class type U, also consider conversion functions of U that convert to T (rather than modeling such conversions as calling a conversion function and then calling a constructor). This approach is proposed as the resolution for the defect, and is also already implemented by GCC. llvm-svn: 314231
* Fix test.Richard Smith2016-12-071-1/+1
| | | | llvm-svn: 288870
* [c++17] P0135R1: Guaranteed copy elision.Richard Smith2016-12-061-0/+134
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
OpenPOWER on IntegriCloud