diff --git a/clang/lib/Sema/SemaExceptionSpec.cpp b/clang/lib/Sema/SemaExceptionSpec.cpp index 3563b4f683f07..00384f9dc16aa 100644 --- a/clang/lib/Sema/SemaExceptionSpec.cpp +++ b/clang/lib/Sema/SemaExceptionSpec.cpp @@ -1017,13 +1017,13 @@ CanThrowResult Sema::canCalleeThrow(Sema &S, const Expr *E, const Decl *D, SourceLocation Loc) { // As an extension, we assume that __attribute__((nothrow)) functions don't // throw. - if (D && isa(D) && D->hasAttr()) + if (isa_and_nonnull(D) && D->hasAttr()) return CT_Cannot; QualType T; // In C++1z, just look at the function type of the callee. - if (S.getLangOpts().CPlusPlus17 && E && isa(E)) { + if (S.getLangOpts().CPlusPlus17 && isa_and_nonnull(E)) { E = cast(E)->getCallee(); T = E->getType(); if (T->isSpecificPlaceholderType(BuiltinType::BoundMember)) {