2851. std::filesystem enum classes are now underspecified

Section: 30.11.9.2 [fs.enum.file_type], 30.11.9.3 [fs.enum.copy.opts], 30.11.9.6 [fs.enum.dir.opts] Status: New Submitter: Tim Song Opened: 2016-12-18 Last modified: 2017-03-19

Priority: 2

View all other issues in [fs.enum.file_type].

View all issues with New status.

Discussion:

LWG 2678 stripped the numerical values of the enumerators from three enum classes in 30.11.9 [fs.enum]; in doing so it also removed the implicit specification 1) of the bitmask elements for the two bitmask types (copy_options and directory_options) and 2) that the file_type constants are distinct.

[2017-01-27 Telecon]

Priority 2; Jonathan to work with Tim to tweak wording.

Proposed resolution:

This wording is relative to N4618.

  1. Edit 30.11.9.2 [fs.enum.file_type]/1 as indicated:

    This enum class specifies constants used to identify file types, with the meanings listed in Table 122. The values of the constants are distinct.

  2. Edit 30.11.9.3 [fs.enum.copy.opts]/1 as indicated:

    The enum class type copy_options is a bitmask type (20.4.2.1.4 [bitmask.types]) that specifies bitmask constants used to control the semantics of copy operations. The constants are specified in option groups with the meanings listed in Table 123. The constant none represents the empty bitmask, and Constant none is shown in each option group for purposes of exposition; implementations shall provide only a single definition. Every other constant in the table represents a distinct bitmask element. Calling a library function with more than a single constant for an option group results in undefined behavior.

  3. Edit 30.11.9.6 [fs.enum.dir.opts]/1 as indicated:

    The enum class type directory_options is a bitmask type (20.4.2.1.4 [bitmask.types]) that specifies bitmask constants used to identify directory traversal options, with the meanings listed in Table 125. The constant none represents the empty bitmask; every other constant in the table represents a distinct bitmask element.