3026. filesystem::weakly_canonical still defined in terms of canonical(p, base)

Section: 30.11.14.39 [fs.op.weakly_canonical] Status: Tentatively Ready Submitter: Jonathan Wakely Opened: 2017-10-14 Last modified: 2017-10-16

Priority: Not Prioritized

View all issues with Tentatively Ready status.

Discussion:

LWG 2956 fixed canonical to no longer use a base path, but weakly_canonical should have been changed too:

Effects: Using status(p) or status(p, ec), respectively, to determine existence, return a path composed by operator/= from the result of calling canonical() without a base argument and with a […]

Since canonical doesn't accept a base argument, it doesn't make sense to talk about calling it without one.

[ 2017-10-16 Moved to Tentatively Ready after 5 positive votes on c++std-lib. ]

Proposed resolution:

This wording is relative to N4687.

  1. Change 30.11.14.39 [fs.op.weakly_canonical] as indicated:

    path weakly_canonical(const path& p);
    path weakly_canonical(const path& p, error_code& ec);
    

    -1- Returns: […]

    -2- Effects: Using status(p) or status(p, ec), respectively, to determine existence, return a path composed by operator/= from the result of calling canonical() without a base argument and with a path argument composed of the leading elements of p that exist, if any, followed by the elements of p that do not exist, if any. For the first form, canonical() is called without an error_code argument. For the second form, canonical() is called with ec as an error_code argument, and path() is returned at the first error occurrence, if any.

    […]