================
@@ -361,9 +361,19 @@ class LineJoiner {
const auto *FirstNonComment = TheLine->getFirstNonComment();
if (!FirstNonComment)
return 0;
+
// FIXME: There are probably cases where we should use FirstNonComment
// instead of TheLine->First.
+ if (TheLine->Last->is(tok::l_brace)) {
+ if (Style.AllowShortNamespacesOnASingleLine &&
+ TheLine->First->is(tok::kw_namespace)) {
+ unsigned result = tryMergeNamespace(I, E, Limit);
+ if (result > 0)
+ return result;
+ }
+ }
----------------
owenca wrote:
```suggestion
if (Style.AllowShortNamespacesOnASingleLine &&
TheLine->First->is(tok::kw_namespace) &&
TheLine->Last->is(tok::l_brace)) {
const auto result = tryMergeNamespace(I, E, Limit);
if (result > 0)
return result;
}
```
https://github.com/llvm/llvm-project/pull/105597
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits