From: Jérémie Galarneau Date: Thu, 5 Jan 2023 19:46:31 +0000 (-0500) Subject: Build fix: g++ < 7.1 mishandles namespaces of specializations X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=7a73918f364c40da63f8ba78633c0d7298545a8a;p=lttng-tools.git Build fix: g++ < 7.1 mishandles namespaces of specializations Due to a bug in g++ < 7.1, these specializations must be explicitly enclosed in the namespaces rather than using the usual `namespace::namespace::function` notation. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480. We already use this work-around in a number of places. Signed-off-by: Jérémie Galarneau Change-Id: Ie0e6a3c4dcfb4bc1581c2d273d73ea3e65b2ccd6 --- diff --git a/src/bin/lttng-sessiond/field.cpp b/src/bin/lttng-sessiond/field.cpp index 4a7915e20..c00f6d135 100644 --- a/src/bin/lttng-sessiond/field.cpp +++ b/src/bin/lttng-sessiond/field.cpp @@ -191,37 +191,42 @@ lst::enumeration_type::enumeration_type(unsigned int in_alignment, { } +/* + * Due to a bug in g++ < 7.1, these specializations must be enclosed in the namespaces + * rather than using the usual `namespace::namespace::function` notation: + * see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480. + */ namespace lttng { namespace sessiond { namespace trace { template <> -void lst::signed_enumeration_type::accept(type_visitor& visitor) const +void signed_enumeration_type::accept(type_visitor& visitor) const { visitor.visit(*this); } template <> -void lst::unsigned_enumeration_type::accept(type_visitor& visitor) const +void unsigned_enumeration_type::accept(type_visitor& visitor) const { visitor.visit(*this); } -} /* namespace trace */ -} /* namespace sessiond */ -} /* namespace lttng */ template <> -void lst::variant_type::accept( +void variant_type::accept( lst::type_visitor& visitor) const { visitor.visit(*this); } template <> -void lst::variant_type::accept( +void variant_type::accept( lst::type_visitor& visitor) const { visitor.visit(*this); } +} /* namespace trace */ +} /* namespace sessiond */ +} /* namespace lttng */ lst::array_type::array_type(unsigned int in_alignment, type::cuptr in_element_type) : type(in_alignment), element_type{std::move(in_element_type)} @@ -389,4 +394,4 @@ bool lst::structure_type::_is_equal(const type& base_other) const noexcept void lst::structure_type::accept(type_visitor& visitor) const { visitor.visit(*this); -} \ No newline at end of file +}