Fix incorrect implicit constructor and destructor names in the symbol tables. Fix some feature matching issues for implicit destructors and implicit constructors and impliciti copy constructors added with %copyctor. Also improves consistency in named typemap lookup rules.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13882 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2012-11-13 22:19:47 +00:00
commit aeebd394f3
4 changed files with 56 additions and 23 deletions

View file

@ -1549,6 +1549,7 @@ static int symbol_no_constructor(Node *n) {
* Swig_symbol_type_qualify()
*
* Create a fully qualified type name
* Note: Does not resolve a constructor if passed in as the 'type'.
* ----------------------------------------------------------------------------- */
SwigType *Swig_symbol_type_qualify(const SwigType *t, Symtab *st) {

View file

@ -1306,6 +1306,7 @@ static String *Swig_typemap_lookup_impl(const_String_or_char_ptr tmap_method, No
SwigType *mtype = 0;
String *pname;
String *qpname = 0;
String *noscope_pname = 0;
Hash *tm = 0;
String *s = 0;
String *sdef = 0;
@ -1338,20 +1339,32 @@ static String *Swig_typemap_lookup_impl(const_String_or_char_ptr tmap_method, No
}
pname = Getattr(node, "name");
noscope_pname = Copy(pname);
if (pname && node && Getattr(node, "sym:symtab")) {
/* Add on a qualified name search for any symbol, for example:
/* Add on a qualified name search for any symbol in the symbol table, for example:
* struct Foo {
* int *foo(int bar) -> Foo::foo
* };
* Note that if node is a parameter (Parm *) then there will be no symbol table attached to the Parm *.
*/
Symtab *st = Getattr(node, "sym:symtab");
String *qsn = st ? Swig_symbol_string_qualify(pname, st) : 0;
if (qsn && Len(qsn) && !Equal(qsn, pname))
qpname = qsn;
String *qsn;
if (Swig_scopename_check(pname)) {
/* sometimes pname is qualified, so we remove all the scope for the lookup */
Delete(noscope_pname);
noscope_pname = Swig_scopename_last(pname);
/*
Printf(stdout, "Removed scope: %s => %s\n", pname, noscope_pname);
*/
}
qsn = Swig_symbol_qualified(node);
if (qsn && Len(qsn)) {
qpname = NewStringf("%s::%s", qsn, noscope_pname);
Delete(qsn);
}
}
tm = typemap_search(tmap_method, type, pname, qpname, &mtype, node);
tm = typemap_search(tmap_method, type, noscope_pname, qpname, &mtype, node);
if (typemap_search_debug)
debug_search_result_display(tm);
if (typemaps_used_debug && tm) {
@ -1364,6 +1377,8 @@ static String *Swig_typemap_lookup_impl(const_String_or_char_ptr tmap_method, No
Delete(qpname);
qpname = 0;
Delete(noscope_pname);
noscope_pname = 0;
if (!tm)
return sdef;