<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/89721>89721</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-format] Unexpected formatting for a vector of strcutures.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
CJCombrink
</td>
</tr>
</table>
<pre>
**Version**: clang-format version 18.1.1
**Platform**: Centos 8
<details>
<summary>.clang-format</summary>
```
---
Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignArrayOfStructures: Left
AlignConsecutiveAssignments:
Enabled: true
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: true
AlignConsecutiveBitFields:
Enabled: true
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: true
AlignConsecutiveDeclarations:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: true
AlignConsecutiveMacros:
Enabled: true
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: true
AlignConsecutiveShortCaseStatements:
Enabled: true
AcrossEmptyLines: true
AcrossComments: true
AlignCaseColons: false
AlignEscapedNewlines: Left
AlignOperands: Align
AlignTrailingComments:
Kind: Always
OverEmptyLines: 0
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowBreakBeforeNoexceptSpecifier: Never
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: true
AllowShortCompoundRequirementOnASingleLine: true
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: true
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: false
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: false
BeforeWhile: true
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakAdjacentStringLiterals: true
BreakAfterAttributes: Leave
BreakAfterJavaFieldAnnotations: false
BreakArrays: true
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeConceptDeclarations: Always
BreakBeforeBraces: Custom
BreakBeforeInlineASMColon: OnlyMultiline
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
BreakStringLiterals: true
ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: Always
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IfMacros:
- KJ_IF_MAYBE
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '".*'
Priority: 0
SortPriority: 1
CaseSensitive: false
- Regex: '^<(protobuf-gen)/'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '^<(messages)/'
Priority: 3
SortPriority: 0
CaseSensitive: false
- Regex: '^<.+/' #include <{lib}/...>
Priority: 4
SortPriority: 0
CaseSensitive: false
- Regex: '.*' # Everything Else - std, etc
Priority: 5
SortPriority: 0
CaseSensitive: false
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentAccessModifiers: false
IndentCaseBlocks: false
IndentCaseLabels: true
IndentExternBlock: AfterExternBlock
IndentGotoLabels: true
IndentPPDirectives: None
IndentRequiresClause: true
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertBraces: false
InsertNewlineAtEOF: true
InsertTrailingCommas: None
IntegerLiteralSeparator:
Binary: 4
BinaryMinDigits: 0
Decimal: 0
DecimalMinDigits: 0
Hex: 0
HexMinDigits: 0
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
KeepEmptyLinesAtEOF: false
LambdaBodyIndentation: Signature
LineEnding: DeriveLF
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PackConstructorInitializers: Never
PenaltyBreakAssignment: 1000000
PenaltyBreakBeforeFirstCallParameter: 1000000
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakOpenParenthesis: 1000000
PenaltyBreakScopeResolution: 500
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyIndentedWhitespace: 0
PenaltyReturnTypeOnItsOwnLine: 1000000
PointerAlignment: Left
PPIndentWidth: -1
QualifierAlignment: Leave
ReferenceAlignment: Pointer
ReflowComments: true
RemoveBracesLLVM: false
RemoveParentheses: Leave
RemoveSemicolon: true
RequiresClausePosition: OwnLine
RequiresExpressionIndentation: OuterScope
SeparateDefinitionBlocks: Always
ShortNamespaceLines: 0
SkipMacroDefinitionBody: false
SortIncludes: CaseSensitive
SortJavaStaticImport: Before
SortUsingDeclarations: LexicographicNumeric
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceAroundPointerQualifiers: Default
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: false
SpaceBeforeInheritanceColon: false
SpaceBeforeJsonColon: false
SpaceBeforeParens: Custom
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterForeachMacros: true
AfterFunctionDefinitionName: false
AfterFunctionDeclarationName: false
AfterIfMacros: true
AfterOverloadedOperator: false
AfterPlacementOperator: true
AfterRequiresInClause: false
AfterRequiresInExpression: false
BeforeNonEmptyParentheses: false
SpaceBeforeRangeBasedForLoopColon: false
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: Never
SpacesInContainerLiterals: true
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInParens: Never
SpacesInParensOptions:
InCStyleCasts: false
InConditionalStatements: false
InEmptyParentheses: false
Other: false
SpacesInSquareBrackets: false
Standard: Latest
StatementAttributeLikeMacros:
- Q_EMIT
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 4
UseTab: Never
VerilogBreakBetweenInstancePorts: true
WhitespaceSensitiveMacros:
- STRINGIZE
- PP_STRINGIZE
- BOOST_PP_STRINGIZE
- NS_SWIFT_NAME
- CF_SWIFT_NAME
...
```
</details>
**Code**
```
struct test_configuration
{
std::string filepath_suffix;
double double1;
double double2;
double double3;
double double4;
};
const auto test_cases = std::vector<test_configuration>{
{"some_long_path/some_folder/111111/some_other_folder/another_folder/11111111/"
"some_really_long_file_name.bin",
111e1, -1111111, 1.11e1, 1111111},
{"some_long_path/some_folder/111111/some_other_folder/another_folder/11111111/"
"some_other_really_long_file_name.bin",
111e1, 11.1111e1, 11.11e1, 11111111.11},
{"short_folder/folder/other/some_long_file_name.bin", 111111111.111111, 1111111, 111111, 111111 },
};
```
**Formatted**
```
struct test_configuration
{
std::string filepath_suffix;
double double1;
double double2;
double double3;
double double4;
};
const auto test_cases = std::vector<test_configuration>{
{"some_long_path/some_folder/111111/some_other_folder/another_folder/11111111/"
"some_really_long_file_name.bin", 111e1,
-1111111,
1.11e1, 1111111},
{"some_long_path/some_folder/111111/some_other_folder/another_folder/11111111/"
"some_other_really_long_file_name.bin", 111e1,
11.1111e1, 11.11e1,
11111111.11 },
{"short_folder/folder/other/some_long_file_name.bin", 111111111.111111, 1111111, 111111, 111111 },
};
```
**Expected**
Probably anything except the amount of padding in front of many of the numbers
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWltz4riz_zTOiwsKTDJJHvIABnaZIYHBZKb2vFDCbhttZMkryUk4n_6ULr6bzNReTtX-60_NEFD_JHWrL-pujITACQV4cG5mzs38CuXyxPiD_9ln6ZFj-nJ1ZNH5wfGmjjf9BlxgRs0XZzJ1Q4JoMogZT5F0Xw3VHd8Nx8OxM5o7o6mBbgmSClRN9IFKJtw718LM-8SPQCJMhDNZtAgiT1PEz85kMaxv6kx8x1tWxMasTyP7T38dDAbmwxrRJEcJaD6yzAxOwxCEeGQRjjHwTRwLkAowuLZ0ghM6jSXwTQZ0xlH4YgCaUMdwjs6bOJA8D2XOQSjQGmJZw_iMCghziV9hqs8_BSoV0GDcBUVHApGaWbwkz8FS3WnImRCLNJPnNaZmhxgR0QL4LC3WbZEND2nGcmo36dKXOQ0lZnTLMJXAO6tsUbTJgCPJDK3BY1vKGZZLDCSqyVgX8i8K16D_LcJ1pLss2hxCgjhSq12Qrng1uPyLUnbF_EeFfESKnY_FqynxXyZdcGJc-khAIJGEli_-CVG75tyQtEHWrCABPiPGgOpCaOpChCiD6AneSLFBK5xoMal2rk442nOECaZJjYNi7y-YNqRyFTtv6CwsYPMKvCmYOypWJuxtSsiUJ7ledUOf4F0qXEcCg9wijlJQetrENY_5eN6MA3qZQcw4PDF4DyGTQQahjtAK_wSvwGt4rccZYeGL2NBpgGlCoFhbC9LGqoNfoyOQLr5uLSXcGuQO_sgx14byU_MWNE-7O7Sl1dDCqn9SgFVcmWxnRu_xrFF6jFAXPCWkA2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