[llvm] r219069 - [SystemZ] Make operator bool explicit. NFC.

David Blaikie dblaikie at gmail.com
Sat Oct 4 18:12:41 PDT 2014


Clang-tidy check for non-explicit operator bool?

Clang warning for implicit calls to operator bool?
On Oct 4, 2014 3:59 PM, "Benjamin Kramer" <benny.kra at googlemail.com> wrote:

> Author: d0k
> Date: Sat Oct  4 17:44:35 2014
> New Revision: 219069
>
> URL: http://llvm.org/viewvc/llvm-project?rev=219069&view=rev
> Log:
> [SystemZ] Make operator bool explicit. NFC.
>
> Modified:
>     llvm/trunk/lib/Target/SystemZ/SystemZElimCompare.cpp
>     llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.cpp
>
> Modified: llvm/trunk/lib/Target/SystemZ/SystemZElimCompare.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZElimCompare.cpp?rev=219069&r1=219068&r2=219069&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Target/SystemZ/SystemZElimCompare.cpp (original)
> +++ llvm/trunk/lib/Target/SystemZ/SystemZElimCompare.cpp Sat Oct  4
> 17:44:35 2014
> @@ -47,7 +47,7 @@ struct Reference {
>      return *this;
>    }
>
> -  operator bool() const { return Def || Use; }
> +  LLVM_EXPLICIT operator bool() const { return Def || Use; }
>
>    // True if the register is defined or used in some form, either
> directly or
>    // via a sub- or super-register.
>
> Modified: llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.cpp?rev=219069&r1=219068&r2=219069&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.cpp (original)
> +++ llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.cpp Sat Oct  4 17:44:35
> 2014
> @@ -633,7 +633,7 @@ struct LogicOp {
>    LogicOp(unsigned regSize, unsigned immLSB, unsigned immSize)
>      : RegSize(regSize), ImmLSB(immLSB), ImmSize(immSize) {}
>
> -  operator bool() const { return RegSize; }
> +  LLVM_EXPLICIT operator bool() const { return RegSize; }
>
>    unsigned RegSize, ImmLSB, ImmSize;
>  };
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141004/69be5b72/attachment.html>


More information about the llvm-commits mailing list