1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // UNSUPPORTED: c++98, c++03, c++11
11 // <experimental/type_traits>
13 #include <experimental/type_traits>
16 #include "test_macros.h"
18 namespace ex = std::experimental;
21 using callFoo = decltype(std::declval<T&>().Foo());
24 int Foo() { return 0; }
31 std::string Foo() { return ""; }
34 struct convertibleFoo {
35 long Foo() { return 0; }
38 template <typename T, bool b>
40 static_assert( b == ex::is_detected_exact <int, callFoo, T>::value, "" );
41 static_assert( b == ex::is_detected_exact_v<int, callFoo, T>, "" );
47 test<wrongFoo, false>();
48 test<convertibleFoo, false>();