[clang-tools-extra] r320591 - [clangd] Fix bool conversion operator of UniqueFunction

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 20 06:07:06 PST 2017


Thanks. Fixed in r321173. Should've been explicit from the start.

On Mon, Dec 18, 2017 at 7:25 PM, David Blaikie <dblaikie at gmail.com> wrote:

> This operator bool should probably be explicit (as most/all of them should
> be - and most of them in LLVM are) - to avoid undue implicit conversion to
> other int types.
>
> On Wed, Dec 13, 2017 at 7:43 AM Ilya Biryukov via cfe-commits <
> cfe-commits at lists.llvm.org> wrote:
>
>> Author: ibiryukov
>> Date: Wed Dec 13 07:42:59 2017
>> New Revision: 320591
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=320591&view=rev
>> Log:
>> [clangd] Fix bool conversion operator of UniqueFunction
>>
>> Usages of it were giving compiler errors because of the missing
>> explicit conversion.
>>
>> Modified:
>>     clang-tools-extra/trunk/clangd/Function.h
>>
>> Modified: clang-tools-extra/trunk/clangd/Function.h
>> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
>> trunk/clangd/Function.h?rev=320591&r1=320590&r2=320591&view=diff
>> ============================================================
>> ==================
>> --- clang-tools-extra/trunk/clangd/Function.h (original)
>> +++ clang-tools-extra/trunk/clangd/Function.h Wed Dec 13 07:42:59 2017
>> @@ -49,7 +49,7 @@ public:
>>                      FunctionCallImpl<typename
>> std::decay<Callable>::type>>(
>>              std::forward<Callable>(Func))) {}
>>
>> -  operator bool() { return CallablePtr; }
>> +  operator bool() { return bool(CallablePtr); }
>>
>>    Ret operator()(Args... As) {
>>      assert(CallablePtr);
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>>
>


-- 
Regards,
Ilya Biryukov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171220/2ebe152e/attachment-0001.html>


More information about the cfe-commits mailing list