<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - "Use of '@import' in framework header" warning should take __has_feature(modules) into account"
   href="https://bugs.llvm.org/show_bug.cgi?id=44968">44968</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>"Use of '@import' in framework header" warning should take __has_feature(modules) into account
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </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>Modules
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>jrose@belkadan.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I recently came across the following code:

#if __has_feature(modules)
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif

For which Xcode 11.3.1 gives me the following warning

<span class="quote">> Use of '@import' in framework header is discouraged, including this header requires -fmodules</span >

defined in Clang here:

<a href="https://github.com/llvm/llvm-project/blob/24ad121582454e625bdad125c90d9ac0dae948c8/clang/include/clang/Basic/DiagnosticParseKinds.td#L280-L283">https://github.com/llvm/llvm-project/blob/24ad121582454e625bdad125c90d9ac0dae948c8/clang/include/clang/Basic/DiagnosticParseKinds.td#L280-L283</a>

But the presence of the __has_feature check indicates that the framework author
has thought about this concern, and thus the warning shouldn't be emitted.</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>