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>
This commit is contained in:
Dimitar Dobrev 2021-11-23 00:19:08 +02:00
Родитель 634c231853
Коммит da251d443b
1 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -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
public override bool VisitFunctionDecl(Function function)
{
if (!VisitDeclaration(function) || function.IsSynthetized
if (!base.VisitFunctionDecl(function) || function.IsSynthetized
|| function.IsExplicitlyGenerated)
return false;