[clang-format] Look ahead before consuming `bool` in requires clause.
authorEmilia Dreamer <emilia@rymiel.space>
Sun, 25 Sep 2022 17:30:10 +0000 (20:30 +0300)
committerEmilia Dreamer <emilia@rymiel.space>
Sun, 25 Sep 2022 17:30:21 +0000 (20:30 +0300)
commit39e6077d97238ec13c9ed1b9dbae1e6408e5aba3
tree5ea0b98688d2b9a5ef91c816924a54aafa2d38c3
parent7847225576d571fb7101463de56330e1f0e84856
[clang-format] Look ahead before consuming `bool` in requires clause.

The comment handling the bool case says:
"bool is only allowed if it is directly followed by a paren for a cast"

This change more closely follows this directive by looking ahead for
the paren before consuming the bool keyword itself. Without a following
paren, the bool would be part of something else, such as a return type
for a function declaration

Fixes https://github.com/llvm/llvm-project/issues/57538

Reviewed By: HazardyKnusperkeks, owenpan, MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D134325
clang/lib/Format/UnwrappedLineParser.cpp
clang/unittests/Format/TokenAnnotatorTest.cpp