clang-tidy: add Chrome-inspired checks
[lttng-tools.git] / src / common / format.hpp
index dace2c027b31a1d9926f63c0fb55f3f4e4f5ed95..b586fd489f8f934f8ace25808c7e19ce2acd4fe9 100644 (file)
@@ -19,6 +19,10 @@ DIAGNOSTIC_IGNORE_DUPLICATED_BRANCHES
 #include <vendor/fmt/core.h>
 DIAGNOSTIC_POP
 
+/*
+ * Due to a bug in g++ < 7.1, this specialization must be enclosed in the fmt namespace,
+ * see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480.
+ */
 namespace fmt {
 template <>
 struct formatter<std::type_info> : formatter<std::string> {
@@ -26,7 +30,8 @@ struct formatter<std::type_info> : formatter<std::string> {
        typename FormatCtx::iterator format(const std::type_info& type_info, FormatCtx& ctx)
        {
                int status;
-               auto demangled_name = abi::__cxa_demangle(type_info.name(), nullptr, 0, &status);
+               auto demangled_name =
+                       abi::__cxa_demangle(type_info.name(), nullptr, nullptr, &status);
                auto it = status == 0 ? formatter<std::string>::format(demangled_name, ctx) :
                                        formatter<std::string>::format(type_info.name(), ctx);
 
This page took 0.023862 seconds and 4 git commands to generate.