From: Chandler Carruth Date: Tue, 16 Aug 2011 22:30:10 +0000 (+0000) Subject: Switch this code to use the more idiomatic 'dyn_cast' pattern. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b33c19fef2b227cd2d8f1de0bcfc157d9e264b21;p=clang 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 --- 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;