]> gcc.gnu.org Git - gcc.git/commit
libstdc++: Fix incorrect test for std::error_code comparisons
authorJonathan Wakely <jwakely@redhat.com>
Wed, 3 Feb 2021 15:49:36 +0000 (15:49 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 29 Mar 2021 19:50:37 +0000 (20:50 +0100)
commit149d4dfbf67abffe196eb41e9a70367678c16c80
tree42539e879ff3337be8db2b23ffbdef1831bba87b
parent564e5b6ce002608f461d4275c126d8179ef806c6
libstdc++: Fix incorrect test for std::error_code comparisons

The tests for std::error_code comparisons assumed that a default
constructed object uses std::generic_category(). That's true for a
default constructed std::error_condition, but not std::error_code.

Fix the three-way comparisons to correctly depend on the result of
comparing the categories, and add another test for comparing two objects
with the same category and different values.

libstdc++-v3/ChangeLog:

* testsuite/19_diagnostics/error_code/operators/not_equal.cc:
Add comparison with same category and different values.
* testsuite/19_diagnostics/error_code/operators/less.cc:
Likewise. Fix comparison involving different categories.
* testsuite/19_diagnostics/error_code/operators/three_way.cc:
Likewise.
* testsuite/19_diagnostics/error_condition/operators/less.cc:
Add comment.
* testsuite/19_diagnostics/error_condition/operators/three_way.cc:
Likewise.

(cherry picked from commit a6f08be383f846a0474ea8d1da9222b802c36c7c)
libstdc++-v3/testsuite/19_diagnostics/error_code/operators/less.cc
libstdc++-v3/testsuite/19_diagnostics/error_code/operators/not_equal.cc
libstdc++-v3/testsuite/19_diagnostics/error_code/operators/three_way.cc
libstdc++-v3/testsuite/19_diagnostics/error_condition/operators/less.cc
libstdc++-v3/testsuite/19_diagnostics/error_condition/operators/three_way.cc
This page took 0.058495 seconds and 5 git commands to generate.