From 7a73918f364c40da63f8ba78633c0d7298545a8a Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Thu, 5 Jan 2023 14:46:31 -0500 Subject: [PATCH] Build fix: g++ < 7.1 mishandles namespaces of specializations MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/bin/lttng-sessiond/field.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) 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 +} -- 2.34.1