From 12dee005f7e2d806f06657bca3dcc82f18a3224d Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Mon, 7 Sep 2015 15:45:14 +0100 Subject: [PATCH] Avoid #ifdef _GLIBCXX_DEBUG in regex_compiler.h * include/bits/regex_compiler.h (_BracketMatcher::_M_is_ready): Initialize using NSDMI and set using _GLIBCXX_DEBUG_ONLY. From-SVN: r227521 --- libstdc++-v3/ChangeLog | 3 +++ libstdc++-v3/include/bits/regex_compiler.h | 29 ++++++---------------- 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index cbe5a6d729f..91e3c356b20 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,8 @@ 2015-09-07 Jonathan Wakely + * include/bits/regex_compiler.h (_BracketMatcher::_M_is_ready): + Initialize using NSDMI and set using _GLIBCXX_DEBUG_ONLY. + * testsuite/30_threads/timed_mutex/try_lock_until/57641.cc: Rename shadowed variable. diff --git a/libstdc++-v3/include/bits/regex_compiler.h b/libstdc++-v3/include/bits/regex_compiler.h index 0cb0c04b1eb..07a9ed3555a 100644 --- a/libstdc++-v3/include/bits/regex_compiler.h +++ b/libstdc++-v3/include/bits/regex_compiler.h @@ -370,9 +370,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION const _TraitsT& __traits) : _M_class_set(0), _M_translator(__traits), _M_traits(__traits), _M_is_non_matching(__is_non_matching) -#ifdef _GLIBCXX_DEBUG - , _M_is_ready(false) -#endif { } bool @@ -386,9 +383,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _M_add_char(_CharT __c) { _M_char_set.push_back(_M_translator._M_translate(__c)); -#ifdef _GLIBCXX_DEBUG - _M_is_ready = false; -#endif + _GLIBCXX_DEBUG_ONLY(_M_is_ready = false); } _StringT @@ -399,9 +394,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION if (__st.empty()) __throw_regex_error(regex_constants::error_collate); _M_char_set.push_back(_M_translator._M_translate(__st[0])); -#ifdef _GLIBCXX_DEBUG - _M_is_ready = false; -#endif + _GLIBCXX_DEBUG_ONLY(_M_is_ready = false); return __st; } @@ -415,9 +408,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __st = _M_traits.transform_primary(__st.data(), __st.data() + __st.size()); _M_equiv_set.push_back(__st); -#ifdef _GLIBCXX_DEBUG - _M_is_ready = false; -#endif + _GLIBCXX_DEBUG_ONLY(_M_is_ready = false); } // __neg should be true for \D, \S and \W only. @@ -433,9 +424,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _M_class_set |= __mask; else _M_neg_class_set.push_back(__mask); -#ifdef _GLIBCXX_DEBUG - _M_is_ready = false; -#endif + _GLIBCXX_DEBUG_ONLY(_M_is_ready = false); } void @@ -445,9 +434,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __throw_regex_error(regex_constants::error_range); _M_range_set.push_back(make_pair(_M_translator._M_transform(__l), _M_translator._M_transform(__r))); -#ifdef _GLIBCXX_DEBUG - _M_is_ready = false; -#endif + _GLIBCXX_DEBUG_ONLY(_M_is_ready = false); } void @@ -457,9 +444,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION auto __end = std::unique(_M_char_set.begin(), _M_char_set.end()); _M_char_set.erase(__end, _M_char_set.end()); _M_make_cache(_UseCache()); -#ifdef _GLIBCXX_DEBUG - _M_is_ready = true; -#endif + _GLIBCXX_DEBUG_ONLY(_M_is_ready = true); } private: @@ -507,7 +492,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION bool _M_is_non_matching; _CacheT _M_cache; #ifdef _GLIBCXX_DEBUG - bool _M_is_ready; + bool _M_is_ready = false; #endif }; -- 2.30.2