diff options
Diffstat (limited to 'lib/Sema/SemaInit.cpp')
-rw-r--r-- | lib/Sema/SemaInit.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index 0612c73f89..1b69872417 100644 --- a/lib/Sema/SemaInit.cpp +++ b/lib/Sema/SemaInit.cpp @@ -3262,10 +3262,9 @@ static OverloadingResult TryRefInitWithConversionFunction(Sema &S, return Result; FunctionDecl *Function = Best->Function; - - // This is the overload that will actually be used for the initialization, so - // mark it as used. - S.MarkFunctionReferenced(DeclLoc, Function); + // This is the overload that will be used for this initialization step if we + // use this initialization. Mark it as referenced. + Function->setReferenced(); // Compute the returned type of the conversion. if (isa<CXXConversionDecl>(Function)) @@ -3831,7 +3830,7 @@ static void TryUserDefinedConversion(Sema &S, } FunctionDecl *Function = Best->Function; - S.MarkFunctionReferenced(DeclLoc, Function); + Function->setReferenced(); bool HadMultipleCandidates = (CandidateSet.size() > 1); if (isa<CXXConstructorDecl>(Function)) { @@ -4609,8 +4608,6 @@ static ExprResult CopyObject(Sema &S, return S.Owned(CurInitExpr); } - S.MarkFunctionReferenced(Loc, Constructor); - // Determine the arguments required to actually perform the // constructor call (we might have derived-to-base conversions, or // the copy constructor may have default arguments). |