r264428 - [ASTMatchers] Fix build for VariadicFunction.

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 25 16:01:44 PDT 2016


On Fri, Mar 25, 2016 at 10:55 AM, David Blaikie via cfe-commits
<cfe-commits at lists.llvm.org> wrote:
>
>
> On Fri, Mar 25, 2016 at 10:46 AM, Samuel Benzaquen via cfe-commits
> <cfe-commits at lists.llvm.org> wrote:
>>
>> Author: sbenza
>> Date: Fri Mar 25 12:46:02 2016
>> New Revision: 264428
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=264428&view=rev
>> Log:
>> [ASTMatchers] Fix build for VariadicFunction.
>>
>> Under some conditions the implicit conversion from array to ArrayRef<>
>> is not working.
>
> Any idea what those conditions are?

Well, the code's ill-formed (relying on a compiler extension) when
Args is empty. Maybe GCC diagnoses that in some cases?

>> Fix the build by making it explicit.
>>
>> Modified:
>>     cfe/trunk/include/clang/ASTMatchers/ASTMatchersInternal.h
>>
>> Modified: cfe/trunk/include/clang/ASTMatchers/ASTMatchersInternal.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/ASTMatchers/ASTMatchersInternal.h?rev=264428&r1=264427&r2=264428&view=diff
>>
>> ==============================================================================
>> --- cfe/trunk/include/clang/ASTMatchers/ASTMatchersInternal.h (original)
>> +++ cfe/trunk/include/clang/ASTMatchers/ASTMatchersInternal.h Fri Mar 25
>> 12:46:02 2016
>> @@ -90,7 +90,7 @@ private:
>>    // before we make the array.
>>    template <typename... ArgsT> ResultT Execute(const ArgsT &... Args)
>> const {
>>      const ArgT *const ArgsArray[] = {&Args...};
>> -    return Func(ArgsArray);
>> +    return Func(ArrayRef<const ArgT *>(ArgsArray, sizeof...(ArgsT)));
>>    }
>>  };
>>
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>


More information about the cfe-commits mailing list