summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/Format.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-02-06 22:04:05 +0000
committerDaniel Jasper <djasper@google.com>2013-02-06 22:04:05 +0000
commitf79f935f387f4a34f0f20a6d6cc1bfb8ebe8fbb4 (patch)
tree3beefde2ce30b3913bb0ce71dfcb423c0bfb9a7b /clang/lib/Format/Format.cpp
parent5b33b3c3be61f7e48462a405f1eb7ad5a8e915aa (diff)
downloadbcm5719-llvm-f79f935f387f4a34f0f20a6d6cc1bfb8ebe8fbb4.tar.gz
bcm5719-llvm-f79f935f387f4a34f0f20a6d6cc1bfb8ebe8fbb4.zip
Fix bug in the alignment of comments.
Before: const char *test[] = { // A "aaaa", // B "aaaaa", }; After: const char *test[] = { // A "aaaa", // B "aaaaa", }; llvm-svn: 174549
Diffstat (limited to 'clang/lib/Format/Format.cpp')
-rw-r--r--clang/lib/Format/Format.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index 4128785f637..7f78ac0bcf0 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -111,7 +111,10 @@ public:
Comments.back().Tok = Tok.FormatTok;
Comments.back().Spaces = Spaces;
Comments.back().NewLines = NewLines;
- Comments.back().MinColumn = WhitespaceStartColumn + Spaces;
+ if (NewLines == 0)
+ Comments.back().MinColumn = WhitespaceStartColumn + Spaces;
+ else
+ Comments.back().MinColumn = Spaces;
Comments.back().MaxColumn =
Style.ColumnLimit - Spaces - Tok.FormatTok.TokenLength;
return;
OpenPOWER on IntegriCloud