<p dir="ltr"><br>
On Oct 2, 2013 4:06 AM, "Patrik Hagglund" <<a href="mailto:patrik.h.hagglund@ericsson.com">patrik.h.hagglund@ericsson.com</a>> wrote:<br>
><br>
> Author: patha<br>
> Date: Wed Oct 2 05:59:08 2013<br>
> New Revision: 191817<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=191817&view=rev">http://llvm.org/viewvc/llvm-project?rev=191817&view=rev</a><br>
> Log:<br>
> Fix gcc -Wunused-but-set-variable warning in r191634.<br>
><br>
> Modified:<br>
> cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp<br>
><br>
> Modified: cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp?rev=191817&r1=191816&r2=191817&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp?rev=191817&r1=191816&r2=191817&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp (original)<br>
> +++ cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp Wed Oct 2 05:59:08 2013<br>
> @@ -3745,11 +3745,8 @@ Sema::DeduceTemplateArguments(FunctionTe<br>
> const bool IsGenericLambdaConversionOperator =<br>
> isLambdaConversionOperator(Conv);<br>
> if (IsGenericLambdaConversionOperator) {<br>
> - const Type *FromTypePtr = P.getTypePtr();<br>
> const Type *ToTypePtr = A.getTypePtr();<br>
><br>
> - assert(P->isPointerType());</p>
<p dir="ltr">You lost this assert in your change (presumably the warning was firing in a release build). Unless you have some reason not to want this assert anymore, please leave it in.</p>
<p dir="ltr">> - FromTypePtr = P->getPointeeType().getTypePtr();<br>
> assert(A->isPointerType());<br>
> ToTypePtr = A->getPointeeType().getTypePtr();<br>
><br>
> @@ -3781,11 +3778,11 @@ Sema::DeduceTemplateArguments(FunctionTe<br>
> 0, CallOpSpec, OpInfo))<br>
> return Result;<br>
><br>
> - bool HadToDeduceReturnTypeDuringCurrentCall = false;<br>
> + // bool HadToDeduceReturnTypeDuringCurrentCall = false;</p>
<p dir="ltr">Please delete these lines rather than leaving them commented out.</p>
<p dir="ltr">> // If we need to deduce the return type, do so (instantiates the callop).<br>
> if (GenericLambdaCallOperatorHasDeducedReturnType &&<br>
> CallOpSpec->getResultType()->isUndeducedType()) {<br>
> - HadToDeduceReturnTypeDuringCurrentCall = true;<br>
> + // HadToDeduceReturnTypeDuringCurrentCall = true;<br>
> DeduceReturnType(CallOpSpec, CallOpSpec->getPointOfInstantiation(),<br>
> /*Diagnose*/ true);<br>
> }<br>
><br>
><br>
> _______________________________________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a></p>