8000 [clang][NFC] Clean up Expr::isTemporaryObject() (#140229) · llvm/llvm-project@e66cecd · GitHub
[go: up one dir, main page]

Skip to content

Commit e66cecd

Browse files
authored
[clang][NFC] Clean up Expr::isTemporaryObject() (#140229)
1 parent 9523062 commit e66cecd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clang/lib/AST/Expr.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -3263,8 +3263,8 @@ bool Expr::isTemporaryObject(ASTContext &C, const CXXRecordDecl *TempTy) const {
32633263
// refer to temporaries of that type:
32643264

32653265
// - implicit derived-to-base conversions
3266-
if (isa<ImplicitCastExpr>(E)) {
3267-
switch (cast<ImplicitCastExpr>(E)->getCastKind()) {
3266+
if (const auto *ICE = dyn_cast<ImplicitCastExpr>(E)) {
3267+
switch (ICE->getCastKind()) {
32683268
case CK_DerivedToBase:
32693269
case CK_UncheckedDerivedToBase:
32703270
return false;
@@ -3277,7 +3277,7 @@ bool Expr::isTemporaryObject(ASTContext &C, const CXXRecordDecl *TempTy) const {
32773277
if (isa<MemberExpr>(E))
32783278
return false;
32793279

3280-
if (const BinaryOperator *BO = dyn_cast<BinaryOperator>(E))
3280+
if (const auto *BO = dyn_cast<BinaryOperator>(E))
32813281
if (BO->isPtrMemOp())
32823282
return false;
32833283

0 commit comments

Comments
 (0)
0