]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: std::system_category should know meaning of zero [PR102425]
authorJonathan Wakely <jwakely@redhat.com>
Wed, 22 Sep 2021 10:58:20 +0000 (11:58 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 23 Sep 2021 15:07:38 +0000 (16:07 +0100)
commitce01e2e64c340dadb55a8a24c545a13e654804d4
tree176a81b25388f926aa7f7285bbea977ff7c80478
parentf6a05b23cc2e53c38e8321ddb5d2cbe40737e506
libstdc++: std::system_category should know meaning of zero [PR102425]

Although 0 is not an errno value, it should still be recognized as
corresponding to a value belonging to the generic_category().

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

PR libstdc++/102425
* src/c++11/system_error.cc
(system_error_category::default_error_condition): Add 0 to
switch.
* testsuite/19_diagnostics/error_category/102425.cc: New test.
libstdc++-v3/src/c++11/system_error.cc
libstdc++-v3/testsuite/19_diagnostics/error_category/102425.cc [new file with mode: 0644]