r237267 - Silence Visual C++ warning C4189: 'Result' : local variable is initialized but not referenced.

Yaron Keren yaron.keren at gmail.com
Wed May 13 10:56:47 PDT 2015


Author: yrnkrn
Date: Wed May 13 12:56:46 2015
New Revision: 237267

URL: http://llvm.org/viewvc/llvm-project?rev=237267&view=rev
Log:
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.


Modified:
    cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp

Modified: cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp?rev=237267&r1=237266&r2=237267&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp Wed May 13 12:56:46 2015
@@ -3656,8 +3656,10 @@ SpecializeCorrespondingLambdaCallOperato
   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!");





More information about the cfe-commits mailing list