summaryrefslogtreecommitdiff
path: root/clang/lib/Format/WhitespaceManager.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2026-01-10 12:21:56 +0100
committerDimitry Andric <dim@FreeBSD.org>2026-01-10 12:21:56 +0100
commit3e481a3afe1344dbb4a0960f34fc89dcdc9f1d61 (patch)
tree9606cd4f686746a547bf31ba2a72777952aacf01 /clang/lib/Format/WhitespaceManager.cpp
parent294ba569803972323a64670451a82af53c660541 (diff)
Vendor import of llvm-project branch release/21.x llvmorg-21.1.8-0-g2078da43e25a, a.k.a. 21.1.8 release.vendor/llvm-project/llvmorg-21.1.8-0-g2078da43e25avendor/llvm-project/release-21.x
Diffstat (limited to 'clang/lib/Format/WhitespaceManager.cpp')
-rw-r--r--clang/lib/Format/WhitespaceManager.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Format/WhitespaceManager.cpp b/clang/lib/Format/WhitespaceManager.cpp
index cc3cc0f6906c..ecc696c53922 100644
--- a/clang/lib/Format/WhitespaceManager.cpp
+++ b/clang/lib/Format/WhitespaceManager.cpp
@@ -1295,7 +1295,10 @@ void WhitespaceManager::alignArrayInitializers() {
bool FoundComplete = false;
for (unsigned InsideIndex = ChangeIndex + 1; InsideIndex < ChangeEnd;
++InsideIndex) {
- if (Changes[InsideIndex].Tok == C.Tok->MatchingParen) {
+ const auto *Tok = Changes[InsideIndex].Tok;
+ if (Tok->is(tok::pp_define))
+ break;
+ if (Tok == C.Tok->MatchingParen) {
alignArrayInitializers(ChangeIndex, InsideIndex + 1);
ChangeIndex = InsideIndex + 1;
FoundComplete = true;