diff options
author | Howard Hinnant <hhinnant@apple.com> | 2012-09-24 23:36:40 +0000 |
---|---|---|
committer | Howard Hinnant <hhinnant@apple.com> | 2012-09-24 23:36:40 +0000 |
commit | 8e747d36713d305a0e872f3329ad396f54ca67a3 (patch) | |
tree | 663a297fa054b199f035d0df61ad4dc938d92d3d | |
parent | 64e15fc9565395b195b596a21e104404f897d1e7 (diff) | |
download | bcm5719-llvm-8e747d36713d305a0e872f3329ad396f54ca67a3.tar.gz bcm5719-llvm-8e747d36713d305a0e872f3329ad396f54ca67a3.zip |
Apply the emulated nullptr_t with constexpr. This is an unusual configuration that would take advantage of this. But it has popped up in the wild and does no harm to support it.
llvm-svn: 164575
-rw-r--r-- | libcxx/include/cstddef | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/libcxx/include/cstddef b/libcxx/include/cstddef index 4a6b16e186b..4b01be26afe 100644 --- a/libcxx/include/cstddef +++ b/libcxx/include/cstddef @@ -62,28 +62,28 @@ struct _LIBCPP_VISIBLE nullptr_t struct __nat {int __for_bool_;}; - _LIBCPP_ALWAYS_INLINE nullptr_t() {} - _LIBCPP_ALWAYS_INLINE nullptr_t(int __nat::*) {} + _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t() : _(0) {} + _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t(int __nat::*) : _(0) {} - _LIBCPP_ALWAYS_INLINE operator int __nat::*() const {return 0;} + _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR operator int __nat::*() const {return 0;} template <class _Tp> - _LIBCPP_ALWAYS_INLINE + _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR operator _Tp* () const {return 0;} template <class _Tp, class _Up> _LIBCPP_ALWAYS_INLINE operator _Tp _Up::* () const {return 0;} - friend _LIBCPP_ALWAYS_INLINE bool operator==(nullptr_t, nullptr_t) {return true;} - friend _LIBCPP_ALWAYS_INLINE bool operator!=(nullptr_t, nullptr_t) {return false;} - friend _LIBCPP_ALWAYS_INLINE bool operator<(nullptr_t, nullptr_t) {return false;} - friend _LIBCPP_ALWAYS_INLINE bool operator<=(nullptr_t, nullptr_t) {return true;} - friend _LIBCPP_ALWAYS_INLINE bool operator>(nullptr_t, nullptr_t) {return false;} - friend _LIBCPP_ALWAYS_INLINE bool operator>=(nullptr_t, nullptr_t) {return true;} + friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator==(nullptr_t, nullptr_t) {return true;} + friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator!=(nullptr_t, nullptr_t) {return false;} + friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator<(nullptr_t, nullptr_t) {return false;} + friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator<=(nullptr_t, nullptr_t) {return true;} + friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator>(nullptr_t, nullptr_t) {return false;} + friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator>=(nullptr_t, nullptr_t) {return true;} }; -inline _LIBCPP_ALWAYS_INLINE nullptr_t __get_nullptr_t() {return nullptr_t(0);} +inline _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t __get_nullptr_t() {return nullptr_t(0);} #define nullptr _VSTD::__get_nullptr_t() |