[clang] [clang-format] Remove special handling of comments after brace/paren (PR #71672)

via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 8 04:38:15 PST 2023


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 b44399296a7fa4323ab32739df6dbcfc6068af8f 4548aa1186531fb93a623144278fe72896d47e89 -- clang/lib/Format/ContinuationIndenter.cpp clang/lib/Format/TokenAnnotator.cpp clang/unittests/Format/FormatTest.cpp clang/unittests/Format/FormatTestComments.cpp
``````````

</details>

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

``````````diff
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index 9691d8797..eb8d31745 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -3513,7 +3513,8 @@ void TokenAnnotator::calculateFormattingInformation(AnnotatedLine &Line) const {
       /*if (Prev->is(BK_BracedInit) && Prev->opensScope()) {
         Current->SpacesRequiredBefore =
             Style.SpacesInParensOptions.Other ? 1 : 0;
-      } else */if (Prev->is(TT_VerilogMultiLineListLParen)) {
+      } else */
+      if (Prev->is(TT_VerilogMultiLineListLParen)) {
         Current->SpacesRequiredBefore = 0;
       } else {
         Current->SpacesRequiredBefore = Style.SpacesBeforeTrailingComments;

``````````

</details>


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


More information about the cfe-commits mailing list