[PATCH] D137181: [clang-format] Don't use 'PPIndentWidth' inside multi-line macros

Noah Goldstein via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 6 14:18:32 PST 2022


goldstein.w.n added a comment.

In D137181#3910799 <https://reviews.llvm.org/D137181#3910799>, @owenpan wrote:

> IMO we should find a simpler way to indent bodies of macro definitions that are nested more than one level deep. I prefer we handle that in another patch and only support the examples in the summary for now.

I'm not sure what changes to the patch that would imply?
I can drop the double-indented tests but seems to me that it would simply be buggy if it overintented the code due to header guards or if the define was placed in code.

Maybe would be cleaner if we made `Level` a new struct and overloading +/- to check if in PP region to keep track of PP level?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137181/new/

https://reviews.llvm.org/D137181



More information about the cfe-commits mailing list