]> granicus.if.org Git - clang/commit
[clang-format] Emit absolute splits before lines for comments
authorKrasimir Georgiev <krasimir@google.com>
Wed, 23 Aug 2017 15:16:47 +0000 (15:16 +0000)
committerKrasimir Georgiev <krasimir@google.com>
Wed, 23 Aug 2017 15:16:47 +0000 (15:16 +0000)
commitd2a520ee9ed8f9f67f561bd8e074781cef7a202c
treeae9099aa62718f42a217f88a04221971f3756103
parent6fe799373a8151095a8665ac6e6f4ed0b6f59538
[clang-format] Emit absolute splits before lines for comments

Summary:
This patch makes the splits emitted for the beginning of comment lines during
reformatting absolute. Previously, they were relative to the start of the
non-whitespace content of the line, which messes up further TailOffset
calculations in breakProtrudingToken. This fixes an assertion failure reported
in bug 34236: https://bugs.llvm.org/show_bug.cgi?id=34236.

Reviewers: djasper

Reviewed By: djasper

Subscribers: klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D36956

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311559 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Format/BreakableToken.cpp
unittests/Format/FormatTestComments.cpp