Fix ignore on implicit constructors
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9934 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
38f6ca7f15
commit
9b79e76d93
4 changed files with 114 additions and 68 deletions
|
|
@ -2141,34 +2141,36 @@ static void addCopyConstructor(Node *n) {
|
|||
}
|
||||
|
||||
String *symname = Swig_name_make(cn, cname, last, decl, oldname);
|
||||
if (!symname) {
|
||||
symname = Copy(csymname);
|
||||
}
|
||||
Parm *p = NewParm(cc, "other");
|
||||
if (Strcmp(symname, "$ignore") != 0) {
|
||||
if (!symname) {
|
||||
symname = Copy(csymname);
|
||||
}
|
||||
Parm *p = NewParm(cc, "other");
|
||||
|
||||
Setattr(cn, "name", name);
|
||||
Setattr(cn, "sym:name", symname);
|
||||
SetFlag(cn, "feature:new");
|
||||
Setattr(cn, "decl", decl);
|
||||
Setattr(cn, "parentNode", n);
|
||||
Setattr(cn, "parms", p);
|
||||
Setattr(cn, "copy_constructor", "1");
|
||||
Setattr(cn, "name", name);
|
||||
Setattr(cn, "sym:name", symname);
|
||||
SetFlag(cn, "feature:new");
|
||||
Setattr(cn, "decl", decl);
|
||||
Setattr(cn, "parentNode", n);
|
||||
Setattr(cn, "parms", p);
|
||||
Setattr(cn, "copy_constructor", "1");
|
||||
|
||||
Symtab *oldscope = Swig_symbol_setscope(Getattr(n, "symtab"));
|
||||
Node *on = Swig_symbol_add(symname, cn);
|
||||
Swig_symbol_setscope(oldscope);
|
||||
Swig_features_get(Swig_cparse_features(), 0, name, decl, cn);
|
||||
Symtab *oldscope = Swig_symbol_setscope(Getattr(n, "symtab"));
|
||||
Node *on = Swig_symbol_add(symname, cn);
|
||||
Swig_symbol_setscope(oldscope);
|
||||
Swig_features_get(Swig_cparse_features(), 0, name, decl, cn);
|
||||
|
||||
if (on == cn) {
|
||||
Node *access = NewHash();
|
||||
set_nodeType(access, "access");
|
||||
Setattr(access, "kind", "public");
|
||||
appendChild(n, access);
|
||||
appendChild(n, cn);
|
||||
Setattr(n, "has_copy_constructor", "1");
|
||||
Setattr(n, "copy_constructor_decl", decl);
|
||||
Setattr(n, "allocate:copy_constructor", "1");
|
||||
Delete(access);
|
||||
if (on == cn) {
|
||||
Node *access = NewHash();
|
||||
set_nodeType(access, "access");
|
||||
Setattr(access, "kind", "public");
|
||||
appendChild(n, access);
|
||||
appendChild(n, cn);
|
||||
Setattr(n, "has_copy_constructor", "1");
|
||||
Setattr(n, "copy_constructor_decl", decl);
|
||||
Setattr(n, "allocate:copy_constructor", "1");
|
||||
Delete(access);
|
||||
}
|
||||
}
|
||||
Delete(cn);
|
||||
Delete(last);
|
||||
|
|
@ -2191,31 +2193,33 @@ static void addDefaultConstructor(Node *n) {
|
|||
String *csymname = Getattr(n, "sym:name");
|
||||
String *oldname = csymname;
|
||||
String *symname = Swig_name_make(cn, cname, last, decl, oldname);
|
||||
if (!symname) {
|
||||
symname = Copy(csymname);
|
||||
}
|
||||
if (Strcmp(symname, "$ignore") != 0) {
|
||||
if (!symname) {
|
||||
symname = Copy(csymname);
|
||||
}
|
||||
|
||||
Setattr(cn, "name", name);
|
||||
Setattr(cn, "sym:name", symname);
|
||||
SetFlag(cn, "feature:new");
|
||||
Setattr(cn, "decl", decl);
|
||||
Setattr(cn, "parentNode", n);
|
||||
Setattr(cn, "default_constructor", "1");
|
||||
Setattr(cn, "name", name);
|
||||
Setattr(cn, "sym:name", symname);
|
||||
SetFlag(cn, "feature:new");
|
||||
Setattr(cn, "decl", decl);
|
||||
Setattr(cn, "parentNode", n);
|
||||
Setattr(cn, "default_constructor", "1");
|
||||
|
||||
Symtab *oldscope = Swig_symbol_setscope(Getattr(n, "symtab"));
|
||||
Node *on = Swig_symbol_add(symname, cn);
|
||||
Swig_symbol_setscope(oldscope);
|
||||
Swig_features_get(Swig_cparse_features(), 0, name, decl, cn);
|
||||
Symtab *oldscope = Swig_symbol_setscope(Getattr(n, "symtab"));
|
||||
Node *on = Swig_symbol_add(symname, cn);
|
||||
Swig_symbol_setscope(oldscope);
|
||||
Swig_features_get(Swig_cparse_features(), 0, name, decl, cn);
|
||||
|
||||
if (on == cn) {
|
||||
Node *access = NewHash();
|
||||
set_nodeType(access, "access");
|
||||
Setattr(access, "kind", "public");
|
||||
appendChild(n, access);
|
||||
appendChild(n, cn);
|
||||
Setattr(n, "has_default_constructor", "1");
|
||||
Setattr(n, "allocate:default_constructor", "1");
|
||||
Delete(access);
|
||||
if (on == cn) {
|
||||
Node *access = NewHash();
|
||||
set_nodeType(access, "access");
|
||||
Setattr(access, "kind", "public");
|
||||
appendChild(n, access);
|
||||
appendChild(n, cn);
|
||||
Setattr(n, "has_default_constructor", "1");
|
||||
Setattr(n, "allocate:default_constructor", "1");
|
||||
Delete(access);
|
||||
}
|
||||
}
|
||||
Delete(cn);
|
||||
Delete(last);
|
||||
|
|
@ -2237,29 +2241,31 @@ static void addDestructor(Node *n) {
|
|||
String *name = NewStringf("%s::%s", cname, last);
|
||||
String *decl = NewString("f().");
|
||||
String *symname = Swig_name_make(cn, cname, last, decl, 0);
|
||||
if (!symname) {
|
||||
symname = NewStringf("~%s", Getattr(n, "sym:name"));
|
||||
}
|
||||
if (Strcmp(symname, "$ignore") != 0) {
|
||||
if (!symname) {
|
||||
symname = NewStringf("~%s", Getattr(n, "sym:name"));
|
||||
}
|
||||
|
||||
Setattr(cn, "name", name);
|
||||
Setattr(cn, "sym:name", symname);
|
||||
Setattr(cn, "decl", "f().");
|
||||
Setattr(cn, "parentNode", n);
|
||||
Setattr(cn, "name", name);
|
||||
Setattr(cn, "sym:name", symname);
|
||||
Setattr(cn, "decl", "f().");
|
||||
Setattr(cn, "parentNode", n);
|
||||
|
||||
Symtab *oldscope = Swig_symbol_setscope(Getattr(n, "symtab"));
|
||||
Node *on = Swig_symbol_add(symname, cn);
|
||||
Swig_symbol_setscope(oldscope);
|
||||
Swig_features_get(Swig_cparse_features(), 0, name, decl, cn);
|
||||
Symtab *oldscope = Swig_symbol_setscope(Getattr(n, "symtab"));
|
||||
Node *on = Swig_symbol_add(symname, cn);
|
||||
Swig_symbol_setscope(oldscope);
|
||||
Swig_features_get(Swig_cparse_features(), 0, name, decl, cn);
|
||||
|
||||
if (on == cn) {
|
||||
Node *access = NewHash();
|
||||
set_nodeType(access, "access");
|
||||
Setattr(access, "kind", "public");
|
||||
appendChild(n, access);
|
||||
appendChild(n, cn);
|
||||
Setattr(n, "has_destructor", "1");
|
||||
Setattr(n, "allocate:destructor", "1");
|
||||
Delete(access);
|
||||
if (on == cn) {
|
||||
Node *access = NewHash();
|
||||
set_nodeType(access, "access");
|
||||
Setattr(access, "kind", "public");
|
||||
appendChild(n, access);
|
||||
appendChild(n, cn);
|
||||
Setattr(n, "has_destructor", "1");
|
||||
Setattr(n, "allocate:destructor", "1");
|
||||
Delete(access);
|
||||
}
|
||||
}
|
||||
Delete(cn);
|
||||
Delete(last);
|
||||
|
|
@ -2475,7 +2481,7 @@ int Language::constructorDeclaration(Node *n) {
|
|||
return SWIG_NOWRAP;
|
||||
|
||||
if (Extend) {
|
||||
/* extend default constructor can be safetly ignored if there is
|
||||
/* extend default constructor can be safely ignored if there is
|
||||
already one */
|
||||
int num_required = ParmList_numrequired(Getattr(n, "parms"));
|
||||
if ((num_required == 0) && Getattr(CurrentClass, "has_default_constructor")) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue