Index: cfe/trunk/lib/Sema/SemaCast.cpp =================================================================== --- cfe/trunk/lib/Sema/SemaCast.cpp +++ cfe/trunk/lib/Sema/SemaCast.cpp @@ -1397,6 +1397,8 @@ msg = diag::err_bad_static_cast_member_pointer_nonmp; return TC_NotApplicable; } + if (Self.Context.getTargetInfo().getCXXABI().isMicrosoft()) + Self.RequireCompleteType(OpRange.getBegin(), SrcType, 0); // T == T, modulo cv if (!Self.Context.hasSameUnqualifiedType(SrcMemPtr->getPointeeType(), Index: cfe/trunk/test/CodeGenCXX/microsoft-abi-member-pointers.cpp =================================================================== --- cfe/trunk/test/CodeGenCXX/microsoft-abi-member-pointers.cpp +++ cfe/trunk/test/CodeGenCXX/microsoft-abi-member-pointers.cpp @@ -729,3 +729,20 @@ // CHECK: @"\01??_9C@pr23878@@$BA@AE" to i8*), i32 0, i32 4 DMemPtrTy get_memptr() { return &D::f; } } + +class C {}; + +typedef void (C::*f)(); + +class CA : public C { +public: + void OnHelp(void); + int OnHelp(int); +}; + +// CHECK-LABEL: foo_fun +void foo_fun() { + // CHECK: store i8* bitcast (void (%class.CA*)* @"\01?OnHelp@CA@@QAEXXZ" to i8*), i8** + f func = (f)&CA::OnHelp; +} +