================
@@ -632,24 +631,37 @@ class LineJoiner {
     if (Limit == 0)
       return 0;
 
-    assert(I[1]);
-    const auto &L1 = *I[1];
+    // The merging code is relative to the opening namespace brace, which could
+    // be either on the first or second line due to the brace wrapping rules.
+    const bool OpenBraceWrapped = Style.BraceWrapping.AfterNamespace;
+    const auto BraceOpenLine = I + OpenBraceWrapped;
+
+    assert(*BraceOpenLine);
+    if ((*BraceOpenLine)->Last->isNot(tok::l_brace))
----------------
owenca wrote:

```suggestion
    if (BraceOpenLine[0]->Last->isNot(TT_NamespaceLBrace))
```

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

Reply via email to