Index: include/functional =================================================================== --- include/functional +++ include/functional @@ -1623,7 +1623,10 @@ function(const function&); function(function&&) _NOEXCEPT; template::value && !is_same<_Fp, function>::value + is_same::value>::type, + void + >::value && + __callable<_Fp>::value >::type> function(_Fp); @@ -1648,8 +1651,11 @@ template typename enable_if < - __callable::type>::value && - !is_same::type, function>::value, + is_same::type, function>::value>::type, + void + >::value && + __callable::type>::value, function& >::type operator=(_Fp&&); @@ -1857,8 +1863,11 @@ template typename enable_if < - function<_Rp(_ArgTypes...)>::template __callable::type>::value && - !is_same::type, function<_Rp(_ArgTypes...)>>::value, + is_same::type, function<_Rp(_ArgTypes...)>>::value>::type, + void + >::value && + function<_Rp(_ArgTypes...)>::template __callable::type>::value, function<_Rp(_ArgTypes...)>& >::type function<_Rp(_ArgTypes...)>::operator=(_Fp&& __f) Index: test/libcxx/utilities/function.objects/func.require/incomplete_return_type.pass.cpp =================================================================== --- /dev/null +++ test/libcxx/utilities/function.objects/func.require/incomplete_return_type.pass.cpp @@ -0,0 +1,23 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// Non-standard extension: +// std::function is allowed to take a function with an incomplete return type. + +// [func.require] + +#include + +struct IncompleteReturnType { + std::function fn; +}; + +int main() { + return 0; +}