From 403845ba75f6b1663013cfac10766e2ef3cd27c3 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 . llvm-svn: 160285 --- libcxx/include/type_traits | 2 +- .../func.wrap.func.con/F_incomplete.pass.cpp | 29 +++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_incomplete.pass.cpp diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits index 31e3fac7b24b..bc3c1c20c5ee 100644 --- a/libcxx/include/type_traits +++ b/libcxx/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/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_incomplete.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_incomplete.pass.cpp new file mode 100644 index 000000000000..4659556897fc --- /dev/null +++ b/libcxx/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() +{ +}