From: Jérémie Galarneau Date: Tue, 30 Jul 2024 19:21:07 +0000 (+0000) Subject: Fix: missing typename in URCU_FORCE_CAST X-Git-Url: http://git.lttng.org./?a=commitdiff_plain;h=e23b38057111f84a1345302a579d08afc78f8fa2;p=urcu.git Fix: missing typename in URCU_FORCE_CAST 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 --- 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