<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:richard-llvm@metafoo.co.uk" title="Richard Smith <richard-llvm@metafoo.co.uk>"> <span class="fn">Richard Smith</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - elaborated-enum-base incompatible with NS_ENUM"
   href="https://bugs.llvm.org/show_bug.cgi?id=49413">bug 49413</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>NEW
           </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 - elaborated-enum-base incompatible with NS_ENUM"
   href="https://bugs.llvm.org/show_bug.cgi?id=49413#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - elaborated-enum-base incompatible with NS_ENUM"
   href="https://bugs.llvm.org/show_bug.cgi?id=49413">bug 49413</a>
              from <span class="vcard"><a class="email" href="mailto:richard-llvm@metafoo.co.uk" title="Richard Smith <richard-llvm@metafoo.co.uk>"> <span class="fn">Richard Smith</span></a>
</span></b>
        <pre>The macro in question generates ill-formed code in C++; note that GCC and ICC
also reject. As a result, Clang generates an error by default. (The code
generated by the macro is valid in Objective-C and Objective-C++, though.)

Because Clang historically incorrectly accepted this, and in particular because
Apple's NS_ENUM macro currently relies on that compiler bug, we allow the error
for this non-conforming code to be disabled with -Wno-elaborated-enum-base. If
you need to keep building such code and can't fix it to be valid C++, you can
use that flag to allow Clang to accept the code (but it will not be portable to
other compilers).

Hopefully Apple will fix their macro at some point, if they've not done so
already. For example, this can be done with something like:

#ifdef __cplusplus
#define NS_ENUM(name, underlying) \
  void NS_ENUM_##name##_typedef(); \
  enum name : underlying
#else
// old definition
#endif

(where the first line of the macro expansion exists only to effectively swallow
the preceding `typedef` keyword, which is useless in C++).</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>