fix problem with template + classforward + default template parameters reported by Bill Spotz
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8494 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
a6e348b846
commit
b54c5bdec5
2 changed files with 44 additions and 0 deletions
|
|
@ -18,3 +18,40 @@ namespace foo {
|
|||
}
|
||||
}
|
||||
%}
|
||||
|
||||
|
||||
|
||||
%inline {
|
||||
// Forward declarations
|
||||
template<class RangeScalar, class DomainScalar = RangeScalar> class LinearOpBase;
|
||||
template<class Scalar> class VectorBase;
|
||||
}
|
||||
|
||||
|
||||
%inline {
|
||||
// Class Describable
|
||||
class Describable {
|
||||
public:
|
||||
};
|
||||
|
||||
// Class LinearOpBase
|
||||
template<class RangeScalar, class DomainScalar>
|
||||
class LinearOpBase : virtual public Describable {
|
||||
public:
|
||||
}; // end class LinearOpBase<RangeScalar,DomainScalar>
|
||||
|
||||
// Class VectorBase
|
||||
template<class Scalar>
|
||||
class VectorBase : virtual public LinearOpBase<Scalar>
|
||||
{
|
||||
public:
|
||||
}; // end class VectorBase<Scalar>
|
||||
|
||||
}
|
||||
|
||||
|
||||
%template (LinearOpBase_double) LinearOpBase<double>;
|
||||
%template (VectorBase_double) VectorBase<double>;
|
||||
%template (LinearOpBase_int) LinearOpBase<int,int>;
|
||||
%template (VectorBase_int) VectorBase<int>;
|
||||
|
||||
|
|
|
|||
|
|
@ -470,7 +470,14 @@ Swig_symbol_cadd(String_or_char *name, Node *n) {
|
|||
append = n;
|
||||
} else if (cn && (HashGetAttr(cn,k_symweak))) {
|
||||
/* The node in the symbol table is weak. Replace it */
|
||||
if (checkAttribute(cn,k_nodetype,k_template)
|
||||
&& checkAttribute(cn,k_templatetype,k_classforward)) {
|
||||
/* The node is a template clasforward declaration, and the
|
||||
template parameters here take precedence over the new ones */
|
||||
Setattr(n,k_templateparms,Getattr(cn,k_templateparms));
|
||||
}
|
||||
Setattr(ccurrent,name, n);
|
||||
|
||||
} else if (cn && (HashGetAttr(n,k_symweak))) {
|
||||
/* The node being added is weak. Don't worry about it */
|
||||
} else if (cn && (HashGetAttr(n,k_symtypename))) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue