<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Issue 2851: std::filesystem enum classes are now underspecified</title>
<meta property="og:title" content="Issue 2851: std::filesystem enum classes are now underspecified">
<meta property="og:description" content="C++ library issue. Status: C++20">
<meta property="og:url" content="https://cplusplus.github.io/LWG/issue2851.html">
<meta property="og:type" content="website">
<meta property="og:image" content="http://cplusplus.github.io/LWG/images/cpp_logo.png">
<meta property="og:image:alt" content="C++ logo">
<style>
  p {text-align:justify}
  li {text-align:justify}
  pre code.backtick::before { content: "`" }
  pre code.backtick::after { content: "`" }
  blockquote.note
  {
    background-color:#E0E0E0;
    padding-left: 15px;
    padding-right: 15px;
    padding-top: 1px;
    padding-bottom: 1px;
  }
  ins {background-color:#A0FFA0}
  del {background-color:#FFA0A0}
  table.issues-index { border: 1px solid; border-collapse: collapse; }
  table.issues-index th { text-align: center; padding: 4px; border: 1px solid; }
  table.issues-index td { padding: 4px; border: 1px solid; }
  table.issues-index td:nth-child(1) { text-align: right; }
  table.issues-index td:nth-child(2) { text-align: left; }
  table.issues-index td:nth-child(3) { text-align: left; }
  table.issues-index td:nth-child(4) { text-align: left; }
  table.issues-index td:nth-child(5) { text-align: center; }
  table.issues-index td:nth-child(6) { text-align: center; }
  table.issues-index td:nth-child(7) { text-align: left; }
  table.issues-index td:nth-child(5) span.no-pr { color: red; }
  @media (prefers-color-scheme: dark) {
     html {
        color: #ddd;
        background-color: black;
     }
     ins {
        background-color: #225522
     }
     del {
        background-color: #662222
     }
     a {
        color: #6af
     }
     a:visited {
        color: #6af
     }
     blockquote.note
     {
        background-color: rgba(255, 255, 255, .10)
     }
  }
</style>
</head>
<body>
<hr>
<p><em>This page is a snapshot from the LWG issues list, see the <a href="lwg-active.html">Library Active Issues List</a> for more information and the meaning of <a href="lwg-active.html#C++20">C++20</a> status.</em></p>
<h3 id="2851"><a href="lwg-defects.html#2851">2851</a>. <code>std::filesystem</code> enum classes are now underspecified</h3>
<p><b>Section:</b> 31.12.8.2 <a href="https://wg21.link/fs.enum.file.type">[fs.enum.file.type]</a>, 31.12.8.3 <a href="https://wg21.link/fs.enum.copy.opts">[fs.enum.copy.opts]</a>, 31.12.8.6 <a href="https://wg21.link/fs.enum.dir.opts">[fs.enum.dir.opts]</a> <b>Status:</b> <a href="lwg-active.html#C++20">C++20</a>
 <b>Submitter:</b> Tim Song <b>Opened:</b> 2016-12-18 <b>Last modified:</b> 2021-06-06</p>
<p><b>Priority: </b>2
</p>
<p><b>View all other</b> <a href="lwg-index.html#fs.enum.file.type">issues</a> in [fs.enum.file.type].</p>
<p><b>View all issues with</b> <a href="lwg-status.html#C++20">C++20</a> status.</p>
<p><b>Discussion:</b></p>
<p>
LWG <a href="lwg-defects.html#2678" title="std::filesystem enum classes overspecified (Status: C++17)">2678</a><sup><a href="https://cplusplus.github.io/LWG/issue2678" title="Latest snapshot">(i)</a></sup> stripped the numerical values of the enumerators from three enum classes in 31.12.8 <a href="https://wg21.link/fs.enum">[fs.enum]</a>;
in doing so it also removed the implicit specification 1) of the bitmask elements for the two bitmask types (<code>copy_options</code>
and <code>directory_options</code>) and 2) that the <code>file_type</code> constants are distinct.
</p>

<p><i>[2017-01-27 Telecon]</i></p>

<p>Priority 2; Jonathan to work with Tim to tweak wording.</p>

<p><i>[2018-01-16, Jonathan comments]</i></p>

<p>
I no longer remember what I didn't like about Tim's P/R so I think we should accept the original P/R.
</p>

<p><i>[2018-1-26 issues processing telecon]</i></p>

<p>Status to 'Tentatively Ready'</p>
<p><i>[2018-3-17 Adopted in Jacksonville]</i></p>



<p id="res-2851"><b>Proposed resolution:</b></p>
<p>This wording is relative to <a href="https://wg21.link/n4713">N4713</a>.</p>

<ol>
<li><p>Edit  [fs.enum.file_type]/1 as indicated:</p>
<blockquote>
<p>
This enum class specifies constants used to identify file types, with the meanings listed in Table 123.
<ins>The values of the constants are distinct.</ins>
</p>
</blockquote>
</li>

<li><p>Edit 31.12.8.3 <a href="https://wg21.link/fs.enum.copy.opts">[fs.enum.copy.opts]</a>/1 as indicated:</p>
<blockquote>
<p>
The <code>enum class</code> type <code>copy_options</code> is a bitmask type (16.3.3.3.3 <a href="https://wg21.link/bitmask.types">[bitmask.types]</a>) 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 124. <ins>The constant <code>none</code> represents the empty bitmask, and </ins><del>Constant <code>none</code></del> is shown in each option group for purposes of
exposition; implementations shall provide only a single definition. <ins>Every other constant in the
table represents a distinct bitmask element.</ins> Calling a library function with more than a single
constant for an option group results in undefined behavior.
</p>
</blockquote>
</li>

<li><p>Edit 31.12.8.6 <a href="https://wg21.link/fs.enum.dir.opts">[fs.enum.dir.opts]</a>/1 as indicated:</p>
<blockquote>
<p>
The <code>enum class</code> type <code>directory_options</code> is a bitmask type (16.3.3.3.3 <a href="https://wg21.link/bitmask.types">[bitmask.types]</a>)
that specifies bitmask constants used to identify directory traversal options, with the meanings listed
in Table 127. <ins>The constant <code>none</code> represents the empty bitmask; every other constant in the
table represents a distinct bitmask element.</ins>
</p>
</blockquote>
</li>

</ol>





</body>
</html>
