diff --git a/sources/libClangSharp/ClangSharp.cpp b/sources/libClangSharp/ClangSharp.cpp index 17eed8dc..a9d2087a 100644 --- a/sources/libClangSharp/ClangSharp.cpp +++ b/sources/libClangSharp/ClangSharp.cpp @@ -1692,7 +1692,8 @@ CXCursor clangsharp_Cursor_getLambdaContextDecl(CXCursor C) { const Decl* D = getCursorDecl(C); if (const CXXRecordDecl* CRD = dyn_cast(D)) { - return MakeCXCursor(CRD->getLambdaContextDecl(), getCursorTU(C)); + if( CRD->isLambda() ) + return MakeCXCursor(CRD->getLambdaContextDecl(), getCursorTU(C)); } }