Permalink
Browse files

Merge pull request #499 from sodevel/fix_localforward

Perform subclass forward declaration even if header is empty
  • Loading branch information...
jhasse committed Feb 9, 2019
2 parents 5e29b99 + 0e70fe2 commit 93dc5c2933917851e863725677c0d15d959c0b7f
Showing with 11 additions and 9 deletions.
  1. +11 −9 src/codegen/cppcg.cpp
@@ -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;
}

0 comments on commit 93dc5c2

Please sign in to comment.