Fixes: https://github.com/llvm/llvm-project/issues/58217
This change is to remove extraneous and unnecessary ';' from after a function definition, its off by default and carries the same "code modification" warning as some of our other code manipulating changes.
int max(int a, int b) { return a>b?a:b; }; class Foo { int getSomething() const { return something; }; };
At first, I thought this was a minor problem and not worth anything other than using -Wextra-semi/-Wextra-semi-stmt as pointed out in the issue comments. But clang-format is used by people who may not use the clang compiler, and not all compilers have this extra semi warning (AFAIK)
However, I ran this over the clang-codebase and realized (in clang and even the clang-format Tests!) how prevalent this is.
This is implemented very much on the same lines as @owenpan does for removing the {} with RemoveBracesLLVM, there is some repeated code that we could rationalize down if accepted. (I didn't want to be too invasive on that work)
This is definitely one of those changes that it would be nice for those of us that use "clang-format on save" could get without having to go through a compile phase in order to catch the warnings.
Because "semicolon" is a single word. Also, FWIW I prefer the singular form here and would save the plural form for e.g. InsertBraces to mean a pair of braces.