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 | 60a2bba9760a52dfc6f5256c5130580e6bbf519e (patch) | |
| tree | c6e1f48a954f98a85068d206ac14b4fa65c23c39 /clang/lib | |
| parent | b9cafbb509e218c6dc631f00ad53fea9b8918540 (diff) | |
| download | bcm5719-llvm-60a2bba9760a52dfc6f5256c5130580e6bbf519e.tar.gz bcm5719-llvm-60a2bba9760a52dfc6f5256c5130580e6bbf519e.zip | |
Handle the case where the base type is not dependent, but the derived one is.
Fixes pr13353.cpp.
llvm-svn: 160393
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/AST/Expr.cpp | 3 | ||||
| -rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp index f2f77367d8d..47b5625b927 100644 --- a/clang/lib/AST/Expr.cpp +++ b/clang/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); diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 915663e6221..177165c79ef 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -10893,8 +10893,6 @@ static void MarkExprReferenced(Sema &SemaRef, SourceLocation Loc, if (!MD) return; const Expr *Base = ME->getBase(); - if (Base->getType()->isDependentType()) - return; const CXXRecordDecl *MostDerivedClassDecl = Base->getBestDynamicClassType(); if (!MostDerivedClassDecl) return; |

