AMDGPU: Make vector_shuffle legal for v2i32 with v_pk_mov_b32 (#123684)
[llvm-project.git] / libcxx / test / std / utilities / variant / variant.visit.member / robust_against_adl.pass.cpp
blobbea6d949924bd8b70703aba0ac5f9b961765e70c
1 //===----------------------------------------------------------------------===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20, c++23
10 // The tested functionality needs deducing this.
11 // UNSUPPORTED: clang-17
12 // XFAIL: apple-clang
14 // <variant>
16 // class variant;
17 // template<class Self, class Visitor>
18 // constexpr decltype(auto) visit(this Self&&, Visitor&&); // since C++26
19 // template<class R, class Self, class Visitor>
20 // constexpr R visit(this Self&&, Visitor&&); // since C++26
22 #include <variant>
24 #include "test_macros.h"
26 struct Incomplete;
27 template <class T>
28 struct Holder {
29 T t;
32 constexpr bool test(bool do_it) {
33 if (do_it) {
34 std::variant<Holder<Incomplete>*, int> v = nullptr;
36 v.visit([](auto) {});
37 v.visit([](auto) -> Holder<Incomplete>* { return nullptr; });
38 v.visit<void>([](auto) {});
39 v.visit<void*>([](auto) -> Holder<Incomplete>* { return nullptr; });
41 return true;
44 int main(int, char**) {
45 test(true);
46 static_assert(test(true));
48 return 0;