From: Nick Lewycky Date: Tue, 9 Nov 2010 00:19:31 +0000 (+0000) Subject: Fix warning about unused variable 'Fn' in no-asserts builds. Also reflow this X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=43328e91627382870d51b5d84e08873cc0c970eb;p=clang Fix warning about unused variable 'Fn' in no-asserts builds. Also reflow this block so that it looks more like the rest of the file. No functional change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118459 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaCXXCast.cpp b/lib/Sema/SemaCXXCast.cpp index ef71599ead..25ad7b6a87 100644 --- a/lib/Sema/SemaCXXCast.cpp +++ b/lib/Sema/SemaCXXCast.cpp @@ -1389,19 +1389,16 @@ Sema::CXXCheckCStyleCast(SourceRange R, QualType CastTy, Expr *&CastExpr, } } - if (tcr != TC_Success && msg != 0) - { - if (CastExpr->getType() == Context.OverloadTy) - { + if (tcr != TC_Success && msg != 0) { + if (CastExpr->getType() == Context.OverloadTy) { DeclAccessPair Found; - FunctionDecl* Fn = ResolveAddressOfOverloadedFunction(CastExpr, + FunctionDecl *Fn = ResolveAddressOfOverloadedFunction(CastExpr, CastTy, /* Complain */ true, Found); assert(!Fn && "cast failed but able to resolve overload expression!!"); - } - else - { + (void)Fn; + } else { Diag(R.getBegin(), msg) << (FunctionalStyle ? CT_Functional : CT_CStyle) << CastExpr->getType() << CastTy << R; }