]> granicus.if.org Git - clang/commit
[c++17] Refine resolution of constructor / conversion function disambiguation.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 1 Nov 2017 01:37:11 +0000 (01:37 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 1 Nov 2017 01:37:11 +0000 (01:37 +0000)
commit2680fb2e8a862140ca2ad728276eeea9bfb1d103
tree27569a25d1ae66683fe5d8362bcab3b639fedf21
parenteb1c10e34de92b9ee0d0ccfbef13a231187eda3d
[c++17] Refine resolution of constructor / conversion function disambiguation.

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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317066 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaOverload.cpp
test/SemaCXX/cxx1z-copy-omission.cpp