From: Yaron Keren Date: Wed, 13 May 2015 17:56:46 +0000 (+0000) Subject: Silence Visual C++ warning C4189: 'Result' : local variable is initialized but not... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9591d15e42abfcacb0225e54ad4a48b215be0726;p=clang Silence Visual C++ warning C4189: 'Result' : local variable is initialized but not referenced. Sadly, LLVM_ATTRIBUTE_UNUSED does nothing with Visual C++ which means we'll have to workaround such cases again and again. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@237267 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaTemplateDeduction.cpp b/lib/Sema/SemaTemplateDeduction.cpp index af8d309267..6f676ad7c5 100644 --- a/lib/Sema/SemaTemplateDeduction.cpp +++ b/lib/Sema/SemaTemplateDeduction.cpp @@ -3656,8 +3656,10 @@ SpecializeCorrespondingLambdaCallOperatorAndInvoker( FunctionTemplateDecl *InvokerTemplate = LambdaClass-> getLambdaStaticInvoker()->getDescribedFunctionTemplate(); - Sema::TemplateDeductionResult LLVM_ATTRIBUTE_UNUSED Result - = S.FinishTemplateArgumentDeduction(InvokerTemplate, DeducedArguments, 0, +#ifndef NDEBUG + Sema::TemplateDeductionResult LLVM_ATTRIBUTE_UNUSED Result = +#endif + S.FinishTemplateArgumentDeduction(InvokerTemplate, DeducedArguments, 0, InvokerSpecialized, TDInfo); assert(Result == Sema::TDK_Success && "If the call operator succeeded so should the invoker!");