<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - [ms] enums are always ints but should not appear to have a fixed underlying type"
   href="https://llvm.org/bugs/show_bug.cgi?id=27098">27098</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[ms] enums are always ints but should not appear to have a fixed underlying type
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Frontend
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>rnk@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>david.majnemer@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Consider:
$ cat t.cpp
enum A {};
void f() { A{0}; }

$ clang -cc1 t.cpp -std=c++1z -triple x86_64-linux
t.cpp:2:18: error: cannot initialize a value of type 'A' with an rvalue of type
'int'
A f() { return A{0}; }
                 ^
1 error generated.

$ clang -cc1 t.cpp -std=c++1z -triple x86_64-windows-msvc
# no output


We always give MS enums the underlying type 'int'. In the AST,
EnumDecl::isFixed returns true, even when the user did not write ': int'. We
should arrange to make that return false while still using an 'int'
representation by default.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>