<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/80579>80579</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-format] When processing constexpr inline, the middle macro will be deleted
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
MacroModel
</td>
</tr>
</table>
<pre>
clang-format --version
clang-format version 18.0.0git (git@github.com:trcrsired/llvm-project.git 5758bf1ec7999db033707991034026ff7b837506)
There has been no modification of any clang format related source code in this repository
.clang-format fills
--------------------------------------------------
# clang-format configuration
# compatible with clang-format 18
UseTab: Never
ColumnLimit: 160
# Indent
IndentWidth: 4
BracedInitializerIndentWidth: 4
AccessModifierOffset: -4
IndentAccessModifiers: false
IndentCaseLabels: true
IndentExternBlock: Indent
IndentGotoLabels: true
IndentPPDirectives: BeforeHash
IndentRequiresClause: true
IndentWrappedFunctionNames: true
NamespaceIndentation: All
LambdaBodyIndentation: Signature
BitFieldColonSpacing: Both
# Insert
InsertBraces: true
InsertNewlineAtEOF: true
KeepEmptyLinesAtEOF: true
# Align
AlignAfterOpenBracket: true
AlignTrailingComments:
Kind: Always
AlignArrayOfStructures: Left
PointerAlignment: Left
# Break
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: Always
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: true
BeforeWhile: true
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakAfterAttributes: Never
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: Always
BreakBeforeInlineASMColon: OnlyMultiline
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
BreakAdjacentStringLiterals: false
BreakStringLiterals: false
CompactNamespaces: false
Cpp11BracedListStyle: true
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: Always
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowBreakBeforeNoexceptSpecifier: Never
AllowShortBlocksOnASingleLine: Always
AllowShortCaseLabelsOnASingleLine: true
AllowShortCompoundRequirementOnASingleLine: true
AllowShortEnumsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: Yes
RequiresClausePosition: OwnLine
BinPackArguments: false
BinPackParameters: false
# Space
SeparateDefinitionBlocks: Always
SpaceBeforeParens: Custom
SpaceBeforeParensOptions:
AfterControlStatements: false
AfterForeachMacros: false
AfterFunctionDeclarationName: false
AfterFunctionDefinitionName: false
AfterIfMacros: false
AfterOverloadedOperator: true
AfterPlacementOperator: Never
AfterRequiresInClause: true
AfterRequiresInExpression: false
BeforeNonEmptyParentheses: false
SpaceBeforeRangeBasedForLoopColon: false
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: Never
SpacesInParens: Custom
SpacesInParensOptions:
InConditionalStatements: false
InCStyleCasts: false
InEmptyParentheses: false
Other: false
SpacesInSquareBrackets: false
# Order
QualifierAlignment: Custom
QualifierOrder: ["constexpr", "const", "inline", "static", "type"]
SortIncludes: Never
SortUsingDeclarations: LexicographicNumeric
--------------------------------------------------
before format:
--------------------------------------------------
inline
#if defined(__has_builtin)
#if __has_builtin(__builtin_memcmp)
constexpr
#endif
#endif
int my_memcmp(const void* dest, const void* src, ::std::size_t count) noexcept
{
return
#if defined(__has_builtin)
#if __has_builtin(__builtin_memcmp)
__builtin_memcmp
#else
::std::memcmp
#endif
#else
::std::memcmp
#endif
(dest, src, count);
}
--------------------------------------------------
after format:
--------------------------------------------------
constexpr inline
#endif
#endif
int
my_memcmp(const void* dest, const void* src, ::std::size_t count) noexcept
{
return
#if defined(__has_builtin)
#if __has_builtin(__builtin_memcmp)
__builtin_memcmp
#else
::std::memcmp
#endif
#else
::std::memcmp
#endif
(dest, src, count);
}
--------------------------------------------------
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWM1u4zgSfhr5QiRQJDu2Dz7YTrJrjBNn22kEewooqmRxQpEakkriefoFSf1LyXTv9mkxPhiS6qti_XysooSVoicOsPJmG292M8GFToVc3WMixb2IgU0iEZ9XhGF-ukiEzLBGFxdvIBUV3PNvPH_dkZUSdLW49C_9E9XICxYnqr2puUmL6JKIzAvXWhKpqITYC-4Ye8sucil-B6IvjcpsPltEyRWQ-XK5jCM_DOf-fLm88sOpH1wnyTxahPOZf-0FS-fCUwoSUIoVigA44gJlIqYJJVgbZ0SCMD8j6ygqHZXAsIYYKVFIAoiIGBDlSKdUIQm5UFQLeXbm3f9lJ9CEMqac4OKnf6XZIEQdm0TwhJ4Kab1uYUSWY00jBuid6rSrc7Vo-_hdwROOvHCNHuANpHu4FazI-J5mVBvJ1bXfVjEr7HgMXLt7d_1MY50a9NQ93UhMIN5xqilm9E-Q47A1IaDUvU0-yEOSKLBrXkzbxrsoZQAJZgramC1WsMcRMCvWsuhIbz80SL5hgrwa8dD_fwgtPld_fLyhEoimb2DlG0iEhH9ilbZR3-CPgkpQW4YLBWN2niXOc4jvCk5MyR5wBr317KMcE3AKrrLhGq0Zc4A9zqIYb0R87iGO9MSxLmRpaEP1HQUWbwUT_JhjQvnJui50OiynAlmnw1zb8g1SYSQP8M4oh7W-Pdx15b8B5LdZrs97ykGNAJoF14yeSsLay3WiQR5y4GbdV0eBRs9CniSmjPLTVmQZcG18c1KEfqM8djl6x2fVXssZlxKfD8lRy4KY_Niw9pCUAT8KyjVICzWWu9LG540E_FqRG_Cr40CTqG2htMha7LfFd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