diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-01-28 18:33:18 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-01-28 18:33:18 +0000 |
commit | 21593acb933324b439bc68b68e7cc7d1c3e3484d (patch) | |
tree | 6feee8a9f735cae4af555e7a7395a67e696d226d /lib/Sema/SemaType.cpp | |
parent | 66973121788ca645fe3d4a66179b9cfb6f2bce08 (diff) |
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
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r-- | lib/Sema/SemaType.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index 60219fe292..5d54f463ea 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -662,7 +662,9 @@ bool Sema::UnwrapSimilarPointerTypes(QualType& T1, QualType& T2) 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; |