Skip to content

Commit 36c1e56

Browse files
committed
[clang-format][NFC] Simplify the UnwrappedLine constructor
1 parent fef1bec commit 36c1e56

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

clang/lib/Format/UnwrappedLineParser.h

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,26 @@ struct UnwrappedLineNode;
4040
/// \c UnwrappedLineFormatter. The key property is that changing the formatting
4141
/// within an unwrapped line does not affect any other unwrapped lines.
4242
struct UnwrappedLine {
43-
UnwrappedLine();
43+
UnwrappedLine() = default;
4444

4545
/// The \c Tokens comprising this \c UnwrappedLine.
4646
std::list<UnwrappedLineNode> Tokens;
4747

4848
/// The indent level of the \c UnwrappedLine.
49-
unsigned Level;
49+
unsigned Level = 0;
5050

5151
/// The \c PPBranchLevel (adjusted for header guards) if this line is a
5252
/// \c InMacroBody line, and 0 otherwise.
53-
unsigned PPLevel;
53+
unsigned PPLevel = 0;
5454

5555
/// Whether this \c UnwrappedLine is part of a preprocessor directive.
56-
bool InPPDirective;
56+
bool InPPDirective = false;
5757
/// Whether this \c UnwrappedLine is part of a pramga directive.
58-
bool InPragmaDirective;
58+
bool InPragmaDirective = false;
5959
/// Whether it is part of a macro body.
60-
bool InMacroBody;
60+
bool InMacroBody = false;
6161

62-
bool MustBeDeclaration;
62+
bool MustBeDeclaration = false;
6363

6464
/// \c True if this line should be indented by ContinuationIndent in
6565
/// addition to the normal indention level.
@@ -410,11 +410,6 @@ struct UnwrappedLineNode {
410410
SmallVector<UnwrappedLine, 0> Children;
411411
};
412412

413-
inline UnwrappedLine::UnwrappedLine()
414-
: Level(0), PPLevel(0), InPPDirective(false), InPragmaDirective(false),
415-
InMacroBody(false), MustBeDeclaration(false),
416-
MatchingOpeningBlockLineIndex(kInvalidIndex) {}
417-
418413
} // end namespace format
419414
} // end namespace clang
420415

0 commit comments

Comments
 (0)