Commit 99e5b2f
clang-format: fix spacing in
Summary:
Revision a75f8d9 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 33463cf)operator const char*()
1 parent 6b16ce9 commit 99e5b2f
File tree
2 files changed
+20
-4
lines changed- clang
- lib/Format
- unittests/Format
2 files changed
+20
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2707 | 2707 | | |
2708 | 2708 | | |
2709 | 2709 | | |
2710 | | - | |
2711 | | - | |
2712 | | - | |
2713 | | - | |
| 2710 | + | |
| 2711 | + | |
| 2712 | + | |
| 2713 | + | |
| 2714 | + | |
| 2715 | + | |
| 2716 | + | |
| 2717 | + | |
| 2718 | + | |
| 2719 | + | |
| 2720 | + | |
2714 | 2721 | | |
2715 | 2722 | | |
2716 | 2723 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15008 | 15008 | | |
15009 | 15009 | | |
15010 | 15010 | | |
| 15011 | + | |
| 15012 | + | |
| 15013 | + | |
15011 | 15014 | | |
15012 | 15015 | | |
15013 | 15016 | | |
15014 | 15017 | | |
15015 | 15018 | | |
15016 | 15019 | | |
15017 | 15020 | | |
| 15021 | + | |
| 15022 | + | |
| 15023 | + | |
15018 | 15024 | | |
15019 | 15025 | | |
15020 | 15026 | | |
15021 | 15027 | | |
15022 | 15028 | | |
15023 | 15029 | | |
15024 | 15030 | | |
| 15031 | + | |
| 15032 | + | |
| 15033 | + | |
15025 | 15034 | | |
15026 | 15035 | | |
15027 | 15036 | | |
| |||
0 commit comments