2787. §[fs.file_status.cons] doesn't match class definition

Section: 30.11.10 [fs.class.file_status], 30.11.10.1 [fs.file_status.cons] Status: C++17 Submitter: Tim Song Opened: 2016-10-21 Last modified: 2017-07-30

Priority: 0

View all issues with C++17 status.

Discussion:

30.11.10 [fs.class.file_status] depicts:

explicit file_status(file_type ft = file_type::none, perms prms = perms::unknown) noexcept;

while 30.11.10.1 [fs.file_status.cons] describes two constructors:

explicit file_status() noexcept;
explicit file_status(file_type ft, perms prms = perms::unknown) noexcept;

It's also not clear why the default constructor needs to be explicit. Unlike tag types, there doesn't seem to be a compelling reason to disallow constructing a file_status without naming the type.

[2016-11-12, Issaquah]

Sat AM: Priority 0; move to Ready

Proposed resolution:

This wording is relative to N4606.

  1. Edit 30.11.10 [fs.class.file_status] as indicated:

    class file_status {
    public:
      // 27.10.11.1, constructors and destructor:
      file_status() noexcept : file_status(file_type::none) {}
      explicit file_status(file_type ft = file_type::none,
                           perms prms = perms::unknown) noexcept;
      […]
    };
    
  2. Edit 30.11.10.1 [fs.file_status.cons] as indicated:

    explicit file_status() noexcept;
    

    -1- Postconditions: type() == file_type::none and permissions() == perms::unknown.