diff options
Diffstat (limited to 'CodeGen/CGExpr.cpp')
-rw-r--r-- | CodeGen/CGExpr.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/CodeGen/CGExpr.cpp b/CodeGen/CGExpr.cpp index 8fcc94805a..a4aa6db7ba 100644 --- a/CodeGen/CGExpr.cpp +++ b/CodeGen/CGExpr.cpp @@ -393,10 +393,11 @@ LValue CodeGenFunction::EmitMemberExpr(const MemberExpr *E) { BaseValue = BaseLV.getAddress(); if (E->isArrow()) { - QualType PTy = cast<PointerType>(BaseExpr->getType())->getPointeeType(); + QualType Ty = BaseExpr->getType(); + Ty = cast<PointerType>(Ty.getCanonicalType())->getPointeeType(); BaseValue = Builder.CreateBitCast(BaseValue, - llvm::PointerType::get(ConvertType(PTy)), "tmp"); + llvm::PointerType::get(ConvertType(Ty)), "tmp"); } } else BaseValue = EmitScalarExpr(BaseExpr); |