2 * Copyright (C) 2022 Jérémie Galarneau <jeremie.galarneau@efficios.com>
4 * SPDX-License-Identifier: LGPL-2.1-only
10 #include <common/macros.hpp>
16 DIAGNOSTIC_IGNORE_SUGGEST_ATTRIBUTE_FORMAT
17 DIAGNOSTIC_IGNORE_DUPLICATED_BRANCHES
18 #define FMT_HEADER_ONLY
19 #include <vendor/fmt/core.h>
23 * Due to a bug in g++ < 7.1, this specialization must be enclosed in the fmt namespace,
24 * see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480.
28 struct formatter<std::type_info> : formatter<std::string> {
29 template <typename FormatContextType>
30 typename FormatContextType::iterator format(const std::type_info& type_info,
31 FormatContextType& ctx)
35 abi::__cxa_demangle(type_info.name(), nullptr, nullptr, &status);
36 auto it = status == 0 ? formatter<std::string>::format(demangled_name, ctx) :
37 formatter<std::string>::format(type_info.name(), ctx);
45 #endif /* LTTNG_FORMAT_H */