forked from OSchip/llvm-project
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 llvm-svn: 213680
This commit is contained in:
parent
3a8c2c1e6c
commit
c3ad3bab61
|
@ -1451,6 +1451,7 @@ static bool IsStandardConversion(Sema &S, Expr* From, QualType ToType,
|
||||||
// We were able to resolve the address of the overloaded function,
|
// We were able to resolve the address of the overloaded function,
|
||||||
// so we can convert to the type of that function.
|
// so we can convert to the type of that function.
|
||||||
FromType = Fn->getType();
|
FromType = Fn->getType();
|
||||||
|
SCS.setFromType(FromType);
|
||||||
|
|
||||||
// we can sometimes resolve &foo<int> regardless of ToType, so check
|
// we can sometimes resolve &foo<int> regardless of ToType, so check
|
||||||
// if the type matches (identity) or we are converting to bool
|
// if the type matches (identity) or we are converting to bool
|
||||||
|
|
Loading…
Reference in New Issue