summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index bc77e6fae7e..2a7a8b9f195 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -10854,8 +10854,9 @@ static void MarkExprReferenced(Sema &SemaRef, SourceLocation Loc,
if (!MD)
return;
const Expr *Base = ME->getBase();
- const CXXRecordDecl *MostDerivedClassDecl
- = Base->getMostDerivedClassDeclForType();
+ if (Base->getType()->isDependentType())
+ return;
+ const CXXRecordDecl *MostDerivedClassDecl = Base->getBestDynamicClassType();
if (!MostDerivedClassDecl)
return;
CXXMethodDecl *DM = MD->getCorrespondingMethodInClass(MostDerivedClassDecl);
OpenPOWER on IntegriCloud