[all-commits] [llvm/llvm-project] 7ee423: [clang-format] clang-format eats space in front of...

MyDeveloperDay via All-commits all-commits at lists.llvm.org
Wed Jan 12 23:58:31 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7ee4236789bb8272cf3a2feedd75336e52f33e78
      https://github.com/llvm/llvm-project/commit/7ee4236789bb8272cf3a2feedd75336e52f33e78
  Author: mydeveloperday <mydeveloperday at gmail.com>
  Date:   2022-01-13 (Thu, 13 Jan 2022)

  Changed paths:
    M clang/lib/Format/TokenAnnotator.cpp
    M clang/unittests/Format/FormatTest.cpp

  Log Message:
  -----------
  [clang-format] clang-format eats space in front of attributes for operator delete

https://github.com/llvm/llvm-project/issues/27037

Sorry its taken so long to get to this issue! (got it before it hit its 6th birthday!)

```
void operator delete(void *foo)ATTRIB;
```

(void *foo) is incorrectly determined to be a C-Style Cast resulting in the space being removed after the ) and before the attrib, due to the detection of

```
delete (A* )a;
```

The following was previously unaffected

```
void operator new(void *foo) ATTRIB;
```

Fixes #27037

Reviewed By: curdeius, HazardyKnusperkeks

Differential Revision: https://reviews.llvm.org/D116920




More information about the All-commits mailing list