summaryrefslogtreecommitdiffstats
path: root/libcxx
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2012-04-03 21:09:48 +0000
committerHoward Hinnant <hhinnant@apple.com>2012-04-03 21:09:48 +0000
commitb2e9f19caf6c834df9c5d2e7d132ce4af5170845 (patch)
treeff2dd1e1711fe61e438589b8699e88647bda0c39 /libcxx
parent13668f2083baa01092b451bec85c77a92c032530 (diff)
downloadbcm5719-llvm-b2e9f19caf6c834df9c5d2e7d132ce4af5170845.tar.gz
bcm5719-llvm-b2e9f19caf6c834df9c5d2e7d132ce4af5170845.zip
constexpr support for <utility>. Patch contributed by Jonathan Sauer.
llvm-svn: 153968
Diffstat (limited to 'libcxx')
-rw-r--r--libcxx/include/utility7
-rw-r--r--libcxx/src/utility.cpp2
2 files changed, 7 insertions, 2 deletions
diff --git a/libcxx/include/utility b/libcxx/include/utility
index 7facea3a649..a12ed91e719 100644
--- a/libcxx/include/utility
+++ b/libcxx/include/utility
@@ -206,8 +206,11 @@ move_if_noexcept(_Tp& __x) _NOEXCEPT
}
struct _LIBCPP_VISIBLE piecewise_construct_t { };
-//constexpr
+#ifdef _LIBCPP_HAS_NO_CONSTEXPR
extern const piecewise_construct_t piecewise_construct;// = piecewise_construct_t();
+#else
+constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
+#endif
template <class _T1, class _T2>
struct _LIBCPP_VISIBLE pair
@@ -221,7 +224,7 @@ struct _LIBCPP_VISIBLE pair
// pair(const pair&) = default;
// pair(pair&&) = default;
- _LIBCPP_INLINE_VISIBILITY pair() : first(), second() {}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR pair() : first(), second() {}
_LIBCPP_INLINE_VISIBILITY pair(const _T1& __x, const _T2& __y)
: first(__x), second(__y) {}
diff --git a/libcxx/src/utility.cpp b/libcxx/src/utility.cpp
index 7dccffb73e5..deb5ffa0077 100644
--- a/libcxx/src/utility.cpp
+++ b/libcxx/src/utility.cpp
@@ -11,6 +11,8 @@
_LIBCPP_BEGIN_NAMESPACE_STD
+#ifdef _LIBCPP_HAS_NO_CONSTEXPR
const piecewise_construct_t piecewise_construct = {};
+#endif
_LIBCPP_END_NAMESPACE_STD
OpenPOWER on IntegriCloud