Skip to content

Commit 6570649

Browse files
committed
fixup! dyn_cast_or_null->dyn_cast; stylistic cleanup
1 parent a6d9cd2 commit 6570649

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

clang/lib/AST/Expr.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2544,19 +2544,18 @@ Stmt *BlockExpr::getBody() {
25442544
//===----------------------------------------------------------------------===//
25452545
// Generic Expression Routines
25462546
//===----------------------------------------------------------------------===//
2547-
namespace {
2547+
25482548
/// Helper to determine wether \c E is a CXXConstructExpr constructing
25492549
/// a DecompositionDecl. Used to skip Clang-generated calls to std::get
25502550
/// for structured bindings.
2551-
bool IsDecompositionDeclRefExpr(const Expr *E) {
2552-
const Expr *Unrwapped = E->IgnoreUnlessSpelledInSource();
2553-
const DeclRefExpr *Ref = llvm::dyn_cast_or_null<DeclRefExpr>(Unrwapped);
2551+
static bool IsDecompositionDeclRefExpr(const Expr *E) {
2552+
const auto *Unwrapped = E->IgnoreUnlessSpelledInSource();
2553+
const auto *Ref = dyn_cast<DeclRefExpr>(Unwrapped);
25542554
if (!Ref)
25552555
return false;
25562556

2557-
return llvm::isa_and_nonnull<DecompositionDecl>(Ref->getDecl());
2557+
return isa_and_nonnull<DecompositionDecl>(Ref->getDecl());
25582558
}
2559-
} // namespace
25602559

25612560
bool Expr::isReadIfDiscardedInCPlusPlus11() const {
25622561
// In C++11, discarded-value expressions of a certain form are special,

0 commit comments

Comments
 (0)