Implement implicit conversions for pointers-to-member.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62971 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index 21db14a..d62e767 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -561,7 +561,8 @@
DeclType.Mem.TypeQuals &= ~QualType::Restrict;
}
- T = Context.getMemberPointerType(T, ClsType.getTypePtr());
+ T = Context.getMemberPointerType(T, ClsType.getTypePtr()).
+ getQualifiedType(DeclType.Mem.TypeQuals);
break;
}
@@ -660,7 +661,13 @@
return true;
}
- // FIXME: pointer-to-member types
+ const MemberPointerType *T1MPType = T1->getAsMemberPointerType(),
+ *T2MPType = T2->getAsMemberPointerType();
+ if (T1MPType && T2MPType) {
+ T1 = T1MPType->getPointeeType();
+ T2 = T2MPType->getPointeeType();
+ return true;
+ }
return false;
}