[llvm] [ADT] Add a missing call to a unique_function destructor after move (PR #98747)

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 21 10:45:43 PDT 2024


================
@@ -12,15 +12,16 @@
 namespace llvm {
 
 struct CountCopyAndMove {
+  static int Constructions;
   static int CopyConstructions;
   static int CopyAssignments;
   static int MoveConstructions;
   static int MoveAssignments;
   static int Destructions;
   int val;
 
-  CountCopyAndMove() = default;
-  explicit CountCopyAndMove(int val) : val(val) {}
+  CountCopyAndMove() { ++Constructions; }
----------------
dwblaikie wrote:

think there's a better name we could come up with for this? I worry it'd confuse users who might think this is all constructions (including copy and move) when it isn't...

Could split it into DefaultConstructions and ValueConstructions, maybe? 

https://github.com/llvm/llvm-project/pull/98747


More information about the llvm-commits mailing list