diff --git a/core/callable_method_pointer.h b/core/callable_method_pointer.h index fed793dfca7..a931a344e66 100644 --- a/core/callable_method_pointer.h +++ b/core/callable_method_pointer.h @@ -134,7 +134,7 @@ void call_with_variant_args_helper(T *p_instance, void (T::*p_method)(P...), con #ifdef DEBUG_METHODS_ENABLED (p_instance->*p_method)(VariantCasterAndValidate
::cast(p_args, Is, r_error)...); #else - (p_instance->*p_method)(VariantCaster
::cast(p_args[Is])...);
#endif
}
@@ -201,6 +201,15 @@ Callable create_custom_callable_function_pointer(T *p_instance,
// VERSION WITH RETURN
+// GCC 8 raises "parameter 'p_args' set but not used" here, probably using a
+// template version that does not have arguments and thus sees it unused, but
+// obviously the template can be used for functions with and without them, and
+// the optimizer will get rid of it anyway.
+#if defined(DEBUG_METHODS_ENABLED) && defined(__GNUC__) && !defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
+#endif
+
template ::cast(p_args, Is, r_error)...);
#else
- (p_instance->*p_method)(VariantCaster ::cast(p_args[Is])...);
#endif
}
+#if defined(DEBUG_METHODS_ENABLED) && defined(__GNUC__) && !defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+
template