llvm/llvm/unittests/Support/ErrorOrTest.cpp

//===- unittests/ErrorOrTest.cpp - ErrorOr.h 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 "llvm/Support/ErrorOr.h"
#include "llvm/Support/Errc.h"
#include "gtest/gtest.h"
#include <memory>

usingnamespacellvm;

namespace {

ErrorOr<int> t1() {}
ErrorOr<int> t2() {}

TEST(ErrorOr, SimpleValue) {}

ErrorOr<std::unique_ptr<int>> t3() {}

TEST(ErrorOr, Types) {}

struct B {};
struct D : B {};

TEST(ErrorOr, Covariant) {}

TEST(ErrorOr, Comparison) {}

TEST(ErrorOr, ImplicitConversion) {}

TEST(ErrorOr, ImplicitConversionCausesMove) {}

TEST(ErrorOr, ImplicitConversionNoAmbiguity) {}

// ErrorOr<int*> x(nullptr);
// ErrorOr<std::unique_ptr<int>> y = x; // invalid conversion
static_assert;

// ErrorOr<std::unique_ptr<int>> y = ErrorOr<int*>(nullptr); // invalid
//                                                           // conversion
static_assert;

// ErrorOr<int*> x(nullptr);
// ErrorOr<std::unique_ptr<int>> y;
// y = x; // invalid conversion
static_assert;

// ErrorOr<std::unique_ptr<int>> x;
// x = ErrorOr<int*>(nullptr); // invalid conversion
static_assert;
} // end anon namespace