From: Ehsan Akhgari Date: Tue, 22 Jul 2014 20:20:14 +0000 (+0000) Subject: Use the correct from type in a SCS X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6057f922af873862ffdc9c99034d1a701c7ebb28;p=clang Use the correct from type in a SCS Summary: If during constructing a standard conversion sequence, we resolve an overload, we need to adjust the from type in the SCS according to the resolved operator. I found this bug when debugging PR20218. This doesn't seem to be observable, so there is no good way of testing it. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4402 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213680 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp index 03001d89f0..e13fd14fd8 100644 --- a/lib/Sema/SemaOverload.cpp +++ b/lib/Sema/SemaOverload.cpp @@ -1451,6 +1451,7 @@ static bool IsStandardConversion(Sema &S, Expr* From, QualType ToType, // We were able to resolve the address of the overloaded function, // so we can convert to the type of that function. FromType = Fn->getType(); + SCS.setFromType(FromType); // we can sometimes resolve &foo regardless of ToType, so check // if the type matches (identity) or we are converting to bool