Skip to content

Commit bea0653

Browse files
committed
Fixed code generation for using template types.
Thanks to @zillemarco for coming up with the test case.
1 parent 06621d4 commit bea0653

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/Generator/Generators/CSharp/CSharpTypePrinter.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,10 @@ public override TypePrinterResult VisitTemplateSpecializationType(
355355
template.Arguments.All(IsValid))
356356
return $@"{VisitDeclaration(decl)}<{string.Join(", ",
357357
template.Arguments.Select(VisitTemplateArgument))}>";
358+
359+
if (ContextKind == TypePrinterContextKind.Native)
360+
return template.Desugared.Visit(this);
361+
358362
return decl.Visit(this);
359363
}
360364

tests/Common/Common.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,3 +1402,13 @@ union
14021402
} Share;
14031403
} Smb2;
14041404
} ProtocolSpecific;
1405+
1406+
1407+
template<class _Other>
1408+
using UsingTemplatePtr = _Other *;
1409+
1410+
struct TemplateWithUsingTemplateMember
1411+
{
1412+
UsingTemplatePtr<TemplateWithUsingTemplateMember> _Ref;
1413+
};
1414+

0 commit comments

Comments
 (0)