mirror of https://github.com/swig/swig
Fix some usage of global scope operator ::
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11719 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
70e8072612
commit
da1fc3ab8f
|
@ -1,6 +1,28 @@
|
|||
Version 1.3.41 (in progress)
|
||||
============================
|
||||
|
||||
2009-11-03: wsfulton
|
||||
Fix some usage of global scope operator, for example:
|
||||
|
||||
namespace AA { /* ... */ }
|
||||
using namespace ::AA;
|
||||
|
||||
and bug #1816802 - SwigValueWrapper should be used ::
|
||||
|
||||
struct CC {
|
||||
CC(int); // no default constructor
|
||||
};
|
||||
::CC x();
|
||||
|
||||
and in template parameter specializations:
|
||||
|
||||
struct S {};
|
||||
template <typename T> struct X { void a() {}; };
|
||||
template <> struct X<S> { void b() {}; };
|
||||
%template(MyTConcrete) X< ::S >;
|
||||
|
||||
plus probably some other corner case usage of ::.
|
||||
|
||||
2009-11-02: olly
|
||||
[Python] Fix potential memory leak in initialisation code for the
|
||||
generated module.
|
||||
|
|
|
@ -69,6 +69,7 @@ namespace Two {
|
|||
template <typename T1> struct TwoParm<T1 *, int *> { void e() {} };
|
||||
template <typename T1> struct TwoParm<T1, int> { void f() {} };
|
||||
template <> struct TwoParm<int *, const int *> { void g() {} };
|
||||
template <> struct TwoParm<Concrete, Concrete *> { void h() {} };
|
||||
}
|
||||
%}
|
||||
|
||||
|
@ -90,6 +91,7 @@ namespace Two {
|
|||
%template(B1_) ::Two::TwoParm<char *, ::Concrete *>;
|
||||
%template(E1_) Two::TwoParm<const int *, int *>;
|
||||
%template(E2_) Two::TwoParm<int **, int *>;
|
||||
%template(H_) Two::TwoParm< ::Concrete, ::Concrete * >;
|
||||
|
||||
|
||||
// Many template parameters
|
||||
|
|
|
@ -74,3 +74,14 @@ struct X {
|
|||
};
|
||||
|
||||
}
|
||||
|
||||
%inline %{
|
||||
namespace SpaceMan {
|
||||
typedef double SpaceManDouble;
|
||||
}
|
||||
using namespace ::SpaceMan; // global namespace prefix
|
||||
|
||||
SpaceManDouble useSpaceMan(SpaceManDouble s) { return s; }
|
||||
|
||||
%}
|
||||
|
||||
|
|
|
@ -24,6 +24,12 @@ public:
|
|||
const B GetBconst() const {
|
||||
return b;
|
||||
}
|
||||
::B GetBGlobalQualifier() {
|
||||
return b;
|
||||
}
|
||||
const ::B GetBconstGlobalGlobalQualifier() const {
|
||||
return b;
|
||||
}
|
||||
};
|
||||
|
||||
%}
|
||||
|
|
|
@ -998,6 +998,8 @@ Node *Swig_symbol_clookup(const_String_or_char_ptr name, Symtab *n) {
|
|||
String *nname = NewString(cname + 2);
|
||||
if (Swig_scopename_check(nname)) {
|
||||
s = symbol_lookup_qualified(nname, global_scope, 0, 0, 0);
|
||||
} else {
|
||||
s = symbol_lookup(nname, global_scope, 0);
|
||||
}
|
||||
Delete(nname);
|
||||
} else {
|
||||
|
@ -1070,6 +1072,8 @@ Node *Swig_symbol_clookup_check(const_String_or_char_ptr name, Symtab *n, int (*
|
|||
String *nname = NewString(cname + 2);
|
||||
if (Swig_scopename_check(nname)) {
|
||||
s = symbol_lookup_qualified(nname, global_scope, 0, 0, checkfunc);
|
||||
} else {
|
||||
s = symbol_lookup(nname, global_scope, checkfunc);
|
||||
}
|
||||
Delete(nname);
|
||||
} else {
|
||||
|
@ -1134,6 +1138,8 @@ Node *Swig_symbol_clookup_local(const_String_or_char_ptr name, Symtab *n) {
|
|||
String *nname = NewString(cname + 2);
|
||||
if (Swig_scopename_check(nname)) {
|
||||
s = symbol_lookup_qualified(nname, global_scope, 0, 0, 0);
|
||||
} else {
|
||||
s = symbol_lookup(nname, global_scope, 0);
|
||||
}
|
||||
Delete(nname);
|
||||
} else {
|
||||
|
@ -1182,6 +1188,8 @@ Node *Swig_symbol_clookup_local_check(const_String_or_char_ptr name, Symtab *n,
|
|||
String *nname = NewString(cname + 2);
|
||||
if (Swig_scopename_check(nname)) {
|
||||
s = symbol_lookup_qualified(nname, global_scope, 0, 0, checkfunc);
|
||||
} else {
|
||||
s = symbol_lookup(nname, global_scope, checkfunc);
|
||||
}
|
||||
Delete(nname);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue