From 7f9727873988ad875c994ad3235b4ecd22606021 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Mon, 14 Mar 2022 19:09:46 +0000 Subject: [PATCH] Testcase correction for using declaration and members The compiler calls setWindowGrab(bool) instead of setWindowsGrab(NativeWindowType*) and gives a warning with Visual C++ when calling setWindowGrab(true) with a pointer to ApplicationContextSDL. Looks like function function hiding of the non-virtual method. I can't see this changing testing of the original bug. --- Examples/test-suite/director_using_member_scopes.i | 4 ++-- Examples/test-suite/using_member_scopes.i | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Examples/test-suite/director_using_member_scopes.i b/Examples/test-suite/director_using_member_scopes.i index 9e359539c..d2776ea1e 100644 --- a/Examples/test-suite/director_using_member_scopes.i +++ b/Examples/test-suite/director_using_member_scopes.i @@ -26,7 +26,7 @@ namespace OgreBites class ApplicationContextSDL : public ApplicationContextBase { public: using ApplicationContextBase::setWindowGrab; - int setWindowGrab(NativeWindowType* win, bool grab) { return 10; } // This should not be added again as it exists in base class + int setWindowGrab(NativeWindowType* win, bool grab = true) { return 10; } // This should not be added again as it exists in base class static int call_setWindowGrab(ApplicationContextSDL* ptr, NativeWindowType* win, bool grab) { return ptr->setWindowGrab(win, grab); } }; @@ -44,7 +44,7 @@ namespace OgreBites class ACSDL : public ACB { public: using ACB::setWindowGrab; // This introduces two methods, not one method like ApplicationContextSDL - int setWindowGrab(NativeWindowType* win, bool grab) { return 10; } // This should not be added again as it exists in base class + int setWindowGrab(NativeWindowType* win, bool grab = true) { return 10; } // This should not be added again as it exists in base class static int call_setWindowGrab(ACSDL* ptr, NativeWindowType* win, bool grab) { return ptr->setWindowGrab(win, grab); } static int call_setWindowGrab(ACSDL* ptr, const char *s, int val) { return ptr->setWindowGrab(s, val); } diff --git a/Examples/test-suite/using_member_scopes.i b/Examples/test-suite/using_member_scopes.i index bfd09902c..354988a0b 100644 --- a/Examples/test-suite/using_member_scopes.i +++ b/Examples/test-suite/using_member_scopes.i @@ -16,7 +16,7 @@ namespace OgreBites class ApplicationContextSDL : public ApplicationContextBase { public: using ApplicationContextBase::setWindowGrab; - void setWindowGrab(NativeWindowType* win, bool grab) {} // This should not be added again as it exists in base class + void setWindowGrab(NativeWindowType* win, bool grab = true) {} // This should not be added again as it exists in base class }; /* typedef not working yet