[clang] [clang-format] Add an option to control indentation of `export { ... }` (PR #110381)

via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 16 23:23:06 PST 2025


================
@@ -26588,10 +26613,7 @@ TEST_F(FormatTest, Cpp20ModulesSupport) {
                "  int foo;\n"
                "};",
                Style);
-  verifyFormat("export {\n"
-               "  int foo;\n"
-               "};",
-               Style);
+  verifyFormat("export { int foo; };", Style);
----------------
Sirraide wrote:

This is now controlled by `AllowShortBlocksOnASingleLine`. I opted against adding a separate option for export blocks for now because realistically, e.g. `export { int x; }` is not going to be very common considering that you can just write `export int x;`.

https://github.com/llvm/llvm-project/pull/110381


More information about the cfe-commits mailing list