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

    <tr>
        <th>Summary</th>
        <td>
            Libclang correctly pretty prints inline function, but incorrectly prints its body as ""
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    Consider the following definition from stdlib.h:

```C
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{
  return ((__uint16_t) ((((__bsx) >> 8) & 0xff) | (((__bsx) & 0xff) << 8)));
}
```

The call `clang_getCursorPrettyPrinted(x, null)` indeed pretty-prints the above function including its body when `x` is the CXCursor for the top-level declaration `__bswap_16`.

However, when `x` is the `CXCursor` of kind CompoundStmt cursor that represents its body, that call prints the empty string,
whereas for other functions it correctly prints the body.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxtU01vnDAQ_TVwsYL4CLAcOHRJqx56iNQeekM2DODUayN_7Gb_fcdmSTZRpBHYnpn33vgBU-O17ZQ0fARN7AJkUkKoC5czGWHikluuJJm0OhFjR8FZskTFtyh9itL9WaVbdNveWGr5QPqeS8El4MJxabOqt1u-75m50LXPKhLlh_cs8YnXKG9usPVxWxCiwTotffWHBiy9ne2ZrZ9ExXcMctgKKpK-TlNY1x35ovq-ougwQuctiuMu5-nTuPd38AcvbqBCEDwfBJVzP4PtnDZKP6N6e33WKBpG5EXOjkgnhEevUsLlCDCSNZQ9rL7OBCMoU2e0w8khWMDlINzofeFYwNA3cllAesbXgLN1dX83WvRx89Oq9UHAGQT6idI0DWjY8e4DbpL7aX6qCzZoL_QrCm_1jcWfqon8wyFIp06rcnL8bU-WDJsIu1CL9uFwBvxcu3QPHXLh0u6GhtNqr_il4cmMRZseFKGBmjCSwir9disekQxKaxisuN4DeZYkhjarqibP0rrJ47EtxqZoaGy5FdD-4ixY9aHfm7DD3L7fnctrZs56Iz4TvjmCIqM8x4idFu1i7Wr835L_wJi5XRxLBnXCjRDn_YWeqxeEwy03xoHBRdlkZRkvbVWn-YE2NRugZLRuWJNNUNYNpONA86aKBWUgTBuVRySVcCEBwmson2Le5mmeZ1leZEXRPBbJ8FhAUWYDmw4sxZuJHlM4US4SryNReo51GyQxNxtMCm6seU9SY_gsAQId4lNnF6Vb-qKVOyuwcSBvg_j_aBBhqg">