Skip to content
Commit 99e5b2ff authored by Krasimir Georgiev's avatar Krasimir Georgiev Committed by Hans Wennborg
Browse files

clang-format: fix spacing in `operator const char*()`

Summary:
Revision a75f8d98 fixed spacing for operators,
but caused the const and non-const versions to diverge:
```
// With Style.PointerAlignment = FormatStyle::PAS_Left:

struct A {
  operator char*() { return ""; }
  operator const char *() const { return ""; }
};

```
The code was checking if the type specifier was directly preceded by `operator`.
However there could be comments and `const/volatile` in between.

Reviewers: mprobst

Reviewed By: mprobst

Subscribers: cfe-commits

Tags: #clang

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

(cherry picked from commit 33463cfb)
parent 6b16ce94
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment