[PATCH] Use the correct from type in a SCS

Ehsan Akhgari ehsan.akhgari at gmail.com
Sun Jul 6 12:16:50 PDT 2014


Hi doug.gregor,

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.  It doesn't completely fix that
test case though.

http://reviews.llvm.org/D4402

Files:
  lib/Sema/SemaOverload.cpp

Index: lib/Sema/SemaOverload.cpp
===================================================================
--- lib/Sema/SemaOverload.cpp
+++ lib/Sema/SemaOverload.cpp
@@ -1462,6 +1462,7 @@
       // 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4402.11107.patch
Type: text/x-patch
Size: 530 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140706/fb486b1f/attachment.bin>


More information about the cfe-commits mailing list