[clang-format] Fix an assertion failure in block parsing
authorOwen Pan <owenpiano@gmail.com>
Sun, 4 Dec 2022 21:52:01 +0000 (13:52 -0800)
committerOwen Pan <owenpiano@gmail.com>
Tue, 6 Dec 2022 22:14:20 +0000 (14:14 -0800)
commit15f121e853846d7c74c243a4249a069dd67ca166
treea1c3f26847fecb18e3348e152dff6a880dcad32a
parent1b1df15538ec08dccf793a01c6615960213d031e
[clang-format] Fix an assertion failure in block parsing

This assertion failure was introduced in 9ed2e68c9ae5 and is
manifested when both RemoveBracesLLVM and MacroBlockBegin are set.

Fixes #59335.

Differential Revision: https://reviews.llvm.org/D139281
clang/lib/Format/FormatToken.h
clang/lib/Format/UnwrappedLineParser.cpp
clang/lib/Format/UnwrappedLineParser.h
clang/unittests/Format/FormatTest.cpp