Moved check on enum aliases from readTypeEnum to checkEnumCorrectness. (#1613)

This commit is contained in:
Andreas Süßenbach 2023-07-04 13:53:21 +02:00 committed by GitHub
parent d748663707
commit 7a4ee5eaaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1145,6 +1145,13 @@ void VulkanHppGenerator::checkEnumCorrectness() const
checkEnumCorrectness( ext.requireData ); checkEnumCorrectness( ext.requireData );
} }
// enum alias checks
for ( auto const & alias : m_enumAliases )
{
checkForError(
m_enums.find( alias.second.name ) != m_enums.end(), alias.second.xmlLine, "enum <" + alias.first + "> uses unknown alias <" + alias.second.name + ">" );
}
// special check for VkFormat // special check for VkFormat
if ( !m_formats.empty() ) if ( !m_formats.empty() )
{ {
@ -14351,9 +14358,7 @@ void VulkanHppGenerator::readTypeEnum( tinyxml2::XMLElement const * element, std
} }
else else
{ {
checkForError( m_enums.find( alias ) != m_enums.end(), line, "enum <" + name + "> uses unknown alias <" + alias + ">" ); checkForError( m_enumAliases.insert( { name, { alias, line } } ).second, line, "enum <" + name + "> already specified as some alias" );
assert( m_enumAliases.find( name ) == m_enumAliases.end() );
m_enumAliases[name] = { alias, line };
} }
} }