1128af315SEric Fiselier //===----------------------------------------------------------------------===//
2128af315SEric Fiselier //
3128af315SEric Fiselier // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4128af315SEric Fiselier // See https://llvm.org/LICENSE.txt for license information.
5128af315SEric Fiselier // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6128af315SEric Fiselier //
7128af315SEric Fiselier //===----------------------------------------------------------------------===//
8128af315SEric Fiselier
931cbe0f2SLouis Dionne // UNSUPPORTED: c++03, c++11, c++14
10128af315SEric Fiselier
11128af315SEric Fiselier // <variant>
12128af315SEric Fiselier
13128af315SEric Fiselier // template <class ...Types> class variant;
14128af315SEric Fiselier
15128af315SEric Fiselier // template <class T> constexpr variant(T&&) noexcept(see below);
16128af315SEric Fiselier
17128af315SEric Fiselier #include <variant>
18128af315SEric Fiselier #include <string>
19128af315SEric Fiselier #include <memory>
20128af315SEric Fiselier
21cc89063bSNico Weber #include "variant_test_helpers.h"
22128af315SEric Fiselier
main(int,char **)23128af315SEric Fiselier int main(int, char**)
24128af315SEric Fiselier {
25128af315SEric Fiselier static_assert(!std::is_constructible<std::variant<int, int>, int>::value, "");
26128af315SEric Fiselier static_assert(!std::is_constructible<std::variant<long, long long>, int>::value, "");
27*9e406ef4SLouis Dionne static_assert(!std::is_constructible<std::variant<char>, int>::value, "");
28128af315SEric Fiselier
29*9e406ef4SLouis Dionne static_assert(!std::is_constructible<std::variant<std::string, float>, int>::value, "");
30*9e406ef4SLouis Dionne static_assert(!std::is_constructible<std::variant<std::string, double>, int>::value, "");
31128af315SEric Fiselier static_assert(!std::is_constructible<std::variant<std::string, bool>, int>::value, "");
32128af315SEric Fiselier
33128af315SEric Fiselier static_assert(!std::is_constructible<std::variant<int, bool>, decltype("meow")>::value, "");
34128af315SEric Fiselier static_assert(!std::is_constructible<std::variant<int, const bool>, decltype("meow")>::value, "");
35128af315SEric Fiselier
36170810fcSDavid Benjamin static_assert(std::is_constructible<std::variant<bool>, std::true_type>::value, "");
37128af315SEric Fiselier static_assert(!std::is_constructible<std::variant<bool>, std::unique_ptr<char> >::value, "");
38128af315SEric Fiselier static_assert(!std::is_constructible<std::variant<bool>, decltype(nullptr)>::value, "");
39128af315SEric Fiselier
4080e088e1SCasey Carter return 0;
41128af315SEric Fiselier }
42