[PATCH] D55545: Allow IncludeSorter to use #import for Objective-C files
Ben Hamilton via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Dec 13 10:35:10 PST 2018
benhamilton added inline comments.
================
Comment at: clang-tidy/utils/IncludeSorter.cpp:116
bool IsAngled) {
+ std::string IncludeDirective = LangOpts->ObjC ? "#import " : "#include ";
std::string IncludeStmt =
----------------
hokein wrote:
> What about the ObjC++? The current behavior is always using `#import`, google objc style guide says `#import Objective-C and Objective-C++ headers, and #include C/C++ headers.`, I don't think we have a way to do it smartly.
>
> Maybe a conservative way is to use `#import ` for ObjC only?
Yeah, came here to say this. Let's enable `#import` for ObjC but disable for C++ (which will include ObjC++).
Repository:
rCTE Clang Tools Extra
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55545/new/
https://reviews.llvm.org/D55545
More information about the cfe-commits
mailing list