Using declarations in derived class parameters scoping fix
Fix using declaration in derived class incorrectly introducing a method from a base class when the using declaration is declared before the method declaration. Problem occurred when within a namespace and the parameter types in the method signatures were not fully qualified. Issue #1441
This commit is contained in:
parent
2a9431ebfb
commit
bd5ffe86e4
4 changed files with 74 additions and 22 deletions
|
|
@ -554,6 +554,7 @@ CPP_TEST_CASES += \
|
|||
using_extend \
|
||||
using_inherit \
|
||||
using_member \
|
||||
using_member_scopes \
|
||||
using_namespace \
|
||||
using_namespace_loop \
|
||||
using_pointers \
|
||||
|
|
|
|||
31
Examples/test-suite/using_member_scopes.i
Normal file
31
Examples/test-suite/using_member_scopes.i
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
%module using_member_scopes
|
||||
|
||||
// Fully qualifying parameter types in a method declared after the using declaration caused
|
||||
// a method being incorrectly added by the using declaration even though the declaration already existed
|
||||
|
||||
%inline %{
|
||||
namespace OgreBites
|
||||
{
|
||||
struct NativeWindowType {};
|
||||
class ApplicationContextBase {
|
||||
public:
|
||||
virtual ~ApplicationContextBase() {}
|
||||
virtual void setWindowGrab(NativeWindowType* win, bool grab = true) {}
|
||||
void setWindowGrab(bool grab = true) {}
|
||||
};
|
||||
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
|
||||
};
|
||||
/*
|
||||
typedef not working yet
|
||||
class ApplicationContextSDL2 : public ApplicationContextBase {
|
||||
public:
|
||||
using ApplicationContextBase::setWindowGrab;
|
||||
typedef NativeWindowType* pNWT;
|
||||
void setWindowGrab(pNWT win, bool grab) {} // This should not be added again as it exists in base class
|
||||
};
|
||||
*/
|
||||
}
|
||||
%}
|
||||
Loading…
Add table
Add a link
Reference in a new issue