[clang-format] Restrict the special handling for K&R C to C/C++
authorowenca <owenpiano@gmail.com>
Fri, 10 Sep 2021 08:03:01 +0000 (01:03 -0700)
committerowenca <owenpiano@gmail.com>
Fri, 10 Sep 2021 22:51:35 +0000 (15:51 -0700)
commit3205dd3d59b3cc36f96b7eff6387de8d2f42825f
tree36ecbfddb38a9dace38c170e26baecd1fc84ecb2
parent29b44ca896e7c5d9fef20f3660cbe5eb321b91ea
[clang-format] Restrict the special handling for K&R C to C/C++

Commits 58494c856a15f6bc614546e1, and 0fc27ef19670 added special
handlings for K&R C function definitions and caused some
JavaScript/TypeScript regressions which were addressed in D107267,
D108538, and D108620. This patch would have prevented these known
regressions and will fix any unknown ones.

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