summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaCast.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2014-02-06 10:59:19 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2014-02-06 10:59:19 +0000
commit763584dc645151f2c9810f6d0fbd29118a44a659 (patch)
tree613c44affbff3b73de3a500dac997d6b4d3c65a9 /clang/lib/Sema/SemaCast.cpp
parentefbcf4943c268b6e5d6cf093b3560d989d4bddec (diff)
downloadbcm5719-llvm-763584dc645151f2c9810f6d0fbd29118a44a659.tar.gz
bcm5719-llvm-763584dc645151f2c9810f6d0fbd29118a44a659.zip
MS ABI: Tweak pointer-to-member mangling/inheritance model selection
Properly determine the inheritance model when dealing with nullptr: - If a nullptr template argument is being checked against pointer-to-member parameter, nail down an inheritance model. N.B. We will chose an inheritance model even if we won't ultimately choose the template to instantiate! Cooky, right? - Null pointer-to-datamembers have a virtual base table offset of -1, not zero. Previously, we chose an offset of 0. llvm-svn: 200920
Diffstat (limited to 'clang/lib/Sema/SemaCast.cpp')
-rw-r--r--clang/lib/Sema/SemaCast.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaCast.cpp b/clang/lib/Sema/SemaCast.cpp
index 499e8b18be8..5d49225ac4c 100644
--- a/clang/lib/Sema/SemaCast.cpp
+++ b/clang/lib/Sema/SemaCast.cpp
@@ -1433,6 +1433,10 @@ TryStaticImplicitCast(Sema &Self, ExprResult &SrcExpr, QualType DestType,
msg = 0;
return TC_Failed;
}
+ } else if (DestType->isMemberPointerType()) {
+ if (Self.Context.getTargetInfo().getCXXABI().isMicrosoft()) {
+ Self.RequireCompleteType(OpRange.getBegin(), DestType, 0);
+ }
}
InitializedEntity Entity = InitializedEntity::InitializeTemporary(DestType);
OpenPOWER on IntegriCloud