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

    <tr>
        <th>Summary</th>
        <td>
            Clang Python marks assert as case statement
        </td>
    </tr>

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

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

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

<pre>
    Hi,
I'm trying to parse a set of swtich-case statements using the Python clang module and ran into some weird behavior.
Given something like this:
```
switch(Enum)
{
   case Enum::Value1:
 assert(false);
      break;
   case Enum::Value2:
      ....
 break;
....
}
```
Clang returns the assert statement's cursor kind as `CursorKind.CASE_STMT`.
However, this only seems to happen when an `assert` is the first statement in a case.
Any other statements parse like expected.
When another expression is placed first in the `case`, the cursor of `assert` is `CursorKind.COMPOUND_STMT` instead.

Am I misinterpreting the functionality of the underlying cursor; i.e. that it is supposed to help identifying the syntactical meaning of the according token; or is this a bug?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsVNGymzYQ_Rr5ZecyWHDBfuDB1zduMp00mSZtHztCLGZrITFaYYe_7yBwfZvE4xlA2j3n6Gh3FTOdLWIlnl_E8-tGjaFzvvp9rKeWNrVrpuo9CXkU6atIDx-ELHsIfiJ7huBgUJ4RFDAGcC3wLZDunrRiBA4qYI82MIwcwzuEz1PonAVtlD1D75rRICjbgFcWyAYH7HqEG5JvoMZOXcn5ZKH-ha5o437oZjhDF4TQEYvssESIIl3_8ZNvFHQn5O6dHXsh92tQ-bK8AEDUGXezg8gOfyoz4vY_OFDM6IOQu1YZxhkhe-QCQO1RXd6u_QxPPvDiL0mS9UDf5T82RPn60wMdo2sew-gtRzsXhQ-rhSwZ9OjZebiQbUAxiCI9xpVfyTbJ8fDl3d9fvn78Kop0pXvvbnhFL-Qx2gnOmgkYsef5hjs1DGjh1qEFZWe01ZYiBVpUtOT5jQggCyp6sRIc7AQudOjf1sRSOfES8duAOmCzhv-1UC0Z-G3wyEzOzmyDURqblZBsZBdFOnPNLsUT4N0A1_6g9jsvPn38_OmP317vfgBZDqjuOlbxPXyAnphsQD94DPdSbkerAzmrDIVpJpsXR9ugN7E7FhUiewFKMIHQqQAUZhU8DoNjbKK9aAagBm2gdrpD82SD0oG0MtCjsvP6SqC0dr5Zuu-CdoZ3frkIYlBQj2eRnTZNlTX7bK82WG1LWW53abbbbbpKZ3qHqt22WsoMt02WFUW506pUdVk8N_mGKpnKPN3LfCu3-7xMcq2Kdp_nus3bvZZS5Cn2ikxizLVPnD9viHnEapvuy125MapGw3GYSBnbXEg5zxVfzQlP9XhmkaeGOPADIlAwWC31vY6IXvkL3wtcMfx_pmxGb6ouhCF2vzwJeTpT6MY60a4X8jQjr4-nwbt_UAchT1EpC3laxV4r-W8AAAD__8gfm2M">