[libcxx-commits] [PATCH] D92229: [libc++] Update clang-format configuration
Marek Kurdej via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Nov 27 08:24:01 PST 2020
curdeius added inline comments.
================
Comment at: libcxx/utils/generate_feature_test_macro_components.py:684
"undefined": """
-# ifdef {name}
-# error "{name} should not be defined before {std_first}"
-# endif
+# ifdef {name}
+# error "{name} should not be defined before {std_first}"
----------------
ldionne wrote:
> Shouldn't this be `# ifdef` (3 spaces) to get the `ifdef` aligned at 4 columns?
The indentation of preprocessor directives depends on `IndentWidth:` (currently 2).
I find it a bit inconsistent, as it is:
`#`, then N * IndentWidth spaces, then directive (so directive is at the N * IndentWidth + 1 column)
against what I used to think and it seems what you think too:
`#`, N * IndentWidth - 1 spaces, directive (directive being at N * IndentWidth column.
Anyway, I wanted to match how clang-format would format it.
Note that we can keep this script unchanged, it's auto-generated anyway. I'd just keep the addition of clang-format on/off comments.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D92229/new/
https://reviews.llvm.org/D92229
More information about the libcxx-commits
mailing list