diff options
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 8c63060b61..7a3c6bdeb1 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -2406,7 +2406,7 @@ static NamedDecl *getPrimaryDecl(Expr *E) { // &X[4] and &4[X] refers to X if X is not a pointer. NamedDecl *D = getPrimaryDecl(cast<ArraySubscriptExpr>(E)->getBase()); - ValueDecl *VD = dyn_cast<ValueDecl>(D); + ValueDecl *VD = dyn_cast_or_null<ValueDecl>(D); if (!VD || VD->getType()->isPointerType()) return 0; else |