<div dir="ltr">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.</div><br><div class="gmail_quote"><div dir="ltr">On Wed, Dec 13, 2017 at 7:43 AM Ilya Biryukov via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: ibiryukov<br>
Date: Wed Dec 13 07:42:59 2017<br>
New Revision: 320591<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=320591&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=320591&view=rev</a><br>
Log:<br>
[clangd] Fix bool conversion operator of UniqueFunction<br>
<br>
Usages of it were giving compiler errors because of the missing<br>
explicit conversion.<br>
<br>
Modified:<br>
    clang-tools-extra/trunk/clangd/Function.h<br>
<br>
Modified: clang-tools-extra/trunk/clangd/Function.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/Function.h?rev=320591&r1=320590&r2=320591&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/Function.h?rev=320591&r1=320590&r2=320591&view=diff</a><br>
==============================================================================<br>
--- clang-tools-extra/trunk/clangd/Function.h (original)<br>
+++ clang-tools-extra/trunk/clangd/Function.h Wed Dec 13 07:42:59 2017<br>
@@ -49,7 +49,7 @@ public:<br>
                     FunctionCallImpl<typename std::decay<Callable>::type>>(<br>
             std::forward<Callable>(Func))) {}<br>
<br>
-  operator bool() { return CallablePtr; }<br>
+  operator bool() { return bool(CallablePtr); }<br>
<br>
   Ret operator()(Args... As) {<br>
     assert(CallablePtr);<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div>