[Mlir-commits] [mlir] 02bc742 - [mlir] Fix -Wdeprecated-copy in SparseTensorType.h (NFC)
Jie Fu
llvmlistbot at llvm.org
Wed Mar 8 18:35:53 PST 2023
Author: Jie Fu
Date: 2023-03-09T10:35:01+08:00
New Revision: 02bc7429d56f453087d0dd5f173b6b7c83fe3f58
URL: https://github.com/llvm/llvm-project/commit/02bc7429d56f453087d0dd5f173b6b7c83fe3f58
DIFF: https://github.com/llvm/llvm-project/commit/02bc7429d56f453087d0dd5f173b6b7c83fe3f58.diff
LOG: [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.
Added:
Modified:
mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorType.h
Removed:
################################################################################
diff --git a/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorType.h b/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorType.h
index 9d22f5220e96..888eb7f325ac 100644
--- a/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorType.h
+++ b/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorType.h
@@ -61,6 +61,7 @@ class SparseTensorType {
// 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.
More information about the Mlir-commits
mailing list