Preserve the FoundDecl properly in constructor overload resolution. No

functionality change; this information is not yet in use.

llvm-svn: 269382
This commit is contained in:
Richard Smith 2016-05-12 23:45:49 +00:00
parent ce5196e728
commit 55c28889c1
2 changed files with 7 additions and 11 deletions

View File

@ -1046,8 +1046,8 @@ public:
/// \param FromInitList The constructor call is syntactically an initializer
/// list.
/// \param AsInitList The constructor is called as an init list constructor.
void AddConstructorInitializationStep(CXXConstructorDecl *Constructor,
AccessSpecifier Access,
void AddConstructorInitializationStep(DeclAccessPair FoundDecl,
CXXConstructorDecl *Constructor,
QualType T,
bool HadMultipleCandidates,
bool FromInitList, bool AsInitList);

View File

@ -3224,13 +3224,9 @@ void InitializationSequence::AddListInitializationStep(QualType T) {
Steps.push_back(S);
}
void
InitializationSequence
::AddConstructorInitializationStep(CXXConstructorDecl *Constructor,
AccessSpecifier Access,
QualType T,
bool HadMultipleCandidates,
bool FromInitList, bool AsInitList) {
void InitializationSequence::AddConstructorInitializationStep(
DeclAccessPair FoundDecl, CXXConstructorDecl *Constructor, QualType T,
bool HadMultipleCandidates, bool FromInitList, bool AsInitList) {
Step S;
S.Kind = FromInitList ? AsInitList ? SK_StdInitializerListConstructorCall
: SK_ConstructorInitializationFromList
@ -3238,7 +3234,7 @@ InitializationSequence
S.Type = T;
S.Function.HadMultipleCandidates = HadMultipleCandidates;
S.Function.Function = Constructor;
S.Function.FoundDecl = DeclAccessPair::make(Constructor, Access);
S.Function.FoundDecl = FoundDecl;
Steps.push_back(S);
}
@ -3628,7 +3624,7 @@ static void TryConstructorInitialization(Sema &S,
// subsumed by the initialization.
bool HadMultipleCandidates = (CandidateSet.size() > 1);
Sequence.AddConstructorInitializationStep(
CtorDecl, Best->FoundDecl.getAccess(), DestType, HadMultipleCandidates,
Best->FoundDecl, CtorDecl, DestType, HadMultipleCandidates,
IsListInit | IsInitListCopy, AsInitializerList);
}