<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/59579>59579</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-format gives different results if line breaks differently.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ZequanWu
</td>
</tr>
</table>
<pre>
Example:
```
$ cat a.cpp
#define COMPONENT_EXPORT(X)
template <typename T>
struct struct_template_long {};
COMPONENT_EXPORT(ASH_CONSTANTS) extern const struct_template_long<bool> kAmbientModeCulturalInstitutePhotosEnabled1;
COMPONENT_EXPORT(ASH_CONSTANTS)
extern const struct_template_long<bool> kAmbientModeCulturalInstitutePhotosEnabled2;
$ clang-format a.cpp
#define COMPONENT_EXPORT(X)
template <typename T> struct struct_template_long {};
COMPONENT_EXPORT(ASH_CONSTANTS)
extern const
struct_template_long<bool> kAmbientModeCulturalInstitutePhotosEnabled1;
COMPONENT_EXPORT(ASH_CONSTANTS)
extern const struct_template_long<bool>
kAmbientModeCulturalInstitutePhotosEnabled2;
```
Expected behavior: `kAmbientModeCulturalInstitutePhotosEnabled1` and `kAmbientModeCulturalInstitutePhotosEnabled2` have the same format after formatting. clang-format should gives the same results even if the original codes break lines differently.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEVEtvozoU_jVmc1QE5pGwYJGmRPcumlS3kW41m8jAATw1NmMfovbfjwjpa6abVlONhGzZPq_v-w5HOCdbjZiz5JIlV54YqTM2_4Y_RqH_H73S1I958SD6QSGLViy4YsGKpcH5m488hkoQCL8ahqerqMZGaoT17vpmty22-0Nxd7P7b8_48o7xbDYj7AclCIFFa3ocUIseYc-iYn52ZMeKYN4OT8YHZXQLbHHJFlcsujwnPK3vJFvd_nNY77a3-9V2f8t4BvhAaDVURrv3Q7NoXRqjWFTA_aovJWq6NjWuR0WjFepf7UjSSHjTGTKu0KJUWIefqGS2_Jp6-Es9kzpK6PaiMbb_szLBVyj0Oy3zDQD8Vb0-LNe57E-J9ssf9motHgasCGsosRNHaSyLVsDS4CPY0wCErj_mxSevThwRqENwUws8NVRDaM8Hkrr13_ab68yoamjlEd2Lr0U3KnKAR9Qgm9ODsbKVWiioTI0OSoviHpTU6KCWTYMWNalH36vzqM6iTHiYh-kijHnG49Tr8mUc10lYRxiKKkmDkFdplERJmsQiiJdl48mcB5yHPMyCJImD1K_Cii-SLFumSbYsF0sWB9gLqXyljr1vbOtJ50bMkyxZZJ4SJSp3GpWcv8bIOJ-Gp80nt4tybB2LAyUduZdAJElh_oaZmZJnaM-cyOaEeibgLXbwRqvyjmhw0zjmG8Y3raRuLP3K9Ixvpnzn7WKw5jtWxPjmhMIxvjkB-RkAAP__drjzBA">