diff --git a/mlir/include/mlir/IR/OpDefinition.h b/mlir/include/mlir/IR/OpDefinition.h --- a/mlir/include/mlir/IR/OpDefinition.h +++ b/mlir/include/mlir/IR/OpDefinition.h @@ -93,8 +93,8 @@ /// they aren't customized. class OpState { public: - /// Ops are pointer-like, so we allow implicit conversion to bool. - operator bool() { return getOperation() != nullptr; } + /// Ops are pointer-like, so we allow conversion to bool. + explicit operator bool() { return getOperation() != nullptr; } /// This implicitly converts to Operation*. operator Operation *() const { return state; }