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 @@ -1780,6 +1780,8 @@ return &verifyInvariants; } static LogicalResult verifyInvariants(Operation *op) { + static_assert(sizeof(ConcreteType) == sizeof(OpState), + "Op class aren't allowed to have data members"); return failure( failed(op_definition_impl::verifyTraits(op)) || failed(cast(op).verify()));