<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/112526>112526</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-format] Regression in class braces formatting in 19.1.0
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
MiKom
</td>
</tr>
</table>
<pre>
Hey. After updating to clang-format 19.1 from 18.x, it started formatting class braces placement differently.
For example, given the code:
```cpp
#define EXPORT_MACRO
class EXPORT_MACRO MyClass
{
public :
virtual ~MyClass() {}
};
```
And config:
```
---
BasedOnStyle: WebKit
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
```
I get the following formatting in 19.1:
```cpp
#define EXPORT_MACRO
class EXPORT_MACRO MyClass {
public :
virtual ~MyClass() {}
};
```
(the brace after class goes after class name and not on a new line)
Whereas in 18.1.3 there's no change to the source.
Interestingly, if I change the destructor to:
```cpp
virtual ~MyClass();
```
It starts behaving properly again.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVE1v4zgM_TXyhYhhy1_xwYd8bLBBUXTRXaB7G8gybWtGlgxJTpvL_PaB7LSTTIueCgSJQ_NJfO-RZNaKTiFWJNuSbB-wyfXaVPfiTg9BrZtz9TeeQ9i0Dg1MY8OcUB04DVwy1a1abQbmIC7DGFqjB4jX4QuhOxAOrGPGYQNLzozjklkLtWEcLYyScRxQOWhE26JB5eQ5JNGeRJvl-6AN4AsbRon-zE6cUIHrEbhukCSXLJJHy4eP4yVCkwZboRD--v-fh8f_vt1vdo8Py7ulhOs43J93PnjBFtvlYZxqKTi8XQMAcBLGTUzCz1cIXRNagscU-1f8niTbPyq7JrVRDXCtWtG9Z7D8Xa1Wy8OWWWwe1L_uLD1deML6Trjrw7YG2Y8tttrgdlbVp-0m6_TwmsA4Phk2jkJ1N1xmSxcWyQacmfCToo_QoZulb7WU-tmbeeWrUHMLfLkl8OaGr_gjR77AFbr2vOamBDb3-VJQp9HeBBQbEJhqQGkHWgEDhc8ghUJCy2u1nno0yOwsyzqMw8QrZ5DQwoLSwHumOvRD5C-2ejIcb_r-qBwatF5aeZ6nqYXjG6xHaNA6M3GnDTj9ieofK_N5fx4vk2uhxp6dvL2j0SMaeQbWMaHCoKmSpkxKFmAVF7SMijJJ86CvCuRpnvCCRbzAtM7ytCli1q55m6-zFutAVDSiaRzFeRynZZSFbVGyDFvMszJKmrQmaYQDEzKU8jSE2nSBsHbCKo5pRvNAshqlnXcVpdcbiFDqt5epPG5VT50laSSFdfb3SU44Oe-5G2C2h0fsDFortPKO3eyo9z0eRsFkZNU7N_rBIfRA6KETrp_qkOuB0IO_8PKzGo3-jtwReph5WEIPFyqniv4KAAD__xxepLs">