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

    <tr>
        <th>Summary</th>
        <td>
            [clang-format] Pointer alignment option for function return types
        </td>
    </tr>

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

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

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

<pre>
    This is a simple example to explain what I mean:


```
char* alloc_str(int size)
{
    char *str = malloc(size);

    return str;
}
```

I'd like to have my code formatted in a way that a pointer is right-aligned in a variable declaration and left-aligned if it is a return type.

Having read through **Clang-Format Style Options**, the only two options I've found were **DerivePointerAlignment** and **PointerAlignment** and they only seem to treat all pointers the same way.

Is there a way to achieve what I'm after? Or could this be worth considering as a new feature?

Thanks!
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx8U03PozYQ_jXmMkoEJoRw4MC7Eep72krdezXAgL1r7MgeyKa_vjIQddtDJSQn9mM_HzODIejJEtWi-BDFPcGFlfO1w-_GLVYnnRte9TelA-gACEHPD0NAP3Fb2QH9fBjUFp4KGT5hJrQib0T6_q7p8aVNr9AL2QAa4_o_A3shb9oyBP0XCVlFdPkh0gYAIGJByCawB5HfYd4uCXl7g_OPnSCCPfHiLcQX9-3y_h9qkTafQpYDGP1jk61wJZhf0LuBYHR-RmYaQFtAeOILONpBeDhtmXw07_Wk-IQmxnUAV_QaO0MwUG_QI2tnAe0AhsZfoCNo3uM7hPLrQedd1W-4ajuBJxyAlXfLpKJtIZsvBu10ajdp8Ae_DMHXR2QI-7mQX4AVgbPmBfx04PZTiEbXaGqxAzzJ0_Hgnbxe6ffdURPFzWR5P9tU7z__B8CKXjtfIJpjjOwp5mTMO6mwaQo4U4zxMPm57Xp6Z-sAe6VppaNrhCxnwJHJi7yFrx56t5hIpwN0BE_nWUHvbNAD-RgXxjAtPWEk5MWTyNud6ZtC-yMImSVDnQ9VXmFCdVZeCnnNZF4lqi6v11s5jGOeyWs5yry6dkVJt6Iaqqq7YZroWqaySC8yy26XMqvOxaUs85wwzy6pTAspLinNqM3ZmHU-Oz8lOoSF6iy_FlWZGOzIhG2epOy3Iu79JaSME-breO_ULVMQl9TowOGfl1iz2WbxXxeLOxxVAXyX5Sh37F0YF9tvf37pr5As3tSK-RHiPMpWyHbSrJbu3LtZyDZyHsvp4d136lnIdrMShGwPN2st_w4AAP___mVXkg">