@@ -407,6 +407,8 @@ class Sema;
407
407
Third == ICK_Identity;
408
408
}
409
409
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.
410
412
bool isPerfect (const ASTContext &C) const {
411
413
if (!isIdentityConversion ())
412
414
return false ;
@@ -759,8 +761,7 @@ class Sema;
759
761
Standard.setAllToTypes (T);
760
762
}
761
763
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
764
765
// / the type of the source is the same as the type of the target.
765
766
bool isPerfect (const ASTContext &C) const {
766
767
return isStandard () && Standard.isPerfect (C);
@@ -1008,9 +1009,7 @@ class Sema;
1008
1009
if (!Viable)
1009
1010
return false ;
1010
1011
for (const auto &C : Conversions) {
1011
- if (!C.isInitialized ())
1012
- return false ;
1013
- if (!C.isPerfect (Ctx))
1012
+ if (!C.isInitialized () || !C.isPerfect (Ctx))
1014
1013
return false ;
1015
1014
}
1016
1015
if (isa_and_nonnull<CXXConversionDecl>(Function))
@@ -1142,6 +1141,9 @@ class Sema;
1142
1141
// / Resolve a call through the address of an overload set.
1143
1142
CSK_AddressOfOverloadSet,
1144
1143
1144
+ // / When doing overload resolution during code completion,
1145
+ // / we want to show all viable candidates, including otherwise
1146
+ // / deferred template candidates.
1145
1147
CSK_CodeCompletion,
1146
1148
};
1147
1149
@@ -1217,7 +1219,7 @@ class Sema;
1217
1219
SmallVector<OverloadCandidate, 16 > Candidates;
1218
1220
llvm::SmallPtrSet<uintptr_t , 16 > Functions;
1219
1221
1220
- DeferredTemplateOverloadCandidate *FirstDeferredCandidate;
1222
+ DeferredTemplateOverloadCandidate *FirstDeferredCandidate = nullptr ;
1221
1223
unsigned DeferredCandidatesCount : 8 * sizeof (unsigned ) - 2 ;
1222
1224
LLVM_PREFERRED_TYPE (bool )
1223
1225
unsigned HasDeferredTemplateConstructors : 1;
0 commit comments