Issue 109787
Summary Clang Python marks assert as case statement
Labels clang
Assignees
Reporter Rubyfi
    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?
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to