Skip to content

Commit e608c08

Browse files
fix: lazyly create scope for typedef to class* (#109)
this is for the case when scope is a typedef to a pointer to a class the test case using this is a class without definition
1 parent ac659d5 commit e608c08

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/ProxyWrappers.cxx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,11 @@ PyObject* CPyCppyy::CreateScopeProxy(const std::string& name, PyObject* parent,
579579
parent = gThisModule;
580580
return CreateScopeProxy(klass, parent, flags);
581581
} else if (Cppyy::TCppScope_t klass = Cppyy::GetScope(name, parent_scope)) {
582+
if (Cppyy::IsTypedefed(klass) &&
583+
Cppyy::IsPointerType(Cppyy::GetTypeFromScope(klass)) &&
584+
Cppyy::IsClass(Cppyy::GetUnderlyingScope(klass)) &&
585+
!Cppyy::IsComplete(Cppyy::GetUnderlyingScope(klass)))
586+
return nullptr; // this is handled by the caller; typedef to undefined class pointer
582587
return CreateScopeProxy(klass, parent, flags);
583588
} else if (Cppyy::IsBuiltin(name)) {
584589
Cppyy::TCppType_t type = Cppyy::GetType(name);

0 commit comments

Comments
 (0)