diff options
Diffstat (limited to 'clang/lib/AST/Expr.cpp')
-rw-r--r-- | clang/lib/AST/Expr.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp index 8c8ccdb..ba66d36 100644 --- a/clang/lib/AST/Expr.cpp +++ b/clang/lib/AST/Expr.cpp @@ -1618,9 +1618,9 @@ QualType CallExpr::getCallReturnType(const ASTContext &Ctx) const { std::pair<const NamedDecl *, const Attr *> CallExpr::getUnusedResultAttr(const ASTContext &Ctx) const { // If the callee is marked nodiscard, return that attribute - const Decl *D = getCalleeDecl(); - if (const auto *A = D->getAttr<WarnUnusedResultAttr>()) - return {nullptr, A}; + if (const Decl *D = getCalleeDecl()) + if (const auto *A = D->getAttr<WarnUnusedResultAttr>()) + return {nullptr, A}; // If the return type is a struct, union, or enum that is marked nodiscard, // then return the return type attribute. |