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<ContainedType, Member>::iterator*)this)->_node_contents.next)>::type' because 'std::remove_cv<__typeof__ (((lttng::urcu::rcu_list_iteration_adapter<ContainedType, Member>::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 <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I209fc5f46fee372bf673fc04c5a55d4827238b19
#define __rcu
#ifdef __cplusplus
-#define URCU_FORCE_CAST(_type, arg) (reinterpret_cast<std::remove_cv<_type>::type>(arg))
+#define URCU_FORCE_CAST(_type, arg) (reinterpret_cast<typename std::remove_cv<_type>::type>(arg))
#else
#define URCU_FORCE_CAST(type, arg) ((type) (arg))
#endif