[PATCH] D135466: [clang-format] Add support to remove unnecessary semicolons after function definition

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 9 02:19:32 PDT 2022


MyDeveloperDay added a comment.

There is a simple fix to allow the empty functions in UnwrappedLineParser::calculateBraceTypes

F24856496: image.png <https://reviews.llvm.org/F24856496>

by moving this clause out of the "isJavaScript()" clause this will ensure for `foo() {}` the `{` is considered a FunctionLBrace (as it will mark the `{}` as a BK_Block

This is having more of a knock on to other unit tests which I need to look more deeply into (as I feel they could be wrong)..

i.e.

should it be

`auto i = decltype(x){};` be or  `auto i = decltype(x) {};`

`"return (a)(b){1, 2, 3};"` it `"return (a)(b) {1, 2, 3};"`

Its possible these tests could be wrong, (some look so) by for decltype and typeof what would people expect?

Either way that change needs to be separate from this.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135466/new/

https://reviews.llvm.org/D135466



More information about the cfe-commits mailing list