-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Closed as not planned
Labels
clang:as-a-librarylibclang and C++ APIlibclang and C++ APIquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!
Description
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:
switch(Enum)
{
case Enum::Value1:
;
assert(false);
break;
case Enum::Value2:
....
break;
....
}
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?
Metadata
Metadata
Assignees
Labels
clang:as-a-librarylibclang and C++ APIlibclang and C++ APIquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!