fix template forward + using
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8547 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
db2955f308
commit
654efd7ba5
3 changed files with 19 additions and 5 deletions
|
|
@ -32,12 +32,14 @@ namespace foo {
|
|||
// Class Describable
|
||||
class Describable {
|
||||
public:
|
||||
void describe() {}
|
||||
};
|
||||
|
||||
// Class LinearOpBase
|
||||
template<class RangeScalar, class DomainScalar>
|
||||
class LinearOpBase : virtual public Describable {
|
||||
public:
|
||||
|
||||
}; // end class LinearOpBase<RangeScalar,DomainScalar>
|
||||
|
||||
// Class VectorBase
|
||||
|
|
@ -45,6 +47,7 @@ namespace foo {
|
|||
class VectorBase : virtual public LinearOpBase<Scalar>
|
||||
{
|
||||
public:
|
||||
using LinearOpBase<Scalar>::describe;
|
||||
}; // end class VectorBase<Scalar>
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -778,9 +778,17 @@ class TypePass : private Dispatcher {
|
|||
} else {
|
||||
Node *ns;
|
||||
/* using id */
|
||||
|
||||
if (Getattr(n,"sym:symtab")) {
|
||||
ns = Swig_symbol_clookup(Getattr(n,"uname"), Getattr(n,"sym:symtab"));
|
||||
Symtab *stab = Getattr(n,"sym:symtab");
|
||||
if (stab) {
|
||||
String *uname = Getattr(n,"uname");
|
||||
ns = Swig_symbol_clookup(uname, stab);
|
||||
if (!ns && SwigType_istemplate(uname)) {
|
||||
String *tmp = Swig_symbol_template_deftype(uname, 0);
|
||||
if (!Equal(tmp, uname)) {
|
||||
ns = Swig_symbol_clookup(tmp, stab);
|
||||
}
|
||||
Delete(tmp);
|
||||
}
|
||||
} else {
|
||||
ns = 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1729,7 +1729,6 @@ Swig_symbol_template_defargs(Parm *parms, Parm *targs, Symtab *tscope, Symtab *t
|
|||
* Apply default args to generic template type
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
#define SWIG_TEMPLATE_DEFTYPE_CACHE
|
||||
SwigType*
|
||||
Swig_symbol_template_deftype(const SwigType *type, Symtab *tscope) {
|
||||
|
|
@ -1787,8 +1786,12 @@ Swig_symbol_template_deftype(const SwigType *type, Symtab *tscope) {
|
|||
String *tsuffix = SwigType_templatesuffix(base);
|
||||
ParmList *tparms = SwigType_function_parms(targs);
|
||||
Node *tempn = Swig_symbol_clookup_local(tprefix,tscope);
|
||||
if (!tempn && tsuffix && Len(tsuffix)) {
|
||||
tempn = Swig_symbol_clookup(tprefix,0);
|
||||
}
|
||||
|
||||
#ifdef SWIG_DEBUG
|
||||
Printf(stderr,"deftype type %s \n", e);
|
||||
Printf(stderr,"deftype type %s %s %d\n", e, tprefix, (long) tempn);
|
||||
#endif
|
||||
if (tempn) {
|
||||
ParmList *tnargs = HashGetAttr(tempn,k_templateparms);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue