aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Format/ContinuationIndenter.cpp
diff options
context:
space:
mode:
authorOwen Pan <owenpiano@gmail.com>2025-05-19 01:29:16 -0700
committerGitHub <noreply@github.com>2025-05-19 01:29:16 -0700
commit0cac25bcf5a246eb8a1f02d5041731ae9a6f00e0 (patch)
tree981f430d8d3352239d64f2d4093c3ecf867fda25 /clang/lib/Format/ContinuationIndenter.cpp
parentdc0dcab397ae3de38141e1995e4b4e5e3bb98660 (diff)
downloadllvm-0cac25bcf5a246eb8a1f02d5041731ae9a6f00e0.zip
llvm-0cac25bcf5a246eb8a1f02d5041731ae9a6f00e0.tar.gz
llvm-0cac25bcf5a246eb8a1f02d5041731ae9a6f00e0.tar.bz2
[clang-format] Fix the indent of StartOfName after AttributeMacro (#140361)
Fix #139510
Diffstat (limited to 'clang/lib/Format/ContinuationIndenter.cpp')
-rw-r--r--clang/lib/Format/ContinuationIndenter.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp
index 55e1d1c..4e4e48f9 100644
--- a/clang/lib/Format/ContinuationIndenter.cpp
+++ b/clang/lib/Format/ContinuationIndenter.cpp
@@ -1475,7 +1475,9 @@ unsigned ContinuationIndenter::getNewLineColumn(const LineState &State) {
(PreviousNonComment->ClosesTemplateDeclaration ||
PreviousNonComment->ClosesRequiresClause ||
(PreviousNonComment->is(TT_AttributeMacro) &&
- Current.isNot(tok::l_paren)) ||
+ Current.isNot(tok::l_paren) &&
+ !Current.endsSequence(TT_StartOfName, TT_AttributeMacro,
+ TT_PointerOrReference)) ||
PreviousNonComment->isOneOf(
TT_AttributeRParen, TT_AttributeSquare, TT_FunctionAnnotationRParen,
TT_JavaAnnotation, TT_LeadingJavaAnnotation))) ||