Skip to content

clang-format-18 DTOR ~ detached from class name #67903

Closed
@kalman5

Description

@kalman5

The following snippet

class LongClassNameToShowTheIssue {
public:
  class AndAnotherLongClassNameToShowTheIssue {
    AndAnotherLongClassNameToShowTheIssue();
    ~AndAnotherLongClassNameToShowTheIssue();
  }
};

LongClassNameToShowTheIssue::AndAnotherLongClassNameToShowTheIssue::
    AndAnotherLongClassNameToShowTheIssue() {}

LongClassNameToShowTheIssue::AndAnotherLongClassNameToShowTheIssue::
    ~AndAnotherLongClassNameToShowTheIssue() {}

formattted with clang-format-17 using the following configuration

Language: Cpp

is formatted in the following way using clang-format-18

class LongClassNameToShowTheIssue {
public:
  class AndAnotherLongClassNameToShowTheIssue {
    AndAnotherLongClassNameToShowTheIssue();
    ~AndAnotherLongClassNameToShowTheIssue();
  }
};

LongClassNameToShowTheIssue::AndAnotherLongClassNameToShowTheIssue::
AndAnotherLongClassNameToShowTheIssue() {}

LongClassNameToShowTheIssue::AndAnotherLongClassNameToShowTheIssue::~
AndAnotherLongClassNameToShowTheIssue() {}

as you can see the DTOR ~ is detached from class name

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions