llvm-project/llvm/unittests/ADT/CountCopyAndMove.cpp
Dmitry Yanovsky e8ca306fbe
[ADT] Add a missing call to a unique_function destructor after move (#98747)
Right now immediately after moving the captured state, we 'disarm' the
moved-from object's destructor by resetting the
`RHS.CallbackAndInlineFlag`. This means that we never properly destroy
the RHS object's captured state.
2024-08-19 12:38:06 -07:00

20 lines
734 B
C++

//===- llvm/unittest/ADT/CountCopyAndMove.cpp - Optional unit tests -------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "CountCopyAndMove.h"
using namespace llvm;
int CountCopyAndMove::DefaultConstructions = 0;
int CountCopyAndMove::ValueConstructions = 0;
int CountCopyAndMove::CopyConstructions = 0;
int CountCopyAndMove::CopyAssignments = 0;
int CountCopyAndMove::MoveConstructions = 0;
int CountCopyAndMove::MoveAssignments = 0;
int CountCopyAndMove::Destructions = 0;