[clang] [clang-format] Reset `Line->IsModuleOrImportDecl` in `addUnwrappedLine` (PR #204565)

Damian Höster via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 19 17:07:11 PDT 2026


damster101 wrote:

> That seems logical, but do you have an example, that can be added as a test?

Well, I noticed the issue in a codebase of mine, which uses a lot of modules. I've tested and been using the patched version there for the last few days.
The bug had bothered me for a while, but became very noticeable when I changed my formatting style in some ways, including a change in IndentWidth, and noticed that it wasn't applied in a lot of places, most notably regarding alignment and indentation beyond the first level. Only the few header files I use were completely unaffected.

So, if you can find any codebase that uses modules, and then mess around with clang-format, it should be easily reproducible. Switching between `IndentWidth:     2` and `IndentWidth:     4`, for example, should make it very apparent.

https://github.com/llvm/llvm-project/pull/204565


More information about the cfe-commits mailing list