llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

clang-format regression for whitespace between `}&&` in clang-format 15.0.0-rc3

Open vogelsgesang opened this issue 4 years ago • 8 comments

I just tried to upgrade our (Salesforce, Hyper team) internal toolchain to 15.0.0-rc3 and came across the following regression in clang-format when compared to clang-format 14.0.3:

-   if (input.size() < 4 || (input[0] == byte{'P'} && input[1] == byte{'A'} && input[2] == byte{'R'} && input[3] == byte{'1'})) {
+   if (input.size() < 4 || (input[0] == byte{'P'}&& input[1] == byte{'A'}&& input[2] == byte{'R'}&& input[3] == byte{'1'})) {

clang-format 15.0.0-rc3 incorrectly removes the whitespace between the } and the &&

vogelsgesang avatar Sep 02 '22 18:09 vogelsgesang

@llvm/issue-subscribers-clang-format

llvmbot avatar Sep 02 '22 18:09 llvmbot

I think this problem has been fixed by https://github.com/llvm/llvm-project/commit/ef71383b0cfbacdbebf495015f6ead5294bf7759.

jackhong12 avatar Sep 02 '22 21:09 jackhong12

Is it possible to cherry pick this into the 15 branch then? @jackhong12

royjacobson avatar Sep 03 '22 14:09 royjacobson

@tru what would be the process to request a backport for this? @jackhong12 do you foresee any potential issues if ef71383b0cfbacdbebf495015f6ead5294bf7759 was applied to the LLVM 15 release branch?

vogelsgesang avatar Sep 05 '22 16:09 vogelsgesang

/cherry-pick ef71383b0cfbacdbebf495015f6ead5294bf7759

tru avatar Sep 05 '22 16:09 tru

/branch llvm/llvm-project-release-prs/issue57534

llvmbot avatar Sep 05 '22 17:09 llvmbot

/pull-request llvm/llvm-project-release-prs#144

llvmbot avatar Sep 05 '22 17:09 llvmbot

@vogelsgesang In https://github.com/llvm/llvm-project/commit/ef71383b0cfbacdbebf495015f6ead5294bf7759, I only reverted some checking rules to the old version and didn't add new features. So, I don't think it will cause other issues.

jackhong12 avatar Sep 06 '22 03:09 jackhong12