diff --git a/llvm/include/llvm/ADT/IntervalMap.h b/llvm/include/llvm/ADT/IntervalMap.h --- a/llvm/include/llvm/ADT/IntervalMap.h +++ b/llvm/include/llvm/ADT/IntervalMap.h @@ -1042,6 +1042,13 @@ new(&rootLeaf()) RootLeaf(); } + // Delete copy/move constructors and assignment operators because the + // default ones may not do the right thing (e.g. deep vs. shallow copy). + IntervalMap(const IntervalMap &Other) = delete; + IntervalMap(IntervalMap &&Other) = delete; + IntervalMap &operator=(const IntervalMap &Other) = delete; + IntervalMap &operator=(IntervalMap &&Other) = delete; + ~IntervalMap() { clear(); rootLeaf().~RootLeaf();