Skip to content

Commit da251d4

Browse files
committed
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>
1 parent 634c231 commit da251d4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Generator/Passes/CheckIgnoredDecls.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ public override bool VisitClassTemplateSpecializationDecl(ClassTemplateSpecializ
6565

6666
Declaration decl = null;
6767
if (specialization.Arguments.Any(a =>
68-
a.Type.Type?.TryGetDeclaration(out decl) == true) &&
69-
decl.Ignore)
68+
a.Kind != TemplateArgument.ArgumentKind.Type ||
69+
(a.Type.Type.TryGetDeclaration(out decl) == true) &&
70+
decl.Ignore))
7071
{
7172
specialization.ExplicitlyIgnore();
7273
return false;
@@ -157,7 +158,7 @@ public override bool VisitFunctionTemplateDecl(FunctionTemplate decl)
157158

158159
public override bool VisitFunctionDecl(Function function)
159160
{
160-
if (!VisitDeclaration(function) || function.IsSynthetized
161+
if (!base.VisitFunctionDecl(function) || function.IsSynthetized
161162
|| function.IsExplicitlyGenerated)
162163
return false;
163164

0 commit comments

Comments
 (0)