[NFC] Make TrailingObjects non-copyable/non-movable
authorErich Keane <erich.keane@intel.com>
Tue, 23 Feb 2021 19:58:46 +0000 (11:58 -0800)
committerErich Keane <erich.keane@intel.com>
Wed, 24 Feb 2021 00:30:13 +0000 (16:30 -0800)
This got me pretty recently... TrailingObjects cannot be copied or
moved, since they need to be pre-allocated. This patch deletes the copy
and move operations (plus re-adds the default ctor).

Differential Revision: https://reviews.llvm.org/D97324

llvm/include/llvm/Support/TrailingObjects.h

index 0d9c4503aa9be454b898ddbdacd9d9ed68411d73..aaee0c4a3fc0b928f557fef3e1e892325e1d5627 100644 (file)
@@ -345,6 +345,12 @@ public:
     return sizeof(BaseTy) + ParentType::additionalSizeToAllocImpl(0, Counts...);
   }
 
+  TrailingObjects() = default;
+  TrailingObjects(const TrailingObjects &) = delete;
+  TrailingObjects(TrailingObjects &&) = delete;
+  TrailingObjects &operator=(const TrailingObjects &) = delete;
+  TrailingObjects &operator=(TrailingObjects &&) = delete;
+
   /// A type where its ::with_counts template member has a ::type member
   /// suitable for use as uninitialized storage for an object with the given
   /// trailing object counts. The template arguments are similar to those