Title
equivalent incorrectly specifies throws clause
Status
c++17
Section
[fs.op.equivalent]
Submitter
Eric Fiselier

Created on 2016-05-28.00:00:00 last changed 82 months ago

Messages

Date: 2016-08-04.02:52:49

Proposed resolution:

This wording is relative to N4594.

  1. Modify [fs.op.equivalent] as follows:

    bool equivalent(const path& p1, const path& p2);
    bool equivalent(const path& p1, const path& p2, error_code& ec) noexcept;
    

    -1- Let s1 and s2 be file_statuss, determined as if by status(p1) and status(p2), respectively.

    -2- Effects: Determines s1 and s2. If (!exists(s1) && !exists(s2)) || (is_other(s1) && is_other(s2)) an error is reported ([fs.err.report]).

    -3- Returns: true, if s1 == s2 and p1 and p2 resolve to the same file system entity, else false. The signature with argument ec returns false if an error occurs.

    -4- Two paths are considered to resolve to the same file system entity if two candidate entities reside on the same device at the same location. This is determined as if by the values of the POSIX stat structure, obtained as if by stat() for the two paths, having equal st_dev values and equal st_ino values.

    -5- Throws: filesystem_error if (!exists(s1) && !exists(s2)) || (is_other(s1) && is_other(s2)), otherwise aAs specified in Eerror reporting ([fs.err.report]).

Date: 2016-08-04.02:52:49

[ 2016-08 Chicago ]

Wed AM: Move to Tentatively Ready

Date: 2016-06-21.21:31:58

[ 2016-06 Oulu — Daniel provides wording improvements ]

mc: do we have an error reporting clause?
jw: there is no such clause
gr: it should go into the effects clause
dk: we have the same issue for file_size
dk: the right place is the effects clause

Date: 2016-06-21.21:31:58

The spec for equivalent has a throws clause which reads: [fs.op.equivalent]/5

Throws: filesystem_error if (!exists(s1) && !exists(s2)) || (is_other(s1) && is_other(s2)), otherwise as specified in Error reporting (27.10.7).

This explicit requirement to throw is incorrect for the equivalent overload which takes an error_code.

Previous resolution [SUPERSEDED]:

This wording is relative to N4582.

  1. Modify [fs.op.equivalent] as follows:

    bool equivalent(const path& p1, const path& p2);
    bool equivalent(const path& p1, const path& p2, error_code& ec) noexcept;
    

    -1- Effects: Determines file_status s1 and s2, as if by status(p1) and status(p2), respectively.

    -2- Returns: If (!exists(s1) && !exists(s2)) || (is_other(s1) && is_other(s2)) an error is reported ([fs.err.report]). Otherwise true, if s1 == s2 and p1 and p2 resolve to the same file system entity, else false. The signature with argument ec returns false if an error occurs.

    -3- Two paths are considered to resolve to the same file system entity if two candidate entities reside on the same device at the same location. This is determined as if by the values of the POSIX stat structure, obtained as if by stat() for the two paths, having equal st_dev values and equal st_ino values.

    -4- Throws: filesystem_error if (!exists(s1) && !exists(s2)) || (is_other(s1) && is_other(s2)), otherwise aAs specified in Eerror reporting ([fs.err.report]).

History
Date User Action Args
2017-07-30 20:15:43adminsetstatus: wp -> c++17
2016-11-14 03:59:28adminsetstatus: pending -> wp
2016-11-14 03:55:22adminsetstatus: ready -> pending
2016-08-04 02:52:49adminsetmessages: + msg8386
2016-08-04 02:52:49adminsetstatus: new -> ready
2016-06-21 21:31:58adminsetmessages: + msg8196
2016-06-05 18:12:48adminsetmessages: + msg8163
2016-05-28 00:00:00admincreate