Created on 2018-10-02.00:00:00 last changed 57 months ago
Proposed resolution:
This wording is relative to N4762.
Change [syserr.syserr.overview] p2, class system_error synopsis, as indicated
namespace std { class system_error : public runtime_error { public: system_error(error_code ec, const string& what_arg); system_error(error_code ec, const char* what_arg); explicit system_error(error_code ec); system_error(int ev, const error_category& ecat, const string& what_arg); system_error(int ev, const error_category& ecat, const char* what_arg); system_error(int ev, const error_category& ecat); const error_code& code() const noexcept; const char* what() const noexcept override; }; }
Change [syserr.syserr.members] as indicated
explicit system_error(error_code ec);-5- Effects: […]
-6- Ensures: […]
[ 2020-04-07 Issue Prioritization ]
Priority to 3 after reflector discussion.
The constructor for std::system_error taking a single argument of type std::error_code is not marked explicit, which allows implicit conversions from error_code to system_error. I think that this is an oversight and not intentional, and that we should make this constructor explicit.
History | |||
---|---|---|---|
Date | User | Action | Args |
2020-04-07 15:51:03 | admin | set | messages: + msg11206 |
2018-10-06 11:25:03 | admin | set | messages: + msg10160 |
2018-10-02 00:00:00 | admin | create |