Fixed building on LLVM < 14 (#266)

This commit is contained in:
Bartek Kryza
2024-05-14 17:27:34 +02:00
parent 27eaea5bbe
commit 6d3d1ae450
4 changed files with 17 additions and 30 deletions

View File

@@ -248,10 +248,24 @@ void generator::generate(const class_ &c, nlohmann::json &parent) const
{
nlohmann::json object = c;
// Perform config dependent postprocessing on generated class;
if (!config().generate_fully_qualified_name())
object["display_name"] =
common::generators::json::render_name(c.full_name_no_ns());
for (auto &tp : object["template_parameters"]) {
if (tp.contains("type") && tp.at("type").is_string()) {
tp["type"] = config().using_namespace().relative(tp.at("type"));
}
}
for (auto &tp : object["members"]) {
if (tp.contains("type") && tp.at("type").is_string()) {
tp["type"] = config().using_namespace().relative(tp.at("type"));
}
}
std::string object_str = object.dump(2);
parent["elements"].push_back(std::move(object));
}