I've found that function default_error_condition doesn't work as expected in my code
auto ec = std::system_category().default_error_condition(EACCES);
std::cout << ec.value() << std::endl << ec.category().name() << std::endl;
Returned ec value has system error category, but it has to be generic, if I got it right from the documentation e.g. cppreference and gcc source code system_error.cc
UPD: also found this remark in the standard 19.5.1.5 Error category objects
The object’s default_error_condition virtual function shall behave as follows:
If the argument ev corresponds to a POSIX errno value posv, the function shall return error_condition(posv, generic_category()). Otherwise, the function shall return error_condition(ev, system_category())
What is happening here ?
I'm using g++ 7.3.0 on linux