Skip to content

Commit

Permalink
Check if CXXRecordDecl is lambda before calling getLambdaContextDecl(…
Browse files Browse the repository at this point in the history
…). (#185)
  • Loading branch information
phizch authored Nov 22, 2020
1 parent 2e4f410 commit 5016d99
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sources/libClangSharp/ClangSharp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1692,7 +1692,8 @@ CXCursor clangsharp_Cursor_getLambdaContextDecl(CXCursor C) {
const Decl* D = getCursorDecl(C);

if (const CXXRecordDecl* CRD = dyn_cast<CXXRecordDecl>(D)) {
return MakeCXCursor(CRD->getLambdaContextDecl(), getCursorTU(C));
if( CRD->isLambda() )
return MakeCXCursor(CRD->getLambdaContextDecl(), getCursorTU(C));
}
}

Expand Down

0 comments on commit 5016d99

Please sign in to comment.