Skip to content

Commit

Permalink
Fix crash when using a default argument from a base template
Browse files Browse the repository at this point in the history
  • Loading branch information
dpaoliello committed Apr 30, 2024
1 parent 8297e2e commit c644f2f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sources/libClangSharp/ClangSharp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,9 @@ CXCursor clangsharp_Cursor_getDefaultArg(CXCursor C) {
}

if (const ParmVarDecl* PVD = dyn_cast<ParmVarDecl>(D)) {
if (PVD->hasUninstantiatedDefaultArg()) {
return MakeCXCursor(PVD->getUninstantiatedDefaultArg(), PVD, getCursorTU(C));
}
return MakeCXCursor(PVD->getDefaultArg(), PVD, getCursorTU(C));
}
}
Expand Down

0 comments on commit c644f2f

Please sign in to comment.