[PATCH] D126401: [ADT] Explicitly delete copy/move constructors and operator= in IntervalMap

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 26 11:43:35 PDT 2022


dblaikie added inline comments.


================
Comment at: llvm/include/llvm/ADT/IntervalMap.h:1052
+  // Note: these are already implicitly deleted, because RootLeaf (union
+  // member) has a non-trivial assignment operator (because of std::pair).
+  IntervalMap &operator=(const IntervalMap &Other) = delete;
----------------
This isn't quite accurate - the "std::pair" situation came up only on FreeBSD when std::pair of trivially copyable types wasn't itself trivially copyable. The general statement is true for any case where the value type is not trivially copyable, but maybe that's not worth mentioning in a comment here? Enough to say that these operations wouldn't be correct (regardless of whether the incorrectness/failure is a compile time or runtime issue?)

So I'd probably just remove this two line comment, keep the one above.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126401/new/

https://reviews.llvm.org/D126401



More information about the llvm-commits mailing list