summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2016-05-18 22:23:46 +0000
committerEric Fiselier <eric@efcs.ca>2016-05-18 22:23:46 +0000
commitae7619a8a358667ea6ade5050512d0a27c03f432 (patch)
treea5f67f15ba68d7e82980e53f8a191ef2f85b61fb
parentf3587ec955b7b00b4e6c206c24213d621cea6157 (diff)
downloadbcm5719-llvm-ae7619a8a358667ea6ade5050512d0a27c03f432.tar.gz
bcm5719-llvm-ae7619a8a358667ea6ade5050512d0a27c03f432.zip
Optimize declval for compile times. Patch from Eric Niebler.
This patch implements the C++11 version of declval without requiring a template instantiation. See PR27798 for more information. https://llvm.org/bugs/show_bug.cgi?id=27798 llvm-svn: 269991
-rw-r--r--libcxx/include/type_traits5
1 files changed, 4 insertions, 1 deletions
diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits
index 2b14160bedd..ad32376b666 100644
--- a/libcxx/include/type_traits
+++ b/libcxx/include/type_traits
@@ -1095,8 +1095,11 @@ template <class _Tp> using add_rvalue_reference_t = typename add_rvalue_referenc
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+template <class _Tp> _Tp&& __declval(int);
+template <class _Tp> _Tp __declval(long);
+
template <class _Tp>
-typename add_rvalue_reference<_Tp>::type
+decltype(_VSTD::__declval<_Tp>(0))
declval() _NOEXCEPT;
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
OpenPOWER on IntegriCloud