Skip to content

Commit 8380509

Browse files
authored
Apply suggestions from code review
Final NFC cleanup
1 parent 9e50108 commit 8380509

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

clang/lib/Format/UnwrappedLineFormatter.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,7 @@ class LineJoiner {
631631
unsigned Limit) {
632632
if (Limit == 0)
633633
return 0;
634+
634635
assert(I[1]);
635636
const auto &L1 = *I[1];
636637
if (L1.InPPDirective != (*I)->InPPDirective ||

clang/unittests/Format/FormatTest.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28321,12 +28321,10 @@ TEST_F(FormatTest, KeepFormFeed) {
2832128321
}
2832228322

2832328323
TEST_F(FormatTest, ShortNamespacesOption) {
28324-
auto BaseStyle = getLLVMStyle();
28325-
BaseStyle.AllowShortNamespacesOnASingleLine = true;
28326-
BaseStyle.FixNamespaceComments = false;
28327-
BaseStyle.CompactNamespaces = true;
28328-
28329-
auto Style = BaseStyle;
28324+
auto Style = getLLVMStyle();
28325+
Style.AllowShortNamespacesOnASingleLine = true;
28326+
Style.CompactNamespaces = true;
28327+
Style.FixNamespaceComments = false;
2833028328

2833128329
// Basic functionality.
2833228330
verifyFormat("namespace foo { class bar; }", Style);
@@ -28358,7 +28356,7 @@ TEST_F(FormatTest, ShortNamespacesOption) {
2835828356
verifyFormat("namespace foo { namespace bar { class baz; } }", Style);
2835928357

2836028358
// Without CompactNamespaces, we won't merge consecutive namespace
28361-
// declarations
28359+
// declarations.
2836228360
Style.CompactNamespaces = false;
2836328361
verifyFormat("namespace foo {\n"
2836428362
"namespace bar { class baz; }\n"
@@ -28371,7 +28369,7 @@ TEST_F(FormatTest, ShortNamespacesOption) {
2837128369
"}",
2837228370
Style);
2837328371

28374-
Style = BaseStyle;
28372+
Style.CompactNamespaces = true;
2837528373

2837628374
// Varying inner content.
2837728375
verifyFormat("namespace foo {\n"
@@ -28419,9 +28417,7 @@ TEST_F(FormatTest, ShortNamespacesOption) {
2841928417
// too long to fit within the ColumnLimit, reducing the how likely the line
2842028418
// will still fit on a single line. The recommendation for now is to use the
2842128419
// concatenated namespace syntax instead. e.g. 'namespace foo::bar'
28422-
Style = BaseStyle;
2842328420
Style.FixNamespaceComments = true;
28424-
2842528421
verifyFormat(
2842628422
"namespace foo { namespace bar { namespace baz {\n"
2842728423
"class qux;\n"

0 commit comments

Comments
 (0)