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
10 // <experimental/type_traits>
12 #include <experimental/type_traits>
15 #include "test_macros.h"
17 namespace ex
= std::experimental
;
20 using callFoo
= decltype(std::declval
<T
&>().Foo());
23 int Foo() { return 0; }
30 std::string
Foo() { return ""; }
33 struct convertibleFoo
{
34 long Foo() { return 0; }
37 template <typename T
, bool b
>
39 static_assert( b
== ex::is_detected_exact
<int, callFoo
, T
>::value
, "" );
40 static_assert( b
== ex::is_detected_exact_v
<int, callFoo
, T
>, "" );
43 int main(int, char**) {
46 test
<wrongFoo
, false>();
47 test
<convertibleFoo
, false>();