Skip to content

Commit eafe658

Browse files
Add IsLambdaClass
1 parent 515c1c8 commit eafe658

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
@@ -1406,6 +1406,14 @@ TCppScope_t LookupDatamember(const std::string& name, TCppScope_t parent) {
14061406
return 0;
14071407
}
14081408

1409+
bool IsLambdaClass(TCppType_t type) {
1410+
QualType QT = QualType::getFromOpaquePtr(type);
1411+
if (auto* CXXRD = QT->getAsCXXRecordDecl()) {
1412+
return CXXRD->isLambda();
1413+
}
1414+
return false;
1415+
}
1416+
14091417
TCppType_t GetVariableType(TCppScope_t var) {
14101418
auto* D = static_cast<Decl*>(var);
14111419

0 commit comments

Comments
 (0)