[clang-format] Add better support for co-routinues
authormydeveloperday <mydeveloperday@gmail.com>
Thu, 2 Dec 2021 08:05:30 +0000 (08:05 +0000)
committermydeveloperday <mydeveloperday@gmail.com>
Thu, 2 Dec 2021 08:06:43 +0000 (08:06 +0000)
commit57b95aed2a04f00dc84c4c4926c506528081196d
tree5954e64881920558746e00c3739e288dda2ea2ac
parent8aabde5a4b4872767dbd75e517f1a93adf097bc0
[clang-format] Add better support for co-routinues

Responding to a Discord call to help {D113977} and heavily inspired by the unlanded {D34225} add some support to help coroutinues from not being formatted from

```for co_await(auto elt : seq)```

to

```
for
co_await(auto elt : seq)
```

Because of the dominance of clang-format in the C++ community, I don't think we should make it the blocker that prevents users from embracing the newer parts of the standard because we butcher the layout of some of the new constucts.

Reviewed By: HazardyKnusperkeks, Quuxplusone, ChuanqiXu

Differential Revision: https://reviews.llvm.org/D114859
clang/docs/ReleaseNotes.rst
clang/lib/Format/TokenAnnotator.cpp
clang/lib/Format/UnwrappedLineParser.cpp
clang/unittests/Format/FormatTest.cpp