https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118105

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Why does the _BracketMatcher::_M_add_equivalence_class function use
lookup_collatename?

      void
      _M_add_equivalence_class(const _StringT& __s)
      {
        auto __st = _M_traits.lookup_collatename(__s.data(),
                                                 __s.data() + __s.size());
        if (__st.empty())
          __throw_regex_error(regex_constants::error_collate,
                              "Invalid equivalence class.");
        __st = _M_traits.transform_primary(__st.data(),
                                           __st.data() + __st.size());
        _M_equiv_set.push_back(__st);
        _GLIBCXX_DEBUG_ONLY(_M_is_ready = false);
      }

Is this a copy&paste error from _M_add_collate_element ?

I would expect it to be:

      void
      _M_add_equivalence_class(const _StringT& __s)
      {
        auto __st = _M_traits.transform_primary(__s.data(),
                                                __s.data() + __s.size());
        if (__st.empty())
          __throw_regex_error(regex_constants::error_collate, // ???
                              "Invalid equivalence class.");
        _M_equiv_set.push_back(__st);
        _GLIBCXX_DEBUG_ONLY(_M_is_ready = false);
      }

Reply via email to