<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=http://email.email.llvm.org/c/eJy9l1tzozYUxz8NftHEg_GVBx587aaTOp3EfuhTRoAw6sqISsKp--n3HGEDTkjt3XTLeAy6nd__SEdwFMr4GMxlIWLCDQkZyaXWPBSMJFIRZ-RGgma7OyjsqYEiMZLQwkgo8YgKcSSKRXKX8X8Y4THLbC3JqTFMZZrQLCZU8F1GTMr2JJIKuhtxdPorx1047tTxJo-K5EoeYDSh5JUeEbFHSzIjuojS2hqy0RiO9vyTAft_b8irdQI82ClGDfZN6YERLffMpDzbEcG_MpRBMvaKnk3R1FQpenxMno0qIlMoptHHnCoKo5iyk3ChodukrqCVZ9rQLGKONydfGctLhaifgG-CJYZAL8V3qcEuMctZFqMcaeeEaGYMFMEfhDn9aRMAYk6_02T1Y5bwjJHp0-bLcrpYPt2v7zfAyUAvmjfHnKEpZzwjl3VzomGNZFJ19skd6UHHRWk7kuBIbRefUkZjprQznDnDBXH6CzRb9iZwvdXgeN40x5VkMTwiEa8vG21iXC1v_q9D5zIzSorGyJuHLqhhzXF2qGJ_3TKUa6N4WGCwnUzcSl3-nXOMlx8QvFJyf00wLkx_1h4GbZVohOsXdAejCTG0wYDljWADv6u_vJbrRakBYtcrh5Ce7e1XYtpAYW2xDQS3sI3ZhvM-gQtr3q24_o_jahi92bvBdVzTVAvuxlUb3uJXFJ_3zUfTGL2bUbjF9W5rQ48-g45aMBZiq5JmzRvs-A32lk1Tv1Bnj48PoAFK-GYsr80fvy9fsGE5XZfu4mu16nVeDffyYb19eKge6vdrjVpvf5stny5hFnVusNYQVRn9gHkVtW1hWdS2ybpAfcC8inrewAvulxavzg3vvbqF2YZ6uH_etK5V2XDaI1dQlUe1pRr1XaEzf1yvXk7xA7GYoFGZJPBht0aHjW8B9AilFHCf1tJPDQfJ43OD3Q2TKKWqUVPaxkcbhBWiToUuJVVrf12UkJCQ_C-itt-hqsg0pFIsJhfyfoaqKnivi6pJl7P1M2SdAv26KG3TV3KA3Fo21f03otp2QycO-rHf92kHTgOpVMGvheAsu1vCf6dQIkiNyTWmsx7k6qsdN2kRdiPMe1ZCHM63O8gX_wTVUORaF5hOrYaeP5500mA8cgcTd9Rzo76XDOJkMori_mQcxaE_Ho6Gg46gIRM6wPzU8zCptybwMzBcdD6vgAee63luzx303GHP9buM-mPXdyllcTh2x74zcNmectFFO12pdh0VWJNhsdPQKCC51HUj1TacWVAm1B3DjWDBU3V80nzPBSxN87gDxxl7noBNEB5J8yzWsWoDK_UbLU-k3g>52978</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Recognize similar patterns to be aligned by clang-format
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Julien-Elie
</td>
</tr>
</table>
<pre>
Could it be possible for `clang-format` to automatically recognize identical patterns and align them correctly?
(Or provide a way to mention such patterns to align?)
It would be great to have something like the new `AlignArrayOfStructures` parameter for such patterns.
For instance, keep alignment (left or right, depending on the setting) for:
```
#define ARTHEADERINIT(name, type) { name, type, sizeof(name) - 1 }
const ARTHEADER ARTheaders[] = {
ARTHEADERINIT("Approved", HTstd),
ARTHEADERINIT("Control", HTstd),
ARTHEADERINIT("Date", HTreq),
ARTHEADERINIT("Distribution", HTstd),
ARTHEADERINIT("Expires", HTstd),
ARTHEADERINIT("From", HTreq),
};
```
```
is_string("a", concat("a", END), "concat 1");
is_string("ab", concat("a", "b", END), "concat 2");
is_string("ab", concat("ab", "", END), "concat 3");
is_string("ab", concat("", "ab", END), "concat 4");
is_string("", concat("", END), "concat 5");
is_string("abcde", concat("ab", "c", "", "de", END), "concat 6");
is_string("abcde", concat("abc", "de", END, "f", END), "concat 7");
```
```
#define BOOL(def) TYPE_BOOLEAN, { (def), 0, 0, NULL, NULL }
#define NUMBER(def) TYPE_NUMBER, { 0, (def), 0, NULL, NULL }
#define UNUMBER(def) TYPE_UNUMBER, { 0, 0, (def), NULL, NULL }
#define STRING(def) TYPE_STRING, { 0, 0, 0, (def), NULL }
#define LIST(def) TYPE_LIST, { 0, 0, 0, NULL, (def) }
```
```
#define CONF_BOOL(conf, offset) \
(bool *) (void *) ((char *) (conf) + (offset))
#define CONF_NUMBER(conf, offset) \
(long *) (void *) ((char *) (conf) + (offset))
#define CONF_UNUMBER(conf, offset) \
(unsigned long *) (void *) ((char *) (conf) + (offset))
#define CONF_STRING(conf, offset) \
(char **) (void *) ((char *) (conf) + (offset))
#define CONF_LIST(conf, offset) \
(struct vector **) (void *) ((char *) (conf) + (offset))
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy9l1tzqzYQxz8NftHEgyG2wwMPvvakkzqdxH7oU0aAMOqREZWEU_fTn11hA05I7XNlPAbd9vdfaSWWSCaHcCZLkRBuSMRIIbXmkWAklYo4IzcWNN_eQGFHDRSJkYSWRkKJx1SIA1Esltuc_8cIT1hua0lBjWEq14TmCaGCb3NiMrYjsVTQ3YiD4y8dd-64E8e7e1SkUHIPowklr_SAiB1akjnRZZw11pCNxnC0FxwN2P97Q16tE-DBVjFqsG9G94xouWMm4_mWCP6ZoQySs1f0bIKmJkrRw2P6bFQZm1IxjT4WVFEYxZSdhDMN_TZ1Ca0814bmMXO8GfnMWFEpRP0EfBMsNQR6Kb7NDHZJWMHyBOVIOydEM2OgCP4gzPEnbQCIOf6Ok-UnLOU5I5On9afFZL54ul_dr4GTg140bw4FQ1POeErO62ZEwxrJtO4ckBsygI7zynYswZHGLj5ljCZMaWc4dYZz4vhzNFv1JnC91eB43qTAlWQJPCIRr09rbRJcLW_2v0NnMjdKitbIq4fOqWHtcXaoYv9cM5Rro3hUYrAdTVxLXfxbcIyXbxC8VHJ3STAujD_tDoOuSjTC9Qu6g9GEGNpiwPLGsIHf1Z9fi9W80gCx61VDyMD2DmoxXaCosdgFglvUxezCed-BixretTj_23ENjF7t3e1lXNtUB-7KVRte41ecnPbNR9MYv5tRuCX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