Skip to content

Commit 7eb5c08

Browse files
[ADT] Use "= default" in DirectedGraph.h (#161628)
This patch drops user copy/move constructors and assignment operators of DirectedGraph to adhere to the Rule of Zero. Now, the original code: DGraphType &operator=(const DGraphType &&G) is most likely unintended -- a move assignment operator with const r-value reference. This patch fixes that.
1 parent 0dd8f32 commit 7eb5c08

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

llvm/include/llvm/ADT/DirectedGraph.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -181,16 +181,6 @@ template <class NodeType, class EdgeType> class DirectedGraph {
181181

182182
DirectedGraph() = default;
183183
explicit DirectedGraph(NodeType &N) : Nodes() { addNode(N); }
184-
DirectedGraph(const DGraphType &G) : Nodes(G.Nodes) {}
185-
DirectedGraph(DGraphType &&RHS) : Nodes(std::move(RHS.Nodes)) {}
186-
DGraphType &operator=(const DGraphType &G) {
187-
Nodes = G.Nodes;
188-
return *this;
189-
}
190-
DGraphType &operator=(const DGraphType &&G) {
191-
Nodes = std::move(G.Nodes);
192-
return *this;
193-
}
194184

195185
const_iterator begin() const { return Nodes.begin(); }
196186
const_iterator end() const { return Nodes.end(); }

0 commit comments

Comments
 (0)