Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clang-format 10.0 vs. 5.0 const member fuction is formated differently

We are updating our clang-format from 5.0 to 10.0 (yes, I know that this is a big jump :-)) The file .clang-format is kept constant.

With the 5.0 version we get a format like this

virtual Composite *copy_composite_tree(Composite *parent  // parent of copied tree
                                      ) const;

With the 10.0 version this changes to

virtual Composite *copy_composite_tree(Composite *parent  // parent of copied tree
) const;

Is there an option to keep the 5.0 formatting style?

like image 820
schorsch312 Avatar asked Sep 02 '25 16:09

schorsch312


1 Answers

I consider this to be a bug, which was introduced with clang-format 9.0.1, since all buildin styles, such as LLVM, Google, ... show the very same behaviour.

I reported this bug to the llvm project.

https://bugs.llvm.org/show_bug.cgi?id=46509

like image 128
schorsch312 Avatar answered Sep 05 '25 07:09

schorsch312