From 48d3aaa2f8db036ac791b00012e10387bd78439c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 16 May 2025 11:42:53 +0200 Subject: [PATCH] [clang][NFC] Clean up Expr::isTemporaryObject() --- clang/lib/AST/Expr.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp index 8557c3b82ca39..ba75197b12626 100644 --- a/clang/lib/AST/Expr.cpp +++ b/clang/lib/AST/Expr.cpp @@ -3263,8 +3263,8 @@ bool Expr::isTemporaryObject(ASTContext &C, const CXXRecordDecl *TempTy) const { // refer to temporaries of that type: // - implicit derived-to-base conversions - if (isa(E)) { - switch (cast(E)->getCastKind()) { + if (const auto *ICE = dyn_cast(E)) { + switch (ICE->getCastKind()) { case CK_DerivedToBase: case CK_UncheckedDerivedToBase: return false; @@ -3277,7 +3277,7 @@ bool Expr::isTemporaryObject(ASTContext &C, const CXXRecordDecl *TempTy) const { if (isa(E)) return false; - if (const BinaryOperator *BO = dyn_cast(E)) + if (const auto *BO = dyn_cast(E)) if (BO->isPtrMemOp()) return false;