llvm/llvm/unittests/ADT/FunctionExtrasTest.cpp

//===- FunctionExtrasTest.cpp - Unit tests for function type erasure ------===//
//
// 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 "llvm/ADT/FunctionExtras.h"
#include "CountCopyAndMove.h"
#include "gtest/gtest.h"

#include <memory>
#include <type_traits>

usingnamespacellvm;

namespace {

TEST(UniqueFunctionTest, Basic) {}

TEST(UniqueFunctionTest, Captures) {}

TEST(UniqueFunctionTest, MoveOnly) {}

TEST(UniqueFunctionTest, CountForwardingCopies) {}

TEST(UniqueFunctionTest, CountForwardingMoves) {}

TEST(UniqueFunctionTest, Const) {}

// Test that overloads on unique_functions are resolved as expected.
std::string returns(StringRef) {}
std::string returns(unique_function<double()> F) {}
std::string returns(unique_function<StringRef()> F) {}

TEST(UniqueFunctionTest, SFINAE) {}

// A forward declared type, and a templated type.
class Incomplete;
template <typename T> class Templated {};

// Check that we can define unique_function that have references to
// incomplete types, even if those types are templated over an
// incomplete type.
TEST(UniqueFunctionTest, IncompleteTypes) {}

// Incomplete function returning an incomplete type
Incomplete incompleteFunction();
const Incomplete incompleteFunctionConst();

// Check that we can assign a callable to a unique_function when the
// callable return value is incomplete.
TEST(UniqueFunctionTest, IncompleteCallableType) {}

// Define the incomplete function
class Incomplete {};
Incomplete incompleteFunction() {}
const Incomplete incompleteFunctionConst() {}

// Check that we can store a pointer-sized payload inline in the unique_function.
TEST(UniqueFunctionTest, InlineStorageWorks) {}

// Check that the moved-from captured state is properly destroyed during
// move construction/assignment.
TEST(UniqueFunctionTest, MovedFromStateIsDestroyedCorrectly) {}

} // anonymous namespace