<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:aaron@aaronballman.com" title="Aaron Ballman <aaron@aaronballman.com>"> <span class="fn">Aaron Ballman</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - Compile fails when using enum declaration"
   href="https://bugs.llvm.org/show_bug.cgi?id=52403">bug 52403</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>CONFIRMED
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>INVALID
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - Compile fails when using enum declaration"
   href="https://bugs.llvm.org/show_bug.cgi?id=52403#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - Compile fails when using enum declaration"
   href="https://bugs.llvm.org/show_bug.cgi?id=52403">bug 52403</a>
              from <span class="vcard"><a class="email" href="mailto:aaron@aaronballman.com" title="Aaron Ballman <aaron@aaronballman.com>"> <span class="fn">Aaron Ballman</span></a>
</span></b>
        <pre>Oops, I jumped the gun on confirming this. Sorry for the confusion!

I think Clang is correct to reject this code. <a href="http://eel.is/c++draft/enum.udecl">http://eel.is/c++draft/enum.udecl</a>
says that the production needs to parse an elaborated-enum-specifier. One of
the requirements for a valid elaborated-enum-specifier is that the elaboration
has to agree in kind with the given declaration
(<a href="https://eel.is/c++draft/dcl.type.elab#6">https://eel.is/c++draft/dcl.type.elab#6</a>). In this case, the given declaration
is not an enum, it's a type alias.

You can see that all compilers agree that `enum Hog` is an invalid elaborated
type specifier outside of a using enum declaration:
<a href="https://godbolt.org/z/MY7PbqbhK">https://godbolt.org/z/MY7PbqbhK</a>

Because it's not a valid elaborated-type-specifier, I think GCC and MSVC are
incorrect to accept this code.</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>