diff --git a/src/Generator/Passes/CheckIgnoredDecls.cs b/src/Generator/Passes/CheckIgnoredDecls.cs index aa27c3f9..3ede566a 100644 --- a/src/Generator/Passes/CheckIgnoredDecls.cs +++ b/src/Generator/Passes/CheckIgnoredDecls.cs @@ -1,8 +1,8 @@ using System.Linq; +using System.Collections.Generic; using CppSharp.AST; using CppSharp.AST.Extensions; using CppSharp.Types; -using System.Collections.Generic; namespace CppSharp.Passes { @@ -96,6 +96,19 @@ namespace CppSharp.Passes 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) { if (!VisitDeclaration(function) || function.IsSynthetized diff --git a/tests/Common/Common.h b/tests/Common/Common.h index a322ef4c..ba279ef9 100644 --- a/tests/Common/Common.h +++ b/tests/Common/Common.h @@ -1356,3 +1356,8 @@ public: void generated(); void ignored(const IgnoredType& ignoredParam); }; + +template void TemplatedFunction(T type) +{ + +} \ No newline at end of file