[PATCH] D11828: [MSVC] Crash fix: assigning of overloaded member function pointer caused assertion

David Majnemer via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 7 08:27:32 PDT 2015


majnemer added inline comments.

================
Comment at: lib/Sema/SemaCast.cpp:1399-1400
@@ -1398,3 +1398,4 @@
     return TC_NotApplicable;
-  }
+  } else if (Self.Context.getTargetInfo().getCXXABI().isMicrosoft())
+    Self.RequireCompleteType(OpRange.getBegin(), SrcType, 0);
 
----------------
There is no need for `else if` here because the previous `if` uses `return` to exit the function: http://llvm.org/docs/CodingStandards.html#don-t-use-else-after-a-return

================
Comment at: lib/Sema/SemaType.cpp:6479
@@ -6478,3 +6478,3 @@
     if (Context.getTargetInfo().getCXXABI().isMicrosoft()) {
-      if (const MemberPointerType *MPTy = T->getAs<MemberPointerType>()) {
+      if (auto *MPTy = T.getCanonicalType()->getAs<MemberPointerType>()) {
         if (!MPTy->getClass()->isDependentType()) {
----------------
This change should be unnecessary because `getAs` already looks through `typedef`s: http://clang.llvm.org/doxygen/Type_8h_source.html#l05557


http://reviews.llvm.org/D11828





More information about the cfe-commits mailing list