[PATCH] D49657: [clangd] Make SymbolLocation => bool conversion explicitly.

Sam McCall via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 23 04:57:40 PDT 2018


Or make operator bool explicit

On Mon, Jul 23, 2018, 13:55 Ilya Biryukov via Phabricator <
reviews at reviews.llvm.org> wrote:

> ilya-biryukov accepted this revision.
> ilya-biryukov added a comment.
> This revision is now accepted and ready to land.
>
> Scary....
> Definitely LGTM!
>
>
>
> ================
> Comment at: clangd/index/Index.h:45
>
> -  operator bool() const { return !FileURI.empty(); }
> +  explicit operator bool() const { return !FileURI.empty(); }
> +  bool operator==(const SymbolLocation& Loc) const {
> ----------------
> Maybe we should go even further and replace this with an `isValid` method?
> Conversion ops are confusing.
>
>
> Repository:
>   rCTE Clang Tools Extra
>
> https://reviews.llvm.org/D49657
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180723/e91cd897/attachment.html>


More information about the cfe-commits mailing list