Skip to content

Commit

Permalink
[clang][Sema][NFC] Merge two if statements
Browse files Browse the repository at this point in the history
  • Loading branch information
tbaederr committed Dec 19, 2023
1 parent 73cf485 commit 258c2ae
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions clang/lib/Sema/SemaDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2211,10 +2211,9 @@ void Sema::DiagnoseUnusedButSetDecl(const VarDecl *VD,
return;
// In C++, don't warn for record types that don't have WarnUnusedAttr, to
// mimic gcc's behavior.
if (const CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(Tag)) {
if (!RD->hasAttr<WarnUnusedAttr>())
return;
}
if (const auto *RD = dyn_cast<CXXRecordDecl>(Tag);
RD && !RD->hasAttr<WarnUnusedAttr>())
return;
}

// Don't warn about __block Objective-C pointer variables, as they might
Expand Down

0 comments on commit 258c2ae

Please sign in to comment.