[clang-format] Adjust braced list detection
authorTan S. B <cpplearner@outlook.com>
Mon, 6 Dec 2021 06:32:48 +0000 (22:32 -0800)
committerOwen Pan <owenpiano@gmail.com>
Mon, 6 Dec 2021 06:39:29 +0000 (22:39 -0800)
commitc41b3b0fa0f4f70aad8deaf48bcd42a04385066c
tree3c8f5b289430fede22c96c317534ed8266cf7b90
parentbdd7c53dc5e0fc3c3fde408df2fd187b11bb8330
[clang-format] Adjust braced list detection

This avoids mishandling nested compound statements that are followed by another compound statement.

Fixes https://llvm.org/PR38314 and https://llvm.org/PR48305.

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