]> granicus.if.org Git - clang/commitdiff
Make sure we initialize all values in WhitespaceManager::Change.
authorManuel Klimek <klimek@google.com>
Tue, 3 Mar 2015 14:21:48 +0000 (14:21 +0000)
committerManuel Klimek <klimek@google.com>
Tue, 3 Mar 2015 14:21:48 +0000 (14:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@231067 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Format/WhitespaceManager.cpp

index fd5dd5991da0835b6a249f4d33919c279578c86c..4896ad70b01a0db10ddfd11114ab266cb7cf9bf7 100644 (file)
@@ -36,7 +36,9 @@ WhitespaceManager::Change::Change(
       PreviousLinePostfix(PreviousLinePostfix),
       CurrentLinePrefix(CurrentLinePrefix), Kind(Kind),
       ContinuesPPDirective(ContinuesPPDirective), IndentLevel(IndentLevel),
-      Spaces(Spaces) {}
+      Spaces(Spaces), IsTrailingComment(false), TokenLength(0),
+      PreviousEndOfTokenColumn(0), EscapedNewlineColumn(0),
+      StartOfBlockComment(nullptr), IndentationOffset(0) {}
 
 void WhitespaceManager::reset() {
   Changes.clear();
@@ -232,7 +234,6 @@ void WhitespaceManager::alignEscapedNewlines() {
   unsigned MaxEndOfLine =
       Style.AlignEscapedNewlinesLeft ? 0 : Style.ColumnLimit;
   unsigned StartOfMacro = 0;
-  Changes[0].EscapedNewlineColumn = 0;
   for (unsigned i = 1, e = Changes.size(); i < e; ++i) {
     Change &C = Changes[i];
     if (C.NewlinesBefore > 0) {