Clang-tidy compiler fail on objective-C++ project

Hi, I’m working on clang-tidy over cmake and I’ve tried to compile .mm file which include foundation.h.

@import <Foundation/Foundation.h> 

However, unlike when I compile with the built-in xcode compiler (when clang-tidy is not set in project properties), with clang-tidy compiler I get error :

.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:91:143: error: function 
does not return NSString [clang-diagnostic-error]

- (NSAttributedString *)localizedAttributedStringForKey:(NSString *)key value:(nullable NSString *)value 
table:(nullable NSString *)tableName NS_FORMAT_ARGUMENT(1) NS_REFINED_FOR_SWIFT 
API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));

Any idea how to resolve it ?

Are there any errors with Xcode compiler? When I try the provided snippet, I’m hitting

error: expected a module name after 'import'
@import <Foundation/Foundation.h>

And that’s the sign you are mixing different styles of import. It should be either #import <Foundation/Foundation.h> or @import Foundation; So what code does trigger clang-diagnostic-error?