Open deadlocklogic opened 1 year ago
I think the library by design don't expect nested templates because consider building a cpp_template_instantiation_type
you need a cpp_template_ref
which most of the time is build manually but in the case of nested templates I don't exactly know what should the arguments be.
Maybe each indexed entity should return its own basic_cpp_entity_ref
so in worst case an AST visit could eventually find the desired value.
After little digging, I found the offending line:
https://github.com/foonathan/cppast/blob/f00df6675d87c6983033d270728c57a55cd3db22/src/libclang/cxtokenizer.cpp#L282
The function test
is a definition but clang_isCursorDefinition
is returning 0.
I am not sure if it is a clang bug, need further investigation.
After trying with cindex python
I noticed the same bug.
Interestingly, if I make the function constexpr
the bug disappears and now is treated as a definition (as it should).
So I don't know what to do here or if there is a workaround (maybe submit an llvm
ticket?).
Thanks.
libclang_parser
15.0.7
Explanation of the error.
Input:
Output: