From c644f2f4a410b34608cb4060bcbc2bf22dfd5ad7 Mon Sep 17 00:00:00 2001 From: Daniel Paoliello Date: Tue, 30 Apr 2024 12:45:34 -0700 Subject: [PATCH] Fix crash when using a default argument from a base template --- sources/libClangSharp/ClangSharp.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sources/libClangSharp/ClangSharp.cpp b/sources/libClangSharp/ClangSharp.cpp index 02c76f2d..ca3e2b4c 100644 --- a/sources/libClangSharp/ClangSharp.cpp +++ b/sources/libClangSharp/ClangSharp.cpp @@ -993,6 +993,9 @@ CXCursor clangsharp_Cursor_getDefaultArg(CXCursor C) { } if (const ParmVarDecl* PVD = dyn_cast(D)) { + if (PVD->hasUninstantiatedDefaultArg()) { + return MakeCXCursor(PVD->getUninstantiatedDefaultArg(), PVD, getCursorTU(C)); + } return MakeCXCursor(PVD->getDefaultArg(), PVD, getCursorTU(C)); } }