Currently the global operator!=(bool, bool) is selected due to the implicit bool
conversion operator. Since this is never the desired semantics, we give it a
standard operator!= and make the bool conversion explicit.
Depends On D86809
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D86810
// underlying record.
bool operator==(const Dialect &other) const;
+ bool operator!=(const Dialect &other) const { return !(*this == other); }
+
// Compares two dialects by comparing the names of the dialects.
bool operator<(const Dialect &other) const;
// Returns whether the dialect is defined.
- operator bool() const { return def != nullptr; }
+ explicit operator bool() const { return def != nullptr; }
private:
const llvm::Record *def;