Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Perform subclass forward declaration even if header is empty #499

Merged
merged 1 commit into from Feb 9, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 11 additions & 9 deletions src/codegen/cppcg.cpp
Expand Up @@ -1323,19 +1323,21 @@ void CppCodeGenerator::GenSubclassSets( PObjectBase obj, std::set< wxString >* s
}

// Now get the header
std::map< wxString, wxString >::iterator header;
header = children.find( wxT( "header" ) );

if ( children.end() == header )
wxString headerVal;
auto header = children.find(wxT("header"));
if (children.end() != header)
{
// No header, so do nothing
return;
headerVal = header->second;
}

wxString headerVal = header->second;
if ( headerVal.empty() )
if (headerVal.empty())
{
// No header, so do nothing
// No header, do a forward declare if requested, otherwise do nothing
if (forward_declare)
{
subclasses->insert(forwardDecl);
}

return;
}

Expand Down