<div dir="ltr">This change breaks a test:<br><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lab.llvm.org-3A8080_green_job_clang-2Dstage2-2Dconfigure-2DRlto-5Fcheck_4473_testReport_Clang_CodeGenCXX_microsoft-5Fabi-5Fvirtual-5Fmember-5Fpointers-5Fcpp_&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=r4PsL3MbEcce9O0hzUTO3_uIIEWeNOQ7Lj0bMV8sCFA&s=18WCviTMJZrQaKD7GwVYnRmPt-5H6OX421VlPL3icZI&e=">http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_check/4473/testReport/Clang/CodeGenCXX/microsoft_abi_virtual_member_pointers_cpp/</a><br></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Jun 11, 2015 at 2:29 AM David Majnemer <<a href="mailto:david.majnemer@gmail.com">david.majnemer@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: majnemer<br>
Date: Wed Jun 10 19:20:57 2015<br>
New Revision: 239499<br>
<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D239499-26view-3Drev&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=r4PsL3MbEcce9O0hzUTO3_uIIEWeNOQ7Lj0bMV8sCFA&s=_CwuhHhsE32GbzGvP-22dyKjslOhzzmmAhMezAVUnR0&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=239499&view=rev</a><br>
Log:<br>
[MS ABI] Allow memfn pointers with unconvertible types to be formed<br>
<br>
Remove the restriction which forbade forming pointers to member<br>
functions which had parameter types or return types which were not<br>
convertible.<br>
<br>
Modified:<br>
    cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp<br>
    cfe/trunk/test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp<br>
<br>
Modified: cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_cfe_trunk_lib_CodeGen_MicrosoftCXXABI.cpp-3Frev-3D239499-26r1-3D239498-26r2-3D239499-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=r4PsL3MbEcce9O0hzUTO3_uIIEWeNOQ7Lj0bMV8sCFA&s=SK2L05-9z_OIzSQqeNsjh2heDVNwCFafFmjtLCsC10c&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp?rev=239499&r1=239498&r2=239499&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp Wed Jun 10 19:20:57 2015<br>
@@ -2423,12 +2423,7 @@ MicrosoftCXXABI::BuildMemberPointer(cons<br>
     FirstField = CGM.GetAddrOfFunction(MD, Ty);<br>
     FirstField = llvm::ConstantExpr::getBitCast(FirstField, CGM.VoidPtrTy);<br>
   } else {<br>
-    if (!CGM.getTypes().isFuncTypeConvertible(<br>
-            MD->getType()->castAs<FunctionType>())) {<br>
-      CGM.ErrorUnsupported(MD, "pointer to virtual member function with "<br>
-                               "incomplete return or parameter type");<br>
-      FirstField = llvm::Constant::getNullValue(CGM.VoidPtrTy);<br>
-    } else if (FPT->getCallConv() == CC_X86FastCall) {<br>
+    if (FPT->getCallConv() == CC_X86FastCall) {<br>
       CGM.ErrorUnsupported(MD, "pointer to fastcall virtual member function");<br>
       FirstField = llvm::Constant::getNullValue(CGM.VoidPtrTy);<br>
     } else {<br>
<br>
Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_cfe_trunk_test_CodeGenCXX_microsoft-2Dabi-2Dvirtual-2Dmember-2Dpointers.cpp-3Frev-3D239499-26r1-3D239498-26r2-3D239499-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=r4PsL3MbEcce9O0hzUTO3_uIIEWeNOQ7Lj0bMV8sCFA&s=4srt_jQ_WVTyPwyEf1E7_jrmUrKaZjtOhoXWQGwDvKA&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp?rev=239499&r1=239498&r2=239499&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp (original)<br>
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp Wed Jun 10 19:20:57 2015<br>
@@ -1,5 +1,5 @@<br>
-// RUN: %clang_cc1 -fno-rtti -emit-llvm -triple=i386-pc-win32 %s -o - | FileCheck %s --check-prefix=CHECK32<br>
-// RUN: %clang_cc1 -fno-rtti -emit-llvm -triple=x86_64-pc-win32 %s -o - | FileCheck %s --check-prefix=CHECK64<br>
+// RUN: %clang_cc1 -std=c++11 -fno-rtti -emit-llvm -triple=i386-pc-win32 %s -o - | FileCheck %s --check-prefix=CHECK32<br>
+// RUN: %clang_cc1 -std=c++11 -fno-rtti -emit-llvm -triple=x86_64-pc-win32 %s -o - | FileCheck %s --check-prefix=CHECK64<br>
<br>
 struct S {<br>
   int x, y, z;<br>
@@ -13,12 +13,15 @@ struct U {<br>
   U(const U &);<br>
 };<br>
<br>
+struct B;<br>
+<br>
 struct C {<br>
   virtual void foo();<br>
   virtual int bar(int, double);<br>
   virtual S baz(int);<br>
   virtual S qux(U);<br>
   virtual void thud(...);<br>
+  virtual void (B::*plugh())();<br>
 };<br>
<br>
 namespace {<br>
@@ -47,6 +50,8 @@ void f() {<br>
   void (C::*ptr6)(...);<br>
   ptr6 = &C::thud;<br>
<br>
+  auto ptr7 = &C::plugh;<br>
+<br>
<br>
 // CHECK32-LABEL: define void @"\01?f@@YAXXZ"()<br>
 // CHECK32: store i8* bitcast (void (%struct.C*, ...)* @"\01??_9C@@$BA@AE" to i8*), i8** %ptr<br>
@@ -165,6 +170,20 @@ void f() {<br>
 // CHECK64: [[CALLEE:%.*]] = load void (%struct.C*, ...)*, void (%struct.C*, ...)** [[VPTR]]<br>
 // CHECK64: musttail call void (%struct.C*, ...) [[CALLEE]](%struct.C* %{{.*}}, ...)<br>
 // CHECK64: ret void<br>
+// CHECK64: }<br>
+<br>
+// CHECK32: define linkonce_odr x86_thiscallcc void @"\01??_9C@@$BBE@AE"(%struct.C* %this, ...) {{.*}} comdat align 2 {<br>
+// CHECK32: [[VPTR:%.*]] = getelementptr inbounds void (%struct.C*, ...)*, void (%struct.C*, ...)** %vtable, i64 5<br>
+// CHECK32: [[CALLEE:%.*]] = load void (%struct.C*, ...)*, void (%struct.C*, ...)** [[VPTR]]<br>
+// CHECK32: musttail call x86_thiscallcc void (%struct.C*, ...) [[CALLEE]](%struct.C* %{{.*}}, ...)<br>
+// CHECK32: ret void<br>
+// CHECK32: }<br>
+<br>
+// CHECK64: define linkonce_odr void @"\01??_9C@@$BCI@AA"(%struct.C* %this, ...) {{.*}} comdat align 2 {<br>
+// CHECK64: [[VPTR:%.*]] = getelementptr inbounds void (%struct.C*, ...)*, void (%struct.C*, ...)** %vtable, i64 5<br>
+// CHECK64: [[CALLEE:%.*]] = load void (%struct.C*, ...)*, void (%struct.C*, ...)** [[VPTR]]<br>
+// CHECK64: musttail call void (%struct.C*, ...) [[CALLEE]](%struct.C* %{{.*}}, ...)<br>
+// CHECK64: ret void<br>
 // CHECK64: }<br>
<br>
 // CHECK32: #[[ATTR]] = {{{.*}}"thunk"{{.*}}}<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div>