Skip to content

Commit 5ca20ff

Browse files
committed
Explicitly initialize __bit_per_word to avoid gdb.error
1 parent 233eeb3 commit 5ca20ff

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

libcxx/include/bitset

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -519,16 +519,15 @@ protected:
519519
_LIBCPP_HIDE_FROM_ABI size_t __hash_code() const _NOEXCEPT;
520520
};
521521

522+
template <size_t _Size>
523+
const unsigned __bitset<1, _Size>::__bits_per_word;
524+
522525
template <size_t _Size>
523526
inline _LIBCPP_CONSTEXPR __bitset<1, _Size>::__bitset() _NOEXCEPT : __first_(0) {}
524527

525528
template <size_t _Size>
526529
inline _LIBCPP_CONSTEXPR __bitset<1, _Size>::__bitset(unsigned long long __v) _NOEXCEPT
527-
: __first_(static_cast<__storage_type>(__v)) {
528-
// Force __bits_per_word to be instantiated to avoid "gdb.error: There is no member or method named
529-
// __bits_per_word"
530-
(void)__bits_per_word;
531-
}
530+
: __first_(static_cast<__storage_type>(__v)) {}
532531

533532
template <size_t _Size>
534533
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 void

0 commit comments

Comments
 (0)