-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash on complex Templates #12
Comments
Thanks @LtJulius. Would you mind posting the code immediately after, like inheritance declaration, or up to the opening curly brace for the class. Looks to me like the parser might be picking up some additional characters, even whitespace, and considering them part of the name. |
@lawmurray Updated the code snippet, actually there are several more classes like this within the same hierarchy, so LoaderChain<...> -> LoaderChainBase<...> -> Loader<...> -> LoaderBase 😅 |
Thanks for the update @LtJulius. Unfortunately I am not able to reproduce. Keen to get this fixed though, real world complex template code like this is exactly the sort of thing to put Doxide through its paces. Can you let me know the following so I can keep investigating?
Also, do you get the error if you put the code, and only the code (plus a doc comment), in a header file, or does it only occur with additional code around? E.g. I tested with the following header: /**
* Test of a complex template.
*/
template <
IsRequestValueType RequestType_,
IsResponseValueType ResponseType_ = ResourceBase,
typename StageRefTypes_ = MetaTypeWrapperList<
_STD type_identity_t,
_STD type_identity_t,
_STD type_identity_t,
sptr
>,
class CacheStageType_ = Cache<RequestType_, ResponseType_>,
class FeedbackStageType_ = Feedback<RequestType_, ResponseType_>,
class TransformerStageType_ = Transformer<RequestType_, ResponseType_>,
class SourceLoaderType_ = SourceLoader,
bool Streamable_ = assets::IsStreamableAsset<RequestType_>>
class LoaderChain :
public LoaderChainBase<
RequestType_, ResponseType_, StageRefTypes_,
CacheStageType_, FeedbackStageType_, TransformerStageType_, SourceLoaderType_> { }; Put that in a
And it worked. I wonder whether tree-sitter encounters a parse error earlier on in the code that knocks it off balance by the time it arrives here. |
Alright, I reinstalled doxide. This time from source, even though I had to change some include paths within tree-sitter because it failed while resolving the includes paths... Anyway. build and installed doxide, but got the same error.
After that, the same error occurs as above. But I digged a bit into it. The actual failing class is a partial template specialization. template <
IsRequestValueType RequestType_,
IsResponseValueType ResponseType_,
typename StageRefTypes_,
class CacheStageType_,
class FeedbackStageType_,
class TransformerStageType_,
class SourceLoaderType_>
class LoaderChain<
RequestType_,
ResponseType_,
StageRefTypes_,
CacheStageType_,
FeedbackStageType_,
TransformerStageType_,
SourceLoaderType_,
true
> :
public LoaderChainBase<
RequestType_, ResponseType_, StageRefTypes_,
CacheStageType_, FeedbackStageType_, TransformerStageType_, SourceLoaderType_> { }; Don't know whether this helps. Distributor ID: Ubuntu If you need; I could even send you the whole header file. |
Thanks @LtJulius , got it this time! Explanation: for partial template specializations, the entity name is taken as the class name and contents of the angle brackets to ensure that different specializations can be distinguished. The sanitizer for converting entity names to file names was encoding the spaces, which could make for lengthy file names that exceed the file system limit of 255 characters. The fix is to first strip whitespace to shorten the name, then truncate at 255 characters (minus a little space for file extensions). Thanks again for the report, and please keep them coming if you encounter further issues. |
Tagged as |
Packages are now built and available. Please reopen if this does not seem to be resolved, however. |
@LtJulius Update on this one, v0.4.0 provides:
This should address the remaining side issues sprinkled throughout the thread here. |
I just tried out to build the documentation for my project and the process crashed while trying to generate files for one of my more complex template classes.
Don't know whether this helps, but if you need further source code or information, just msg me.
The text was updated successfully, but these errors were encountered: