[clang] [clang-format] add an option to insert a space only for non-code block empty braces, not for empty parentheses (PR #93634)

via cfe-commits cfe-commits at lists.llvm.org
Wed May 29 19:47:50 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 203232ffbd80e9f4631213a3876f14dde155a92d d75153bb6777aacf4f08c2c08eca27646bb08727 -- clang/include/clang/Format/Format.h clang/lib/Format/Format.cpp clang/lib/Format/TokenAnnotator.cpp clang/unittests/Format/ConfigParseTest.cpp clang/unittests/Format/FormatTest.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 7909f8175b..c72bb25b4b 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -14033,7 +14033,8 @@ TEST_F(FormatTest, LayoutCxx11BraceInitializers) {
   SpaceBetweenBraces.SpacesInParensOptions.InEmptyBraces = true;
   verifyFormat("T x = { };\n"
                "f(x, { });\n"
-               "g();", SpaceBetweenBraces);
+               "g();",
+               SpaceBetweenBraces);
 }
 
 TEST_F(FormatTest, FormatsBracedListsInColumnLayout) {

``````````

</details>


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


More information about the cfe-commits mailing list