From f0bd62d8709a49dd87eb75411e41e2e11e0ab59d Mon Sep 17 00:00:00 2001 From: Brad House Date: Sun, 6 Oct 2024 20:46:43 -0400 Subject: [clang-format] Add AlignFunctionDeclarations to AlignConsecutiveDeclarations (#108241) Enabling AlignConsecutiveDeclarations also aligns function prototypes or declarations. This is often unexpected as typically function prototypes, especially in public headers, don't use any padding. Setting AlignFunctionDeclarations to false will skip this alignment. It is by default set to true to keep compatibility with prior versions to not make unexpected changes. Fixes #74320 --- clang/lib/Format/WhitespaceManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/Format/WhitespaceManager.cpp') diff --git a/clang/lib/Format/WhitespaceManager.cpp b/clang/lib/Format/WhitespaceManager.cpp index fd4a40a..b6b2467 100644 --- a/clang/lib/Format/WhitespaceManager.cpp +++ b/clang/lib/Format/WhitespaceManager.cpp @@ -1020,7 +1020,7 @@ void WhitespaceManager::alignConsecutiveDeclarations() { return true; } if (C.Tok->is(TT_FunctionDeclarationName)) - return true; + return Style.AlignConsecutiveDeclarations.AlignFunctionDeclarations; if (C.Tok->isNot(TT_StartOfName)) return false; if (C.Tok->Previous && -- cgit v1.1