diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-09-26 18:37:55 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-09-26 18:37:55 +0000 |
commit | 67ef14fe486e169f937737672d687032122d4637 (patch) | |
tree | 2c137a7dcade43e44be85dcd5773d9b755fb05be /clang/lib/Sema/SemaCodeComplete.cpp | |
parent | afd34c6df76a68b581205a21733ceedf8676932d (diff) | |
download | bcm5719-llvm-67ef14fe486e169f937737672d687032122d4637.tar.gz bcm5719-llvm-67ef14fe486e169f937737672d687032122d4637.zip |
Resolve a defect in C++17 copy omission.
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
Diffstat (limited to 'clang/lib/Sema/SemaCodeComplete.cpp')
-rw-r--r-- | clang/lib/Sema/SemaCodeComplete.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp index d3138a96501..90a15e17a2f 100644 --- a/clang/lib/Sema/SemaCodeComplete.cpp +++ b/clang/lib/Sema/SemaCodeComplete.cpp @@ -4293,7 +4293,8 @@ static void mergeCandidatesWithResults(Sema &SemaRef, std::stable_sort( CandidateSet.begin(), CandidateSet.end(), [&](const OverloadCandidate &X, const OverloadCandidate &Y) { - return isBetterOverloadCandidate(SemaRef, X, Y, Loc); + return isBetterOverloadCandidate(SemaRef, X, Y, Loc, + CandidateSet.getKind()); }); // Add the remaining viable overload candidates as code-completion results. |