diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2012-07-17 20:24:05 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2012-07-17 20:24:05 +0000 |
commit | 251c449b280eb845017a6c022ed7189d17c63d49 (patch) | |
tree | 27bb722dc9e9946b298b84baf9c56648a007c4f8 /lib/AST/Expr.cpp | |
parent | e9af3e66cffa1b3d6dc75433b8a9673ecae33044 (diff) |
Handle the case where the base type is not dependent, but the derived one is.
Fixes pr13353.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160393 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Expr.cpp')
-rw-r--r-- | lib/AST/Expr.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index f2f77367d8..47b5625b92 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -40,6 +40,9 @@ const CXXRecordDecl *Expr::getBestDynamicClassType() const { if (const PointerType *PTy = DerivedType->getAs<PointerType>()) DerivedType = PTy->getPointeeType(); + if (DerivedType->isDependentType()) + return NULL; + const RecordType *Ty = DerivedType->castAs<RecordType>(); Decl *D = Ty->getDecl(); return cast<CXXRecordDecl>(D); |