summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2011-06-01 17:25:11 +0000
committerHoward Hinnant <hhinnant@apple.com>2011-06-01 17:25:11 +0000
commite88f577da1bf6a95d3b9e8a70c12922caca109eb (patch)
treeea4f0e8b1ba343a4fd158b0a52e8519ae3ab174a
parent10539ada0527dfbe37579307bf2d8708ab7771ca (diff)
downloadbcm5719-llvm-e88f577da1bf6a95d3b9e8a70c12922caca109eb.tar.gz
bcm5719-llvm-e88f577da1bf6a95d3b9e8a70c12922caca109eb.zip
Turning on cxx_nullptr exposed a latent bug in is_function, causing nullptr to wrongly classify as a function. Fixed.
llvm-svn: 132406
-rw-r--r--libcxx/include/type_traits13
1 files changed, 7 insertions, 6 deletions
diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits
index 3ad7d86557a..e7bb1eb34cb 100644
--- a/libcxx/include/type_traits
+++ b/libcxx/include/type_traits
@@ -328,6 +328,11 @@ template <class _Tp> struct _LIBCPP_VISIBLE is_class
#endif
+// is_same
+
+template <class _Tp, class _Up> struct _LIBCPP_VISIBLE is_same : public false_type {};
+template <class _Tp> struct _LIBCPP_VISIBLE is_same<_Tp, _Tp> : public true_type {};
+
// is_function
namespace __is_function_imp
@@ -340,7 +345,8 @@ template <class _Tp> _Tp& __source();
template <class _Tp, bool = is_class<_Tp>::value ||
is_union<_Tp>::value ||
is_void<_Tp>::value ||
- is_reference<_Tp>::value>
+ is_reference<_Tp>::value ||
+ is_same<_Tp, nullptr_t>::value >
struct __is_function
: public integral_constant<bool, sizeof(__is_function_imp::__test<_Tp>(__is_function_imp::__source<_Tp>())) == 1>
{};
@@ -591,11 +597,6 @@ template <class _Tp> struct _LIBCPP_VISIBLE remove_all_extents<_Tp[]>
template <class _Tp, size_t _Np> struct _LIBCPP_VISIBLE remove_all_extents<_Tp[_Np]>
{typedef typename remove_all_extents<_Tp>::type type;};
-// is_same
-
-template <class _Tp, class _Up> struct _LIBCPP_VISIBLE is_same : public false_type {};
-template <class _Tp> struct _LIBCPP_VISIBLE is_same<_Tp, _Tp> : public true_type {};
-
// is_abstract
namespace __is_abstract_imp
OpenPOWER on IntegriCloud