Skip to content

[clang-format] [feature-request] Add option to autoreplace class -> structΒ #162223

@kelbon

Description

@kelbon

In my company, coding style completely forbids the use of the class keyword.
Unfortunately, there is currently no option in clang-format to automatically enforce or transform this rule.

It would be very useful to add an option to clang-format to automatically replace class with struct

expected behavior:

enum class abc ===> enum struct abc

template<class T> ===> template<typename T>

template<template<typename> class A>
void foo();

===>

template<template<typename> typename A>
void foo();

class A ===> struct A

class A : a, b, c ===> struct A : private a, private b, private c

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