[clang] [clang-format] Support BraceWrapping.AfterNamespace with AllowShortNamespacesOnASingleLine (PR #123010)
Owen Pan via cfe-commits
cfe-commits at lists.llvm.org
Sat Feb 8 17:24:51 PST 2025
================
@@ -367,8 +367,12 @@ class LineJoiner {
if (Style.AllowShortNamespacesOnASingleLine &&
TheLine->First->is(tok::kw_namespace) &&
- TheLine->Last->is(tok::l_brace)) {
- const auto result = tryMergeNamespace(I, E, Limit);
+ ((Style.BraceWrapping.AfterNamespace &&
+ NextLine.First->is(tok::l_brace)) ||
+ (!Style.BraceWrapping.AfterNamespace &&
+ TheLine->Last->is(tok::l_brace)))) {
----------------
owenca wrote:
I would move this into `tryMergeNamespace()`.
https://github.com/llvm/llvm-project/pull/123010
More information about the cfe-commits
mailing list