<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/73494>73494</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            clang-format C++ allowShortFunctionsOnASingleLine does not cater for getters and setters
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang-format
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          marlowa
      </td>
    </tr>
</table>

<pre>
    Getters and setters are typically implemented on a single line. Yet the config parameter allowShortFunctionsOnASingleLine is unaware of this. Hence, when the parameter is set so that short functions will not be scrunched up into a line line, getters and setters that were implemented on a single line get reformatted to be multi-line. This is an enhancement request to fix this issue. It ought to be possible to specify the format of getters and setters separately from short functions. Let's call the parameter allowGettersSettersOnASingleLine. The parameter should be optional. Where it is not specified then allowShortFunctionsOnASingleLine applies. Where allowGettersSettersOnASingleLine is specified then it should take precedence over allowShortFunctionsOnASingleLine. Somehow clang-format would have to recognise the pattern for getters and setters.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVM1unDoUfhqzORoEZghhwSLJ1dx7pUhdTKWqS2MO2K2xqX0Inbev7JlRfpQ23YwHyec73x-IEPRkETtW37P6n0yspJzvZuGN20TWu-HU_YtE6AMIO0C4_vcIdFq0FMacQM-LwRkt4QDOgoCg7WQQjLaYw1ckIIUgnR31BIvwYkZCD8IYtx2V83RYrSTtbPhk745p9lFbBB1gtWKLy9wIpHTI4T-0Ehl_gE2hTbjPgDpEghAckBIEIULDeMWGTRsD1hH0CEH61UqFA6wLaEsORKKbfiL89I7qhLqhxz8qjqPgcXR-FhQvkIsb59WQ3p0t-ax0iGyFBbRKWJmwwOOPFQPFgVH_TIJBh7BiDv8TuHVSdAFbXAi6Nxgfw4JSj6fkxXlpdOs9_gGjV4TmBKN381uDcnhEYrwJEGN9420K61KF4_l4FVYU9fJ-UG41Q-TqloguTA5fVPKOovSYw5m5jhbFMD_sg1gWozFcgT6ilPrweoWmKzES3xEWjxKH2ChwT3_RyByObkblNpBG2Gl3sXtLiEo8pTw8SjdZHfDiYCRmYzLvZZJnQ1cNbdWKDLuyKcqiaeu6zVTXt1Vf7stqz-Vwwxu8bYa6qppxXw9l3_djpjte8KoseVMWRV23uZD8ZmjLamxvb4ridmT7AmehTW7M05w7P2WpTF1T7dt9ZkSPJqQXn_OXchjn8VPguzi269cpsH1hdKDwDESaDHavTHhg_J7x-49THBye45ciFuU3xmSrN50iWgKr7hg_MH6YNKm1z6WbGT9EKpdjt3j3DSUxfkgCA-OHpPFXAAAA__-ha7__">