From c42530723824fa58b3e49e9dcd0fd794d5f85712 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Mon, 16 Jul 2012 16:17:34 +0000 Subject: [PATCH] Relax the complete-type checks that are happening under __invokable to only check Fp, and not Args... . This should be sufficient to give the desired high quality diagnostics under both bind and function. And this allows a test reported by Rich E on cfe-dev to pass. Tracked by . git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@160285 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/type_traits | 2 +- .../func.wrap.func.con/F_incomplete.pass.cpp | 29 +++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_incomplete.pass.cpp diff --git a/include/type_traits b/include/type_traits index 31e3fac7b..bc3c1c20c 100644 --- a/include/type_traits +++ b/include/type_traits @@ -2853,7 +2853,7 @@ __invoke(_Fp&& __f, _Args&& ...__args) template struct __invokable_imp - : private __check_complete<_Fp, _Args...> + : private __check_complete<_Fp> { typedef decltype( __invoke(_VSTD::declval<_Fp>(), _VSTD::declval<_Args>()...) diff --git a/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_incomplete.pass.cpp b/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_incomplete.pass.cpp new file mode 100644 index 000000000..465955689 --- /dev/null +++ b/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_incomplete.pass.cpp @@ -0,0 +1,29 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// class function + +// template function(F); + +// Allow incomplete argument types in the __is_callable check + +#include + +struct X{ + typedef std::function callback_type; + virtual ~X() {} +private: + callback_type _cb; +}; + +int main() +{ +}