<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/148199>148199</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[format] Macro replacement results in long code to be put on a single line.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
JVApen
</td>
</tr>
</table>
<pre>
````
#define DEFAULT_UNREACHABLE() default: break
auto func()
{
switch (0)
{
case 0:
return MyVeryLongInitialization{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z, {MyOtherClass{abc,def,ghi}}};
case 1:
return MyVeryLongInitialization{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z, {MyOtherClass{abc,def,ghi}}};
DEFAULT_UNREACHABLE();
}
}
````
I'm using the following config:
````
--style="{ 'Macros': ['DEFAULT_UNREACHABLE=default: break' ], 'ColumnLimit': 20, 'AllowShortCaseExpressionOnASingleLine': true}"
````
results in
````
#define DEFAULT_UNREACHABLE() \
default: \
break
auto func() {
switch (0) {
case 0:
return MyVeryLongInitialization{
a,
b,
c,
d,
e,
f,
g,
h,
i,
j,
k,
l,
m,
n,
o,
p,
q,
r,
s,
t,
u,
v,
w,
x,
y,
z,
{MyOtherClass{
abc,
def,
ghi}}};
case 1:
return MyVeryLongInitialization{a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, {MyOtherClass{abc, def, ghi}}};
DEFAULT_UNREACHABLE();
}
}
````
while I expect the second return to be formatted the same as the first one.
Note that with 'Macros', I cannot define a replacement for `DEFAULT_UNREACHABLE()`, only for `DEFAULT_UNREACHABLE`
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzcVs1u4zgTfJr2hYghteLIPugg0zG-fEhmgJ2duS4oqWUxoUiPSMVxnn5BWpmE-d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