Skip to content

clang-format format several times gives different result #145226

@kelbon

Description

@kelbon
#define TAG(...)  struct a {             \ 
  };

clang-format once gives

#define TAG(...) \
  struct a {     \
    \ 
            \
  };

clang-format second time gives

#define TAG(...) \
  struct a {     \
    \ 
                      \
  };

And its endless:

third time:

#define TAG(...) \
  struct a {     \
    \ 
                                \ < this brake moves to right every time
  };
clang-format --version
  clang-format version 20.1.5

.clang-format file:

BasedOnStyle: Google
ColumnLimit : 110
AllowShortFunctionsOnASingleLine: false
AllowShortLambdasOnASingleLine: true
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
SortIncludes: false
DerivePointerAlignment: false # disables 'Google' option which forces ignoring my rules
PointerAlignment: Left
ReferenceAlignment: Left
InsertNewlineAtEOF: true
IndentPPDirectives: BeforeHash

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions