Browse Source

[generator] Fixed regression ignoring function templates.

pull/916/head
Joao Matos 8 years ago
parent
commit
9c83f88c7f
  1. 15
      src/Generator/Passes/CheckIgnoredDecls.cs
  2. 5
      tests/Common/Common.h

15
src/Generator/Passes/CheckIgnoredDecls.cs

@ -1,8 +1,8 @@
using System.Linq; using System.Linq;
using System.Collections.Generic;
using CppSharp.AST; using CppSharp.AST;
using CppSharp.AST.Extensions; using CppSharp.AST.Extensions;
using CppSharp.Types; using CppSharp.Types;
using System.Collections.Generic;
namespace CppSharp.Passes namespace CppSharp.Passes
{ {
@ -96,6 +96,19 @@ namespace CppSharp.Passes
return true; return true;
} }
public override bool VisitFunctionTemplateDecl(FunctionTemplate decl)
{
if (decl.TemplatedFunction.IsDependent && !decl.IsExplicitlyGenerated)
{
decl.TemplatedFunction.GenerationKind = GenerationKind.None;
Diagnostics.Debug("Decl '{0}' was ignored due to dependent context",
decl.Name);
return true;
}
return true;
}
public override bool VisitFunctionDecl(Function function) public override bool VisitFunctionDecl(Function function)
{ {
if (!VisitDeclaration(function) || function.IsSynthetized if (!VisitDeclaration(function) || function.IsSynthetized

5
tests/Common/Common.h

@ -1356,3 +1356,8 @@ public:
void generated(); void generated();
void ignored(const IgnoredType& ignoredParam); void ignored(const IgnoredType& ignoredParam);
}; };
template<typename T> void TemplatedFunction(T type)
{
}
Loading…
Cancel
Save