diff --git a/libcxx/.clang-tidy b/libcxx/.clang-tidy --- a/libcxx/.clang-tidy +++ b/libcxx/.clang-tidy @@ -38,6 +38,12 @@ value: lower_case - key: readability-identifier-naming.ParameterPrefix value: __ + - key: readability-identifier-naming.PrivateMemberCase + value: lower_case + - key: readability-identifier-naming.PrivateMemberPrefix + value: __ + - key: readability-identifier-naming.PrivateMemberSuffix + value: _ # TODO: investigate these checks # bugprone-branch-clone, diff --git a/libcxx/include/__algorithm/shuffle.h b/libcxx/include/__algorithm/shuffle.h --- a/libcxx/include/__algorithm/shuffle.h +++ b/libcxx/include/__algorithm/shuffle.h @@ -29,9 +29,9 @@ class _LIBCPP_TYPE_VIS __libcpp_debug_randomizer { public: __libcpp_debug_randomizer() { - __state = __seed(); - __inc = __state + 0xda3e39cb94b95bdbULL; - __inc = (__inc << 1) | 1; + __state_ = __seed(); + __inc_ = __state_ + 0xda3e39cb94b95bdbULL; + __inc_ = (__inc_ << 1) | 1; } typedef uint_fast32_t result_type; @@ -39,8 +39,8 @@ static const result_type _Max = 0xFFFFFFFF; _LIBCPP_HIDE_FROM_ABI result_type operator()() { - uint_fast64_t __oldstate = __state; - __state = __oldstate * 6364136223846793005ULL + __inc; + uint_fast64_t __oldstate = __state_; + __state_ = __oldstate * 6364136223846793005ULL + __inc_; return __oldstate >> 32; } @@ -48,8 +48,8 @@ static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR result_type max() { return _Max; } private: - uint_fast64_t __state; - uint_fast64_t __inc; + uint_fast64_t __state_; + uint_fast64_t __inc_; _LIBCPP_HIDE_FROM_ABI static uint_fast64_t __seed() { #ifdef _LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY_SEED return _LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY_SEED; diff --git a/libcxx/include/__chrono/day.h b/libcxx/include/__chrono/day.h --- a/libcxx/include/__chrono/day.h +++ b/libcxx/include/__chrono/day.h @@ -26,18 +26,18 @@ class day { private: - unsigned char __d; + unsigned char __d_; public: _LIBCPP_HIDE_FROM_ABI day() = default; - _LIBCPP_HIDE_FROM_ABI explicit inline constexpr day(unsigned __val) noexcept : __d(static_cast(__val)) {} - _LIBCPP_HIDE_FROM_ABI inline constexpr day& operator++() noexcept { ++__d; return *this; } + _LIBCPP_HIDE_FROM_ABI explicit inline constexpr day(unsigned __val) noexcept : __d_(static_cast(__val)) {} + _LIBCPP_HIDE_FROM_ABI inline constexpr day& operator++() noexcept { ++__d_; return *this; } _LIBCPP_HIDE_FROM_ABI inline constexpr day operator++(int) noexcept { day __tmp = *this; ++(*this); return __tmp; } - _LIBCPP_HIDE_FROM_ABI inline constexpr day& operator--() noexcept { --__d; return *this; } + _LIBCPP_HIDE_FROM_ABI inline constexpr day& operator--() noexcept { --__d_; return *this; } _LIBCPP_HIDE_FROM_ABI inline constexpr day operator--(int) noexcept { day __tmp = *this; --(*this); return __tmp; } _LIBCPP_HIDE_FROM_ABI constexpr day& operator+=(const days& __dd) noexcept; _LIBCPP_HIDE_FROM_ABI constexpr day& operator-=(const days& __dd) noexcept; - _LIBCPP_HIDE_FROM_ABI explicit inline constexpr operator unsigned() const noexcept { return __d; } - _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __d >= 1 && __d <= 31; } + _LIBCPP_HIDE_FROM_ABI explicit inline constexpr operator unsigned() const noexcept { return __d_; } + _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __d_ >= 1 && __d_ <= 31; } }; diff --git a/libcxx/include/__chrono/hh_mm_ss.h b/libcxx/include/__chrono/hh_mm_ss.h --- a/libcxx/include/__chrono/hh_mm_ss.h +++ b/libcxx/include/__chrono/hh_mm_ss.h @@ -57,33 +57,33 @@ _LIBCPP_HIDE_FROM_ABI constexpr hh_mm_ss() noexcept : hh_mm_ss{_Duration::zero()} {} _LIBCPP_HIDE_FROM_ABI constexpr explicit hh_mm_ss(_Duration __d) noexcept : - __is_neg(__d < _Duration(0)), - __h(duration_cast (abs(__d))), - __m(duration_cast(abs(__d) - hours())), - __s(duration_cast(abs(__d) - hours() - minutes())), - __f(duration_cast (abs(__d) - hours() - minutes() - seconds())) + __is_neg_(__d < _Duration(0)), + __h_(duration_cast (abs(__d))), + __m_(duration_cast(abs(__d) - hours())), + __s_(duration_cast(abs(__d) - hours() - minutes())), + __f_(duration_cast (abs(__d) - hours() - minutes() - seconds())) {} - _LIBCPP_HIDE_FROM_ABI constexpr bool is_negative() const noexcept { return __is_neg; } - _LIBCPP_HIDE_FROM_ABI constexpr chrono::hours hours() const noexcept { return __h; } - _LIBCPP_HIDE_FROM_ABI constexpr chrono::minutes minutes() const noexcept { return __m; } - _LIBCPP_HIDE_FROM_ABI constexpr chrono::seconds seconds() const noexcept { return __s; } - _LIBCPP_HIDE_FROM_ABI constexpr precision subseconds() const noexcept { return __f; } + _LIBCPP_HIDE_FROM_ABI constexpr bool is_negative() const noexcept { return __is_neg_; } + _LIBCPP_HIDE_FROM_ABI constexpr chrono::hours hours() const noexcept { return __h_; } + _LIBCPP_HIDE_FROM_ABI constexpr chrono::minutes minutes() const noexcept { return __m_; } + _LIBCPP_HIDE_FROM_ABI constexpr chrono::seconds seconds() const noexcept { return __s_; } + _LIBCPP_HIDE_FROM_ABI constexpr precision subseconds() const noexcept { return __f_; } _LIBCPP_HIDE_FROM_ABI constexpr precision to_duration() const noexcept { - auto __dur = __h + __m + __s + __f; - return __is_neg ? -__dur : __dur; + auto __dur = __h_ + __m_ + __s_ + __f_; + return __is_neg_ ? -__dur : __dur; } _LIBCPP_HIDE_FROM_ABI constexpr explicit operator precision() const noexcept { return to_duration(); } private: - bool __is_neg; - chrono::hours __h; - chrono::minutes __m; - chrono::seconds __s; - precision __f; + bool __is_neg_; + chrono::hours __h_; + chrono::minutes __m_; + chrono::seconds __s_; + precision __f_; }; _LIBCPP_HIDE_FROM_ABI constexpr bool is_am(const hours& __h) noexcept { return __h >= hours( 0) && __h < hours(12); } diff --git a/libcxx/include/__chrono/month.h b/libcxx/include/__chrono/month.h --- a/libcxx/include/__chrono/month.h +++ b/libcxx/include/__chrono/month.h @@ -26,18 +26,18 @@ class month { private: - unsigned char __m; + unsigned char __m_; public: _LIBCPP_HIDE_FROM_ABI month() = default; - _LIBCPP_HIDE_FROM_ABI explicit inline constexpr month(unsigned __val) noexcept : __m(static_cast(__val)) {} - _LIBCPP_HIDE_FROM_ABI inline constexpr month& operator++() noexcept { ++__m; return *this; } + _LIBCPP_HIDE_FROM_ABI explicit inline constexpr month(unsigned __val) noexcept : __m_(static_cast(__val)) {} + _LIBCPP_HIDE_FROM_ABI inline constexpr month& operator++() noexcept { ++__m_; return *this; } _LIBCPP_HIDE_FROM_ABI inline constexpr month operator++(int) noexcept { month __tmp = *this; ++(*this); return __tmp; } - _LIBCPP_HIDE_FROM_ABI inline constexpr month& operator--() noexcept { --__m; return *this; } + _LIBCPP_HIDE_FROM_ABI inline constexpr month& operator--() noexcept { --__m_; return *this; } _LIBCPP_HIDE_FROM_ABI inline constexpr month operator--(int) noexcept { month __tmp = *this; --(*this); return __tmp; } _LIBCPP_HIDE_FROM_ABI constexpr month& operator+=(const months& __m1) noexcept; _LIBCPP_HIDE_FROM_ABI constexpr month& operator-=(const months& __m1) noexcept; - _LIBCPP_HIDE_FROM_ABI explicit inline constexpr operator unsigned() const noexcept { return __m; } - _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __m >= 1 && __m <= 12; } + _LIBCPP_HIDE_FROM_ABI explicit inline constexpr operator unsigned() const noexcept { return __m_; } + _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __m_ >= 1 && __m_ <= 12; } }; diff --git a/libcxx/include/__chrono/month_weekday.h b/libcxx/include/__chrono/month_weekday.h --- a/libcxx/include/__chrono/month_weekday.h +++ b/libcxx/include/__chrono/month_weekday.h @@ -27,14 +27,14 @@ class month_weekday { private: - chrono::month __m; - chrono::weekday_indexed __wdi; + chrono::month __m_; + chrono::weekday_indexed __wdi_; public: _LIBCPP_HIDE_FROM_ABI constexpr month_weekday(const chrono::month& __mval, const chrono::weekday_indexed& __wdival) noexcept - : __m{__mval}, __wdi{__wdival} {} - _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m; } - _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday_indexed weekday_indexed() const noexcept { return __wdi; } - _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __m.ok() && __wdi.ok(); } + : __m_{__mval}, __wdi_{__wdival} {} + _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m_; } + _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday_indexed weekday_indexed() const noexcept { return __wdi_; } + _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __m_.ok() && __wdi_.ok(); } }; _LIBCPP_HIDE_FROM_ABI inline constexpr @@ -63,14 +63,14 @@ class month_weekday_last { - chrono::month __m; - chrono::weekday_last __wdl; + chrono::month __m_; + chrono::weekday_last __wdl_; public: _LIBCPP_HIDE_FROM_ABI constexpr month_weekday_last(const chrono::month& __mval, const chrono::weekday_last& __wdlval) noexcept - : __m{__mval}, __wdl{__wdlval} {} - _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m; } - _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday_last weekday_last() const noexcept { return __wdl; } - _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __m.ok() && __wdl.ok(); } + : __m_{__mval}, __wdl_{__wdlval} {} + _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m_; } + _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday_last weekday_last() const noexcept { return __wdl_; } + _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __m_.ok() && __wdl_.ok(); } }; _LIBCPP_HIDE_FROM_ABI inline constexpr diff --git a/libcxx/include/__chrono/monthday.h b/libcxx/include/__chrono/monthday.h --- a/libcxx/include/__chrono/monthday.h +++ b/libcxx/include/__chrono/monthday.h @@ -28,26 +28,26 @@ class month_day { private: - chrono::month __m; - chrono::day __d; + chrono::month __m_; + chrono::day __d_; public: _LIBCPP_HIDE_FROM_ABI month_day() = default; _LIBCPP_HIDE_FROM_ABI constexpr month_day(const chrono::month& __mval, const chrono::day& __dval) noexcept - : __m{__mval}, __d{__dval} {} - _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m; } - _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::day day() const noexcept { return __d; } + : __m_{__mval}, __d_{__dval} {} + _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m_; } + _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::day day() const noexcept { return __d_; } _LIBCPP_HIDE_FROM_ABI constexpr bool ok() const noexcept; }; _LIBCPP_HIDE_FROM_ABI inline constexpr bool month_day::ok() const noexcept { - if (!__m.ok()) return false; - const unsigned __dval = static_cast(__d); + if (!__m_.ok()) return false; + const unsigned __dval = static_cast(__d_); if (__dval < 1 || __dval > 31) return false; if (__dval <= 29) return true; // Now we've got either 30 or 31 - const unsigned __mval = static_cast(__m); + const unsigned __mval = static_cast(__m_); if (__mval == 2) return false; if (__mval == 4 || __mval == 6 || __mval == 9 || __mval == 11) return __dval == 30; @@ -103,12 +103,12 @@ class month_day_last { private: - chrono::month __m; + chrono::month __m_; public: _LIBCPP_HIDE_FROM_ABI explicit constexpr month_day_last(const chrono::month& __val) noexcept - : __m{__val} {} - _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m; } - _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __m.ok(); } + : __m_{__val} {} + _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m_; } + _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __m_.ok(); } }; _LIBCPP_HIDE_FROM_ABI inline constexpr diff --git a/libcxx/include/__chrono/weekday.h b/libcxx/include/__chrono/weekday.h --- a/libcxx/include/__chrono/weekday.h +++ b/libcxx/include/__chrono/weekday.h @@ -32,25 +32,25 @@ class weekday { private: - unsigned char __wd; + unsigned char __wd_; _LIBCPP_HIDE_FROM_ABI static constexpr unsigned char __weekday_from_days(int __days) noexcept; public: _LIBCPP_HIDE_FROM_ABI weekday() = default; - _LIBCPP_HIDE_FROM_ABI inline explicit constexpr weekday(unsigned __val) noexcept : __wd(static_cast(__val == 7 ? 0 : __val)) {} + _LIBCPP_HIDE_FROM_ABI inline explicit constexpr weekday(unsigned __val) noexcept : __wd_(static_cast(__val == 7 ? 0 : __val)) {} _LIBCPP_HIDE_FROM_ABI inline constexpr weekday(const sys_days& __sysd) noexcept - : __wd(__weekday_from_days(__sysd.time_since_epoch().count())) {} + : __wd_(__weekday_from_days(__sysd.time_since_epoch().count())) {} _LIBCPP_HIDE_FROM_ABI inline explicit constexpr weekday(const local_days& __locd) noexcept - : __wd(__weekday_from_days(__locd.time_since_epoch().count())) {} + : __wd_(__weekday_from_days(__locd.time_since_epoch().count())) {} - _LIBCPP_HIDE_FROM_ABI inline constexpr weekday& operator++() noexcept { __wd = (__wd == 6 ? 0 : __wd + 1); return *this; } + _LIBCPP_HIDE_FROM_ABI inline constexpr weekday& operator++() noexcept { __wd_ = (__wd_ == 6 ? 0 : __wd_ + 1); return *this; } _LIBCPP_HIDE_FROM_ABI inline constexpr weekday operator++(int) noexcept { weekday __tmp = *this; ++(*this); return __tmp; } - _LIBCPP_HIDE_FROM_ABI inline constexpr weekday& operator--() noexcept { __wd = (__wd == 0 ? 6 : __wd - 1); return *this; } + _LIBCPP_HIDE_FROM_ABI inline constexpr weekday& operator--() noexcept { __wd_ = (__wd_ == 0 ? 6 : __wd_ - 1); return *this; } _LIBCPP_HIDE_FROM_ABI inline constexpr weekday operator--(int) noexcept { weekday __tmp = *this; --(*this); return __tmp; } _LIBCPP_HIDE_FROM_ABI constexpr weekday& operator+=(const days& __dd) noexcept; _LIBCPP_HIDE_FROM_ABI constexpr weekday& operator-=(const days& __dd) noexcept; - _LIBCPP_HIDE_FROM_ABI inline constexpr unsigned c_encoding() const noexcept { return __wd; } - _LIBCPP_HIDE_FROM_ABI inline constexpr unsigned iso_encoding() const noexcept { return __wd == 0u ? 7 : __wd; } - _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __wd <= 6; } + _LIBCPP_HIDE_FROM_ABI inline constexpr unsigned c_encoding() const noexcept { return __wd_; } + _LIBCPP_HIDE_FROM_ABI inline constexpr unsigned iso_encoding() const noexcept { return __wd_ == 0u ? 7 : __wd_; } + _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __wd_ <= 6; } _LIBCPP_HIDE_FROM_ABI constexpr weekday_indexed operator[](unsigned __index) const noexcept; _LIBCPP_HIDE_FROM_ABI constexpr weekday_last operator[](last_spec) const noexcept; }; @@ -123,15 +123,15 @@ class weekday_indexed { private: - chrono::weekday __wd; - unsigned char __idx; + chrono::weekday __wd_; + unsigned char __idx_; public: _LIBCPP_HIDE_FROM_ABI weekday_indexed() = default; _LIBCPP_HIDE_FROM_ABI inline constexpr weekday_indexed(const chrono::weekday& __wdval, unsigned __idxval) noexcept - : __wd{__wdval}, __idx(__idxval) {} - _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday weekday() const noexcept { return __wd; } - _LIBCPP_HIDE_FROM_ABI inline constexpr unsigned index() const noexcept { return __idx; } - _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __wd.ok() && __idx >= 1 && __idx <= 5; } + : __wd_{__wdval}, __idx_(__idxval) {} + _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday weekday() const noexcept { return __wd_; } + _LIBCPP_HIDE_FROM_ABI inline constexpr unsigned index() const noexcept { return __idx_; } + _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __wd_.ok() && __idx_ >= 1 && __idx_ <= 5; } }; _LIBCPP_HIDE_FROM_ABI inline constexpr @@ -145,12 +145,12 @@ class weekday_last { private: - chrono::weekday __wd; + chrono::weekday __wd_; public: _LIBCPP_HIDE_FROM_ABI explicit constexpr weekday_last(const chrono::weekday& __val) noexcept - : __wd{__val} {} - _LIBCPP_HIDE_FROM_ABI constexpr chrono::weekday weekday() const noexcept { return __wd; } - _LIBCPP_HIDE_FROM_ABI constexpr bool ok() const noexcept { return __wd.ok(); } + : __wd_{__val} {} + _LIBCPP_HIDE_FROM_ABI constexpr chrono::weekday weekday() const noexcept { return __wd_; } + _LIBCPP_HIDE_FROM_ABI constexpr bool ok() const noexcept { return __wd_.ok(); } }; _LIBCPP_HIDE_FROM_ABI inline constexpr diff --git a/libcxx/include/__chrono/year.h b/libcxx/include/__chrono/year.h --- a/libcxx/include/__chrono/year.h +++ b/libcxx/include/__chrono/year.h @@ -29,22 +29,22 @@ class year { private: - short __y; + short __y_; public: _LIBCPP_HIDE_FROM_ABI year() = default; - _LIBCPP_HIDE_FROM_ABI explicit inline constexpr year(int __val) noexcept : __y(static_cast(__val)) {} + _LIBCPP_HIDE_FROM_ABI explicit inline constexpr year(int __val) noexcept : __y_(static_cast(__val)) {} - _LIBCPP_HIDE_FROM_ABI inline constexpr year& operator++() noexcept { ++__y; return *this; } + _LIBCPP_HIDE_FROM_ABI inline constexpr year& operator++() noexcept { ++__y_; return *this; } _LIBCPP_HIDE_FROM_ABI inline constexpr year operator++(int) noexcept { year __tmp = *this; ++(*this); return __tmp; } - _LIBCPP_HIDE_FROM_ABI inline constexpr year& operator--() noexcept { --__y; return *this; } + _LIBCPP_HIDE_FROM_ABI inline constexpr year& operator--() noexcept { --__y_; return *this; } _LIBCPP_HIDE_FROM_ABI inline constexpr year operator--(int) noexcept { year __tmp = *this; --(*this); return __tmp; } _LIBCPP_HIDE_FROM_ABI constexpr year& operator+=(const years& __dy) noexcept; _LIBCPP_HIDE_FROM_ABI constexpr year& operator-=(const years& __dy) noexcept; _LIBCPP_HIDE_FROM_ABI inline constexpr year operator+() const noexcept { return *this; } - _LIBCPP_HIDE_FROM_ABI inline constexpr year operator-() const noexcept { return year{-__y}; } + _LIBCPP_HIDE_FROM_ABI inline constexpr year operator-() const noexcept { return year{-__y_}; } - _LIBCPP_HIDE_FROM_ABI inline constexpr bool is_leap() const noexcept { return __y % 4 == 0 && (__y % 100 != 0 || __y % 400 == 0); } - _LIBCPP_HIDE_FROM_ABI explicit inline constexpr operator int() const noexcept { return __y; } + _LIBCPP_HIDE_FROM_ABI inline constexpr bool is_leap() const noexcept { return __y_ % 4 == 0 && (__y_ % 100 != 0 || __y_ % 400 == 0); } + _LIBCPP_HIDE_FROM_ABI explicit inline constexpr operator int() const noexcept { return __y_; } _LIBCPP_HIDE_FROM_ABI constexpr bool ok() const noexcept; _LIBCPP_HIDE_FROM_ABI static inline constexpr year min() noexcept { return year{-32767}; } _LIBCPP_HIDE_FROM_ABI static inline constexpr year max() noexcept { return year{ 32767}; } @@ -102,7 +102,7 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr bool year::ok() const noexcept -{ return static_cast(min()) <= __y && __y <= static_cast(max()); } +{ return static_cast(min()) <= __y_ && __y_ <= static_cast(max()); } } // namespace chrono _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/__chrono/year_month.h b/libcxx/include/__chrono/year_month.h --- a/libcxx/include/__chrono/year_month.h +++ b/libcxx/include/__chrono/year_month.h @@ -27,19 +27,19 @@ { class year_month { - chrono::year __y; - chrono::month __m; + chrono::year __y_; + chrono::month __m_; public: _LIBCPP_HIDE_FROM_ABI year_month() = default; _LIBCPP_HIDE_FROM_ABI constexpr year_month(const chrono::year& __yval, const chrono::month& __mval) noexcept - : __y{__yval}, __m{__mval} {} - _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year year() const noexcept { return __y; } - _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m; } - _LIBCPP_HIDE_FROM_ABI inline constexpr year_month& operator+=(const months& __dm) noexcept { this->__m += __dm; return *this; } - _LIBCPP_HIDE_FROM_ABI inline constexpr year_month& operator-=(const months& __dm) noexcept { this->__m -= __dm; return *this; } - _LIBCPP_HIDE_FROM_ABI inline constexpr year_month& operator+=(const years& __dy) noexcept { this->__y += __dy; return *this; } - _LIBCPP_HIDE_FROM_ABI inline constexpr year_month& operator-=(const years& __dy) noexcept { this->__y -= __dy; return *this; } - _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __y.ok() && __m.ok(); } + : __y_{__yval}, __m_{__mval} {} + _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year year() const noexcept { return __y_; } + _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m_; } + _LIBCPP_HIDE_FROM_ABI inline constexpr year_month& operator+=(const months& __dm) noexcept { this->__m_ += __dm; return *this; } + _LIBCPP_HIDE_FROM_ABI inline constexpr year_month& operator-=(const months& __dm) noexcept { this->__m_ -= __dm; return *this; } + _LIBCPP_HIDE_FROM_ABI inline constexpr year_month& operator+=(const years& __dy) noexcept { this->__y_ += __dy; return *this; } + _LIBCPP_HIDE_FROM_ABI inline constexpr year_month& operator-=(const years& __dy) noexcept { this->__y_ -= __dy; return *this; } + _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __y_.ok() && __m_.ok(); } }; _LIBCPP_HIDE_FROM_ABI inline constexpr diff --git a/libcxx/include/__chrono/year_month_day.h b/libcxx/include/__chrono/year_month_day.h --- a/libcxx/include/__chrono/year_month_day.h +++ b/libcxx/include/__chrono/year_month_day.h @@ -37,14 +37,14 @@ class year_month_day { private: - chrono::year __y; - chrono::month __m; - chrono::day __d; + chrono::year __y_; + chrono::month __m_; + chrono::day __d_; public: _LIBCPP_HIDE_FROM_ABI year_month_day() = default; _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day( const chrono::year& __yval, const chrono::month& __mval, const chrono::day& __dval) noexcept - : __y{__yval}, __m{__mval}, __d{__dval} {} + : __y_{__yval}, __m_{__mval}, __d_{__dval} {} _LIBCPP_HIDE_FROM_ABI constexpr year_month_day(const year_month_day_last& __ymdl) noexcept; _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day(const sys_days& __sysd) noexcept : year_month_day(__from_days(__sysd.time_since_epoch())) {} @@ -56,9 +56,9 @@ _LIBCPP_HIDE_FROM_ABI constexpr year_month_day& operator+=(const years& __dy) noexcept; _LIBCPP_HIDE_FROM_ABI constexpr year_month_day& operator-=(const years& __dy) noexcept; - _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year year() const noexcept { return __y; } - _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m; } - _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::day day() const noexcept { return __d; } + _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year year() const noexcept { return __y_; } + _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m_; } + _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::day day() const noexcept { return __d_; } _LIBCPP_HIDE_FROM_ABI inline constexpr operator sys_days() const noexcept { return sys_days{__to_days()}; } _LIBCPP_HIDE_FROM_ABI inline explicit constexpr operator local_days() const noexcept { return local_days{__to_days()}; } @@ -94,9 +94,9 @@ static_assert(numeric_limits::digits >= 18, ""); static_assert(numeric_limits::digits >= 20 , ""); - const int __yr = static_cast(__y) - (__m <= February); - const unsigned __mth = static_cast(__m); - const unsigned __dy = static_cast(__d); + const int __yr = static_cast(__y_) - (__m_ <= February); + const unsigned __mth = static_cast(__m_); + const unsigned __dy = static_cast(__d_); const int __era = (__yr >= 0 ? __yr : __yr - 399) / 400; const unsigned __yoe = static_cast(__yr - __era * 400); // [0, 399] @@ -191,24 +191,24 @@ class year_month_day_last { private: - chrono::year __y; - chrono::month_day_last __mdl; + chrono::year __y_; + chrono::month_day_last __mdl_; public: _LIBCPP_HIDE_FROM_ABI constexpr year_month_day_last(const year& __yval, const month_day_last& __mdlval) noexcept - : __y{__yval}, __mdl{__mdlval} {} + : __y_{__yval}, __mdl_{__mdlval} {} _LIBCPP_HIDE_FROM_ABI constexpr year_month_day_last& operator+=(const months& __m) noexcept; _LIBCPP_HIDE_FROM_ABI constexpr year_month_day_last& operator-=(const months& __m) noexcept; _LIBCPP_HIDE_FROM_ABI constexpr year_month_day_last& operator+=(const years& __y) noexcept; _LIBCPP_HIDE_FROM_ABI constexpr year_month_day_last& operator-=(const years& __y) noexcept; - _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year year() const noexcept { return __y; } - _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __mdl.month(); } - _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month_day_last month_day_last() const noexcept { return __mdl; } + _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year year() const noexcept { return __y_; } + _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __mdl_.month(); } + _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month_day_last month_day_last() const noexcept { return __mdl_; } _LIBCPP_HIDE_FROM_ABI constexpr chrono::day day() const noexcept; _LIBCPP_HIDE_FROM_ABI inline constexpr operator sys_days() const noexcept { return sys_days{year()/month()/day()}; } _LIBCPP_HIDE_FROM_ABI inline explicit constexpr operator local_days() const noexcept { return local_days{year()/month()/day()}; } - _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __y.ok() && __mdl.ok(); } + _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __y_.ok() && __mdl_.ok(); } }; _LIBCPP_HIDE_FROM_ABI inline constexpr @@ -221,7 +221,7 @@ chrono::day(31), chrono::day(31), chrono::day(30), chrono::day(31), chrono::day(30), chrono::day(31) }; - return (month() != February || !__y.is_leap()) && month().ok() ? + return (month() != February || !__y_.is_leap()) && month().ok() ? __d[static_cast(month()) - 1] : chrono::day{29}; } @@ -305,13 +305,13 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day::year_month_day(const year_month_day_last& __ymdl) noexcept - : __y{__ymdl.year()}, __m{__ymdl.month()}, __d{__ymdl.day()} {} + : __y_{__ymdl.year()}, __m_{__ymdl.month()}, __d_{__ymdl.day()} {} _LIBCPP_HIDE_FROM_ABI inline constexpr bool year_month_day::ok() const noexcept { - if (!__y.ok() || !__m.ok()) return false; - return chrono::day{1} <= __d && __d <= (__y / __m / last).day(); + if (!__y_.ok() || !__m_.ok()) return false; + return chrono::day{1} <= __d_ && __d_ <= (__y_ / __m_ / last).day(); } } // namespace chrono diff --git a/libcxx/include/__chrono/year_month_weekday.h b/libcxx/include/__chrono/year_month_weekday.h --- a/libcxx/include/__chrono/year_month_weekday.h +++ b/libcxx/include/__chrono/year_month_weekday.h @@ -35,14 +35,14 @@ { class year_month_weekday { - chrono::year __y; - chrono::month __m; - chrono::weekday_indexed __wdi; + chrono::year __y_; + chrono::month __m_; + chrono::weekday_indexed __wdi_; public: _LIBCPP_HIDE_FROM_ABI year_month_weekday() = default; _LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday(const chrono::year& __yval, const chrono::month& __mval, const chrono::weekday_indexed& __wdival) noexcept - : __y{__yval}, __m{__mval}, __wdi{__wdival} {} + : __y_{__yval}, __m_{__mval}, __wdi_{__wdival} {} _LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday(const sys_days& __sysd) noexcept : year_month_weekday(__from_days(__sysd.time_since_epoch())) {} _LIBCPP_HIDE_FROM_ABI inline explicit constexpr year_month_weekday(const local_days& __locd) noexcept @@ -52,24 +52,24 @@ _LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday& operator+=(const years&) noexcept; _LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday& operator-=(const years&) noexcept; - _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year year() const noexcept { return __y; } - _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m; } - _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday weekday() const noexcept { return __wdi.weekday(); } - _LIBCPP_HIDE_FROM_ABI inline constexpr unsigned index() const noexcept { return __wdi.index(); } - _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday_indexed weekday_indexed() const noexcept { return __wdi; } + _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year year() const noexcept { return __y_; } + _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m_; } + _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday weekday() const noexcept { return __wdi_.weekday(); } + _LIBCPP_HIDE_FROM_ABI inline constexpr unsigned index() const noexcept { return __wdi_.index(); } + _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday_indexed weekday_indexed() const noexcept { return __wdi_; } _LIBCPP_HIDE_FROM_ABI inline constexpr operator sys_days() const noexcept { return sys_days{__to_days()}; } _LIBCPP_HIDE_FROM_ABI inline explicit constexpr operator local_days() const noexcept { return local_days{__to_days()}; } _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { - if (!__y.ok() || !__m.ok() || !__wdi.ok()) return false; - if (__wdi.index() <= 4) return true; + if (!__y_.ok() || !__m_.ok() || !__wdi_.ok()) return false; + if (__wdi_.index() <= 4) return true; auto __nth_weekday_day = - __wdi.weekday() - - chrono::weekday{static_cast(__y / __m / 1)} + - days{(__wdi.index() - 1) * 7 + 1}; + __wdi_.weekday() - + chrono::weekday{static_cast(__y_ / __m_ / 1)} + + days{(__wdi_.index() - 1) * 7 + 1}; return static_cast(__nth_weekday_day.count()) <= - static_cast((__y / __m / last).day()); + static_cast((__y_ / __m_ / last).day()); } _LIBCPP_HIDE_FROM_ABI static constexpr year_month_weekday __from_days(days __d) noexcept; @@ -89,8 +89,8 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr days year_month_weekday::__to_days() const noexcept { - const sys_days __sysd = sys_days(__y/__m/1); - return (__sysd + (__wdi.weekday() - chrono::weekday(__sysd) + days{(__wdi.index()-1)*7})) + const sys_days __sysd = sys_days(__y_/__m_/1); + return (__sysd + (__wdi_.weekday() - chrono::weekday(__sysd) + days{(__wdi_.index()-1)*7})) .time_since_epoch(); } @@ -155,25 +155,25 @@ class year_month_weekday_last { private: - chrono::year __y; - chrono::month __m; - chrono::weekday_last __wdl; + chrono::year __y_; + chrono::month __m_; + chrono::weekday_last __wdl_; public: _LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday_last(const chrono::year& __yval, const chrono::month& __mval, const chrono::weekday_last& __wdlval) noexcept - : __y{__yval}, __m{__mval}, __wdl{__wdlval} {} + : __y_{__yval}, __m_{__mval}, __wdl_{__wdlval} {} _LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday_last& operator+=(const months& __dm) noexcept; _LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday_last& operator-=(const months& __dm) noexcept; _LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday_last& operator+=(const years& __dy) noexcept; _LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday_last& operator-=(const years& __dy) noexcept; - _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year year() const noexcept { return __y; } - _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m; } - _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday weekday() const noexcept { return __wdl.weekday(); } - _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday_last weekday_last() const noexcept { return __wdl; } + _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year year() const noexcept { return __y_; } + _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m_; } + _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday weekday() const noexcept { return __wdl_.weekday(); } + _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday_last weekday_last() const noexcept { return __wdl_; } _LIBCPP_HIDE_FROM_ABI inline constexpr operator sys_days() const noexcept { return sys_days{__to_days()}; } _LIBCPP_HIDE_FROM_ABI inline explicit constexpr operator local_days() const noexcept { return local_days{__to_days()}; } - _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __y.ok() && __m.ok() && __wdl.ok(); } + _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __y_.ok() && __m_.ok() && __wdl_.ok(); } _LIBCPP_HIDE_FROM_ABI constexpr days __to_days() const noexcept; @@ -182,8 +182,8 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr days year_month_weekday_last::__to_days() const noexcept { - const sys_days __last = sys_days{__y/__m/last}; - return (__last - (chrono::weekday{__last} - __wdl.weekday())).time_since_epoch(); + const sys_days __last = sys_days{__y_/__m_/last}; + return (__last - (chrono::weekday{__last} - __wdl_.weekday())).time_since_epoch(); } diff --git a/libcxx/include/__iterator/reverse_iterator.h b/libcxx/include/__iterator/reverse_iterator.h --- a/libcxx/include/__iterator/reverse_iterator.h +++ b/libcxx/include/__iterator/reverse_iterator.h @@ -47,7 +47,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP private: #ifndef _LIBCPP_ABI_NO_ITERATOR_BASES - _Iter __t; // no longer used as of LWG #2360, not removed due to ABI break + _Iter __t_; // no longer used as of LWG #2360, not removed due to ABI break #endif #if _LIBCPP_STD_VER > 17 @@ -79,17 +79,17 @@ #ifndef _LIBCPP_ABI_NO_ITERATOR_BASES _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 - reverse_iterator() : __t(), current() {} + reverse_iterator() : __t_(), current() {} _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 - explicit reverse_iterator(_Iter __x) : __t(__x), current(__x) {} + explicit reverse_iterator(_Iter __x) : __t_(__x), current(__x) {} template ::value && is_convertible<_Up const&, _Iter>::value > > _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reverse_iterator(const reverse_iterator<_Up>& __u) - : __t(__u.base()), current(__u.base()) + : __t_(__u.base()), current(__u.base()) { } template > _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reverse_iterator& operator=(const reverse_iterator<_Up>& __u) { - __t = current = __u.base(); + __t_ = current = __u.base(); return *this; } #else diff --git a/libcxx/include/__iterator/wrap_iter.h b/libcxx/include/__iterator/wrap_iter.h --- a/libcxx/include/__iterator/wrap_iter.h +++ b/libcxx/include/__iterator/wrap_iter.h @@ -38,17 +38,17 @@ #endif private: - iterator_type __i; + iterator_type __i_; public: _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 __wrap_iter() _NOEXCEPT - : __i() + : __i_() { _VSTD::__debug_db_insert_i(this); } template _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 __wrap_iter(const __wrap_iter<_Up>& __u, typename enable_if::value>::type* = nullptr) _NOEXCEPT - : __i(__u.base()) + : __i_(__u.base()) { #ifdef _LIBCPP_ENABLE_DEBUG_MODE if (!__libcpp_is_constant_evaluated()) @@ -85,19 +85,19 @@ { _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this), "Attempted to dereference a non-dereferenceable iterator"); - return *__i; + return *__i_; } _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 pointer operator->() const _NOEXCEPT { _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this), "Attempted to dereference a non-dereferenceable iterator"); - return _VSTD::__to_address(__i); + return _VSTD::__to_address(__i_); } _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 __wrap_iter& operator++() _NOEXCEPT { _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this), "Attempted to increment a non-incrementable iterator"); - ++__i; + ++__i_; return *this; } _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 __wrap_iter operator++(int) _NOEXCEPT @@ -107,7 +107,7 @@ { _LIBCPP_DEBUG_ASSERT(__get_const_db()->__decrementable(this), "Attempted to decrement a non-decrementable iterator"); - --__i; + --__i_; return *this; } _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 __wrap_iter operator--(int) _NOEXCEPT @@ -118,7 +118,7 @@ { _LIBCPP_DEBUG_ASSERT(__get_const_db()->__addable(this, __n), "Attempted to add/subtract an iterator outside its valid range"); - __i += __n; + __i_ += __n; return *this; } _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 __wrap_iter operator- (difference_type __n) const _NOEXCEPT @@ -129,14 +129,14 @@ { _LIBCPP_DEBUG_ASSERT(__get_const_db()->__subscriptable(this, __n), "Attempted to subscript an iterator outside its valid range"); - return __i[__n]; + return __i_[__n]; } - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 iterator_type base() const _NOEXCEPT {return __i;} + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 iterator_type base() const _NOEXCEPT {return __i_;} private: _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 - explicit __wrap_iter(const void* __p, iterator_type __x) _NOEXCEPT : __i(__x) + explicit __wrap_iter(const void* __p, iterator_type __x) _NOEXCEPT : __i_(__x) { (void)__p; #ifdef _LIBCPP_ENABLE_DEBUG_MODE diff --git a/libcxx/include/__locale b/libcxx/include/__locale --- a/libcxx/include/__locale +++ b/libcxx/include/__locale @@ -350,7 +350,7 @@ class _LIBCPP_TYPE_VIS collate_byname : public collate { - locale_t __l; + locale_t __l_; public: typedef char char_type; typedef basic_string string_type; @@ -370,7 +370,7 @@ class _LIBCPP_TYPE_VIS collate_byname : public collate { - locale_t __l; + locale_t __l_; public: typedef wchar_t char_type; typedef basic_string string_type; @@ -791,7 +791,7 @@ class _LIBCPP_TYPE_VIS ctype_byname : public ctype { - locale_t __l; + locale_t __l_; public: explicit ctype_byname(const char*, size_t = 0); @@ -810,7 +810,7 @@ class _LIBCPP_TYPE_VIS ctype_byname : public ctype { - locale_t __l; + locale_t __l_; public: explicit ctype_byname(const char*, size_t = 0); @@ -1044,7 +1044,7 @@ : public locale::facet, public codecvt_base { - locale_t __l; + locale_t __l_; public: typedef wchar_t intern_type; typedef char extern_type; diff --git a/libcxx/include/__memory/shared_ptr.h b/libcxx/include/__memory/shared_ptr.h --- a/libcxx/include/__memory/shared_ptr.h +++ b/libcxx/include/__memory/shared_ptr.h @@ -1771,7 +1771,7 @@ class _LIBCPP_TYPE_VIS __sp_mut { - void* __lx; + void* __lx_; public: void lock() _NOEXCEPT; void unlock() _NOEXCEPT; diff --git a/libcxx/include/__random/normal_distribution.h b/libcxx/include/__random/normal_distribution.h --- a/libcxx/include/__random/normal_distribution.h +++ b/libcxx/include/__random/normal_distribution.h @@ -58,8 +58,8 @@ private: param_type __p_; - result_type _V_; - bool _V_hot_; + result_type __v_; + bool __v_hot_; public: // constructors and reset functions @@ -68,7 +68,7 @@ normal_distribution() : normal_distribution(0) {} _LIBCPP_INLINE_VISIBILITY explicit normal_distribution(result_type __mean, result_type __stddev = 1) - : __p_(param_type(__mean, __stddev)), _V_hot_(false) {} + : __p_(param_type(__mean, __stddev)), __v_hot_(false) {} #else _LIBCPP_INLINE_VISIBILITY explicit normal_distribution(result_type __mean = 0, @@ -77,9 +77,9 @@ #endif _LIBCPP_INLINE_VISIBILITY explicit normal_distribution(const param_type& __p) - : __p_(__p), _V_hot_(false) {} + : __p_(__p), __v_hot_(false) {} _LIBCPP_INLINE_VISIBILITY - void reset() {_V_hot_ = false;} + void reset() {__v_hot_ = false;} // generating functions template @@ -107,8 +107,8 @@ friend _LIBCPP_INLINE_VISIBILITY bool operator==(const normal_distribution& __x, const normal_distribution& __y) - {return __x.__p_ == __y.__p_ && __x._V_hot_ == __y._V_hot_ && - (!__x._V_hot_ || __x._V_ == __y._V_);} + {return __x.__p_ == __y.__p_ && __x.__v_hot_ == __y.__v_hot_ && + (!__x.__v_hot_ || __x.__v_ == __y.__v_);} friend _LIBCPP_INLINE_VISIBILITY bool operator!=(const normal_distribution& __x, const normal_distribution& __y) @@ -134,10 +134,10 @@ { static_assert(__libcpp_random_is_valid_urng<_URNG>::value, ""); result_type _Up; - if (_V_hot_) + if (__v_hot_) { - _V_hot_ = false; - _Up = _V_; + __v_hot_ = false; + _Up = __v_; } else { @@ -152,8 +152,8 @@ __s = __u * __u + __v * __v; } while (__s > 1 || __s == 0); result_type _Fp = _VSTD::sqrt(-2 * _VSTD::log(__s) / __s); - _V_ = __v * _Fp; - _V_hot_ = true; + __v_ = __v * _Fp; + __v_hot_ = true; _Up = __u * _Fp; } return _Up * __p.stddev() + __p.mean(); @@ -170,9 +170,9 @@ _OStream::scientific); _CharT __sp = __os.widen(' '); __os.fill(__sp); - __os << __x.mean() << __sp << __x.stddev() << __sp << __x._V_hot_; - if (__x._V_hot_) - __os << __sp << __x._V_; + __os << __x.mean() << __sp << __x.stddev() << __sp << __x.__v_hot_; + if (__x.__v_hot_) + __os << __sp << __x.__v_; return __os; } @@ -197,8 +197,8 @@ if (!__is.fail()) { __x.param(param_type(__mean, __stddev)); - __x._V_hot_ = _V_hot; - __x._V_ = _Vp; + __x.__v_hot_ = _V_hot; + __x.__v_ = _Vp; } return __is; } diff --git a/libcxx/include/__random/shuffle_order_engine.h b/libcxx/include/__random/shuffle_order_engine.h --- a/libcxx/include/__random/shuffle_order_engine.h +++ b/libcxx/include/__random/shuffle_order_engine.h @@ -60,8 +60,8 @@ private: _Engine __e_; - result_type _V_[__k]; - result_type _Y_; + result_type __v_[__k]; + result_type __y_; public: // engine characteristics @@ -157,8 +157,8 @@ void __init() { for (size_t __i = 0; __i < __k; ++__i) - _V_[__i] = __e_(); - _Y_ = __e_(); + __v_[__i] = __e_(); + __y_ = __e_(); } _LIBCPP_INLINE_VISIBILITY @@ -190,11 +190,11 @@ >::type __eval(__uratio<_Np, _Dp>) { - const size_t __j = static_cast(__uratio<_Np, _Dp>::num * (_Y_ - _Min) + const size_t __j = static_cast(__uratio<_Np, _Dp>::num * (__y_ - _Min) / __uratio<_Np, _Dp>::den); - _Y_ = _V_[__j]; - _V_[__j] = __e_(); - return _Y_; + __y_ = __v_[__j]; + __v_[__j] = __e_(); + return __y_; } template @@ -204,10 +204,10 @@ const double _Fp = __d == 0 ? __n / (2. * 0x8000000000000000ull) : __n / (double)__d; - const size_t __j = static_cast(_Fp * (_Y_ - _Min)); - _Y_ = _V_[__j]; - _V_[__j] = __e_(); - return _Y_; + const size_t __j = static_cast(_Fp * (__y_ - _Min)); + __y_ = __v_[__j]; + __v_[__j] = __e_(); + return __y_; } }; @@ -220,7 +220,7 @@ const shuffle_order_engine<_Eng, _Kp>& __x, const shuffle_order_engine<_Eng, _Kp>& __y) { - return __x._Y_ == __y._Y_ && _VSTD::equal(__x._V_, __x._V_ + _Kp, __y._V_) && + return __x.__y_ == __y.__y_ && _VSTD::equal(__x.__v_, __x.__v_ + _Kp, __y.__v_) && __x.__e_ == __y.__e_; } @@ -245,10 +245,10 @@ __os.flags(_Ostream::dec | _Ostream::left); _CharT __sp = __os.widen(' '); __os.fill(__sp); - __os << __x.__e_ << __sp << __x._V_[0]; + __os << __x.__e_ << __sp << __x.__v_[0]; for (size_t __i = 1; __i < _Kp; ++__i) - __os << __sp << __x._V_[__i]; - return __os << __sp << __x._Y_; + __os << __sp << __x.__v_[__i]; + return __os << __sp << __x.__y_; } template __call(_Action::_Destroy); } + void reset() _NOEXCEPT { if (__h_) this->__call(_Action::_Destroy); } _LIBCPP_INLINE_VISIBILITY void swap(any & __rhs) _NOEXCEPT; // 6.3.4 any observers _LIBCPP_INLINE_VISIBILITY - bool has_value() const _NOEXCEPT { return __h != nullptr; } + bool has_value() const _NOEXCEPT { return __h_ != nullptr; } #if !defined(_LIBCPP_NO_RTTI) _LIBCPP_INLINE_VISIBILITY const type_info & type() const _NOEXCEPT { - if (__h) { + if (__h_) { return *static_cast(this->__call(_Action::_TypeInfo)); } else { return typeid(void); @@ -320,7 +320,7 @@ type_info const * __info = nullptr, const void* __fallback_info = nullptr) const { - return __h(__a, this, __other, __info, __fallback_info); + return __h_(__a, this, __other, __info, __fallback_info); } _LIBCPP_INLINE_VISIBILITY @@ -328,7 +328,7 @@ type_info const * __info = nullptr, const void* __fallback_info = nullptr) { - return __h(__a, this, __other, __info, __fallback_info); + return __h_(__a, this, __other, __info, __fallback_info); } template @@ -344,8 +344,8 @@ friend add_pointer_t<_ValueType> any_cast(any *) _NOEXCEPT; - _HandleFuncPtr __h = nullptr; - _Storage __s; + _HandleFuncPtr __h_ = nullptr; + _Storage __s_; }; namespace __any_imp @@ -382,9 +382,9 @@ typedef allocator<_Tp> _Alloc; typedef allocator_traits<_Alloc> _ATraits; _Alloc __a; - _Tp * __ret = static_cast<_Tp*>(static_cast(&__dest.__s.__buf)); + _Tp * __ret = static_cast<_Tp*>(static_cast(&__dest.__s_.__buf)); _ATraits::construct(__a, __ret, _VSTD::forward<_Args>(__args)...); - __dest.__h = &_SmallHandler::__handle; + __dest.__h_ = &_SmallHandler::__handle; return *__ret; } @@ -394,21 +394,21 @@ typedef allocator<_Tp> _Alloc; typedef allocator_traits<_Alloc> _ATraits; _Alloc __a; - _Tp * __p = static_cast<_Tp *>(static_cast(&__this.__s.__buf)); + _Tp * __p = static_cast<_Tp *>(static_cast(&__this.__s_.__buf)); _ATraits::destroy(__a, __p); - __this.__h = nullptr; + __this.__h_ = nullptr; } _LIBCPP_INLINE_VISIBILITY static void __copy(any const & __this, any & __dest) { _SmallHandler::__create(__dest, *static_cast<_Tp const *>( - static_cast(&__this.__s.__buf))); + static_cast(&__this.__s_.__buf))); } _LIBCPP_INLINE_VISIBILITY static void __move(any & __this, any & __dest) { _SmallHandler::__create(__dest, _VSTD::move( - *static_cast<_Tp*>(static_cast(&__this.__s.__buf)))); + *static_cast<_Tp*>(static_cast(&__this.__s_.__buf)))); __destroy(__this); } @@ -418,7 +418,7 @@ const void* __fallback_id) { if (__any_imp::__compare_typeid<_Tp>(__info, __fallback_id)) - return static_cast(&__this.__s.__buf); + return static_cast(&__this.__s_.__buf); return nullptr; } @@ -470,8 +470,8 @@ unique_ptr<_Tp, _Dp> __hold(_ATraits::allocate(__a, 1), _Dp(__a, 1)); _Tp * __ret = __hold.get(); _ATraits::construct(__a, __ret, _VSTD::forward<_Args>(__args)...); - __dest.__s.__ptr = __hold.release(); - __dest.__h = &_LargeHandler::__handle; + __dest.__s_.__ptr = __hold.release(); + __dest.__h_ = &_LargeHandler::__handle; return *__ret; } @@ -482,22 +482,22 @@ typedef allocator<_Tp> _Alloc; typedef allocator_traits<_Alloc> _ATraits; _Alloc __a; - _Tp * __p = static_cast<_Tp *>(__this.__s.__ptr); + _Tp * __p = static_cast<_Tp *>(__this.__s_.__ptr); _ATraits::destroy(__a, __p); _ATraits::deallocate(__a, __p, 1); - __this.__h = nullptr; + __this.__h_ = nullptr; } _LIBCPP_INLINE_VISIBILITY static void __copy(any const & __this, any & __dest) { - _LargeHandler::__create(__dest, *static_cast<_Tp const *>(__this.__s.__ptr)); + _LargeHandler::__create(__dest, *static_cast<_Tp const *>(__this.__s_.__ptr)); } _LIBCPP_INLINE_VISIBILITY static void __move(any & __this, any & __dest) { - __dest.__s.__ptr = __this.__s.__ptr; - __dest.__h = &_LargeHandler::__handle; - __this.__h = nullptr; + __dest.__s_.__ptr = __this.__s_.__ptr; + __dest.__h_ = &_LargeHandler::__handle; + __this.__h_ = nullptr; } _LIBCPP_INLINE_VISIBILITY @@ -505,7 +505,7 @@ void const* __fallback_info) { if (__any_imp::__compare_typeid<_Tp>(__info, __fallback_info)) - return static_cast(__this.__s.__ptr); + return static_cast(__this.__s_.__ptr); return nullptr; } @@ -525,7 +525,7 @@ template -any::any(_ValueType && __v) : __h(nullptr) +any::any(_ValueType && __v) : __h_(nullptr) { __any_imp::_Handler<_Tp>::__create(*this, _VSTD::forward<_ValueType>(__v)); } @@ -567,16 +567,16 @@ { if (this == &__rhs) return; - if (__h && __rhs.__h) { + if (__h_ && __rhs.__h_) { any __tmp; __rhs.__call(_Action::_Move, &__tmp); this->__call(_Action::_Move, &__rhs); __tmp.__call(_Action::_Move, this); } - else if (__h) { + else if (__h_) { this->__call(_Action::_Move, &__rhs); } - else if (__rhs.__h) { + else if (__rhs.__h_) { __rhs.__call(_Action::_Move, this); } } @@ -677,7 +677,7 @@ static_assert(!is_reference<_ValueType>::value, "_ValueType may not be a reference."); typedef typename add_pointer<_ValueType>::type _ReturnType; - if (__any && __any->__h) { + if (__any && __any->__h_) { void *__p = __any->__call(_Action::_Get, nullptr, #if !defined(_LIBCPP_NO_RTTI) &typeid(_ValueType), diff --git a/libcxx/include/barrier b/libcxx/include/barrier --- a/libcxx/include/barrier +++ b/libcxx/include/barrier @@ -283,7 +283,7 @@ template class barrier { - __barrier_base<_CompletionF> __b; + __barrier_base<_CompletionF> __b_; public: using arrival_token = typename __barrier_base<_CompletionF>::arrival_token; @@ -293,7 +293,7 @@ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY barrier(ptrdiff_t __count, _CompletionF __completion = _CompletionF()) - : __b(__count, _VSTD::move(__completion)) { + : __b_(__count, _VSTD::move(__completion)) { } barrier(barrier const&) = delete; @@ -302,12 +302,12 @@ [[nodiscard]] _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY arrival_token arrive(ptrdiff_t __update = 1) { - return __b.arrive(__update); + return __b_.arrive(__update); } _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY void wait(arrival_token&& __phase) const { - __b.wait(_VSTD::move(__phase)); + __b_.wait(_VSTD::move(__phase)); } _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY void arrive_and_wait() @@ -317,7 +317,7 @@ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY void arrive_and_drop() { - __b.arrive_and_drop(); + __b_.arrive_and_drop(); } }; diff --git a/libcxx/include/codecvt b/libcxx/include/codecvt --- a/libcxx/include/codecvt +++ b/libcxx/include/codecvt @@ -81,9 +81,9 @@ class _LIBCPP_TYPE_VIS __codecvt_utf8 : public codecvt { - unsigned long _Maxcode_; + unsigned long __maxcode_; _LIBCPP_SUPPRESS_DEPRECATED_PUSH - codecvt_mode _Mode_; + codecvt_mode __mode_; _LIBCPP_SUPPRESS_DEPRECATED_POP public: typedef wchar_t intern_type; @@ -94,8 +94,8 @@ _LIBCPP_INLINE_VISIBILITY explicit __codecvt_utf8(size_t __refs, unsigned long __maxcode, codecvt_mode __mode) - : codecvt(__refs), _Maxcode_(__maxcode), - _Mode_(__mode) {} + : codecvt(__refs), __maxcode_(__maxcode), + __mode_(__mode) {} _LIBCPP_SUPPRESS_DEPRECATED_POP protected: virtual result @@ -122,8 +122,8 @@ class _LIBCPP_TYPE_VIS __codecvt_utf8 : public codecvt { - unsigned long _Maxcode_; - codecvt_mode _Mode_; + unsigned long __maxcode_; + codecvt_mode __mode_; public: typedef char16_t intern_type; typedef char extern_type; @@ -132,8 +132,8 @@ _LIBCPP_INLINE_VISIBILITY explicit __codecvt_utf8(size_t __refs, unsigned long __maxcode, codecvt_mode __mode) - : codecvt(__refs), _Maxcode_(__maxcode), - _Mode_(__mode) {} + : codecvt(__refs), __maxcode_(__maxcode), + __mode_(__mode) {} _LIBCPP_SUPPRESS_DEPRECATED_POP protected: @@ -160,8 +160,8 @@ class _LIBCPP_TYPE_VIS __codecvt_utf8 : public codecvt { - unsigned long _Maxcode_; - codecvt_mode _Mode_; + unsigned long __maxcode_; + codecvt_mode __mode_; public: typedef char32_t intern_type; typedef char extern_type; @@ -170,8 +170,8 @@ _LIBCPP_INLINE_VISIBILITY explicit __codecvt_utf8(size_t __refs, unsigned long __maxcode, codecvt_mode __mode) - : codecvt(__refs), _Maxcode_(__maxcode), - _Mode_(__mode) {} + : codecvt(__refs), __maxcode_(__maxcode), + __mode_(__mode) {} _LIBCPP_SUPPRESS_DEPRECATED_POP protected: @@ -218,9 +218,9 @@ class _LIBCPP_TYPE_VIS __codecvt_utf16 : public codecvt { - unsigned long _Maxcode_; + unsigned long __maxcode_; _LIBCPP_SUPPRESS_DEPRECATED_PUSH - codecvt_mode _Mode_; + codecvt_mode __mode_; _LIBCPP_SUPPRESS_DEPRECATED_POP public: typedef wchar_t intern_type; @@ -231,8 +231,8 @@ _LIBCPP_INLINE_VISIBILITY explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode) - : codecvt(__refs), _Maxcode_(__maxcode), - _Mode_(__mode) {} + : codecvt(__refs), __maxcode_(__maxcode), + __mode_(__mode) {} _LIBCPP_SUPPRESS_DEPRECATED_POP protected: virtual result @@ -257,9 +257,9 @@ class _LIBCPP_TYPE_VIS __codecvt_utf16 : public codecvt { - unsigned long _Maxcode_; + unsigned long __maxcode_; _LIBCPP_SUPPRESS_DEPRECATED_PUSH - codecvt_mode _Mode_; + codecvt_mode __mode_; _LIBCPP_SUPPRESS_DEPRECATED_POP public: typedef wchar_t intern_type; @@ -270,8 +270,8 @@ _LIBCPP_INLINE_VISIBILITY explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode) - : codecvt(__refs), _Maxcode_(__maxcode), - _Mode_(__mode) {} + : codecvt(__refs), __maxcode_(__maxcode), + __mode_(__mode) {} _LIBCPP_SUPPRESS_DEPRECATED_POP protected: virtual result @@ -298,8 +298,8 @@ class _LIBCPP_TYPE_VIS __codecvt_utf16 : public codecvt { - unsigned long _Maxcode_; - codecvt_mode _Mode_; + unsigned long __maxcode_; + codecvt_mode __mode_; public: typedef char16_t intern_type; typedef char extern_type; @@ -308,8 +308,8 @@ _LIBCPP_INLINE_VISIBILITY explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode) - : codecvt(__refs), _Maxcode_(__maxcode), - _Mode_(__mode) {} + : codecvt(__refs), __maxcode_(__maxcode), + __mode_(__mode) {} _LIBCPP_SUPPRESS_DEPRECATED_POP protected: @@ -336,8 +336,8 @@ class _LIBCPP_TYPE_VIS __codecvt_utf16 : public codecvt { - unsigned long _Maxcode_; - codecvt_mode _Mode_; + unsigned long __maxcode_; + codecvt_mode __mode_; public: typedef char16_t intern_type; typedef char extern_type; @@ -346,8 +346,8 @@ _LIBCPP_INLINE_VISIBILITY explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode) - : codecvt(__refs), _Maxcode_(__maxcode), - _Mode_(__mode) {} + : codecvt(__refs), __maxcode_(__maxcode), + __mode_(__mode) {} _LIBCPP_SUPPRESS_DEPRECATED_POP protected: @@ -374,8 +374,8 @@ class _LIBCPP_TYPE_VIS __codecvt_utf16 : public codecvt { - unsigned long _Maxcode_; - codecvt_mode _Mode_; + unsigned long __maxcode_; + codecvt_mode __mode_; public: typedef char32_t intern_type; typedef char extern_type; @@ -384,8 +384,8 @@ _LIBCPP_INLINE_VISIBILITY explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode) - : codecvt(__refs), _Maxcode_(__maxcode), - _Mode_(__mode) {} + : codecvt(__refs), __maxcode_(__maxcode), + __mode_(__mode) {} _LIBCPP_SUPPRESS_DEPRECATED_POP protected: @@ -412,8 +412,8 @@ class _LIBCPP_TYPE_VIS __codecvt_utf16 : public codecvt { - unsigned long _Maxcode_; - codecvt_mode _Mode_; + unsigned long __maxcode_; + codecvt_mode __mode_; public: typedef char32_t intern_type; typedef char extern_type; @@ -422,8 +422,8 @@ _LIBCPP_INLINE_VISIBILITY explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode) - : codecvt(__refs), _Maxcode_(__maxcode), - _Mode_(__mode) {} + : codecvt(__refs), __maxcode_(__maxcode), + __mode_(__mode) {} _LIBCPP_SUPPRESS_DEPRECATED_POP protected: @@ -470,9 +470,9 @@ class _LIBCPP_TYPE_VIS __codecvt_utf8_utf16 : public codecvt { - unsigned long _Maxcode_; + unsigned long __maxcode_; _LIBCPP_SUPPRESS_DEPRECATED_PUSH - codecvt_mode _Mode_; + codecvt_mode __mode_; _LIBCPP_SUPPRESS_DEPRECATED_POP public: typedef wchar_t intern_type; @@ -483,8 +483,8 @@ _LIBCPP_INLINE_VISIBILITY explicit __codecvt_utf8_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode) - : codecvt(__refs), _Maxcode_(__maxcode), - _Mode_(__mode) {} + : codecvt(__refs), __maxcode_(__maxcode), + __mode_(__mode) {} _LIBCPP_SUPPRESS_DEPRECATED_POP protected: virtual result @@ -511,8 +511,8 @@ class _LIBCPP_TYPE_VIS __codecvt_utf8_utf16 : public codecvt { - unsigned long _Maxcode_; - codecvt_mode _Mode_; + unsigned long __maxcode_; + codecvt_mode __mode_; public: typedef char32_t intern_type; typedef char extern_type; @@ -521,8 +521,8 @@ _LIBCPP_INLINE_VISIBILITY explicit __codecvt_utf8_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode) - : codecvt(__refs), _Maxcode_(__maxcode), - _Mode_(__mode) {} + : codecvt(__refs), __maxcode_(__maxcode), + __mode_(__mode) {} _LIBCPP_SUPPRESS_DEPRECATED_POP protected: @@ -549,8 +549,8 @@ class _LIBCPP_TYPE_VIS __codecvt_utf8_utf16 : public codecvt { - unsigned long _Maxcode_; - codecvt_mode _Mode_; + unsigned long __maxcode_; + codecvt_mode __mode_; public: typedef char16_t intern_type; typedef char extern_type; @@ -559,8 +559,8 @@ _LIBCPP_INLINE_VISIBILITY explicit __codecvt_utf8_utf16(size_t __refs, unsigned long __maxcode, codecvt_mode __mode) - : codecvt(__refs), _Maxcode_(__maxcode), - _Mode_(__mode) {} + : codecvt(__refs), __maxcode_(__maxcode), + __mode_(__mode) {} _LIBCPP_SUPPRESS_DEPRECATED_POP protected: diff --git a/libcxx/include/experimental/functional b/libcxx/include/experimental/functional --- a/libcxx/include/experimental/functional +++ b/libcxx/include/experimental/functional @@ -132,24 +132,24 @@ typedef _Key key_type; const _Value __default_value_; - std::unordered_map<_Key, _Value, _Hash, _BinaryPredicate> __table; + std::unordered_map<_Key, _Value, _Hash, _BinaryPredicate> __table_; public: _LIBCPP_INLINE_VISIBILITY _BMSkipTable(size_t __sz, _Value __default, _Hash __hf, _BinaryPredicate __pred) - : __default_value_(__default), __table(__sz, __hf, __pred) {} + : __default_value_(__default), __table_(__sz, __hf, __pred) {} _LIBCPP_INLINE_VISIBILITY void insert(const key_type &__key, value_type __val) { - __table [__key] = __val; // Would skip_.insert (val) be better here? + __table_ [__key] = __val; // Would skip_.insert (val) be better here? } _LIBCPP_INLINE_VISIBILITY value_type operator [](const key_type & __key) const { - auto __it = __table.find (__key); - return __it == __table.end() ? __default_value_ : __it->second; + auto __it = __table_.find (__key); + return __it == __table_.end() ? __default_value_ : __it->second; } }; @@ -163,25 +163,25 @@ typedef typename make_unsigned::type unsigned_key_type; typedef std::array skip_map; - skip_map __table; + skip_map __table_; public: _LIBCPP_INLINE_VISIBILITY _BMSkipTable(size_t /*__sz*/, _Value __default, _Hash /*__hf*/, _BinaryPredicate /*__pred*/) { - std::fill_n(__table.begin(), __table.size(), __default); + std::fill_n(__table_.begin(), __table_.size(), __default); } _LIBCPP_INLINE_VISIBILITY void insert(key_type __key, value_type __val) { - __table[static_cast(__key)] = __val; + __table_[static_cast(__key)] = __val; } _LIBCPP_INLINE_VISIBILITY value_type operator [](key_type __key) const { - return __table[static_cast(__key)]; + return __table_[static_cast(__key)]; } }; diff --git a/libcxx/include/experimental/iterator b/libcxx/include/experimental/iterator --- a/libcxx/include/experimental/iterator +++ b/libcxx/include/experimental/iterator @@ -82,19 +82,19 @@ typedef void reference; ostream_joiner(ostream_type& __os, _Delim&& __d) - : __output_iter(_VSTD::addressof(__os)), __delim(_VSTD::move(__d)), __first(true) {} + : __output_iter_(_VSTD::addressof(__os)), __delim_(_VSTD::move(__d)), __first_(true) {} ostream_joiner(ostream_type& __os, const _Delim& __d) - : __output_iter(_VSTD::addressof(__os)), __delim(__d), __first(true) {} + : __output_iter_(_VSTD::addressof(__os)), __delim_(__d), __first_(true) {} template ostream_joiner& operator=(const _Tp& __v) { - if (!__first) - *__output_iter << __delim; - __first = false; - *__output_iter << __v; + if (!__first_) + *__output_iter_ << __delim_; + __first_ = false; + *__output_iter_ << __v; return *this; } @@ -103,9 +103,9 @@ ostream_joiner& operator++(int) _NOEXCEPT { return *this; } private: - ostream_type* __output_iter; - _Delim __delim; - bool __first; + ostream_type* __output_iter_; + _Delim __delim_; + bool __first_; }; diff --git a/libcxx/include/latch b/libcxx/include/latch --- a/libcxx/include/latch +++ b/libcxx/include/latch @@ -64,7 +64,7 @@ class latch { - __atomic_base __a; + __atomic_base __a_; public: static constexpr ptrdiff_t max() noexcept { @@ -72,7 +72,7 @@ } inline _LIBCPP_INLINE_VISIBILITY - constexpr explicit latch(ptrdiff_t __expected) : __a(__expected) { } + constexpr explicit latch(ptrdiff_t __expected) : __a_(__expected) { } ~latch() = default; latch(const latch&) = delete; @@ -81,19 +81,19 @@ inline _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY void count_down(ptrdiff_t __update = 1) { - auto const __old = __a.fetch_sub(__update, memory_order_release); + auto const __old = __a_.fetch_sub(__update, memory_order_release); if(__old == __update) - __a.notify_all(); + __a_.notify_all(); } inline _LIBCPP_INLINE_VISIBILITY bool try_wait() const noexcept { - return 0 == __a.load(memory_order_acquire); + return 0 == __a_.load(memory_order_acquire); } inline _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY void wait() const { - __cxx_atomic_wait(&__a.__a_, [&]() -> bool { + __cxx_atomic_wait(&__a_.__a_, [&]() -> bool { return try_wait(); }); } diff --git a/libcxx/include/map b/libcxx/include/map --- a/libcxx/include/map +++ b/libcxx/include/map @@ -619,46 +619,46 @@ template class __map_value_compare<_Key, _CP, _Compare, false> { - _Compare comp; + _Compare __comp_; public: _LIBCPP_INLINE_VISIBILITY __map_value_compare() _NOEXCEPT_(is_nothrow_default_constructible<_Compare>::value) - : comp() {} + : __comp_() {} _LIBCPP_INLINE_VISIBILITY __map_value_compare(_Compare __c) _NOEXCEPT_(is_nothrow_copy_constructible<_Compare>::value) - : comp(__c) {} + : __comp_(__c) {} _LIBCPP_INLINE_VISIBILITY - const _Compare& key_comp() const _NOEXCEPT {return comp;} + const _Compare& key_comp() const _NOEXCEPT {return __comp_;} _LIBCPP_INLINE_VISIBILITY bool operator()(const _CP& __x, const _CP& __y) const - {return comp(__x.__get_value().first, __y.__get_value().first);} + {return __comp_(__x.__get_value().first, __y.__get_value().first);} _LIBCPP_INLINE_VISIBILITY bool operator()(const _CP& __x, const _Key& __y) const - {return comp(__x.__get_value().first, __y);} + {return __comp_(__x.__get_value().first, __y);} _LIBCPP_INLINE_VISIBILITY bool operator()(const _Key& __x, const _CP& __y) const - {return comp(__x, __y.__get_value().first);} + {return __comp_(__x, __y.__get_value().first);} void swap(__map_value_compare& __y) _NOEXCEPT_(__is_nothrow_swappable<_Compare>::value) { using _VSTD::swap; - swap(comp, __y.comp); + swap(__comp_, __y.__comp_); } #if _LIBCPP_STD_VER > 11 template _LIBCPP_INLINE_VISIBILITY bool operator()(const _K2& __x, const _CP& __y) const - {return comp(__x, __y.__get_value().first);} + {return __comp_(__x, __y.__get_value().first);} template _LIBCPP_INLINE_VISIBILITY bool operator()(const _CP& __x, const _K2& __y) const - {return comp(__x.__get_value().first, __y);} + {return __comp_(__x.__get_value().first, __y);} #endif }; @@ -738,14 +738,14 @@ typedef pair __nc_rref_pair_type; private: - value_type __cc; + value_type __cc_; public: _LIBCPP_INLINE_VISIBILITY value_type& __get_value() { #if _LIBCPP_STD_VER > 14 - return *_VSTD::launder(_VSTD::addressof(__cc)); + return *_VSTD::launder(_VSTD::addressof(__cc_)); #else return __cc; #endif @@ -755,7 +755,7 @@ const value_type& __get_value() const { #if _LIBCPP_STD_VER > 14 - return *_VSTD::launder(_VSTD::addressof(__cc)); + return *_VSTD::launder(_VSTD::addressof(__cc_)); #else return __cc; #endif diff --git a/libcxx/include/semaphore b/libcxx/include/semaphore --- a/libcxx/include/semaphore +++ b/libcxx/include/semaphore @@ -80,31 +80,31 @@ class __atomic_semaphore_base { - __atomic_base __a; + __atomic_base __a_; public: _LIBCPP_INLINE_VISIBILITY - constexpr explicit __atomic_semaphore_base(ptrdiff_t __count) : __a(__count) + constexpr explicit __atomic_semaphore_base(ptrdiff_t __count) : __a_(__count) { } _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY void release(ptrdiff_t __update = 1) { - if(0 < __a.fetch_add(__update, memory_order_release)) + if(0 < __a_.fetch_add(__update, memory_order_release)) ; else if(__update > 1) - __a.notify_all(); + __a_.notify_all(); else - __a.notify_one(); + __a_.notify_one(); } _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY void acquire() { auto const __test_fn = [this]() -> bool { - auto __old = __a.load(memory_order_relaxed); - return (__old != 0) && __a.compare_exchange_strong(__old, __old - 1, memory_order_acquire, memory_order_relaxed); + auto __old = __a_.load(memory_order_relaxed); + return (__old != 0) && __a_.compare_exchange_strong(__old, __old - 1, memory_order_acquire, memory_order_relaxed); }; - __cxx_atomic_wait(&__a.__a_, __test_fn); + __cxx_atomic_wait(&__a_.__a_, __test_fn); } template _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY @@ -118,11 +118,11 @@ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY bool try_acquire() { - auto __old = __a.load(memory_order_acquire); + auto __old = __a_.load(memory_order_acquire); while (true) { if (__old == 0) return false; - if (__a.compare_exchange_strong(__old, __old - 1, memory_order_acquire, memory_order_relaxed)) + if (__a_.compare_exchange_strong(__old, __old - 1, memory_order_acquire, memory_order_relaxed)) return true; } } @@ -133,7 +133,7 @@ template class counting_semaphore { - __atomic_semaphore_base __semaphore; + __atomic_semaphore_base __semaphore_; public: static constexpr ptrdiff_t max() noexcept { @@ -141,7 +141,7 @@ } _LIBCPP_INLINE_VISIBILITY - constexpr explicit counting_semaphore(ptrdiff_t __count) : __semaphore(__count) { } + constexpr explicit counting_semaphore(ptrdiff_t __count) : __semaphore_(__count) { } ~counting_semaphore() = default; counting_semaphore(const counting_semaphore&) = delete; @@ -150,23 +150,23 @@ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY void release(ptrdiff_t __update = 1) { - __semaphore.release(__update); + __semaphore_.release(__update); } _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY void acquire() { - __semaphore.acquire(); + __semaphore_.acquire(); } template _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY bool try_acquire_for(chrono::duration const& __rel_time) { - return __semaphore.try_acquire_for(chrono::duration_cast(__rel_time)); + return __semaphore_.try_acquire_for(chrono::duration_cast(__rel_time)); } _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY bool try_acquire() { - return __semaphore.try_acquire(); + return __semaphore_.try_acquire(); } template _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY diff --git a/libcxx/include/shared_mutex b/libcxx/include/shared_mutex --- a/libcxx/include/shared_mutex +++ b/libcxx/include/shared_mutex @@ -180,23 +180,23 @@ #if _LIBCPP_STD_VER > 14 class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_SHARED_MUTEX shared_mutex { - __shared_mutex_base __base; + __shared_mutex_base __base_; public: - _LIBCPP_INLINE_VISIBILITY shared_mutex() : __base() {} + _LIBCPP_INLINE_VISIBILITY shared_mutex() : __base_() {} _LIBCPP_INLINE_VISIBILITY ~shared_mutex() = default; shared_mutex(const shared_mutex&) = delete; shared_mutex& operator=(const shared_mutex&) = delete; // Exclusive ownership - _LIBCPP_INLINE_VISIBILITY void lock() { return __base.lock(); } - _LIBCPP_INLINE_VISIBILITY bool try_lock() { return __base.try_lock(); } - _LIBCPP_INLINE_VISIBILITY void unlock() { return __base.unlock(); } + _LIBCPP_INLINE_VISIBILITY void lock() { return __base_.lock(); } + _LIBCPP_INLINE_VISIBILITY bool try_lock() { return __base_.try_lock(); } + _LIBCPP_INLINE_VISIBILITY void unlock() { return __base_.unlock(); } // Shared ownership - _LIBCPP_INLINE_VISIBILITY void lock_shared() { return __base.lock_shared(); } - _LIBCPP_INLINE_VISIBILITY bool try_lock_shared() { return __base.try_lock_shared(); } - _LIBCPP_INLINE_VISIBILITY void unlock_shared() { return __base.unlock_shared(); } + _LIBCPP_INLINE_VISIBILITY void lock_shared() { return __base_.lock_shared(); } + _LIBCPP_INLINE_VISIBILITY bool try_lock_shared() { return __base_.try_lock_shared(); } + _LIBCPP_INLINE_VISIBILITY void unlock_shared() { return __base_.unlock_shared(); } // typedef __shared_mutex_base::native_handle_type native_handle_type; // _LIBCPP_INLINE_VISIBILITY native_handle_type native_handle() { return __base::unlock_shared(); } @@ -206,7 +206,7 @@ class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_SHARED_MUTEX shared_timed_mutex { - __shared_mutex_base __base; + __shared_mutex_base __base_; public: shared_timed_mutex(); _LIBCPP_INLINE_VISIBILITY ~shared_timed_mutex() = default; @@ -252,30 +252,30 @@ shared_timed_mutex::try_lock_until( const chrono::time_point<_Clock, _Duration>& __abs_time) { - unique_lock __lk(__base.__mut_); - if (__base.__state_ & __base.__write_entered_) + unique_lock __lk(__base_.__mut_); + if (__base_.__state_ & __base_.__write_entered_) { while (true) { - cv_status __status = __base.__gate1_.wait_until(__lk, __abs_time); - if ((__base.__state_ & __base.__write_entered_) == 0) + cv_status __status = __base_.__gate1_.wait_until(__lk, __abs_time); + if ((__base_.__state_ & __base_.__write_entered_) == 0) break; if (__status == cv_status::timeout) return false; } } - __base.__state_ |= __base.__write_entered_; - if (__base.__state_ & __base.__n_readers_) + __base_.__state_ |= __base_.__write_entered_; + if (__base_.__state_ & __base_.__n_readers_) { while (true) { - cv_status __status = __base.__gate2_.wait_until(__lk, __abs_time); - if ((__base.__state_ & __base.__n_readers_) == 0) + cv_status __status = __base_.__gate2_.wait_until(__lk, __abs_time); + if ((__base_.__state_ & __base_.__n_readers_) == 0) break; if (__status == cv_status::timeout) { - __base.__state_ &= ~__base.__write_entered_; - __base.__gate1_.notify_all(); + __base_.__state_ &= ~__base_.__write_entered_; + __base_.__gate1_.notify_all(); return false; } } @@ -288,22 +288,22 @@ shared_timed_mutex::try_lock_shared_until( const chrono::time_point<_Clock, _Duration>& __abs_time) { - unique_lock __lk(__base.__mut_); - if ((__base.__state_ & __base.__write_entered_) || (__base.__state_ & __base.__n_readers_) == __base.__n_readers_) + unique_lock __lk(__base_.__mut_); + if ((__base_.__state_ & __base_.__write_entered_) || (__base_.__state_ & __base_.__n_readers_) == __base_.__n_readers_) { while (true) { - cv_status status = __base.__gate1_.wait_until(__lk, __abs_time); - if ((__base.__state_ & __base.__write_entered_) == 0 && - (__base.__state_ & __base.__n_readers_) < __base.__n_readers_) + cv_status status = __base_.__gate1_.wait_until(__lk, __abs_time); + if ((__base_.__state_ & __base_.__write_entered_) == 0 && + (__base_.__state_ & __base_.__n_readers_) < __base_.__n_readers_) break; if (status == cv_status::timeout) return false; } } - unsigned __num_readers = (__base.__state_ & __base.__n_readers_) + 1; - __base.__state_ &= ~__base.__n_readers_; - __base.__state_ |= __num_readers; + unsigned __num_readers = (__base_.__state_ & __base_.__n_readers_) + 1; + __base_.__state_ &= ~__base_.__n_readers_; + __base_.__state_ |= __num_readers; return true; } diff --git a/libcxx/include/span b/libcxx/include/span --- a/libcxx/include/span +++ b/libcxx/include/span @@ -245,7 +245,7 @@ // [span.cons], span constructors, copy, assignment, and destructor template requires(_Sz == 0) - _LIBCPP_INLINE_VISIBILITY constexpr span() noexcept : __data{nullptr} {} + _LIBCPP_INLINE_VISIBILITY constexpr span() noexcept : __data_{nullptr} {} constexpr span (const span&) noexcept = default; constexpr span& operator=(const span&) noexcept = default; @@ -253,30 +253,30 @@ template <__span_compatible_iterator _It> _LIBCPP_INLINE_VISIBILITY constexpr explicit span(_It __first, size_type __count) - : __data{_VSTD::to_address(__first)} { + : __data_{_VSTD::to_address(__first)} { (void)__count; _LIBCPP_ASSERT(_Extent == __count, "size mismatch in span's constructor (iterator, len)"); } template <__span_compatible_iterator _It, __span_compatible_sentinel_for<_It> _End> _LIBCPP_INLINE_VISIBILITY - constexpr explicit span(_It __first, _End __last) : __data{_VSTD::to_address(__first)} { + constexpr explicit span(_It __first, _End __last) : __data_{_VSTD::to_address(__first)} { (void)__last; _LIBCPP_ASSERT((__last - __first >= 0), "invalid range in span's constructor (iterator, sentinel)"); _LIBCPP_ASSERT(__last - __first == _Extent, "invalid range in span's constructor (iterator, sentinel): last - first != extent"); } - _LIBCPP_INLINE_VISIBILITY constexpr span(type_identity_t (&__arr)[_Extent]) noexcept : __data{__arr} {} + _LIBCPP_INLINE_VISIBILITY constexpr span(type_identity_t (&__arr)[_Extent]) noexcept : __data_{__arr} {} template <__span_array_convertible _OtherElementType> _LIBCPP_INLINE_VISIBILITY - constexpr span(array<_OtherElementType, _Extent>& __arr) noexcept : __data{__arr.data()} {} + constexpr span(array<_OtherElementType, _Extent>& __arr) noexcept : __data_{__arr.data()} {} template requires __span_array_convertible _LIBCPP_INLINE_VISIBILITY - constexpr span(const array<_OtherElementType, _Extent>& __arr) noexcept : __data{__arr.data()} {} + constexpr span(const array<_OtherElementType, _Extent>& __arr) noexcept : __data_{__arr.data()} {} #if defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) template @@ -294,7 +294,7 @@ #else template <__span_compatible_range _Range> _LIBCPP_INLINE_VISIBILITY - constexpr explicit span(_Range&& __r) : __data{ranges::data(__r)} { + constexpr explicit span(_Range&& __r) : __data_{ranges::data(__r)} { _LIBCPP_ASSERT(ranges::size(__r) == _Extent, "size mismatch in span's constructor (range)"); } #endif @@ -302,12 +302,12 @@ template <__span_array_convertible _OtherElementType> _LIBCPP_INLINE_VISIBILITY constexpr span(const span<_OtherElementType, _Extent>& __other) - : __data{__other.data()} {} + : __data_{__other.data()} {} template <__span_array_convertible _OtherElementType> _LIBCPP_INLINE_VISIBILITY constexpr explicit span(const span<_OtherElementType, dynamic_extent>& __other) noexcept - : __data{__other.data()} { _LIBCPP_ASSERT(_Extent == __other.size(), "size mismatch in span's constructor (other span)"); } + : __data_{__other.data()} { _LIBCPP_ASSERT(_Extent == __other.size(), "size mismatch in span's constructor (other span)"); } // ~span() noexcept = default; @@ -374,22 +374,22 @@ _LIBCPP_INLINE_VISIBILITY constexpr reference operator[](size_type __idx) const noexcept { _LIBCPP_ASSERT(__idx < size(), "span::operator[](index): index out of range"); - return __data[__idx]; + return __data_[__idx]; } _LIBCPP_INLINE_VISIBILITY constexpr reference front() const noexcept { _LIBCPP_ASSERT(!empty(), "span::front() on empty span"); - return __data[0]; + return __data_[0]; } _LIBCPP_INLINE_VISIBILITY constexpr reference back() const noexcept { _LIBCPP_ASSERT(!empty(), "span::back() on empty span"); - return __data[size()-1]; + return __data_[size()-1]; } - _LIBCPP_INLINE_VISIBILITY constexpr pointer data() const noexcept { return __data; } + _LIBCPP_INLINE_VISIBILITY constexpr pointer data() const noexcept { return __data_; } // [span.iter], span iterator support _LIBCPP_INLINE_VISIBILITY constexpr iterator begin() const noexcept { @@ -416,7 +416,7 @@ { return span{reinterpret_cast(data()), size_bytes()}; } private: - pointer __data; + pointer __data_; }; @@ -442,7 +442,7 @@ static constexpr size_type extent = dynamic_extent; // [span.cons], span constructors, copy, assignment, and destructor - _LIBCPP_INLINE_VISIBILITY constexpr span() noexcept : __data{nullptr}, __size{0} {} + _LIBCPP_INLINE_VISIBILITY constexpr span() noexcept : __data_{nullptr}, __size_{0} {} constexpr span (const span&) noexcept = default; constexpr span& operator=(const span&) noexcept = default; @@ -450,25 +450,25 @@ template <__span_compatible_iterator _It> _LIBCPP_INLINE_VISIBILITY constexpr span(_It __first, size_type __count) - : __data{_VSTD::to_address(__first)}, __size{__count} {} + : __data_{_VSTD::to_address(__first)}, __size_{__count} {} template <__span_compatible_iterator _It, __span_compatible_sentinel_for<_It> _End> _LIBCPP_INLINE_VISIBILITY constexpr span(_It __first, _End __last) - : __data(_VSTD::to_address(__first)), __size(__last - __first) {} + : __data_(_VSTD::to_address(__first)), __size_(__last - __first) {} template _LIBCPP_INLINE_VISIBILITY - constexpr span(type_identity_t (&__arr)[_Sz]) noexcept : __data{__arr}, __size{_Sz} {} + constexpr span(type_identity_t (&__arr)[_Sz]) noexcept : __data_{__arr}, __size_{_Sz} {} template <__span_array_convertible _OtherElementType, size_t _Sz> _LIBCPP_INLINE_VISIBILITY - constexpr span(array<_OtherElementType, _Sz>& __arr) noexcept : __data{__arr.data()}, __size{_Sz} {} + constexpr span(array<_OtherElementType, _Sz>& __arr) noexcept : __data_{__arr.data()}, __size_{_Sz} {} template requires __span_array_convertible _LIBCPP_INLINE_VISIBILITY - constexpr span(const array<_OtherElementType, _Sz>& __arr) noexcept : __data{__arr.data()}, __size{_Sz} {} + constexpr span(const array<_OtherElementType, _Sz>& __arr) noexcept : __data_{__arr.data()}, __size_{_Sz} {} #if defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) template @@ -482,13 +482,13 @@ #else template <__span_compatible_range _Range> _LIBCPP_INLINE_VISIBILITY - constexpr span(_Range&& __r) : __data(ranges::data(__r)), __size{ranges::size(__r)} {} + constexpr span(_Range&& __r) : __data_(ranges::data(__r)), __size_{ranges::size(__r)} {} #endif template <__span_array_convertible _OtherElementType, size_t _OtherExtent> _LIBCPP_INLINE_VISIBILITY constexpr span(const span<_OtherElementType, _OtherExtent>& __other) noexcept - : __data{__other.data()}, __size{__other.size()} {} + : __data_{__other.data()}, __size_{__other.size()} {} // ~span() noexcept = default; @@ -543,30 +543,30 @@ return {data() + __offset, __count}; } - _LIBCPP_INLINE_VISIBILITY constexpr size_type size() const noexcept { return __size; } - _LIBCPP_INLINE_VISIBILITY constexpr size_type size_bytes() const noexcept { return __size * sizeof(element_type); } - [[nodiscard]] _LIBCPP_INLINE_VISIBILITY constexpr bool empty() const noexcept { return __size == 0; } + _LIBCPP_INLINE_VISIBILITY constexpr size_type size() const noexcept { return __size_; } + _LIBCPP_INLINE_VISIBILITY constexpr size_type size_bytes() const noexcept { return __size_ * sizeof(element_type); } + [[nodiscard]] _LIBCPP_INLINE_VISIBILITY constexpr bool empty() const noexcept { return __size_ == 0; } _LIBCPP_INLINE_VISIBILITY constexpr reference operator[](size_type __idx) const noexcept { _LIBCPP_ASSERT(__idx < size(), "span::operator[](index): index out of range"); - return __data[__idx]; + return __data_[__idx]; } _LIBCPP_INLINE_VISIBILITY constexpr reference front() const noexcept { _LIBCPP_ASSERT(!empty(), "span::front() on empty span"); - return __data[0]; + return __data_[0]; } _LIBCPP_INLINE_VISIBILITY constexpr reference back() const noexcept { _LIBCPP_ASSERT(!empty(), "span::back() on empty span"); - return __data[size()-1]; + return __data_[size()-1]; } - _LIBCPP_INLINE_VISIBILITY constexpr pointer data() const noexcept { return __data; } + _LIBCPP_INLINE_VISIBILITY constexpr pointer data() const noexcept { return __data_; } // [span.iter], span iterator support _LIBCPP_INLINE_VISIBILITY constexpr iterator begin() const noexcept { @@ -593,8 +593,8 @@ { return {reinterpret_cast(data()), size_bytes()}; } private: - pointer __data; - size_type __size; + pointer __data_; + size_type __size_; }; template diff --git a/libcxx/include/string_view b/libcxx/include/string_view --- a/libcxx/include/string_view +++ b/libcxx/include/string_view @@ -289,7 +289,7 @@ // [string.view.cons], construct/copy _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY - basic_string_view() _NOEXCEPT : __data (nullptr), __size(0) {} + basic_string_view() _NOEXCEPT : __data_ (nullptr), __size_(0) {} _LIBCPP_INLINE_VISIBILITY basic_string_view(const basic_string_view&) _NOEXCEPT = default; @@ -299,7 +299,7 @@ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY basic_string_view(const _CharT* __s, size_type __len) _NOEXCEPT - : __data(__s), __size(__len) + : __data_(__s), __size_(__len) { #if _LIBCPP_STD_VER > 11 _LIBCPP_ASSERT(__len == 0 || __s != nullptr, "string_view::string_view(_CharT *, size_t): received nullptr"); @@ -310,7 +310,7 @@ template _End> requires (is_same_v, _CharT> && !is_convertible_v<_End, size_type>) constexpr _LIBCPP_HIDE_FROM_ABI basic_string_view(_It __begin, _End __end) - : __data(_VSTD::to_address(__begin)), __size(__end - __begin) + : __data_(_VSTD::to_address(__begin)), __size_(__end - __begin) { _LIBCPP_ASSERT((__end - __begin) >= 0, "std::string_view::string_view(iterator, sentinel) received invalid range"); } @@ -332,12 +332,12 @@ } || is_same_v::traits_type, _Traits>) ) constexpr _LIBCPP_HIDE_FROM_ABI - basic_string_view(_Range&& __r) : __data(ranges::data(__r)), __size(ranges::size(__r)) {} + basic_string_view(_Range&& __r) : __data_(ranges::data(__r)), __size_(ranges::size(__r)) {} #endif // _LIBCPP_STD_VER > 20 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY basic_string_view(const _CharT* __s) - : __data(__s), __size(_VSTD::__char_traits_length_checked<_Traits>(__s)) {} + : __data_(__s), __size_(_VSTD::__char_traits_length_checked<_Traits>(__s)) {} #if _LIBCPP_STD_VER > 20 basic_string_view(nullptr_t) = delete; @@ -351,10 +351,10 @@ const_iterator end() const _NOEXCEPT { return cend(); } _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY - const_iterator cbegin() const _NOEXCEPT { return __data; } + const_iterator cbegin() const _NOEXCEPT { return __data_; } _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY - const_iterator cend() const _NOEXCEPT { return __data + __size; } + const_iterator cend() const _NOEXCEPT { return __data_ + __size_; } _LIBCPP_CONSTEXPR_AFTER_CXX14 _LIBCPP_INLINE_VISIBILITY const_reverse_iterator rbegin() const _NOEXCEPT { return const_reverse_iterator(cend()); } @@ -370,72 +370,72 @@ // [string.view.capacity], capacity _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY - size_type size() const _NOEXCEPT { return __size; } + size_type size() const _NOEXCEPT { return __size_; } _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY - size_type length() const _NOEXCEPT { return __size; } + size_type length() const _NOEXCEPT { return __size_; } _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY size_type max_size() const _NOEXCEPT { return numeric_limits::max() / sizeof(value_type); } _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR - bool empty() const _NOEXCEPT { return __size == 0; } + bool empty() const _NOEXCEPT { return __size_ == 0; } // [string.view.access], element access _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY const_reference operator[](size_type __pos) const _NOEXCEPT { - return _LIBCPP_ASSERT(__pos < size(), "string_view[] index out of bounds"), __data[__pos]; + return _LIBCPP_ASSERT(__pos < size(), "string_view[] index out of bounds"), __data_[__pos]; } _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY const_reference at(size_type __pos) const { return __pos >= size() - ? (__throw_out_of_range("string_view::at"), __data[0]) - : __data[__pos]; + ? (__throw_out_of_range("string_view::at"), __data_[0]) + : __data_[__pos]; } _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY const_reference front() const _NOEXCEPT { - return _LIBCPP_ASSERT(!empty(), "string_view::front(): string is empty"), __data[0]; + return _LIBCPP_ASSERT(!empty(), "string_view::front(): string is empty"), __data_[0]; } _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY const_reference back() const _NOEXCEPT { - return _LIBCPP_ASSERT(!empty(), "string_view::back(): string is empty"), __data[__size-1]; + return _LIBCPP_ASSERT(!empty(), "string_view::back(): string is empty"), __data_[__size_-1]; } _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY - const_pointer data() const _NOEXCEPT { return __data; } + const_pointer data() const _NOEXCEPT { return __data_; } // [string.view.modifiers], modifiers: _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY void remove_prefix(size_type __n) _NOEXCEPT { _LIBCPP_ASSERT(__n <= size(), "remove_prefix() can't remove more than size()"); - __data += __n; - __size -= __n; + __data_ += __n; + __size_ -= __n; } _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY void remove_suffix(size_type __n) _NOEXCEPT { _LIBCPP_ASSERT(__n <= size(), "remove_suffix() can't remove more than size()"); - __size -= __n; + __size_ -= __n; } _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY void swap(basic_string_view& __other) _NOEXCEPT { - const value_type *__p = __data; - __data = __other.__data; - __other.__data = __p; + const value_type *__p = __data_; + __data_ = __other.__data_; + __other.__data_ = __p; - size_type __sz = __size; - __size = __other.__size; - __other.__size = __sz; + size_type __sz = __size_; + __size_ = __other.__size_; + __other.__size_ = __sz; } _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 @@ -723,8 +723,8 @@ #endif private: - const value_type* __data; - size_type __size; + const value_type* __data_; + size_type __size_; }; #if _LIBCPP_STD_VER > 17 diff --git a/libcxx/include/unordered_map b/libcxx/include/unordered_map --- a/libcxx/include/unordered_map +++ b/libcxx/include/unordered_map @@ -822,14 +822,14 @@ typedef pair __nc_rref_pair_type; private: - value_type __cc; + value_type __cc_; public: _LIBCPP_INLINE_VISIBILITY value_type& __get_value() { #if _LIBCPP_STD_VER > 14 - return *_VSTD::launder(_VSTD::addressof(__cc)); + return *_VSTD::launder(_VSTD::addressof(__cc_)); #else return __cc; #endif @@ -839,7 +839,7 @@ const value_type& __get_value() const { #if _LIBCPP_STD_VER > 14 - return *_VSTD::launder(_VSTD::addressof(__cc)); + return *_VSTD::launder(_VSTD::addressof(__cc_)); #else return __cc; #endif diff --git a/libcxx/include/variant b/libcxx/include/variant --- a/libcxx/include/variant +++ b/libcxx/include/variant @@ -481,7 +481,7 @@ template inline _LIBCPP_INLINE_VISIBILITY static constexpr auto&& __get_alt(_Vp&& __v) { - return __base::__get_alt<_Ip>(_VSTD::forward<_Vp>(__v).__impl); + return __base::__get_alt<_Ip>(_VSTD::forward<_Vp>(__v).__impl_); } }; @@ -608,7 +608,7 @@ __visit_alt_at(size_t __index, _Visitor&& __visitor, _Vs&&... __vs) { return __base::__visit_alt_at(__index, _VSTD::forward<_Visitor>(__visitor), - _VSTD::forward<_Vs>(__vs).__impl...); + _VSTD::forward<_Vs>(__vs).__impl_...); } template @@ -617,7 +617,7 @@ _Vs&&... __vs) { return __base::__visit_alt( _VSTD::forward<_Visitor>(__visitor), - _VSTD::__as_variant(_VSTD::forward<_Vs>(__vs)).__impl...); + _VSTD::__as_variant(_VSTD::forward<_Vs>(__vs)).__impl_...); } template @@ -1300,7 +1300,7 @@ int> = 0> inline _LIBCPP_INLINE_VISIBILITY constexpr variant() noexcept(is_nothrow_default_constructible_v<__first_type>) - : __impl(in_place_index<0>) {} + : __impl_(in_place_index<0>) {} variant(const variant&) = default; variant(variant&&) = default; @@ -1317,7 +1317,7 @@ inline _LIBCPP_INLINE_VISIBILITY constexpr variant(_Arg&& __arg) noexcept( is_nothrow_constructible_v<_Tp, _Arg>) - : __impl(in_place_index<_Ip>, _VSTD::forward<_Arg>(__arg)) {} + : __impl_(in_place_index<_Ip>, _VSTD::forward<_Arg>(__arg)) {} template , @@ -1327,7 +1327,7 @@ explicit constexpr variant( in_place_index_t<_Ip>, _Args&&... __args) noexcept(is_nothrow_constructible_v<_Tp, _Args...>) - : __impl(in_place_index<_Ip>, _VSTD::forward<_Args>(__args)...) {} + : __impl_(in_place_index<_Ip>, _VSTD::forward<_Args>(__args)...) {} template < size_t _Ip, @@ -1343,7 +1343,7 @@ initializer_list<_Up> __il, _Args&&... __args) noexcept( is_nothrow_constructible_v<_Tp, initializer_list<_Up>&, _Args...>) - : __impl(in_place_index<_Ip>, __il, _VSTD::forward<_Args>(__args)...) {} + : __impl_(in_place_index<_Ip>, __il, _VSTD::forward<_Args>(__args)...) {} template < class _Tp, @@ -1354,7 +1354,7 @@ inline _LIBCPP_INLINE_VISIBILITY explicit constexpr variant(in_place_type_t<_Tp>, _Args&&... __args) noexcept( is_nothrow_constructible_v<_Tp, _Args...>) - : __impl(in_place_index<_Ip>, _VSTD::forward<_Args>(__args)...) {} + : __impl_(in_place_index<_Ip>, _VSTD::forward<_Args>(__args)...) {} template < class _Tp, @@ -1370,7 +1370,7 @@ initializer_list<_Up> __il, _Args&&... __args) noexcept( is_nothrow_constructible_v<_Tp, initializer_list< _Up>&, _Args...>) - : __impl(in_place_index<_Ip>, __il, _VSTD::forward<_Args>(__args)...) {} + : __impl_(in_place_index<_Ip>, __il, _VSTD::forward<_Args>(__args)...) {} ~variant() = default; @@ -1389,7 +1389,7 @@ variant& operator=(_Arg&& __arg) noexcept( is_nothrow_assignable_v<_Tp&, _Arg> && is_nothrow_constructible_v<_Tp, _Arg>) { - __impl.template __assign<_Ip>(_VSTD::forward<_Arg>(__arg)); + __impl_.template __assign<_Ip>(_VSTD::forward<_Arg>(__arg)); return *this; } @@ -1401,7 +1401,7 @@ enable_if_t, int> = 0> inline _LIBCPP_INLINE_VISIBILITY _Tp& emplace(_Args&&... __args) { - return __impl.template __emplace<_Ip>(_VSTD::forward<_Args>(__args)...); + return __impl_.template __emplace<_Ip>(_VSTD::forward<_Args>(__args)...); } template < @@ -1414,7 +1414,7 @@ int> = 0> inline _LIBCPP_INLINE_VISIBILITY _Tp& emplace(initializer_list<_Up> __il, _Args&&... __args) { - return __impl.template __emplace<_Ip>(__il, _VSTD::forward<_Args>(__args)...); + return __impl_.template __emplace<_Ip>(__il, _VSTD::forward<_Args>(__args)...); } template < @@ -1425,7 +1425,7 @@ enable_if_t, int> = 0> inline _LIBCPP_INLINE_VISIBILITY _Tp& emplace(_Args&&... __args) { - return __impl.template __emplace<_Ip>(_VSTD::forward<_Args>(__args)...); + return __impl_.template __emplace<_Ip>(_VSTD::forward<_Args>(__args)...); } template < @@ -1438,16 +1438,16 @@ int> = 0> inline _LIBCPP_INLINE_VISIBILITY _Tp& emplace(initializer_list<_Up> __il, _Args&&... __args) { - return __impl.template __emplace<_Ip>(__il, _VSTD::forward<_Args>(__args)...); + return __impl_.template __emplace<_Ip>(__il, _VSTD::forward<_Args>(__args)...); } inline _LIBCPP_INLINE_VISIBILITY constexpr bool valueless_by_exception() const noexcept { - return __impl.valueless_by_exception(); + return __impl_.valueless_by_exception(); } inline _LIBCPP_INLINE_VISIBILITY - constexpr size_t index() const noexcept { return __impl.index(); } + constexpr size_t index() const noexcept { return __impl_.index(); } template < bool _Dummy = true, @@ -1460,11 +1460,11 @@ void swap(variant& __that) noexcept( __all<(is_nothrow_move_constructible_v<_Types> && is_nothrow_swappable_v<_Types>)...>::value) { - __impl.__swap(__that.__impl); + __impl_.__swap(__that.__impl_); } private: - __variant_detail::__impl<_Types...> __impl; + __variant_detail::__impl<_Types...> __impl_; friend struct __variant_detail::__access::__variant; friend struct __variant_detail::__visitation::__variant; diff --git a/libcxx/src/locale.cpp b/libcxx/src/locale.cpp --- a/libcxx/src/locale.cpp +++ b/libcxx/src/locale.cpp @@ -739,25 +739,25 @@ collate_byname::collate_byname(const char* n, size_t refs) : collate(refs), - __l(newlocale(LC_ALL_MASK, n, 0)) + __l_(newlocale(LC_ALL_MASK, n, 0)) { - if (__l == 0) + if (__l_ == 0) __throw_runtime_error("collate_byname::collate_byname" " failed to construct for " + string(n)); } collate_byname::collate_byname(const string& name, size_t refs) : collate(refs), - __l(newlocale(LC_ALL_MASK, name.c_str(), 0)) + __l_(newlocale(LC_ALL_MASK, name.c_str(), 0)) { - if (__l == 0) + if (__l_ == 0) __throw_runtime_error("collate_byname::collate_byname" " failed to construct for " + name); } collate_byname::~collate_byname() { - freelocale(__l); + freelocale(__l_); } int @@ -766,7 +766,7 @@ { string_type lhs(__lo1, __hi1); string_type rhs(__lo2, __hi2); - int r = strcoll_l(lhs.c_str(), rhs.c_str(), __l); + int r = strcoll_l(lhs.c_str(), rhs.c_str(), __l_); if (r < 0) return -1; if (r > 0) @@ -778,8 +778,8 @@ collate_byname::do_transform(const char_type* lo, const char_type* hi) const { const string_type in(lo, hi); - string_type out(strxfrm_l(0, in.c_str(), 0, __l), char()); - strxfrm_l(const_cast(out.c_str()), in.c_str(), out.size()+1, __l); + string_type out(strxfrm_l(0, in.c_str(), 0, __l_), char()); + strxfrm_l(const_cast(out.c_str()), in.c_str(), out.size()+1, __l_); return out; } @@ -788,25 +788,25 @@ #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS collate_byname::collate_byname(const char* n, size_t refs) : collate(refs), - __l(newlocale(LC_ALL_MASK, n, 0)) + __l_(newlocale(LC_ALL_MASK, n, 0)) { - if (__l == 0) + if (__l_ == 0) __throw_runtime_error("collate_byname::collate_byname(size_t refs)" " failed to construct for " + string(n)); } collate_byname::collate_byname(const string& name, size_t refs) : collate(refs), - __l(newlocale(LC_ALL_MASK, name.c_str(), 0)) + __l_(newlocale(LC_ALL_MASK, name.c_str(), 0)) { - if (__l == 0) + if (__l_ == 0) __throw_runtime_error("collate_byname::collate_byname(size_t refs)" " failed to construct for " + name); } collate_byname::~collate_byname() { - freelocale(__l); + freelocale(__l_); } int @@ -815,7 +815,7 @@ { string_type lhs(__lo1, __hi1); string_type rhs(__lo2, __hi2); - int r = wcscoll_l(lhs.c_str(), rhs.c_str(), __l); + int r = wcscoll_l(lhs.c_str(), rhs.c_str(), __l_); if (r < 0) return -1; if (r > 0) @@ -827,8 +827,8 @@ collate_byname::do_transform(const char_type* lo, const char_type* hi) const { const string_type in(lo, hi); - string_type out(wcsxfrm_l(0, in.c_str(), 0, __l), wchar_t()); - wcsxfrm_l(const_cast(out.c_str()), in.c_str(), out.size()+1, __l); + string_type out(wcsxfrm_l(0, in.c_str(), 0, __l_), wchar_t()); + wcsxfrm_l(const_cast(out.c_str()), in.c_str(), out.size()+1, __l_); return out; } #endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS @@ -1286,52 +1286,52 @@ ctype_byname::ctype_byname(const char* name, size_t refs) : ctype(0, false, refs), - __l(newlocale(LC_ALL_MASK, name, 0)) + __l_(newlocale(LC_ALL_MASK, name, 0)) { - if (__l == 0) + if (__l_ == 0) __throw_runtime_error("ctype_byname::ctype_byname" " failed to construct for " + string(name)); } ctype_byname::ctype_byname(const string& name, size_t refs) : ctype(0, false, refs), - __l(newlocale(LC_ALL_MASK, name.c_str(), 0)) + __l_(newlocale(LC_ALL_MASK, name.c_str(), 0)) { - if (__l == 0) + if (__l_ == 0) __throw_runtime_error("ctype_byname::ctype_byname" " failed to construct for " + name); } ctype_byname::~ctype_byname() { - freelocale(__l); + freelocale(__l_); } char ctype_byname::do_toupper(char_type c) const { - return static_cast(toupper_l(static_cast(c), __l)); + return static_cast(toupper_l(static_cast(c), __l_)); } const char* ctype_byname::do_toupper(char_type* low, const char_type* high) const { for (; low != high; ++low) - *low = static_cast(toupper_l(static_cast(*low), __l)); + *low = static_cast(toupper_l(static_cast(*low), __l_)); return low; } char ctype_byname::do_tolower(char_type c) const { - return static_cast(tolower_l(static_cast(c), __l)); + return static_cast(tolower_l(static_cast(c), __l_)); } const char* ctype_byname::do_tolower(char_type* low, const char_type* high) const { for (; low != high; ++low) - *low = static_cast(tolower_l(static_cast(*low), __l)); + *low = static_cast(tolower_l(static_cast(*low), __l_)); return low; } @@ -1340,45 +1340,45 @@ #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ctype_byname::ctype_byname(const char* name, size_t refs) : ctype(refs), - __l(newlocale(LC_ALL_MASK, name, 0)) + __l_(newlocale(LC_ALL_MASK, name, 0)) { - if (__l == 0) + if (__l_ == 0) __throw_runtime_error("ctype_byname::ctype_byname" " failed to construct for " + string(name)); } ctype_byname::ctype_byname(const string& name, size_t refs) : ctype(refs), - __l(newlocale(LC_ALL_MASK, name.c_str(), 0)) + __l_(newlocale(LC_ALL_MASK, name.c_str(), 0)) { - if (__l == 0) + if (__l_ == 0) __throw_runtime_error("ctype_byname::ctype_byname" " failed to construct for " + name); } ctype_byname::~ctype_byname() { - freelocale(__l); + freelocale(__l_); } bool ctype_byname::do_is(mask m, char_type c) const { #ifdef _LIBCPP_WCTYPE_IS_MASK - return static_cast(iswctype_l(c, m, __l)); + return static_cast(iswctype_l(c, m, __l_)); #else bool result = false; wint_t ch = static_cast(c); - if ((m & space) == space) result |= (iswspace_l(ch, __l) != 0); - if ((m & print) == print) result |= (iswprint_l(ch, __l) != 0); - if ((m & cntrl) == cntrl) result |= (iswcntrl_l(ch, __l) != 0); - if ((m & upper) == upper) result |= (iswupper_l(ch, __l) != 0); - if ((m & lower) == lower) result |= (iswlower_l(ch, __l) != 0); - if ((m & alpha) == alpha) result |= (iswalpha_l(ch, __l) != 0); - if ((m & digit) == digit) result |= (iswdigit_l(ch, __l) != 0); - if ((m & punct) == punct) result |= (iswpunct_l(ch, __l) != 0); - if ((m & xdigit) == xdigit) result |= (iswxdigit_l(ch, __l) != 0); - if ((m & blank) == blank) result |= (iswblank_l(ch, __l) != 0); + if ((m & space) == space) result |= (iswspace_l(ch, __l_) != 0); + if ((m & print) == print) result |= (iswprint_l(ch, __l_) != 0); + if ((m & cntrl) == cntrl) result |= (iswcntrl_l(ch, __l_) != 0); + if ((m & upper) == upper) result |= (iswupper_l(ch, __l_) != 0); + if ((m & lower) == lower) result |= (iswlower_l(ch, __l_) != 0); + if ((m & alpha) == alpha) result |= (iswalpha_l(ch, __l_) != 0); + if ((m & digit) == digit) result |= (iswdigit_l(ch, __l_) != 0); + if ((m & punct) == punct) result |= (iswpunct_l(ch, __l_) != 0); + if ((m & xdigit) == xdigit) result |= (iswxdigit_l(ch, __l_) != 0); + if ((m & blank) == blank) result |= (iswblank_l(ch, __l_) != 0); return result; #endif } @@ -1394,32 +1394,32 @@ { *vec = 0; wint_t ch = static_cast(*low); - if (iswspace_l(ch, __l)) + if (iswspace_l(ch, __l_)) *vec |= space; #ifndef _LIBCPP_CTYPE_MASK_IS_COMPOSITE_PRINT - if (iswprint_l(ch, __l)) + if (iswprint_l(ch, __l_)) *vec |= print; #endif - if (iswcntrl_l(ch, __l)) + if (iswcntrl_l(ch, __l_)) *vec |= cntrl; - if (iswupper_l(ch, __l)) + if (iswupper_l(ch, __l_)) *vec |= upper; - if (iswlower_l(ch, __l)) + if (iswlower_l(ch, __l_)) *vec |= lower; #ifndef _LIBCPP_CTYPE_MASK_IS_COMPOSITE_ALPHA - if (iswalpha_l(ch, __l)) + if (iswalpha_l(ch, __l_)) *vec |= alpha; #endif - if (iswdigit_l(ch, __l)) + if (iswdigit_l(ch, __l_)) *vec |= digit; - if (iswpunct_l(ch, __l)) + if (iswpunct_l(ch, __l_)) *vec |= punct; #ifndef _LIBCPP_CTYPE_MASK_IS_COMPOSITE_XDIGIT - if (iswxdigit_l(ch, __l)) + if (iswxdigit_l(ch, __l_)) *vec |= xdigit; #endif #if !defined(__sun__) - if (iswblank_l(ch, __l)) + if (iswblank_l(ch, __l_)) *vec |= blank; #endif } @@ -1437,16 +1437,16 @@ break; #else wint_t ch = static_cast(*low); - if ((m & space) == space && iswspace_l(ch, __l)) break; - if ((m & print) == print && iswprint_l(ch, __l)) break; - if ((m & cntrl) == cntrl && iswcntrl_l(ch, __l)) break; - if ((m & upper) == upper && iswupper_l(ch, __l)) break; - if ((m & lower) == lower && iswlower_l(ch, __l)) break; - if ((m & alpha) == alpha && iswalpha_l(ch, __l)) break; - if ((m & digit) == digit && iswdigit_l(ch, __l)) break; - if ((m & punct) == punct && iswpunct_l(ch, __l)) break; - if ((m & xdigit) == xdigit && iswxdigit_l(ch, __l)) break; - if ((m & blank) == blank && iswblank_l(ch, __l)) break; + if ((m & space) == space && iswspace_l(ch, __l_)) break; + if ((m & print) == print && iswprint_l(ch, __l_)) break; + if ((m & cntrl) == cntrl && iswcntrl_l(ch, __l_)) break; + if ((m & upper) == upper && iswupper_l(ch, __l_)) break; + if ((m & lower) == lower && iswlower_l(ch, __l_)) break; + if ((m & alpha) == alpha && iswalpha_l(ch, __l_)) break; + if ((m & digit) == digit && iswdigit_l(ch, __l_)) break; + if ((m & punct) == punct && iswpunct_l(ch, __l_)) break; + if ((m & xdigit) == xdigit && iswxdigit_l(ch, __l_)) break; + if ((m & blank) == blank && iswblank_l(ch, __l_)) break; #endif } return low; @@ -1458,20 +1458,20 @@ for (; low != high; ++low) { #ifdef _LIBCPP_WCTYPE_IS_MASK - if (!iswctype_l(*low, m, __l)) + if (!iswctype_l(*low, m, __l_)) break; #else wint_t ch = static_cast(*low); - if ((m & space) == space && iswspace_l(ch, __l)) continue; - if ((m & print) == print && iswprint_l(ch, __l)) continue; - if ((m & cntrl) == cntrl && iswcntrl_l(ch, __l)) continue; - if ((m & upper) == upper && iswupper_l(ch, __l)) continue; - if ((m & lower) == lower && iswlower_l(ch, __l)) continue; - if ((m & alpha) == alpha && iswalpha_l(ch, __l)) continue; - if ((m & digit) == digit && iswdigit_l(ch, __l)) continue; - if ((m & punct) == punct && iswpunct_l(ch, __l)) continue; - if ((m & xdigit) == xdigit && iswxdigit_l(ch, __l)) continue; - if ((m & blank) == blank && iswblank_l(ch, __l)) continue; + if ((m & space) == space && iswspace_l(ch, __l_)) continue; + if ((m & print) == print && iswprint_l(ch, __l_)) continue; + if ((m & cntrl) == cntrl && iswcntrl_l(ch, __l_)) continue; + if ((m & upper) == upper && iswupper_l(ch, __l_)) continue; + if ((m & lower) == lower && iswlower_l(ch, __l_)) continue; + if ((m & alpha) == alpha && iswalpha_l(ch, __l_)) continue; + if ((m & digit) == digit && iswdigit_l(ch, __l_)) continue; + if ((m & punct) == punct && iswpunct_l(ch, __l_)) continue; + if ((m & xdigit) == xdigit && iswxdigit_l(ch, __l_)) continue; + if ((m & blank) == blank && iswblank_l(ch, __l_)) continue; break; #endif } @@ -1481,49 +1481,49 @@ wchar_t ctype_byname::do_toupper(char_type c) const { - return towupper_l(c, __l); + return towupper_l(c, __l_); } const wchar_t* ctype_byname::do_toupper(char_type* low, const char_type* high) const { for (; low != high; ++low) - *low = towupper_l(*low, __l); + *low = towupper_l(*low, __l_); return low; } wchar_t ctype_byname::do_tolower(char_type c) const { - return towlower_l(c, __l); + return towlower_l(c, __l_); } const wchar_t* ctype_byname::do_tolower(char_type* low, const char_type* high) const { for (; low != high; ++low) - *low = towlower_l(*low, __l); + *low = towlower_l(*low, __l_); return low; } wchar_t ctype_byname::do_widen(char c) const { - return __libcpp_btowc_l(c, __l); + return __libcpp_btowc_l(c, __l_); } const char* ctype_byname::do_widen(const char* low, const char* high, char_type* dest) const { for (; low != high; ++low, ++dest) - *dest = __libcpp_btowc_l(*low, __l); + *dest = __libcpp_btowc_l(*low, __l_); return low; } char ctype_byname::do_narrow(char_type c, char dfault) const { - int r = __libcpp_wctob_l(c, __l); + int r = __libcpp_wctob_l(c, __l_); return (r != EOF) ? static_cast(r) : dfault; } @@ -1532,7 +1532,7 @@ { for (; low != high; ++low, ++dest) { - int r = __libcpp_wctob_l(*low, __l); + int r = __libcpp_wctob_l(*low, __l_); *dest = (r != EOF) ? static_cast(r) : dfault; } return low; @@ -1607,23 +1607,23 @@ codecvt::codecvt(size_t refs) : locale::facet(refs), - __l(_LIBCPP_GET_C_LOCALE) + __l_(_LIBCPP_GET_C_LOCALE) { } codecvt::codecvt(const char* nm, size_t refs) : locale::facet(refs), - __l(newlocale(LC_ALL_MASK, nm, 0)) + __l_(newlocale(LC_ALL_MASK, nm, 0)) { - if (__l == 0) + if (__l_ == 0) __throw_runtime_error("codecvt_byname::codecvt_byname" " failed to construct for " + string(nm)); } codecvt::~codecvt() { - if (__l != _LIBCPP_GET_C_LOCALE) - freelocale(__l); + if (__l_ != _LIBCPP_GET_C_LOCALE) + freelocale(__l_); } codecvt::result @@ -1643,13 +1643,13 @@ // save state in case it is needed to recover to_nxt on error mbstate_t save_state = st; size_t n = __libcpp_wcsnrtombs_l(to, &frm_nxt, static_cast(fend-frm), - static_cast(to_end-to), &st, __l); + static_cast(to_end-to), &st, __l_); if (n == size_t(-1)) { // need to recover to_nxt for (to_nxt = to; frm != frm_nxt; ++frm) { - n = __libcpp_wcrtomb_l(to_nxt, *frm, &save_state, __l); + n = __libcpp_wcrtomb_l(to_nxt, *frm, &save_state, __l_); if (n == size_t(-1)) break; to_nxt += n; @@ -1666,7 +1666,7 @@ { // Try to write the terminating null extern_type tmp[MB_LEN_MAX]; - n = __libcpp_wcrtomb_l(tmp, intern_type(), &st, __l); + n = __libcpp_wcrtomb_l(tmp, intern_type(), &st, __l_); if (n == size_t(-1)) // on error return error; if (n > static_cast(to_end-to_nxt)) // is there room? @@ -1700,14 +1700,14 @@ // save state in case it is needed to recover to_nxt on error mbstate_t save_state = st; size_t n = __libcpp_mbsnrtowcs_l(to, &frm_nxt, static_cast(fend-frm), - static_cast(to_end-to), &st, __l); + static_cast(to_end-to), &st, __l_); if (n == size_t(-1)) { // need to recover to_nxt for (to_nxt = to; frm != frm_nxt; ++to_nxt) { n = __libcpp_mbrtowc_l(to_nxt, frm, static_cast(fend-frm), - &save_state, __l); + &save_state, __l_); switch (n) { case 0: @@ -1735,7 +1735,7 @@ if (fend != frm_end) // set up next null terminated sequence { // Try to write the terminating null - n = __libcpp_mbrtowc_l(to_nxt, frm_nxt, 1, &st, __l); + n = __libcpp_mbrtowc_l(to_nxt, frm_nxt, 1, &st, __l_); if (n != 0) // on error return error; ++to_nxt; @@ -1755,7 +1755,7 @@ { to_nxt = to; extern_type tmp[MB_LEN_MAX]; - size_t n = __libcpp_wcrtomb_l(tmp, intern_type(), &st, __l); + size_t n = __libcpp_wcrtomb_l(tmp, intern_type(), &st, __l_); if (n == size_t(-1) || n == 0) // on error return error; --n; @@ -1769,11 +1769,11 @@ int codecvt::do_encoding() const noexcept { - if (__libcpp_mbtowc_l(nullptr, nullptr, MB_LEN_MAX, __l) != 0) + if (__libcpp_mbtowc_l(nullptr, nullptr, MB_LEN_MAX, __l_) != 0) return -1; // stateless encoding - if (__l == 0 || __libcpp_mb_cur_max_l(__l) == 1) // there are no known constant length encodings + if (__l_ == 0 || __libcpp_mb_cur_max_l(__l_) == 1) // there are no known constant length encodings return 1; // which take more than 1 char to form a wchar_t return 0; } @@ -1791,7 +1791,7 @@ int nbytes = 0; for (size_t nwchar_t = 0; nwchar_t < mx && frm != frm_end; ++nwchar_t) { - size_t n = __libcpp_mbrlen_l(frm, static_cast(frm_end-frm), &st, __l); + size_t n = __libcpp_mbrlen_l(frm, static_cast(frm_end-frm), &st, __l_); switch (n) { case 0: @@ -1813,7 +1813,7 @@ int codecvt::do_max_length() const noexcept { - return __l == 0 ? 1 : static_cast(__libcpp_mb_cur_max_l(__l)); + return __l_ == 0 ? 1 : static_cast(__libcpp_mb_cur_max_l(__l_)); } #endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS @@ -3545,10 +3545,10 @@ uint8_t* _to_nxt = _to; #if defined(_LIBCPP_SHORT_WCHAR) result r = ucs2_to_utf8(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt, - _Maxcode_, _Mode_); + __maxcode_, __mode_); #else result r = ucs4_to_utf8(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt, - _Maxcode_, _Mode_); + __maxcode_, __mode_); #endif frm_nxt = frm + (_frm_nxt - _frm); to_nxt = to + (_to_nxt - _to); @@ -3568,13 +3568,13 @@ uint16_t* _to_end = reinterpret_cast(to_end); uint16_t* _to_nxt = _to; result r = utf8_to_ucs2(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt, - _Maxcode_, _Mode_); + __maxcode_, __mode_); #else uint32_t* _to = reinterpret_cast(to); uint32_t* _to_end = reinterpret_cast(to_end); uint32_t* _to_nxt = _to; result r = utf8_to_ucs4(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt, - _Maxcode_, _Mode_); + __maxcode_, __mode_); #endif frm_nxt = frm + (_frm_nxt - _frm); to_nxt = to + (_to_nxt - _to); @@ -3608,9 +3608,9 @@ const uint8_t* _frm = reinterpret_cast(frm); const uint8_t* _frm_end = reinterpret_cast(frm_end); #if defined(_LIBCPP_SHORT_WCHAR) - return utf8_to_ucs2_length(_frm, _frm_end, mx, _Maxcode_, _Mode_); + return utf8_to_ucs2_length(_frm, _frm_end, mx, __maxcode_, __mode_); #else - return utf8_to_ucs4_length(_frm, _frm_end, mx, _Maxcode_, _Mode_); + return utf8_to_ucs4_length(_frm, _frm_end, mx, __maxcode_, __mode_); #endif } @@ -3619,11 +3619,11 @@ __codecvt_utf8::do_max_length() const noexcept { #if defined(_LIBCPP_SHORT_WCHAR) - if (_Mode_ & consume_header) + if (__mode_ & consume_header) return 6; return 3; #else - if (_Mode_ & consume_header) + if (__mode_ & consume_header) return 7; return 4; #endif @@ -3644,7 +3644,7 @@ uint8_t* _to_end = reinterpret_cast(to_end); uint8_t* _to_nxt = _to; result r = ucs2_to_utf8(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt, - _Maxcode_, _Mode_); + __maxcode_, __mode_); frm_nxt = frm + (_frm_nxt - _frm); to_nxt = to + (_to_nxt - _to); return r; @@ -3662,7 +3662,7 @@ uint16_t* _to_end = reinterpret_cast(to_end); uint16_t* _to_nxt = _to; result r = utf8_to_ucs2(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt, - _Maxcode_, _Mode_); + __maxcode_, __mode_); frm_nxt = frm + (_frm_nxt - _frm); to_nxt = to + (_to_nxt - _to); return r; @@ -3694,14 +3694,14 @@ { const uint8_t* _frm = reinterpret_cast(frm); const uint8_t* _frm_end = reinterpret_cast(frm_end); - return utf8_to_ucs2_length(_frm, _frm_end, mx, _Maxcode_, _Mode_); + return utf8_to_ucs2_length(_frm, _frm_end, mx, __maxcode_, __mode_); } _LIBCPP_SUPPRESS_DEPRECATED_PUSH int __codecvt_utf8::do_max_length() const noexcept { - if (_Mode_ & consume_header) + if (__mode_ & consume_header) return 6; return 3; } @@ -3721,7 +3721,7 @@ uint8_t* _to_end = reinterpret_cast(to_end); uint8_t* _to_nxt = _to; result r = ucs4_to_utf8(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt, - _Maxcode_, _Mode_); + __maxcode_, __mode_); frm_nxt = frm + (_frm_nxt - _frm); to_nxt = to + (_to_nxt - _to); return r; @@ -3739,7 +3739,7 @@ uint32_t* _to_end = reinterpret_cast(to_end); uint32_t* _to_nxt = _to; result r = utf8_to_ucs4(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt, - _Maxcode_, _Mode_); + __maxcode_, __mode_); frm_nxt = frm + (_frm_nxt - _frm); to_nxt = to + (_to_nxt - _to); return r; @@ -3771,14 +3771,14 @@ { const uint8_t* _frm = reinterpret_cast(frm); const uint8_t* _frm_end = reinterpret_cast(frm_end); - return utf8_to_ucs4_length(_frm, _frm_end, mx, _Maxcode_, _Mode_); + return utf8_to_ucs4_length(_frm, _frm_end, mx, __maxcode_, __mode_); } _LIBCPP_SUPPRESS_DEPRECATED_PUSH int __codecvt_utf8::do_max_length() const noexcept { - if (_Mode_ & consume_header) + if (__mode_ & consume_header) return 7; return 4; } @@ -3806,10 +3806,10 @@ uint8_t* _to_nxt = _to; #if defined(_LIBCPP_SHORT_WCHAR) result r = ucs2_to_utf16be(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt, - _Maxcode_, _Mode_); + __maxcode_, __mode_); #else result r = ucs4_to_utf16be(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt, - _Maxcode_, _Mode_); + __maxcode_, __mode_); #endif frm_nxt = frm + (_frm_nxt - _frm); to_nxt = to + (_to_nxt - _to); @@ -3829,13 +3829,13 @@ uint16_t* _to_end = reinterpret_cast(to_end); uint16_t* _to_nxt = _to; result r = utf16be_to_ucs2(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt, - _Maxcode_, _Mode_); + __maxcode_, __mode_); #else uint32_t* _to = reinterpret_cast(to); uint32_t* _to_end = reinterpret_cast(to_end); uint32_t* _to_nxt = _to; result r = utf16be_to_ucs4(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt, - _Maxcode_, _Mode_); + __maxcode_, __mode_); #endif frm_nxt = frm + (_frm_nxt - _frm); to_nxt = to + (_to_nxt - _to); @@ -3869,9 +3869,9 @@ const uint8_t* _frm = reinterpret_cast(frm); const uint8_t* _frm_end = reinterpret_cast(frm_end); #if defined(_LIBCPP_SHORT_WCHAR) - return utf16be_to_ucs2_length(_frm, _frm_end, mx, _Maxcode_, _Mode_); + return utf16be_to_ucs2_length(_frm, _frm_end, mx, __maxcode_, __mode_); #else - return utf16be_to_ucs4_length(_frm, _frm_end, mx, _Maxcode_, _Mode_); + return utf16be_to_ucs4_length(_frm, _frm_end, mx, __maxcode_, __mode_); #endif } @@ -3879,11 +3879,11 @@ __codecvt_utf16::do_max_length() const noexcept { #if defined(_LIBCPP_SHORT_WCHAR) - if (_Mode_ & consume_header) + if (__mode_ & consume_header) return 4; return 2; #else - if (_Mode_ & consume_header) + if (__mode_ & consume_header) return 6; return 4; #endif @@ -3910,10 +3910,10 @@ uint8_t* _to_nxt = _to; #if defined(_LIBCPP_SHORT_WCHAR) result r = ucs2_to_utf16le(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt, - _Maxcode_, _Mode_); + __maxcode_, __mode_); #else result r = ucs4_to_utf16le(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt, - _Maxcode_, _Mode_); + __maxcode_, __mode_); #endif frm_nxt = frm + (_frm_nxt - _frm); to_nxt = to + (_to_nxt - _to); @@ -3933,13 +3933,13 @@ uint16_t* _to_end = reinterpret_cast(to_end); uint16_t* _to_nxt = _to; result r = utf16le_to_ucs2(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt, - _Maxcode_, _Mode_); + __maxcode_, __mode_); #else uint32_t* _to = reinterpret_cast(to); uint32_t* _to_end = reinterpret_cast(to_end); uint32_t* _to_nxt = _to; result r = utf16le_to_ucs4(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt, - _Maxcode_, _Mode_); + __maxcode_, __mode_); #endif frm_nxt = frm + (_frm_nxt - _frm); to_nxt = to + (_to_nxt - _to); @@ -3973,9 +3973,9 @@ const uint8_t* _frm = reinterpret_cast(frm); const uint8_t* _frm_end = reinterpret_cast(frm_end); #if defined(_LIBCPP_SHORT_WCHAR) - return utf16le_to_ucs2_length(_frm, _frm_end, mx, _Maxcode_, _Mode_); + return utf16le_to_ucs2_length(_frm, _frm_end, mx, __maxcode_, __mode_); #else - return utf16le_to_ucs4_length(_frm, _frm_end, mx, _Maxcode_, _Mode_); + return utf16le_to_ucs4_length(_frm, _frm_end, mx, __maxcode_, __mode_); #endif } @@ -3983,11 +3983,11 @@ __codecvt_utf16::do_max_length() const noexcept { #if defined(_LIBCPP_SHORT_WCHAR) - if (_Mode_ & consume_header) + if (__mode_ & consume_header) return 4; return 2; #else - if (_Mode_ & consume_header) + if (__mode_ & consume_header) return 6; return 4; #endif @@ -4008,7 +4008,7 @@ uint8_t* _to_end = reinterpret_cast(to_end); uint8_t* _to_nxt = _to; result r = ucs2_to_utf16be(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt, - _Maxcode_, _Mode_); + __maxcode_, __mode_); frm_nxt = frm + (_frm_nxt - _frm); to_nxt = to + (_to_nxt - _to); return r; @@ -4026,7 +4026,7 @@ uint16_t* _to_end = reinterpret_cast(to_end); uint16_t* _to_nxt = _to; result r = utf16be_to_ucs2(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt, - _Maxcode_, _Mode_); + __maxcode_, __mode_); frm_nxt = frm + (_frm_nxt - _frm); to_nxt = to + (_to_nxt - _to); return r; @@ -4058,14 +4058,14 @@ { const uint8_t* _frm = reinterpret_cast(frm); const uint8_t* _frm_end = reinterpret_cast(frm_end); - return utf16be_to_ucs2_length(_frm, _frm_end, mx, _Maxcode_, _Mode_); + return utf16be_to_ucs2_length(_frm, _frm_end, mx, __maxcode_, __mode_); } _LIBCPP_SUPPRESS_DEPRECATED_PUSH int __codecvt_utf16::do_max_length() const noexcept { - if (_Mode_ & consume_header) + if (__mode_ & consume_header) return 4; return 2; } @@ -4085,7 +4085,7 @@ uint8_t* _to_end = reinterpret_cast(to_end); uint8_t* _to_nxt = _to; result r = ucs2_to_utf16le(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt, - _Maxcode_, _Mode_); + __maxcode_, __mode_); frm_nxt = frm + (_frm_nxt - _frm); to_nxt = to + (_to_nxt - _to); return r; @@ -4103,7 +4103,7 @@ uint16_t* _to_end = reinterpret_cast(to_end); uint16_t* _to_nxt = _to; result r = utf16le_to_ucs2(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt, - _Maxcode_, _Mode_); + __maxcode_, __mode_); frm_nxt = frm + (_frm_nxt - _frm); to_nxt = to + (_to_nxt - _to); return r; @@ -4135,14 +4135,14 @@ { const uint8_t* _frm = reinterpret_cast(frm); const uint8_t* _frm_end = reinterpret_cast(frm_end); - return utf16le_to_ucs2_length(_frm, _frm_end, mx, _Maxcode_, _Mode_); + return utf16le_to_ucs2_length(_frm, _frm_end, mx, __maxcode_, __mode_); } _LIBCPP_SUPPRESS_DEPRECATED_PUSH int __codecvt_utf16::do_max_length() const noexcept { - if (_Mode_ & consume_header) + if (__mode_ & consume_header) return 4; return 2; } @@ -4162,7 +4162,7 @@ uint8_t* _to_end = reinterpret_cast(to_end); uint8_t* _to_nxt = _to; result r = ucs4_to_utf16be(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt, - _Maxcode_, _Mode_); + __maxcode_, __mode_); frm_nxt = frm + (_frm_nxt - _frm); to_nxt = to + (_to_nxt - _to); return r; @@ -4180,7 +4180,7 @@ uint32_t* _to_end = reinterpret_cast(to_end); uint32_t* _to_nxt = _to; result r = utf16be_to_ucs4(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt, - _Maxcode_, _Mode_); + __maxcode_, __mode_); frm_nxt = frm + (_frm_nxt - _frm); to_nxt = to + (_to_nxt - _to); return r; @@ -4212,14 +4212,14 @@ { const uint8_t* _frm = reinterpret_cast(frm); const uint8_t* _frm_end = reinterpret_cast(frm_end); - return utf16be_to_ucs4_length(_frm, _frm_end, mx, _Maxcode_, _Mode_); + return utf16be_to_ucs4_length(_frm, _frm_end, mx, __maxcode_, __mode_); } _LIBCPP_SUPPRESS_DEPRECATED_PUSH int __codecvt_utf16::do_max_length() const noexcept { - if (_Mode_ & consume_header) + if (__mode_ & consume_header) return 6; return 4; } @@ -4239,7 +4239,7 @@ uint8_t* _to_end = reinterpret_cast(to_end); uint8_t* _to_nxt = _to; result r = ucs4_to_utf16le(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt, - _Maxcode_, _Mode_); + __maxcode_, __mode_); frm_nxt = frm + (_frm_nxt - _frm); to_nxt = to + (_to_nxt - _to); return r; @@ -4257,7 +4257,7 @@ uint32_t* _to_end = reinterpret_cast(to_end); uint32_t* _to_nxt = _to; result r = utf16le_to_ucs4(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt, - _Maxcode_, _Mode_); + __maxcode_, __mode_); frm_nxt = frm + (_frm_nxt - _frm); to_nxt = to + (_to_nxt - _to); return r; @@ -4289,14 +4289,14 @@ { const uint8_t* _frm = reinterpret_cast(frm); const uint8_t* _frm_end = reinterpret_cast(frm_end); - return utf16le_to_ucs4_length(_frm, _frm_end, mx, _Maxcode_, _Mode_); + return utf16le_to_ucs4_length(_frm, _frm_end, mx, __maxcode_, __mode_); } _LIBCPP_SUPPRESS_DEPRECATED_PUSH int __codecvt_utf16::do_max_length() const noexcept { - if (_Mode_ & consume_header) + if (__mode_ & consume_header) return 6; return 4; } @@ -4323,7 +4323,7 @@ uint8_t* _to_end = reinterpret_cast(to_end); uint8_t* _to_nxt = _to; result r = utf16_to_utf8(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt, - _Maxcode_, _Mode_); + __maxcode_, __mode_); frm_nxt = frm + (_frm_nxt - _frm); to_nxt = to + (_to_nxt - _to); return r; @@ -4347,7 +4347,7 @@ uint32_t* _to_nxt = _to; #endif result r = utf8_to_utf16(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt, - _Maxcode_, _Mode_); + __maxcode_, __mode_); frm_nxt = frm + (_frm_nxt - _frm); to_nxt = to + (_to_nxt - _to); return r; @@ -4379,13 +4379,13 @@ { const uint8_t* _frm = reinterpret_cast(frm); const uint8_t* _frm_end = reinterpret_cast(frm_end); - return utf8_to_utf16_length(_frm, _frm_end, mx, _Maxcode_, _Mode_); + return utf8_to_utf16_length(_frm, _frm_end, mx, __maxcode_, __mode_); } int __codecvt_utf8_utf16::do_max_length() const noexcept { - if (_Mode_ & consume_header) + if (__mode_ & consume_header) return 7; return 4; } @@ -4405,7 +4405,7 @@ uint8_t* _to_end = reinterpret_cast(to_end); uint8_t* _to_nxt = _to; result r = utf16_to_utf8(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt, - _Maxcode_, _Mode_); + __maxcode_, __mode_); frm_nxt = frm + (_frm_nxt - _frm); to_nxt = to + (_to_nxt - _to); return r; @@ -4423,7 +4423,7 @@ uint16_t* _to_end = reinterpret_cast(to_end); uint16_t* _to_nxt = _to; result r = utf8_to_utf16(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt, - _Maxcode_, _Mode_); + __maxcode_, __mode_); frm_nxt = frm + (_frm_nxt - _frm); to_nxt = to + (_to_nxt - _to); return r; @@ -4455,14 +4455,14 @@ { const uint8_t* _frm = reinterpret_cast(frm); const uint8_t* _frm_end = reinterpret_cast(frm_end); - return utf8_to_utf16_length(_frm, _frm_end, mx, _Maxcode_, _Mode_); + return utf8_to_utf16_length(_frm, _frm_end, mx, __maxcode_, __mode_); } _LIBCPP_SUPPRESS_DEPRECATED_PUSH int __codecvt_utf8_utf16::do_max_length() const noexcept { - if (_Mode_ & consume_header) + if (__mode_ & consume_header) return 7; return 4; } @@ -4482,7 +4482,7 @@ uint8_t* _to_end = reinterpret_cast(to_end); uint8_t* _to_nxt = _to; result r = utf16_to_utf8(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt, - _Maxcode_, _Mode_); + __maxcode_, __mode_); frm_nxt = frm + (_frm_nxt - _frm); to_nxt = to + (_to_nxt - _to); return r; @@ -4500,7 +4500,7 @@ uint32_t* _to_end = reinterpret_cast(to_end); uint32_t* _to_nxt = _to; result r = utf8_to_utf16(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt, - _Maxcode_, _Mode_); + __maxcode_, __mode_); frm_nxt = frm + (_frm_nxt - _frm); to_nxt = to + (_to_nxt - _to); return r; @@ -4532,14 +4532,14 @@ { const uint8_t* _frm = reinterpret_cast(frm); const uint8_t* _frm_end = reinterpret_cast(frm_end); - return utf8_to_utf16_length(_frm, _frm_end, mx, _Maxcode_, _Mode_); + return utf8_to_utf16_length(_frm, _frm_end, mx, __maxcode_, __mode_); } _LIBCPP_SUPPRESS_DEPRECATED_PUSH int __codecvt_utf8_utf16::do_max_length() const noexcept { - if (_Mode_ & consume_header) + if (__mode_ & consume_header) return 7; return 4; } diff --git a/libcxx/src/memory.cpp b/libcxx/src/memory.cpp --- a/libcxx/src/memory.cpp +++ b/libcxx/src/memory.cpp @@ -152,21 +152,21 @@ }; _LIBCPP_CONSTEXPR __sp_mut::__sp_mut(void* p) noexcept - : __lx(p) + : __lx_(p) { } void __sp_mut::lock() noexcept { - auto m = static_cast<__libcpp_mutex_t*>(__lx); + auto m = static_cast<__libcpp_mutex_t*>(__lx_); __libcpp_mutex_lock(m); } void __sp_mut::unlock() noexcept { - __libcpp_mutex_unlock(static_cast<__libcpp_mutex_t*>(__lx)); + __libcpp_mutex_unlock(static_cast<__libcpp_mutex_t*>(__lx_)); } __sp_mut& diff --git a/libcxx/src/shared_mutex.cpp b/libcxx/src/shared_mutex.cpp --- a/libcxx/src/shared_mutex.cpp +++ b/libcxx/src/shared_mutex.cpp @@ -106,13 +106,13 @@ // Shared Timed Mutex // These routines are here for ABI stability -shared_timed_mutex::shared_timed_mutex() : __base() {} -void shared_timed_mutex::lock() { return __base.lock(); } -bool shared_timed_mutex::try_lock() { return __base.try_lock(); } -void shared_timed_mutex::unlock() { return __base.unlock(); } -void shared_timed_mutex::lock_shared() { return __base.lock_shared(); } -bool shared_timed_mutex::try_lock_shared() { return __base.try_lock_shared(); } -void shared_timed_mutex::unlock_shared() { return __base.unlock_shared(); } +shared_timed_mutex::shared_timed_mutex() : __base_() {} +void shared_timed_mutex::lock() { return __base_.lock(); } +bool shared_timed_mutex::try_lock() { return __base_.try_lock(); } +void shared_timed_mutex::unlock() { return __base_.unlock(); } +void shared_timed_mutex::lock_shared() { return __base_.lock_shared(); } +bool shared_timed_mutex::try_lock_shared() { return __base_.try_lock_shared(); } +void shared_timed_mutex::unlock_shared() { return __base_.unlock_shared(); } _LIBCPP_END_NAMESPACE_STD