@@ -407,6 +407,8 @@ class Sema;
407407 Third == ICK_Identity;
408408 }
409409
410+ // / A conversion sequence is perfect if it is an identity conversion and
411+ // / the type of the source is the same as the type of the target.
410412 bool isPerfect (const ASTContext &C) const {
411413 if (!isIdentityConversion ())
412414 return false ;
@@ -759,8 +761,7 @@ class Sema;
759761 Standard.setAllToTypes (T);
760762 }
761763
762- // / A conversion sequence is perfect if
763- // / it is an identity conversion and
764+ // / A conversion sequence is perfect if it is an identity conversion and
764765 // / the type of the source is the same as the type of the target.
765766 bool isPerfect (const ASTContext &C) const {
766767 return isStandard () && Standard.isPerfect (C);
@@ -1008,9 +1009,7 @@ class Sema;
10081009 if (!Viable)
10091010 return false ;
10101011 for (const auto &C : Conversions) {
1011- if (!C.isInitialized ())
1012- return false ;
1013- if (!C.isPerfect (Ctx))
1012+ if (!C.isInitialized () || !C.isPerfect (Ctx))
10141013 return false ;
10151014 }
10161015 if (isa_and_nonnull<CXXConversionDecl>(Function))
@@ -1142,6 +1141,9 @@ class Sema;
11421141 // / Resolve a call through the address of an overload set.
11431142 CSK_AddressOfOverloadSet,
11441143
1144+ // / When doing overload resolution during code completion,
1145+ // / we want to show all viable candidates, including otherwise
1146+ // / deferred template candidates.
11451147 CSK_CodeCompletion,
11461148 };
11471149
@@ -1217,7 +1219,7 @@ class Sema;
12171219 SmallVector<OverloadCandidate, 16 > Candidates;
12181220 llvm::SmallPtrSet<uintptr_t , 16 > Functions;
12191221
1220- DeferredTemplateOverloadCandidate *FirstDeferredCandidate;
1222+ DeferredTemplateOverloadCandidate *FirstDeferredCandidate = nullptr ;
12211223 unsigned DeferredCandidatesCount : 8 * sizeof (unsigned ) - 2 ;
12221224 LLVM_PREFERRED_TYPE (bool )
12231225 unsigned HasDeferredTemplateConstructors : 1;
0 commit comments