aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Format/QualifierAlignmentFixer.cpp
diff options
context:
space:
mode:
authorEmilia Dreamer <emilia@rymiel.space>2023-02-25 12:13:27 +0200
committerEmilia Dreamer <emilia@rymiel.space>2023-02-25 12:13:53 +0200
commit7ba91016c6ad4cb8f82ed154753ddeeb524f9a64 (patch)
treee3b8818ff6f79c39b1bbafa752e1e9d2fc0fc125 /clang/lib/Format/QualifierAlignmentFixer.cpp
parentb0676fb0fb0a44a4a1c4ec1f0270fef1f1842817 (diff)
downloadllvm-7ba91016c6ad4cb8f82ed154753ddeeb524f9a64.zip
llvm-7ba91016c6ad4cb8f82ed154753ddeeb524f9a64.tar.gz
llvm-7ba91016c6ad4cb8f82ed154753ddeeb524f9a64.tar.bz2
[clang-format] Rewrite how indent is reduced for compacted namespaces
The previous version set the indentation directly using IndentForLevel, however, this has a few caveats, namely: * IndentForLevel applies to all scopes of the entire program being formatted, but this indentation should only be adjusted for scopes of namespaces. * The method it used only set the correct indent amount if one wasn't already set for a given level, meaning it didn't work correctly if anything with indentation preceded a namespace keyword. This includes preprocessing directives if using IndentPPDirectives. This patch instead reduces the Level of all lines within namespaces which are compacted by CompactNamespaces. This means they will get correct indentation using the normal process. Fixes https://github.com/llvm/llvm-project/issues/60843 Reviewed By: owenpan, MyDeveloperDay, HazardyKnusperkeks Differential Revision: https://reviews.llvm.org/D144296
Diffstat (limited to 'clang/lib/Format/QualifierAlignmentFixer.cpp')
0 files changed, 0 insertions, 0 deletions