[mlir] Fix -Wdeprecated-copy in SparseTensorType.h (NFC)

/data/jiefu/llvm-project/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorType.h:63:21: error: definition of implicit copy constructor for 'SparseTensorType' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
  SparseTensorType &operator=(const SparseTensorType &) = delete;
                    ^
/data/jiefu/llvm-project/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorStorageLayout.h:239:9: note: in implicit copy constructor for 'mlir::sparse_tensor::SparseTensorType' first required here
      : rType(stt), fields(fields) {
        ^
1 error generated.
This commit is contained in:
Jie Fu
2023-03-09 10:35:01 +08:00
parent a08b005c71
commit 02bc7429d5

View File

@@ -61,6 +61,7 @@ public:
// Copy-assignment would be implicitly deleted (because our fields
// are const), so we explicitly delete it for clarity.
SparseTensorType &operator=(const SparseTensorType &) = delete;
SparseTensorType(const SparseTensorType &) = default;
/// Constructs a new `SparseTensorType` with the same dimension-shape
/// and element type, but with the encoding replaced by the given encoding.