Skip to content

Commit dc6581c

Browse files
Add IsLambdaClass
1 parent ea8b2aa commit dc6581c

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

include/CppInterOp/CppInterOp.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,9 @@ void GetEnumConstantDatamembers(TCppScope_t scope,
573573
CPPINTEROP_API TCppScope_t LookupDatamember(const std::string& name,
574574
TCppScope_t parent);
575575

576+
/// Check if the given type is a lamda class
577+
bool IsLambdaClass(TCppType_t type);
578+
576579
/// Gets the type of the variable that is passed as a parameter.
577580
CPPINTEROP_API TCppType_t GetVariableType(TCppScope_t var);
578581

lib/CppInterOp/CppInterOp.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,6 +1399,14 @@ TCppScope_t LookupDatamember(const std::string& name, TCppScope_t parent) {
13991399
return 0;
14001400
}
14011401

1402+
bool IsLambdaClass(TCppType_t type) {
1403+
QualType QT = QualType::getFromOpaquePtr(type);
1404+
if (auto* CXXRD = QT->getAsCXXRecordDecl()) {
1405+
return CXXRD->isLambda();
1406+
}
1407+
return false;
1408+
}
1409+
14021410
TCppType_t GetVariableType(TCppScope_t var) {
14031411
auto* D = static_cast<Decl*>(var);
14041412

0 commit comments

Comments
 (0)