]> granicus.if.org Git - clang/commitdiff
Use the correct from type in a SCS
authorEhsan Akhgari <ehsan.akhgari@gmail.com>
Tue, 22 Jul 2014 20:20:14 +0000 (20:20 +0000)
committerEhsan Akhgari <ehsan.akhgari@gmail.com>
Tue, 22 Jul 2014 20:20:14 +0000 (20:20 +0000)
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

lib/Sema/SemaOverload.cpp

index 03001d89f07ea08c4da3f79deff72564cf527cce..e13fd14fd8c6e420dfac48d0b5b35ef3c598f869 100644 (file)
@@ -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<int> regardless of ToType, so check
       // if the type matches (identity) or we are converting to bool