diff --git a/src/Bridge/ASTVisitor.cs b/src/Bridge/ASTVisitor.cs
index dafddc75..040db346 100644
--- a/src/Bridge/ASTVisitor.cs
+++ b/src/Bridge/ASTVisitor.cs
@@ -130,6 +130,12 @@ namespace CppSharp
return true;
}
+ public bool VisitTemplateParameterSubstitutionType(TemplateParameterSubstitutionType param,
+ TypeQualifiers quals)
+ {
+ return param.Replacement.Type.Visit(this, quals);
+ }
+
public bool VisitInjectedClassNameType(InjectedClassNameType injected, TypeQualifiers quals)
{
return true;
diff --git a/src/Bridge/Type.cs b/src/Bridge/Type.cs
index 3412aa9b..7781267b 100644
--- a/src/Bridge/Type.cs
+++ b/src/Bridge/Type.cs
@@ -390,6 +390,25 @@ namespace CppSharp
}
}
+ ///
+ /// Represents the result of substituting a type for a template type parameter.
+ ///
+ public class TemplateParameterSubstitutionType : Type
+ {
+ public TemplateParameterSubstitutionType()
+ {
+
+ }
+
+ public QualifiedType Replacement;
+
+ public override T Visit(ITypeVisitor visitor,
+ TypeQualifiers quals = new TypeQualifiers())
+ {
+ return visitor.VisitTemplateParameterSubstitutionType(this, quals);
+ }
+ }
+
///
/// The injected class name of a C++ class template or class template partial
/// specialization.
@@ -494,6 +513,8 @@ namespace CppSharp
T VisitDeclaration(Declaration decl, TypeQualifiers quals);
T VisitTemplateParameterType(TemplateParameterType param,
TypeQualifiers quals);
+ T VisitTemplateParameterSubstitutionType(
+ TemplateParameterSubstitutionType param, TypeQualifiers quals);
T VisitInjectedClassNameType(InjectedClassNameType injected,
TypeQualifiers quals);
T VisitDependentNameType(DependentNameType dependent,
diff --git a/src/Generator/Generators/CLI/CLITypePrinter.cs b/src/Generator/Generators/CLI/CLITypePrinter.cs
index 3ef59ef8..d1d8d0a1 100644
--- a/src/Generator/Generators/CLI/CLITypePrinter.cs
+++ b/src/Generator/Generators/CLI/CLITypePrinter.cs
@@ -217,6 +217,12 @@ namespace CppSharp.Generators.CLI
return param.Parameter.Name;
}
+ public string VisitTemplateParameterSubstitutionType(
+ TemplateParameterSubstitutionType param, TypeQualifiers quals)
+ {
+ throw new NotImplementedException();
+ }
+
public string VisitInjectedClassNameType(InjectedClassNameType injected, TypeQualifiers quals)
{
throw new NotImplementedException();
diff --git a/src/Generator/Generators/CSharp/CSharpTypePrinter.cs b/src/Generator/Generators/CSharp/CSharpTypePrinter.cs
index 02c15cdb..1ffc7772 100644
--- a/src/Generator/Generators/CSharp/CSharpTypePrinter.cs
+++ b/src/Generator/Generators/CSharp/CSharpTypePrinter.cs
@@ -237,6 +237,11 @@ namespace CppSharp.Generators.CSharp
public CSharpTypePrinterResult VisitTemplateParameterType(
TemplateParameterType param, TypeQualifiers quals)
+ {
+ }
+
+ public CSharpTypePrinterResult VisitTemplateParameterSubstitutionType(TemplateParameterSubstitutionType param,
+ TypeQualifiers quals)
{
throw new NotImplementedException();
}
diff --git a/src/Generator/Types/CppTypePrinter.cs b/src/Generator/Types/CppTypePrinter.cs
index 6a37f93d..ec13df69 100644
--- a/src/Generator/Types/CppTypePrinter.cs
+++ b/src/Generator/Types/CppTypePrinter.cs
@@ -107,6 +107,12 @@ namespace CppSharp.Types
return param.Parameter.Name;
}
+ public string VisitTemplateParameterSubstitutionType(
+ TemplateParameterSubstitutionType param, TypeQualifiers quals)
+ {
+ throw new System.NotImplementedException();
+ }
+
public string VisitInjectedClassNameType(InjectedClassNameType injected, TypeQualifiers quals)
{
throw new System.NotImplementedException();
diff --git a/src/Parser/Parser.cpp b/src/Parser/Parser.cpp
index 48803720..73f1611c 100644
--- a/src/Parser/Parser.cpp
+++ b/src/Parser/Parser.cpp
@@ -962,7 +962,13 @@ CppSharp::Type^ Parser::WalkType(clang::QualType QualType, clang::TypeLoc* TL,
}
case Type::SubstTemplateTypeParm:
{
- auto TPT = gcnew CppSharp::TemplateParameterType();
+ auto TP = Type->getAs();
+ auto Ty = TP->getReplacementType();
+ auto TPT = gcnew CppSharp::TemplateParameterSubstitutionType();
+
+ auto Next = TL->getNextTypeLoc();
+ TPT->Replacement = GetQualifiedType(Ty, WalkType(Ty, &Next));
+
return TPT;
}
case Type::InjectedClassName: