[llvm-bugs] [Bug 44968] New: "Use of '@import' in framework header" warning should take __has_feature(modules) into account

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Feb 19 14:49:36 PST 2020


            Bug ID: 44968
           Summary: "Use of '@import' in framework header" warning should
                    take __has_feature(modules) into account
           Product: clang
           Version: unspecified
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Modules
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jrose at belkadan.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

I recently came across the following code:

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

For which Xcode 11.3.1 gives me the following warning

> Use of '@import' in framework header is discouraged, including this header requires -fmodules

defined in Clang here:


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.

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200219/74e94543/attachment.html>

More information about the llvm-bugs mailing list