We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 549d778 commit df397a9Copy full SHA for df397a9
clang/lib/Format/UnwrappedLineFormatter.cpp
@@ -365,13 +365,12 @@ class LineJoiner {
365
// FIXME: There are probably cases where we should use FirstNonComment
366
// instead of TheLine->First.
367
368
- if (TheLine->Last->is(tok::l_brace)) {
369
- if (Style.AllowShortNamespacesOnASingleLine &&
370
- TheLine->First->is(tok::kw_namespace)) {
371
- unsigned result = tryMergeNamespace(I, E, Limit);
372
- if (result > 0)
373
- return result;
374
- }
+ 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;
375
}
376
377
if (Style.CompactNamespaces) {
0 commit comments