summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2014-02-20 23:22:07 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2014-02-20 23:22:07 +0000
commitc1f8c88ff426b317deb83ff7c2af0a21bb640d53 (patch)
tree72b132640140732415bbebf33aa69e5e529954df /lib/CodeGen/CGExpr.cpp
parent9e1078f32e6a48b9d9e38cb640acf1f6b43642a0 (diff)
downloadclang-c1f8c88ff426b317deb83ff7c2af0a21bb640d53.tar.gz
clang-c1f8c88ff426b317deb83ff7c2af0a21bb640d53.tar.bz2
clang-c1f8c88ff426b317deb83ff7c2af0a21bb640d53.tar.xz
Sema: Do not assert when dereferencing member pointer using virtual inheritance with an incomplete class type
The MS ABI requires that we determine the vbptr offset if have a virtual inheritance model. Instead, raise an error pointing to the diagnostic when this happens. This fixes PR18583. Differential Revision: http://llvm-reviews.chandlerc.com/D2842 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201824 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r--lib/CodeGen/CGExpr.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp
index 40ca588939..5ba748a88d 100644
--- a/lib/CodeGen/CGExpr.cpp
+++ b/lib/CodeGen/CGExpr.cpp
@@ -390,7 +390,7 @@ LValue CodeGenFunction::EmitMaterializeTemporaryExpr(
case SubobjectAdjustment::MemberPointerAdjustment: {
llvm::Value *Ptr = EmitScalarExpr(Adjustment.Ptr.RHS);
Object = CGM.getCXXABI().EmitMemberDataPointerAddress(
- *this, Object, Ptr, Adjustment.Ptr.MPT);
+ *this, E, Object, Ptr, Adjustment.Ptr.MPT);
break;
}
}
@@ -3239,8 +3239,8 @@ EmitPointerToDataMemberBinaryExpr(const BinaryOperator *E) {
const MemberPointerType *MPT
= E->getRHS()->getType()->getAs<MemberPointerType>();
- llvm::Value *AddV =
- CGM.getCXXABI().EmitMemberDataPointerAddress(*this, BaseV, OffsetV, MPT);
+ llvm::Value *AddV = CGM.getCXXABI().EmitMemberDataPointerAddress(
+ *this, E, BaseV, OffsetV, MPT);
return MakeAddrLValue(AddV, MPT->getPointeeType());
}