Browse Source

Always ignore functions returning unsupported specializations

In very complex headers with heavily typedef-ed returned specializations of templates with non-type template parameters the functions themselves can be visited before such templates - thus leaving such invalid functions as valid.
Unfortunately, such a complex interaction cannot be reproduced and therefore tested in a reasonable time-frame.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/1641/head
Dimitar Dobrev 4 years ago
parent
commit
da251d443b
  1. 7
      src/Generator/Passes/CheckIgnoredDecls.cs

7
src/Generator/Passes/CheckIgnoredDecls.cs

@ -65,8 +65,9 @@ namespace CppSharp.Passes @@ -65,8 +65,9 @@ namespace CppSharp.Passes
Declaration decl = null;
if (specialization.Arguments.Any(a =>
a.Type.Type?.TryGetDeclaration(out decl) == true) &&
decl.Ignore)
a.Kind != TemplateArgument.ArgumentKind.Type ||
(a.Type.Type.TryGetDeclaration(out decl) == true) &&
decl.Ignore))
{
specialization.ExplicitlyIgnore();
return false;
@ -157,7 +158,7 @@ namespace CppSharp.Passes @@ -157,7 +158,7 @@ namespace CppSharp.Passes
public override bool VisitFunctionDecl(Function function)
{
if (!VisitDeclaration(function) || function.IsSynthetized
if (!base.VisitFunctionDecl(function) || function.IsSynthetized
|| function.IsExplicitlyGenerated)
return false;

Loading…
Cancel
Save