]> granicus.if.org Git - clang/commitdiff
Silence Visual C++ warning C4189: 'Result' : local variable is initialized but not...
authorYaron Keren <yaron.keren@gmail.com>
Wed, 13 May 2015 17:56:46 +0000 (17:56 +0000)
committerYaron Keren <yaron.keren@gmail.com>
Wed, 13 May 2015 17:56:46 +0000 (17:56 +0000)
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

lib/Sema/SemaTemplateDeduction.cpp

index af8d309267c2b735c83b917383460acca8e82c0a..6f676ad7c55de987a8d97385d601d4d8443a0f0a 100644 (file)
@@ -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!");