r191817 - Fix gcc -Wunused-but-set-variable warning in r191634.

David Blaikie dblaikie at gmail.com
Wed Oct 2 09:58:54 PDT 2013


On Oct 2, 2013 4:06 AM, "Patrik Hagglund" <patrik.h.hagglund at ericsson.com>
wrote:
>
> Author: patha
> Date: Wed Oct  2 05:59:08 2013
> New Revision: 191817
>
> URL: http://llvm.org/viewvc/llvm-project?rev=191817&view=rev
> Log:
> Fix gcc -Wunused-but-set-variable warning in r191634.
>
> 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=191817&r1=191816&r2=191817&view=diff
>
==============================================================================
> --- cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp Wed Oct  2 05:59:08 2013
> @@ -3745,11 +3745,8 @@ Sema::DeduceTemplateArguments(FunctionTe
>    const bool IsGenericLambdaConversionOperator =
>        isLambdaConversionOperator(Conv);
>    if (IsGenericLambdaConversionOperator) {
> -    const Type *FromTypePtr = P.getTypePtr();
>      const Type *ToTypePtr = A.getTypePtr();
>
> -    assert(P->isPointerType());

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.

> -    FromTypePtr = P->getPointeeType().getTypePtr();
>      assert(A->isPointerType());
>      ToTypePtr = A->getPointeeType().getTypePtr();
>
> @@ -3781,11 +3778,11 @@ Sema::DeduceTemplateArguments(FunctionTe
>                                                      0, CallOpSpec,
OpInfo))
>        return Result;
>
> -    bool HadToDeduceReturnTypeDuringCurrentCall = false;
> +    // bool HadToDeduceReturnTypeDuringCurrentCall = false;

Please delete these lines rather than leaving them commented out.

>      // If we need to deduce the return type, do so (instantiates the
callop).
>      if (GenericLambdaCallOperatorHasDeducedReturnType &&
>          CallOpSpec->getResultType()->isUndeducedType()) {
> -      HadToDeduceReturnTypeDuringCurrentCall = true;
> +      // HadToDeduceReturnTypeDuringCurrentCall = true;
>        DeduceReturnType(CallOpSpec, CallOpSpec->getPointOfInstantiation(),
>                        /*Diagnose*/ true);
>      }
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131002/fd967a82/attachment.html>


More information about the cfe-commits mailing list