forked from OSchip/llvm-project
Fix regression I introduced when dynamic_cast-ing to a reference type.
llvm-svn: 91687
This commit is contained in:
parent
b396f43520
commit
0087bc851c
|
@ -501,7 +501,7 @@ llvm::Value *CodeGenFunction::EmitDynamicCast(llvm::Value *V,
|
|||
SrcTy = SrcTy->getPointeeType();
|
||||
SrcTy = SrcTy.getUnqualifiedType();
|
||||
|
||||
if (DestTy->isPointerType())
|
||||
if (DestTy->isPointerType() || DestTy->isReferenceType())
|
||||
DestTy = DestTy->getPointeeType();
|
||||
DestTy = DestTy.getUnqualifiedType();
|
||||
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
// RUN: %clang_cc1 %s -emit-llvm-only
|
||||
|
||||
struct A { virtual void f(); };
|
||||
struct B : A { };
|
||||
|
||||
const B& f(A *a) {
|
||||
return dynamic_cast<const B&>(*a);
|
||||
}
|
Loading…
Reference in New Issue