This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/69191] Wrong equality comparison between error_code and error_condition + segfault
- From: "kristian.spangsege at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 05 Aug 2016 02:05:46 +0000
- Subject: [Bug libstdc++/69191] Wrong equality comparison between error_code and error_condition + segfault
- Auto-submitted: auto-generated
- References: <bug-69191-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69191
Kristian Spangsege <kristian.spangsege at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kristian.spangsege at gmail dot co
| |m
--- Comment #13 from Kristian Spangsege <kristian.spangsege at gmail dot com> ---
I've now run into this problem too, and it seems to be general, not just
limited to Ubuntu.
There is the code that I compile:
#include <cerrno>
#include <system_error>
#include <iostream>
int main()
{
std::error_code ec(EDOM, std::system_category());
bool b = (ec == std::errc::argument_out_of_domain);
std::cout << b << "\n";
}
I expect it to write `1`, not `0`.
I get the expected result with Clang on OS X. I get the wrong result with
- GCC 6.1.1 on Fedora 24, which links against libstdc++.so.6.0.22
- GCC 5.4.0 on Linux Mint 18 (Ubuntu 14.04), which links against
libstdc++.so.6.0.21
- GCC 4.9.3 on Linux Mint 17.1 (Ubuntu 16.04), which links against
libstdc++.so.6.0.22
It therefore seems to me that this is really a bug in libstdc++.