diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2015-04-16 21:36:54 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2015-04-16 21:36:54 +0000 |
| commit | 60d5e0e027da4bf5187b0221e8a06f5a8d072d8b (patch) | |
| tree | 93574d60a447b5dfcd0d58548afa0deb0885bb34 /libcxx/include | |
| parent | 19d704d13ce1d024de9c23336f331f9919af801c (diff) | |
| download | bcm5719-llvm-60d5e0e027da4bf5187b0221e8a06f5a8d072d8b.tar.gz bcm5719-llvm-60d5e0e027da4bf5187b0221e8a06f5a8d072d8b.zip | |
A few bits of N2994 didn't get fully implemented a long time ago. Thanks to STL@microsoft.com for the bug report
llvm-svn: 235134
Diffstat (limited to 'libcxx/include')
| -rw-r--r-- | libcxx/include/iterator | 4 | ||||
| -rw-r--r-- | libcxx/include/ratio | 16 |
2 files changed, 10 insertions, 10 deletions
diff --git a/libcxx/include/iterator b/libcxx/include/iterator index 7f7e9ee1933..c06ef8f6777 100644 --- a/libcxx/include/iterator +++ b/libcxx/include/iterator @@ -214,7 +214,7 @@ public: typedef traits traits_type; typedef basic_istream<charT,traits> istream_type; - istream_iterator(); + constexpr istream_iterator(); istream_iterator(istream_type& s); istream_iterator(const istream_iterator& x); ~istream_iterator(); @@ -765,7 +765,7 @@ private: istream_type* __in_stream_; _Tp __value_; public: - _LIBCPP_INLINE_VISIBILITY istream_iterator() : __in_stream_(0) {} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR istream_iterator() : __in_stream_(0), __value_() {} _LIBCPP_INLINE_VISIBILITY istream_iterator(istream_type& __s) : __in_stream_(&__s) { if (!(*__in_stream_ >> __value_)) diff --git a/libcxx/include/ratio b/libcxx/include/ratio index 48dcd81c1a7..25ab503abfb 100644 --- a/libcxx/include/ratio +++ b/libcxx/include/ratio @@ -21,8 +21,8 @@ template <intmax_t N, intmax_t D = 1> class ratio { public: - static const intmax_t num; - static const intmax_t den; + static constexpr intmax_t num; + static constexpr intmax_t den; typedef ratio<num, den> type; }; @@ -236,13 +236,13 @@ class _LIBCPP_TYPE_VIS_ONLY ratio static_assert(__static_abs<_Num>::value >= 0, "ratio numerator is out of range"); static_assert(_Den != 0, "ratio divide by 0"); static_assert(__static_abs<_Den>::value > 0, "ratio denominator is out of range"); - static const intmax_t __na = __static_abs<_Num>::value; - static const intmax_t __da = __static_abs<_Den>::value; - static const intmax_t __s = __static_sign<_Num>::value * __static_sign<_Den>::value; - static const intmax_t __gcd = __static_gcd<__na, __da>::value; + static _LIBCPP_CONSTEXPR const intmax_t __na = __static_abs<_Num>::value; + static _LIBCPP_CONSTEXPR const intmax_t __da = __static_abs<_Den>::value; + static _LIBCPP_CONSTEXPR const intmax_t __s = __static_sign<_Num>::value * __static_sign<_Den>::value; + static _LIBCPP_CONSTEXPR const intmax_t __gcd = __static_gcd<__na, __da>::value; public: - static const intmax_t num = __s * __na / __gcd; - static const intmax_t den = __da / __gcd; + static _LIBCPP_CONSTEXPR const intmax_t num = __s * __na / __gcd; + static _LIBCPP_CONSTEXPR const intmax_t den = __da / __gcd; typedef ratio<num, den> type; }; |

