From 4c0763cd88c3add157703f2f1c1ce1d208336576 Mon Sep 17 00:00:00 2001 From: Marc Gilleron Date: Sun, 31 Jan 2021 22:21:31 +0000 Subject: [PATCH] Revert comment, this raised another warning, and I could not find a pattern that works --- include/core/Godot.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/core/Godot.hpp b/include/core/Godot.hpp index db5a8716..d98535f6 100644 --- a/include/core/Godot.hpp +++ b/include/core/Godot.hpp @@ -210,14 +210,17 @@ void register_tool_class() { typedef godot_variant (*__godot_wrapper_method)(godot_object *, void *, void *, int, godot_variant **); template -const char *___get_method_class_name(R (T::*/*p*/)(args... a)) { +const char *___get_method_class_name(R (T::*p)(args... a)) { static_assert(T::___CLASS_IS_SCRIPT, "This function must only be used on custom classes"); + (void)p; // To avoid "unused parameter" warnings. `p` is required for template matching. return T::___get_class_name(); } +// This second version is also required to match constant functions template -const char *___get_method_class_name(R (T::*/*p*/)(args... a) const) { +const char *___get_method_class_name(R (T::*p)(args... a) const) { static_assert(T::___CLASS_IS_SCRIPT, "This function must only be used on custom classes"); + (void)p; // To avoid "unused parameter" warnings. `p` is required for template matching. return T::___get_class_name(); }