summaryrefslogtreecommitdiff
path: root/lib/Format/Format.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-07-11 13:48:16 +0000
committerDaniel Jasper <djasper@google.com>2013-07-11 13:48:16 +0000
commite1f9a8e27f553dcb359dfd96a3fe3065de7c4dad (patch)
tree56fe0efbd732a8741bdff8673e722061b1a02e56 /lib/Format/Format.cpp
parentc18cff311118fc6a30929468fc82b2b35cbd7fbf (diff)
downloadclang-e1f9a8e27f553dcb359dfd96a3fe3065de7c4dad.tar.gz
clang-e1f9a8e27f553dcb359dfd96a3fe3065de7c4dad.tar.bz2
clang-e1f9a8e27f553dcb359dfd96a3fe3065de7c4dad.tar.xz
Fix indentation problem for comments in call chains
Before: SomeObject // Calling someFunction on SomeObject .someFunction(); After: SomeObject // Calling someFunction on SomeObject .someFunction(); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186085 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/Format.cpp')
-rw-r--r--lib/Format/Format.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp
index ad390c23dc..0dd47fe4a9 100644
--- a/lib/Format/Format.cpp
+++ b/lib/Format/Format.cpp
@@ -589,7 +589,8 @@ private:
State.Column, Line.InPPDirective);
}
- State.Stack.back().LastSpace = State.Column;
+ if (!Current.isTrailingComment())
+ State.Stack.back().LastSpace = State.Column;
if (Current.isOneOf(tok::arrow, tok::period) &&
Current.Type != TT_DesignatedInitializerPeriod)
State.Stack.back().LastSpace += Current.CodePointCount;