1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03, c++11, c++14
11 // XFAIL: availability-bad_variant_access-missing && !no-exceptions
14 // template <class Visitor, class... Variants>
15 // constexpr see below visit(Visitor&& vis, Variants&&... vars);
19 #include "test_macros.h"
22 template<class T
> struct Holder
{ T t
; };
24 constexpr bool test(bool do_it
)
27 std::variant
<Holder
<Incomplete
>*, int> v
= nullptr;
28 std::visit([](auto){}, v
);
29 std::visit([](auto) -> Holder
<Incomplete
>* { return nullptr; }, v
);
31 std::visit
<void>([](auto){}, v
);
32 std::visit
<void*>([](auto) -> Holder
<Incomplete
>* { return nullptr; }, v
);
42 static_assert(test(true));