From 7750f7694c26a6f0002a4efab8490bf1ac61873e Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Tue, 29 Mar 2011 18:38:10 +0000 Subject: [PATCH] Fix an unused variable warning in release builds and make the assert-less codepath marginally more efficient. llvm-svn: 128472 --- clang/lib/Sema/SemaOverload.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp index 8125ce108623..c023cd3b2a4f 100644 --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/lib/Sema/SemaOverload.cpp @@ -1074,9 +1074,9 @@ static bool IsStandardConversion(Sema &S, Expr* From, QualType ToType, const Type *ClassType = S.Context.getTypeDeclType(Method->getParent()).getTypePtr(); FromType = S.Context.getMemberPointerType(FromType, ClassType); - } else if (UnaryOperator *UnOp - = dyn_cast(From->IgnoreParens())) { - assert(UnOp->getOpcode() == UO_AddrOf && + } else if (isa(From->IgnoreParens())) { + assert(cast(From->IgnoreParens())->getOpcode() == + UO_AddrOf && "Non-address-of operator for overloaded function expression"); FromType = S.Context.getPointerType(FromType); }