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)
|
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
|
2009-11-02: olly
|
||||||
[Python] Fix potential memory leak in initialisation code for the
|
[Python] Fix potential memory leak in initialisation code for the
|
||||||
generated module.
|
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 e() {} };
|
||||||
template <typename T1> struct TwoParm<T1, int> { void f() {} };
|
template <typename T1> struct TwoParm<T1, int> { void f() {} };
|
||||||
template <> struct TwoParm<int *, const int *> { void g() {} };
|
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(B1_) ::Two::TwoParm<char *, ::Concrete *>;
|
||||||
%template(E1_) Two::TwoParm<const int *, int *>;
|
%template(E1_) Two::TwoParm<const int *, int *>;
|
||||||
%template(E2_) Two::TwoParm<int **, int *>;
|
%template(E2_) Two::TwoParm<int **, int *>;
|
||||||
|
%template(H_) Two::TwoParm< ::Concrete, ::Concrete * >;
|
||||||
|
|
||||||
|
|
||||||
// Many template parameters
|
// 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 {
|
const B GetBconst() const {
|
||||||
return b;
|
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);
|
String *nname = NewString(cname + 2);
|
||||||
if (Swig_scopename_check(nname)) {
|
if (Swig_scopename_check(nname)) {
|
||||||
s = symbol_lookup_qualified(nname, global_scope, 0, 0, 0);
|
s = symbol_lookup_qualified(nname, global_scope, 0, 0, 0);
|
||||||
|
} else {
|
||||||
|
s = symbol_lookup(nname, global_scope, 0);
|
||||||
}
|
}
|
||||||
Delete(nname);
|
Delete(nname);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1070,6 +1072,8 @@ Node *Swig_symbol_clookup_check(const_String_or_char_ptr name, Symtab *n, int (*
|
||||||
String *nname = NewString(cname + 2);
|
String *nname = NewString(cname + 2);
|
||||||
if (Swig_scopename_check(nname)) {
|
if (Swig_scopename_check(nname)) {
|
||||||
s = symbol_lookup_qualified(nname, global_scope, 0, 0, checkfunc);
|
s = symbol_lookup_qualified(nname, global_scope, 0, 0, checkfunc);
|
||||||
|
} else {
|
||||||
|
s = symbol_lookup(nname, global_scope, checkfunc);
|
||||||
}
|
}
|
||||||
Delete(nname);
|
Delete(nname);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1134,6 +1138,8 @@ Node *Swig_symbol_clookup_local(const_String_or_char_ptr name, Symtab *n) {
|
||||||
String *nname = NewString(cname + 2);
|
String *nname = NewString(cname + 2);
|
||||||
if (Swig_scopename_check(nname)) {
|
if (Swig_scopename_check(nname)) {
|
||||||
s = symbol_lookup_qualified(nname, global_scope, 0, 0, 0);
|
s = symbol_lookup_qualified(nname, global_scope, 0, 0, 0);
|
||||||
|
} else {
|
||||||
|
s = symbol_lookup(nname, global_scope, 0);
|
||||||
}
|
}
|
||||||
Delete(nname);
|
Delete(nname);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1182,6 +1188,8 @@ Node *Swig_symbol_clookup_local_check(const_String_or_char_ptr name, Symtab *n,
|
||||||
String *nname = NewString(cname + 2);
|
String *nname = NewString(cname + 2);
|
||||||
if (Swig_scopename_check(nname)) {
|
if (Swig_scopename_check(nname)) {
|
||||||
s = symbol_lookup_qualified(nname, global_scope, 0, 0, checkfunc);
|
s = symbol_lookup_qualified(nname, global_scope, 0, 0, checkfunc);
|
||||||
|
} else {
|
||||||
|
s = symbol_lookup(nname, global_scope, checkfunc);
|
||||||
}
|
}
|
||||||
Delete(nname);
|
Delete(nname);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue