[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / utilities / function.objects / refwrap / refwrap.const / ctor.incomplete.pass.cpp
blob757a0d707493df78b584e6103f0124dfb8b4010f
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
11 // <functional>
13 // reference_wrapper<T>
15 // where T is an incomplete type (since C++20)
18 #include <functional>
19 #include <cassert>
21 #include "test_macros.h"
24 struct Foo;
26 Foo& get_foo();
28 void test() {
29 Foo& foo = get_foo();
30 std::reference_wrapper<Foo> ref{foo};
31 assert(&ref.get() == &foo);
34 struct Foo { };
36 Foo& get_foo() {
37 static Foo foo;
38 return foo;
41 int main(int, char**) {
42 test();
43 return 0;