[clang-format] Allow `throw` to be a keyword in front of casts
authorEmilia Dreamer <emilia@rymiel.space>
Mon, 5 Sep 2022 10:32:40 +0000 (12:32 +0200)
committerBjörn Schäpers <bjoern@hazardy.de>
Mon, 5 Sep 2022 10:35:39 +0000 (12:35 +0200)
commitc6e7752f8e144ad78aee2e56a7c901c56be360de
tree42b664c11c18fda852df049e31d943dab6806172
parentf54d42abcf82e122ed0ac4688f01c1f4da5599f2
[clang-format] Allow `throw` to be a keyword in front of casts

This makes throw more similar to return. However, unlike return,
it has to more strict as to not remove spaces after usages of throw as
a (deprecated) exception specifier.

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

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