]> granicus.if.org Git - clang/commitdiff
Peer through refernces for typeid. WIP.
authorMike Stump <mrs@apple.com>
Sun, 15 Nov 2009 20:30:39 +0000 (20:30 +0000)
committerMike Stump <mrs@apple.com>
Sun, 15 Nov 2009 20:30:39 +0000 (20:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88871 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGCXXExpr.cpp

index ccbb608553e69cce2a5c6caf60f4c148447f665b..3fbd2b242abcf8b2a74361c1d0a2db173ccc5734 100644 (file)
@@ -340,6 +340,8 @@ llvm::Value * CodeGenFunction::EmitCXXTypeidExpr(const CXXTypeidExpr *E) {
   const llvm::Type *LTy = ConvertType(Ty)->getPointerTo();
   if (E->isTypeOperand()) {
     QualType Ty = E->getTypeOperand();
+    CanQualType CanTy = CGM.getContext().getCanonicalType(Ty);
+    Ty = CanTy.getUnqualifiedType().getNonReferenceType();
     if (const RecordType *RT = Ty->getAs<RecordType>()) {
       const CXXRecordDecl *RD = cast<CXXRecordDecl>(RT->getDecl());
       if (RD->isPolymorphic())