diff options
author | Francois Ferrand <thetypz@gmail.com> | 2019-06-06 20:06:23 +0000 |
---|---|---|
committer | Francois Ferrand <thetypz@gmail.com> | 2019-06-06 20:06:23 +0000 |
commit | c65fb39b929fc1a0ed7bbb93bab40fe53086cbd7 (patch) | |
tree | 3443e9ba621f7893289f7ab5bf1fddfec5de094b /docs | |
parent | 5175654bee59d5b608d7d244aaeba455b1500be8 (diff) | |
download | clang-c65fb39b929fc1a0ed7bbb93bab40fe53086cbd7.tar.gz |
clang-format: better handle namespace macros
Summary:
Other macros are used to declare namespaces, and should thus be handled
similarly. This is the case for crpcut's TESTSUITE macro, or for
unittest-cpp's SUITE macro:
TESTSUITE(Foo) {
TEST(MyFirstTest) {
assert(0);
}
} // TESTSUITE(Foo)
This patch deals with this cases by introducing a new option to specify
lists of namespace macros. Internally, it re-uses the system already in
place for foreach and statement macros, to ensure there is no impact on
performance.
Reviewers: krasimir, djasper, klimek
Reviewed By: klimek
Subscribers: acoomans, cfe-commits, klimek
Tags: #clang
Differential Revision: https://reviews.llvm.org/D37813
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@362740 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r-- | docs/ClangFormatStyleOptions.rst | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/ClangFormatStyleOptions.rst b/docs/ClangFormatStyleOptions.rst index 8bd0e9c8f7..1276a41acb 100644 --- a/docs/ClangFormatStyleOptions.rst +++ b/docs/ClangFormatStyleOptions.rst @@ -1782,6 +1782,19 @@ the configuration (without a prefix: ``Auto``). +**NamespaceMacros** (``std::vector<std::string>``) + A vector of macros which are used to open namespace blocks. + + These are expected to be macros of the form: + + .. code-block:: c++ + + NAMESPACE(<namespace-name>, ...) { + <namespace-content> + } + + For example: TESTSUITE + **ObjCBinPackProtocolList** (``BinPackStyle``) Controls bin-packing Objective-C protocol conformance list items into as few lines as possible when they go over ``ColumnLimit``. |