Make some operator bools explicit for sanity/safety.

There are a couple left in bool-like containers (BitVector, etc) where
the implicit conversions seem more suitable - though it might be worth
considering explicitifying those too.

llvm-svn: 291694
This commit is contained in:
David Blaikie 2017-01-11 19:47:16 +00:00
parent 3a03742c37
commit de782d1616
3 changed files with 3 additions and 3 deletions

View File

@ -94,7 +94,7 @@ public:
return HelperT::template Lookup<N>::TraitsT::getFromVoidPointer(getImpl());
}
operator bool() const { return Value & HelperT::PointerMask; }
explicit operator bool() const { return Value & HelperT::PointerMask; }
bool operator==(const PointerSumType &R) const { return Value == R.Value; }
bool operator!=(const PointerSumType &R) const { return Value != R.Value; }
bool operator<(const PointerSumType &R) const { return Value < R.Value; }

View File

@ -148,7 +148,7 @@ public:
///
/// This happens when an edge has been deleted. We leave the edge objects
/// around but clear them.
operator bool() const;
explicit operator bool() const;
/// Returnss the \c Kind of the edge.
Kind getKind() const;

View File

@ -201,7 +201,7 @@ public:
void reset();
operator bool() const;
explicit operator bool() const;
StringRef getName() const { return Name; }
StringRef getDescription() const { return Description; }