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-Tag: v0.14.1~1 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=ebd83c14476470e7b06b2720d7cc61993c135fe3;p=userspace-rcu.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 0de713a..bd35e82 100644 --- a/include/urcu/compiler.h +++ b/include/urcu/compiler.h @@ -103,7 +103,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