llvm-project/libcxx/test/std/utilities/meta/meta.rel
Aaron Jacobs c3a2488290 [libc++] type_traits: use __is_core_convertible in __invokable_r.
This fixes incorrect handling of non-moveable types, adding tests for this case.
See [issue 55346](https://github.com/llvm/llvm-project/issues/55346).

The current implementation is based on is_convertible, which is
[defined](https://timsong-cpp.github.io/cppwp/n4659/meta.rel#5) in terms of
validity of the following function:

```
To test() {
  return declval<From>();
}
```

But this doesn't work if To and From are both some non-moveable type, which the
[definition](https://timsong-cpp.github.io/cppwp/n4659/conv#3) of implicit
conversions says should work due to guaranteed copy elision:

```
To to = E;  // E has type From
```

It is this latter definition that is used in the
[definition](https://timsong-cpp.github.io/cppwp/n4659/function.objects#func.require-2)
of INVOKE<R>. Make __invokable_r use __is_core_convertible, which
captures the ability to use guaranteed copy elision, making the
definition correct for non-moveable types.

Fixes llvm/llvm-project#55346.

Reviewed By: #libc, philnik, EricWF

Spies: EricWF, jloser, ldionne, philnik, libcxx-commits

Differential Revision: https://reviews.llvm.org/D125300
2022-05-24 10:22:40 +02:00
..
is_base_of.pass.cpp
is_base_of_union.pass.cpp
is_convertible.pass.cpp
is_convertible_fallback.pass.cpp [libc++] Add warning pragma macros in the test suite 2022-03-17 00:11:20 +01:00
is_invocable.pass.cpp
is_invocable_r.compile.pass.cpp [libc++] type_traits: use __is_core_convertible in __invokable_r. 2022-05-24 10:22:40 +02:00
is_invocable_r_v.compile.pass.cpp [libc++] type_traits: use __is_core_convertible in __invokable_r. 2022-05-24 10:22:40 +02:00
is_nothrow_convertible.pass.cpp
is_nothrow_invocable.pass.cpp [libc++] type_traits: use __is_core_convertible in __invokable_r. 2022-05-24 10:22:40 +02:00
is_same.pass.cpp