[clang] [clang-format] Handle AttributeMacro before access modifiers (PR #95503)
Owen Pan via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 14 23:45:16 PDT 2024
================
@@ -57,7 +57,10 @@ class LevelIndentTracker {
/// Update the indent state given that \p Line is going to be formatted
/// next.
void nextLine(const AnnotatedLine &Line) {
- Offset = getIndentOffset(*Line.First);
+ const auto *Tok = Line.First;
+ if (Tok->is(TT_AttributeMacro) && Tok->Next)
----------------
owenca wrote:
I thought of it but decided to not bother because it would be rare and looping through all `AttributeMacro` prefixes would still leave comments and function-like macros unsupported. See a better solution in #95634.
https://github.com/llvm/llvm-project/pull/95503
More information about the cfe-commits
mailing list