From b33c19fef2b227cd2d8f1de0bcfc157d9e264b21 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Tue, 16 Aug 2011 22:30:10 +0000 Subject: [PATCH] Switch this code to use the more idiomatic 'dyn_cast' pattern. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137780 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaExpr.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 20d129da99..19cd1184ff 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -9425,8 +9425,7 @@ void Sema::DiagnoseAssignmentAsCondition(Expr *E) { unsigned diagnostic = diag::warn_condition_is_assignment; bool IsOrAssign = false; - if (isa(E)) { - BinaryOperator *Op = cast(E); + if (BinaryOperator *Op = dyn_cast(E)) { if (Op->getOpcode() != BO_Assign && Op->getOpcode() != BO_OrAssign) return; @@ -9447,8 +9446,7 @@ void Sema::DiagnoseAssignmentAsCondition(Expr *E) { } Loc = Op->getOperatorLoc(); - } else if (isa(E)) { - CXXOperatorCallExpr *Op = cast(E); + } else if (CXXOperatorCallExpr *Op = dyn_cast(E)) { if (Op->getOperator() != OO_Equal && Op->getOperator() != OO_PipeEqual) return; -- 2.40.0