https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99876
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2021-04-01
Assignee|unassigned at gcc dot gnu.org |redi at gcc dot gnu.org
Status|UNCONFIRMED |ASSIGNED
Ever confirmed|0 |1
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to M Welinder from comment #0)
> If the given filename is already absolute, it should be simply returned.
> There is no need to call current_path() which leads to a getcwd syscall.
Yes we already do that for the overload with an error_code parameter:
fs::path
fs::absolute(const path& p, error_code& ec)
{
path ret;
if (p.empty())
{
ec = make_error_code(std::errc::invalid_argument);
return ret;
}
ec.clear();
if (p.is_absolute())
{
ret = p;
return ret;
}