Skip to content

Commit 9e8950a

Browse files
committed
Use inline decl in if to test nullptr
1 parent e81792a commit 9e8950a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

clang/lib/AST/Expr.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,8 +1618,7 @@ QualType CallExpr::getCallReturnType(const ASTContext &Ctx) const {
16181618
std::pair<const NamedDecl *, const Attr *>
16191619
CallExpr::getUnusedResultAttr(const ASTContext &Ctx) const {
16201620
// If the callee is marked nodiscard, return that attribute
1621-
const Decl *D = getCalleeDecl();
1622-
if (D != nullptr)
1621+
if (const Decl *D = getCalleeDecl())
16231622
if (const auto *A = D->getAttr<WarnUnusedResultAttr>())
16241623
return {nullptr, A};
16251624

0 commit comments

Comments
 (0)