Clang Format not-deterministic?

Hi All,

I’ve been noticing that clang-format either seems to be non-deterministic or there is a difference between “-i” and “-output-replacements-xml”.

I.e. if you do:
$ clang-format -style=file -i source_code.cpp

$ clang-format -style=file -output-replacements-xml source_code.cpp

The second command outputs replacements…

Should I file a bug for this and if so, where?


There is nothing non-deterministic about this, the behaviour is well-documented if you say “–help”:

-i - Inplace edit s, if specified.

-output-replacements-xml - Output replacements as XML.

Bram De Jong via cfe-dev <> ezt írta (időpont: 2018. dec. 3., H, 11:30):

What I meant is that

  1. running formatting first ( -i … )
    and then
  2. running -output-replacements-xml afterwards, with exactly the same config

Should not give any replacements in -output-replacements-xml.
Or, am I wrong in assuming that?