Skip to content

[clang-format] Mixed pointer and reference alignment suggestion #146568

Open
@untodesu

Description

@untodesu

By searching I found at minimum one issue (#136597) asking for a solution on this. It would really be cool to have an option for a mixed pointer and reference alignment for various cases (mainly return types, template arguments and anything else):

// Return type is aligned-left
// Argument is aligned-right
const char* my_function(const std::string &my_argument);

// Template argument is aligned-left
extern std::vector<const char*> list_of_strings;

// Variable is aligned-right
extern const char *my_cool_string;

We work on a large-scale project with this specific code style and mixed pointer/reference alignment is the only thing that practically stops us from auto-formatting the entire source tree :trollface:

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions