<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/109768>109768</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-format - function declaration incorrect formatting
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
robert-andrzejuk
</td>
</tr>
</table>
<pre>
Is:
int function_name(HWND* parent,
int id,
const wchar_t* title,
int x = 0,
int y = 0,
int w = 0,
int h = 0,
long extraStyle = 0,
bool readOnly = false,
FancyClassType* module = nullptr);
Expected:
int function_name(HWND* parent,
int id,
const wchar_t* title,
int x = 0,
int y = 0,
int w = 0,
int h = 0,
long extraStyle = 0,
bool readOnly = false,
FancyClassType* module = nullptr);
Clang-format file:
```
# LLVM version 18
Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignArrayOfStructures: Right
AlignConsecutiveAssignments:
Enabled: true
AcrossEmptyLines: false
AcrossComments: true
AlignCompound: true
AlignFunctionPointers: true
PadOperators: true
AlignConsecutiveBitFields:
Enabled: true
AcrossEmptyLines: false
AcrossComments: true
AlignCompound: true
AlignFunctionPointers: true
PadOperators: false
AlignConsecutiveDeclarations:
Enabled: true
AcrossEmptyLines: false
AcrossComments: true
AlignCompound: true
AlignFunctionPointers: true
PadOperators: false
AlignConsecutiveMacros:
Enabled: true
AcrossEmptyLines: false
AcrossComments: true
AlignCompound: true
AlignFunctionPointers: true
PadOperators: false
AlignConsecutiveShortCaseStatements:
Enabled: true
AcrossEmptyLines: false
AcrossComments: false
AlignCaseColons: false
AlignEscapedNewlines: Left
AlignOperands: Align
AlignTrailingComments:
Kind: Always
OverEmptyLines: 0
AllowAllArgumentsOnNextLine: false
#AllowAllConstructorInitializersOnNextLine: false #depracated
AllowAllParametersOfDeclarationOnNextLine: false
AllowBreakBeforeNoexceptSpecifier: OnlyWithParen
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortCompoundRequirementOnASingleLine: true
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: Inline
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
AttributeMacros:
- __capability
BinPackArguments: false
BinPackParameters: false
BitFieldColonSpacing: Both
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: Always
AfterEnum: true
AfterExternBlock: true
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: true
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
BreakAdjacentStringLiterals: true
BreakAfterAttributes: Leave
BreakAfterJavaFieldAnnotations: false
BreakArrays: true
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeConceptDeclarations: Always
BreakBeforeBraces: Custom
BreakBeforeInlineASMColon: OnlyMultiline
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: AfterComma
BreakStringLiterals: false
ColumnLimit: 120
CommentPragmas: "^ IWYU pragma:"
CompactNamespaces: true
#ConstructorInitializerAllOnOneLineOrOnePerLine: false #depracated
ConstructorInitializerIndentWidth: 6
ContinuationIndentWidth: 6
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: Always
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IfMacros:
- KJ_IF_MAYBE
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '\"stdafx.h\"|\"StdAfx.h\"'
Priority: -1
SortPriority: 0
CaseSensitive: false
- Regex: ".*"
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '\<cstdlib\>|\<csignal\>|\<csetjmp\>|\<cstdarg\>|\<typeinfo\>|\<typeindex\>|\<type_traits\>|\<bitset\>|\<functional\>|\<utility\>|\<ctime\>|\<chrono\>|\<cstddef\>|\<initializer_list\>|\<tuple\>|\<any\>|\<optional\>|\<new\>|\<memory\>|\<scoped_allocator\>|\<memory_resource\>|\<climits\>|\<cfloat\>|\<cstdint\>|\<cinttypes\>|\<limits\>|\<exception\>|\<exception_list\>|\<stdexcept\>|\<cassert\>|\<system_error\>|\<cerrno\>|\<cctype\>|\<cwctype\>|\<cstring\>|\<cwchar\>|\<cuchar\>|\<string\>|\<string_view\>|\<array\>|\<vector\>|\<deque\>|\<list\>|\<forward_list\>|\<set\>|\<map\>|\<unordered_set\>|\<unordered_map\>|\<stack\>|\<queue\>|\<algorithm\>|\<execution_policy\>|\<iterator\>|\<cmath\>|\<complex\>|\<valarray\>|\<random\>|\<numeric\>|\<ratio\>|\<cfenv\>|\<iosfwd\>|\<ios\>|\<istream\>|\<ostream\>|\<iostream\>|\<fstream\>|\<sstream\>|\<strstream\>|\<iomanip\>|\<streambuf\>|\<cstdio\>|\<locale\>|\<clocale\>|\<codecvt\>|\<regex\>|\<atomic\>|\<thread\>|\<mutex\>|\<shared_mutex\>|\<future\>|\<condition_variable\>|\<filesystem\>|\<ciso646\>|\<ccomplex\>|\<ctgmath\>|\<cstdalign\>|\<cstdbool\>'
Priority: 3
SortPriority: 0
CaseSensitive: false
- Regex: '\<sys\/|\<unistd.h\>|\<fcntl.h>|\<poll.h\>'
Priority: 4
SortPriority: 0
CaseSensitive: false
- Regex: '\<gmock|\<gtest|\<log'
Priority: 5
SortPriority: 0
CaseSensitive: false
IncludeIsMainRegex: "(Test)?$"
IncludeIsMainSourceRegex: ""
IndentAccessModifiers: false
IndentCaseBlocks: false
IndentCaseLabels: true
IndentExternBlock: Indent
IndentGotoLabels: false
IndentPPDirectives: BeforeHash
IndentRequiresClause: true
IndentWidth: 4
IndentWrappedFunctionNames: true
InsertBraces: true
InsertNewlineAtEOF: true
InsertTrailingCommas: None
#IntegerLiteralSeparator:
# Binary: 4
# BinaryMinDigits: 6
# Decimal: 3
# DecimalMinDigits: 5
# Hex: 4
# HexMinDigits: 4
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
KeepEmptyLinesAtEOF: false
LambdaBodyIndentation: Signature
LineEnding: DeriveCRLF
MacroBlockBegin: "DEFINE_RESPONSE_TABLE1|BEGIN_COM_MAP"
MacroBlockEnd: "END_RESPONSE_TABLE|END_COM_MAP"
MaxEmptyLinesToKeep: 2
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PackConstructorInitializers: Never
PenaltyBreakAssignment: 200
PenaltyBreakBeforeFirstCallParameter: 200
PenaltyBreakComment: 30000
PenaltyBreakFirstLessLess: 150
PenaltyBreakOpenParenthesis: 100
PenaltyBreakScopeResolution: 500
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 100
PenaltyIndentedWhitespace: 0
PenaltyReturnTypeOnItsOwnLine: 500
PointerAlignment: Left
PPIndentWidth: 2
QualifierAlignment: Leave
#QualifierOrder: ['inline', 'static', 'const', 'type', 'volatile' ]
ReferenceAlignment: Left
ReflowComments: false
RemoveBracesLLVM: false
RemoveParentheses: Leave
RemoveSemicolon: true
RequiresClausePosition: OwnLine
RequiresExpressionIndentation: Keyword
SeparateDefinitionBlocks: Leave
ShortNamespaceLines: 40
SkipMacroDefinitionBody: false
SortIncludes: Never
SortJavaStaticImport: Before
SortUsingDeclarations: LexicographicNumeric
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceAroundPointerQualifiers: Default
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeJsonColon: true
SpaceBeforeParens: Custom
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterForeachMacros: true
AfterFunctionDefinitionName: false
AfterFunctionDeclarationName: false
AfterIfMacros: true
AfterOverloadedOperator: false
AfterPlacementOperator: true
AfterRequiresInClause: true
AfterRequiresInExpression: true
BeforeNonEmptyParentheses: false
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: Never
SpacesInContainerLiterals: false
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInParens: Custom
SpacesInParensOptions:
InCStyleCasts: true
InConditionalStatements: false
InEmptyParentheses: false
Other: false
SpacesInSquareBrackets: false
Standard: Latest
StatementAttributeLikeMacros:
- Q_EMIT
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
- "EV.*,"
- EV_WM_SIZE,
- EV_WM_DESTROY,
- _STD_BEGIN
- _STD_END
- _STDEXT_BEGIN
- _STDEXT_END
- _EXTERN_C
- _END_EXTERN_C
- _EXTERN_C_UNLESS_PURE
- _END_EXTERN_C_UNLESS_PURE
- COM_INTERFACE_ENTRY
TabWidth: 4
UseTab: Never
VerilogBreakBetweenInstancePorts: true
WhitespaceSensitiveMacros:
- STRINGIZE
- PP_STRINGIZE
- BOOST_PP_STRINGIZE
- NS_SWIFT_NAME
- CF_SWIFT_NAME
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzcW1t34jjy_zTOCyd9iMn1IQ9czAwzBGhMOtv_Fx9hF6COLHkkmcB--v-RfJdEZ3Z39mHHpzuE0q9KJamqVCo5SAi8pwDP3t3Iu5tcoVweGH_mbAtcXiOa8H_Cj_z9asuS8_NMeIOh1594_fJn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