Implement pointer to member handling in static_cast.
Fix a stupid mistake in UnwrapSimilarPointers that made any two member pointers compatible as long as the pointee was the same.
Make a few style corrections as suggested by Chris.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63215 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index 60219fe..5d54f46 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -662,7 +662,9 @@
const MemberPointerType *T1MPType = T1->getAsMemberPointerType(),
*T2MPType = T2->getAsMemberPointerType();
- if (T1MPType && T2MPType) {
+ if (T1MPType && T2MPType &&
+ Context.getCanonicalType(T1MPType->getClass()) ==
+ Context.getCanonicalType(T2MPType->getClass())) {
T1 = T1MPType->getPointeeType();
T2 = T2MPType->getPointeeType();
return true;