<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Wrongly incrementing indentation for a multiline macro"
href="https://bugs.llvm.org/show_bug.cgi?id=46240">46240</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Wrongly incrementing indentation for a multiline macro
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>10.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Formatter
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>anton.kochkov@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>djasper@google.com, klimek@google.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>.clang-format has the following contents
(<a href="https://github.com/radareorg/radare2/blob/master/.clang-format">https://github.com/radareorg/radare2/blob/master/.clang-format</a>):
Language: Cpp
MaxEmptyLinesToKeep: 1
SpaceBeforeParens: Always
SpaceInEmptyParentheses: false
SpacesInContainerLiterals: true
BasedOnStyle: LLVM
ContinuationIndentWidth: 8
IndentCaseLabels: false
IndentFunctionDeclarationAfterType: false
IndentWidth: 8
UseTab: Always
ColumnLimit: 0
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
AllowShortIfStatementsOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: Inline
AllowShortLoopsOnASingleLine: false
AlignAfterOpenBracket: DontAlign
AlignTrailingComments: false
AlignOperands: false
Cpp11BracedListStyle: false
ForEachMacros: ['r_list_foreach', 'ls_foreach', 'fcn_tree_foreach_intersect',
'r_skiplist_foreach', 'graph_foreach_anode']
SortIncludes: false
The code below
#define R2R_CMD_TEST_FOREACH_RECORD_NOP(name, field)
#define R2R_CMD_TEST_FOREACH_RECORD(macro_str, macro_bool) \
macro_str ("NAME", name) \
macro_str ("FILE", file) \
macro_str ("ARGS", args) \
macro_str ("SOURCE", source) \
macro_str ("CMDS", cmds) \
macro_str ("EXPECT", expect) \
macro_str ("EXPECT_ERR", expect_err) \
macro_bool ("BROKEN", broken)
becomes
#define R2R_CMD_TEST_FOREACH_RECORD_NOP(name, field)
#define R2R_CMD_TEST_FOREACH_RECORD(macro_str, macro_bool)
\
macro_str ("NAME", name)
\
macro_str ("FILE", file)
\
macro_str ("ARGS", args)
\
macro_str ("SOURCE", source)
\
macro_str ("CMDS", cmds)
\
macro_str ("EXPECT", expect)
\
macro_str
("EXPECT_ERR", expect_err) \
macro_bool
("BROKEN", broken)
Which is obviously wrong.
See the code
<a href="https://github.com/radareorg/radare2/blob/master/binr/r2r/r2r.h#L53">https://github.com/radareorg/radare2/blob/master/binr/r2r/r2r.h#L53</a></pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>