From e23b38057111f84a1345302a579d08afc78f8fa2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Tue, 30 Jul 2024 19:21:07 +0000 Subject: [PATCH] Fix: missing typename in URCU_FORCE_CAST MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When using rcu_dereference() in the method of a templated class on a pointer whose type is determined by the template arguments, the following error occurs (using g++ 13.2.0): ../../src/common/urcu.hpp:387:39: error: need 'typename' before 'std::remove_cv<__typeof__ (((lttng::urcu::rcu_list_iteration_adapter::iterator*)this)->_node_contents.next)>::type' because 'std::remove_cv<__typeof__ (((lttng::urcu::rcu_list_iteration_adapter::iterator*)this)->_node_contents.next)>' is a dependent scope `typename` is necessary here since the result of the template argument provided to std::remove_cv can be a dependant type and we are required to inform the compiler of this dependency. Signed-off-by: Jérémie Galarneau Signed-off-by: Mathieu Desnoyers Change-Id: I209fc5f46fee372bf673fc04c5a55d4827238b19 --- include/urcu/compiler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/urcu/compiler.h b/include/urcu/compiler.h index 197656c..31a474c 100644 --- a/include/urcu/compiler.h +++ b/include/urcu/compiler.h @@ -99,7 +99,7 @@ #define __rcu #ifdef __cplusplus -#define URCU_FORCE_CAST(_type, arg) (reinterpret_cast::type>(arg)) +#define URCU_FORCE_CAST(_type, arg) (reinterpret_cast::type>(arg)) #else #define URCU_FORCE_CAST(type, arg) ((type) (arg)) #endif -- 2.34.1