HomePhabricator

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

Authored by krasimir on Jan 17 2020, 4:26 AM.

Description

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

Summary:
Revision a75f8d98d7ac9e557b238a229a9a2647c71feed1 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

Details

Committed
krasimirJan 17 2020, 4:33 AM
Reviewer
mprobst
Differential Revision
D72911: clang-format: fix spacing in `operator const char*()`
Parents
rGea91758a3c45: [llvm-exegesis][mips] Add support for memory instructions
Branches
Unknown
Tags
Unknown