<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/138124>138124</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-format] RemoveParentheses option removes necessary parentheses of Google Mock macro
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
JeroenBrunnenkreef
</td>
</tr>
</table>
<pre>
I've got the RemoveParentheses option of clang-format set to MultipleParentheses. If I then format a file containing a Google Mock MOCK_METHOD macro, it removes parentheses that are necessary.
Example before format (correct code):
`MOCK_METHOD(void, Function, (), (override));`
Example after format (does not compile):
`MOCK_METHOD(void, Function, , override);`
clang-format version: 21.0.0git (shipped with CLion 2025.1)
Google Test framework version: 1.15.0
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUk0FznDgQhX-NuHSZkgQMw4HDeOzZ9e5OeSvle0pAA4qFmpIEjv99SuNxwhxyyAkd9N7Xj35S3uvBItasuGfFQ6KWMJKr_0FHaO_dYi3aV4fYJw117_UTk-WKMFCAMCJ8wYlW_F85tGFEjx5oDposUA-tUXa468lNKoDHAIHgvJigZ7NVpPDUw1N0s3C9rKDXBqElG5S22g6g4C-iwSCcqX2F8_Px36_nx5e_nx9gUq0jJo-gA7jLNB7mzTxhjIYOwWKL3iv3njJ-YPzw-F1Ns0FosCeHn2gm9y05h22AljpksmJZvM12fENlcr-S7iL2tNg2Jo5nJvdR8HGiFZ3THxbR5Z7t-C1Z9QHdBtwRerAUydOszR_Dj7BlboA3m1jR-SjJDiBFylM-6Avdj3qesYM3HUY4_heXKLksUhHN-OH6_1_QB-idmvCN3OvWTKSiSHnS1VlXZZVKsBZlvhNcFEWejHXWVDsu8jzfNVIKWe5kWam-VTwru6rnTaLriOMFF0IKmeVpX4iuKTuZVyU2jahYznFS2qTGrFNKbki09wvWItsLmSdGNWj8pcZSbhMzKWOxXR11d80yeJZzo33wv5yCDubyBG6ExcPvC_7ZtZ-1umkd9TeFvZQ0WZypxxBmH7cqT0yeBh3GpUlbmpg8xWGun7vZ0TdsA5OnS0bP5Okac63ljwAAAP__wL0zWA">