Index: libcxx/include/__utility/declval.h =================================================================== --- libcxx/include/__utility/declval.h +++ libcxx/include/__utility/declval.h @@ -26,8 +26,10 @@ _Tp __declval(long); _LIBCPP_SUPPRESS_DEPRECATED_POP -template -decltype(std::__declval<_Tp>(0)) declval() _NOEXCEPT; +template +decltype(std::__declval<_Tp>(0)) declval() _NOEXCEPT { + static_assert(_False, "Calling declval is ill-formed, see [declval]/2."); +} _LIBCPP_END_NAMESPACE_STD