[clang] e66cecd - [clang][NFC] Clean up Expr::isTemporaryObject() (#140229)
via cfe-commits
cfe-commits at lists.llvm.org
Fri May 16 21:28:33 PDT 2025
Author: Timm Baeder
Date: 2025-05-17T06:28:30+02:00
New Revision: e66cecd8d56f4bb62e01e47830327f28dcd7ac66
URL: https://github.com/llvm/llvm-project/commit/e66cecd8d56f4bb62e01e47830327f28dcd7ac66
DIFF: https://github.com/llvm/llvm-project/commit/e66cecd8d56f4bb62e01e47830327f28dcd7ac66.diff
LOG: [clang][NFC] Clean up Expr::isTemporaryObject() (#140229)
Added:
Modified:
clang/lib/AST/Expr.cpp
Removed:
################################################################################
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<ImplicitCastExpr>(E)) {
- switch (cast<ImplicitCastExpr>(E)->getCastKind()) {
+ if (const auto *ICE = dyn_cast<ImplicitCastExpr>(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<MemberExpr>(E))
return false;
- if (const BinaryOperator *BO = dyn_cast<BinaryOperator>(E))
+ if (const auto *BO = dyn_cast<BinaryOperator>(E))
if (BO->isPtrMemOp())
return false;
More information about the cfe-commits
mailing list