Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

dpaoliello
Copy link
Contributor

ClangSharp currently excludes templates unless the generate-template-bindings config option is set, but it still visits template specialization declarations, resulting in the warning Class template specializations are not supported.

This change excludes template specializations unless the generate-template-bindings config option is set.

{
return (_config.ExcludeFunctionsWithBody && (cursor is FunctionDecl functionDecl) && functionDecl.HasBody)
|| (!_config.GenerateTemplateBindings && (cursor is TemplateDecl));
|| (!_config.GenerateTemplateBindings && ((cursor is TemplateDecl) || (cursor is ClassTemplateSpecializationDecl)));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some other template related declarations that don't inherit from these two include:

  • FriendTemplateDecl
  • NonTypeTemplateParmDecl
  • TemplateParamObjectDecl
  • TemplateTypeParmDecl
  • VarTemplatePartialSpecializationDecl
  • VarTemplateSpecializationDecl

Of these, I think VarTemplateSpecializationDecl and VarTemplatePartialSpecializationDecl are the only two that don't require first being in an already skipped templated declaration context. But it may be important to look a bit more deeply.

@tannergooding tannergooding merged commit be6c8f8 into dotnet:main May 15, 2024
@dpaoliello dpaoliello deleted the special branch May 15, 2024 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants