Commit 6179131
authored
[mlir] explicitly delete copy ctor for DialectRegistry and OperationState (llvm#140963)
Both of these classes have fields involving `unique_ptr`s and thus can't
be copied.
Holding a unique_ptr should trigger implicit deletion of the
copy/assignment constructors, however
not when held through a container:
```
struct Foo {
explicit Foo();
std::vector<std::unique_ptr<Bar>> ptr; // Does not implicitly delete its cpy/assign ctors
};
```
This results in a complicated diagnostics when attempting to copy such a
class (it'll point to the
inner implementation of the container), instead of a nicer error message
about `Foo` not being able
to be copied/assigned. Explicitly deleting the ctors provides an
immediate diagnostic about the issue.
Fixes llvm#1183881 parent 6db8490 commit 6179131
2 files changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| 146 | + | |
| 147 | + | |
146 | 148 | | |
147 | 149 | | |
148 | 150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
985 | 985 | | |
986 | 986 | | |
987 | 987 | | |
988 | | - | |
989 | 988 | | |
990 | | - | |
| 989 | + | |
| 990 | + | |
991 | 991 | | |
992 | 992 | | |
993 | 993 | | |
| |||
0 commit comments