-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[clang-format] Add an option to control indentation of export { ... }
#110381
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
Changes from 3 commits
570aff7
21b0563
c53fb38
d39d28f
712caa4
5e288f4
a2dfdca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9040,6 +9040,31 @@ TEST_F(FormatTest, AdaptiveOnePerLineFormatting) { | |
| Style); | ||
| } | ||
|
|
||
| TEST_F(FormatTest, ExportBlockIndentation) { | ||
| FormatStyle Style = getLLVMStyleWithColumns(80); | ||
| Style.ExportBlockIndentation = true; | ||
| verifyFormat("export {\n" | ||
| " int x;\n" | ||
| " int y;\n" | ||
| "}", | ||
| "export {\n" | ||
| "int x;\n" | ||
| "int y;\n" | ||
| "}", | ||
| Style); | ||
|
|
||
| Style.ExportBlockIndentation = false; | ||
| verifyFormat("export {\n" | ||
| "int x;\n" | ||
| "int y;\n" | ||
| "}", | ||
| "export {\n" | ||
| " int x;\n" | ||
| " int y;\n" | ||
| "}", | ||
| Style); | ||
| } | ||
|
|
||
| TEST_F(FormatTest, FormatsBuilderPattern) { | ||
| verifyFormat("return llvm::StringSwitch<Reference::Kind>(name)\n" | ||
| " .StartsWith(\".eh_frame_hdr\", ORDER_EH_FRAMEHDR)\n" | ||
|
|
@@ -26588,10 +26613,7 @@ TEST_F(FormatTest, Cpp20ModulesSupport) { | |
| " int foo;\n" | ||
| "};", | ||
| Style); | ||
| verifyFormat("export {\n" | ||
| " int foo;\n" | ||
| "};", | ||
| Style); | ||
| verifyFormat("export { int foo; };", Style); | ||
|
||
| verifyFormat("export export char const *hello() { return \"hello\"; }"); | ||
|
|
||
| verifyFormat("import bar;", Style); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.