[cfe-users] clang-format: IndentBraces not acting as advertised?

Kasper Peeters via cfe-users cfe-users at lists.llvm.org
Fri Jan 28 11:00:11 PST 2022


I am trying to use clang-format to indent braces as in

   void fun(...) 
      {
      [...] 
      [...]
      }

which I know can be achieved with `BreakBeforeBraces: Whitesmiths`, but
I want to customise some other settings. So I set `BreakBeforeBraces:
Custom`, and then `IndentBraces: true` and `AfterFunction: true`.
Unfortunately, that does not indent the braces, but rather the line
following it, as in

   void fun(...)
   {
         [...]
       [...]
       }

and sometimes it does not even do that.

Is this a bug or do I not understand how to use `IndentBraces`
properly? 

(using clang-format-13).

Thanks,
Kasper


More information about the cfe-users mailing list