On Tue, 2022-11-22 at 22:13 -0500, Richard Kimberly Heck wrote:
> Here's the program to check:
> 
> #define _GLIBCXX_DEBUG 1
> #include <unordered_set>
> 
> int main()
> {
>    std::unordered_set<int>::iterator it{};
>    it == it;
> }
> 
> That's what was crashing in GCC.

Are you saying that this program will crash when called?

I do not see this compiling with either gcc 12 or 13. We get a warning
when compiling but that is it:

crash.cpp: In function ‘int main()’:
crash.cpp:7:7: warning: ignoring return value of ‘bool
__gnu_debug::operator==(const
_Safe_iterator<std::__detail::_Node_iterator<int, true, false>,
std::__debug::unordered_set<int>, std::forward_iterator_tag>::_Self&,
const _Safe_iterator<std::__detail::_Node_iterator<int, true, false>,
std::__debug::unordered_set<int>, std::forward_iterator_tag>::_Self&)’,
declared with attribute ‘nodiscard’ [-Wunused-result]
    7 |    it == it;
      |    ~~~^~~~~
In file included from /usr/include/c++/12/debug/unordered_set:48,
                 from /usr/include/c++/12/unordered_set:52,
                 from crash.cpp:2:
/usr/include/c++/12/debug/safe_iterator.h:470:7: note: declared here
  470 |       operator==(const _Self& __lhs, const _Self& __rhs)
_GLIBCXX_NOEXCEPT
      |       ^~~~~~~~

-- 
José Abílio
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to