-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[clang-format] [C++20] [Modules] Unexpected/Uncontrollable indentation for export block #121723
Comments
@llvm/issue-subscribers-clang-modules Author: Chuanqi Xu (ChuanqiXu9)
Reproducer:
after format we got:
But we don't want the indentation. Or we hope we can control the behavior by an option like |
@llvm/issue-subscribers-clang-format Author: Chuanqi Xu (ChuanqiXu9)
Reproducer:
after format we got:
But we don't want the indentation. Or we hope we can control the behavior by an option like |
What's your expected output? |
Sorry. Updated now. The key point is, I don't want the indentation for every declaration in |
…dentation of `export { ... }` (#110381) `export { ... }` blocks can get a bit long, so I thought it would make sense to have an option that makes it so their contents are not indented (basically the same argument as for namespaces). This is based on the `NamespaceIndentation` option, except that there is no option to control the behaviour of `export` blocks when nested because nesting them doesn’t really make sense. Additionally, brace wrapping of short `export { ... }` blocks is now controlled by the `AllowShortBlocksOnASingleLine` option. There is no separate option just for `export` blocks because you can just write e.g. `export int x;` instead of `export { int x; }`. This closes #121723.
Reproducer:
after format we got:
But we don't want the indentation. Or we hope we can control the behavior by an option like
NamespaceIndentation
(https://clang.llvm.org/docs/ClangFormatStyleOptions.html#namespaceindentation)Expected output:
The text was updated successfully, but these errors were encountered: