From d5f58e07dd295a81fc5669efa254e777e7504926 Mon Sep 17 00:00:00 2001 From: Markus Tavenrath Date: Tue, 7 Jan 2020 16:50:46 +0100 Subject: [PATCH] Add error message when referencing undefined type requirements (#473) --- VulkanHppGenerator.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index 1906856..7ecf0a5 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -803,7 +803,10 @@ void VulkanHppGenerator::appendBitmasks(std::string & str) const for (auto const& bitmask : m_bitmasks) { auto bitmaskBits = m_bitmaskBits.find(bitmask.second.requirement); - assert(bitmaskBits != m_bitmaskBits.end()); + if (bitmaskBits == m_bitmaskBits.end()) + { + throw std::runtime_error( bitmask.first + " references the undefined requirement '" + bitmask.second.requirement + "'"); + } std::string strippedBitmaskName = stripPrefix(bitmask.first, "Vk"); std::string strippedEnumName = stripPrefix(bitmaskBits->first, "Vk");