Skip to content

Commit c75e9f6

Browse files
committed
Fix a crash when a function pointer is a template arg
Signed-off-by: Dimitar Dobrev <[email protected]>
1 parent 51d422a commit c75e9f6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/Generator/Generators/CSharp/CSharpTypePrinter.cs

+3
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ public override TypePrinterResult VisitBuiltinType(BuiltinType builtin, TypeQual
157157
return base.VisitBuiltinType(builtin, quals);
158158
}
159159

160+
public override TypePrinterResult VisitFunctionType(FunctionType function, TypeQualifiers quals)
161+
=> IntPtrType;
162+
160163
private bool allowStrings = true;
161164

162165
public override TypePrinterResult VisitPointerType(PointerType pointer,

tests/CSharp/CSharpTemplates.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ void forceUseSpecializations(IndependentFields<int> _1, IndependentFields<bool>
715715
TemplateDerivedFromRegularDynamic<RegularDynamic> _14,
716716
IndependentFields<OnlySpecialisedInTypeArg<double>> _15,
717717
DependentPointerFields<float> _16, IndependentFields<const T1&> _17,
718-
TemplateWithIndexer<T2*> _18, std::string s);
718+
TemplateWithIndexer<T2*> _18, IndependentFields<int(*)(int)>, std::string s);
719719

720720
void hasIgnoredParam(DependentValueFields<IndependentFields<Ignored>> ii);
721721

0 commit comments

Comments
 (0)