https://bugs.llvm.org/show_bug.cgi?id=44968

            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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]

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

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

defined in Clang here:

https://github.com/llvm/llvm-project/blob/24ad121582454e625bdad125c90d9ac0dae948c8/clang/include/clang/Basic/DiagnosticParseKinds.td#L280-L283

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.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to