[PATCH] D44634: [clang-format] Detect Objective-C for #import

2018-07-10 Thread Jacek Olesiak via Phabricator via cfe-commits
jolesiak added a comment. Herald added a subscriber: acoomans. I think we should reconsider applying this change, at least for a very common "#import ". Repository: rC Clang https://reviews.llvm.org/D44634 ___ cfe-commits mailing list cfe-commit

[PATCH] D44634: [clang-format] Detect Objective-C for #import

2018-03-21 Thread Yan Zhang via Phabricator via cfe-commits
Wizard added a comment. For some ObjC headers it uses #import to import other headers instead of system framework, so I think we should also detect #import "*.h" as well. The only usage of #import in C++ is to import type library, which won't have suffix of ".h". Repository: rC Clang http

Re: [PATCH] D44634: [clang-format] Detect Objective-C for #import

2018-03-21 Thread Ben Hamilton via cfe-commits
#import is perfectly legal in C and C++, it's just not commonly used. On Wed, Mar 21, 2018, 14:27 Yan Zhang via Phabricator < revi...@reviews.llvm.org> wrote: > Wizard added a comment. > > Why do we only detect system framework? I think any #import could indicate > ObjC header. > > > Repository:

[PATCH] D44634: [clang-format] Detect Objective-C for #import

2018-03-21 Thread Yan Zhang via Phabricator via cfe-commits
Wizard added a comment. Why do we only detect system framework? I think any #import could indicate ObjC header. Repository: rC Clang https://reviews.llvm.org/D44634 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cg

[PATCH] D44634: [clang-format] Detect Objective-C for #import

2018-03-20 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton updated this revision to Diff 139137. benhamilton added a comment. Add assert(std::is_sorted(...)). (We can't static_assert on is_sorted until C++2x.) Repository: rC Clang https://reviews.llvm.org/D44634 Files: lib/Format/Format.cpp unittests/Format/FormatTest.cpp Index: un

[PATCH] D44634: [clang-format] Detect Objective-C for #import

2018-03-20 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton updated this revision to Diff 139127. benhamilton added a comment. clang-format Repository: rC Clang https://reviews.llvm.org/D44634 Files: lib/Format/Format.cpp unittests/Format/FormatTest.cpp Index: unittests/Format/FormatTest.cpp ==

[PATCH] D44634: [clang-format] Detect Objective-C for #import

2018-03-20 Thread Daniel Jasper via Phabricator via cfe-commits
djasper added a comment. I'd really like to not parse include/import statements this way. Can you send me examples of headers where we fail to recognize them as ObjC and this matters (happy for you to send me examples offline). Repository: rC Clang https://reviews.llvm.org/D44634 ___

[PATCH] D44634: [clang-format] Detect Objective-C for #import

2018-03-19 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton created this revision. benhamilton added reviewers: jolesiak, djasper. Herald added subscribers: cfe-commits, klimek. Previously, the Objective-C heuristic failed to detect headers which #imported Objective-C system framework(s) and declared C functions on top them. This extends the h