[clang-format] handle trailing comments in function definition detection
authorKrasimir Georgiev <krasimir@google.com>
Thu, 12 Aug 2021 06:51:58 +0000 (08:51 +0200)
committerKrasimir Georgiev <krasimir@google.com>
Thu, 12 Aug 2021 06:55:54 +0000 (08:55 +0200)
commit0fc27ef19670676689d3317948c81eb171bb25f8
tree379526118ce66fe61e8e570969786bdcf0e0e188
parent645f5890ec211b89782d6b660c68ad5fcf1228f6
[clang-format] handle trailing comments in function definition detection

A follow-up to
https://github.com/llvm/llvm-project/commit/f6bc614546e169bb1b17a29c422ebace038e6c62
where we handle the case where the semicolon is followed by a trailing
comment.

Reviewed By: MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D107907
clang/lib/Format/TokenAnnotator.cpp
clang/unittests/Format/FormatTest.cpp