Author: ehsan Date: Tue Jul 22 15:20:14 2014 New Revision: 213680 URL: http://llvm.org/viewvc/llvm-project?rev=213680&view=rev Log: 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 Modified: cfe/trunk/lib/Sema/SemaOverload.cpp Modified: cfe/trunk/lib/Sema/SemaOverload.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=213680&r1=213679&r2=213680&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaOverload.cpp (original) +++ cfe/trunk/lib/Sema/SemaOverload.cpp Tue Jul 22 15:20:14 2014 @@ -1451,6 +1451,7 @@ static bool IsStandardConversion(Sema &S // 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<int> regardless of ToType, so check // if the type matches (identity) or we are converting to bool _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
