From 70466cdb8020da3562b4e615753a6f24bb0d1343 Mon Sep 17 00:00:00 2001 From: Username404 Date: Fri, 29 Oct 2021 00:10:49 +0200 Subject: [PATCH] Demangle the name of components when a GNU/Clang compiler is being used --- src/headers/transpiler/Target.hpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/headers/transpiler/Target.hpp b/src/headers/transpiler/Target.hpp index 877a869..5c0693d 100644 --- a/src/headers/transpiler/Target.hpp +++ b/src/headers/transpiler/Target.hpp @@ -10,6 +10,9 @@ #include #include #include +#ifdef __GNUC__ +#include +#endif #include "../parsing/ParseComponents.hpp" @@ -86,7 +89,13 @@ public: const optional& currentTask = taskMap.at(id); if (currentTask.has_value()) currentTask.value()(tree, i); } catch (const out_of_range&) { - throw Yerbacon::Exception(string(id.name()) += " is not supported by the current target"); + throw Yerbacon::Exception(string( + #ifndef __GNUC__ + id.name() + #else + abi::__cxa_demangle(id.name(), nullptr, nullptr, nullptr) + #endif + ) += " is not supported by the current target"); } } return output.str();