=?utf-8?q?Bj=C3=B6rn_Sch=C3=A4pers?= <bjo...@hazardy.de>
Message-ID:
In-Reply-To: <llvm/llvm-project/pull/68743/cl...@github.com>


================
@@ -1118,16 +1121,39 @@ void WhitespaceManager::alignTrailingComments() {
       }
     }
 
-    // We don't want to align namespace end comments.
-    const bool DontAlignThisComment =
-        I > 0 && C.NewlinesBefore == 0 &&
-        Changes[I - 1].Tok->is(TT_NamespaceRBrace);
-    if (Style.AlignTrailingComments.Kind == FormatStyle::TCAS_Never ||
-        DontAlignThisComment) {
+    // We don't want to align comments which end a scope, which are here
+    // identified by most closing braces.
+    const bool DontAlignThisComment = [&] {
+      if (I == 0 || C.NewlinesBefore > 0)
+        return false;
+      const auto *Tok = Changes[I - 1].Tok;
----------------
owenca wrote:

```suggestion
    auto DontAlignThisComment = [](const auto *Tok) {
```

https://github.com/llvm/llvm-project/pull/68743
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to