adding support for structs, docu

This commit is contained in:
Frank Schlimbach 2019-02-28 02:48:05 -06:00 committed by Olly Betts
commit 4ce2964ab8
2 changed files with 7 additions and 6 deletions

View file

@ -6,17 +6,15 @@
%inline %{
namespace interface1
{
class A
struct A
{
public:
int get(int) {return 10;}
};
}
using interface1::A;
class B : public A
struct B : public A
{
public:
using A::get;
int get(double) {return 20;}
};

View file

@ -384,12 +384,15 @@ String *Swig_symbol_qualified_language_scopename(Symtab *n) {
/* -----------------------------------------------------------------------------
* Swig_symbol_add_using()
*
* Adds a node to the C symbol table for a using declaration.
* Used for using-declarations within classes/structs.
* ----------------------------------------------------------------------------- */
void Swig_symbol_add_using(String * name, String * uname, Node * n) {
Hash *h;
h = Swig_symbol_clookup(uname,0);
if (h && checkAttribute(h, "kind", "class")) {
h = Swig_symbol_clookup(uname, 0);
if (h && (checkAttribute(h, "kind", "class") || checkAttribute(h, "kind", "struct"))) {
String *qcurrent = Swig_symbol_qualifiedscopename(0);
if (qcurrent) {
Append(qcurrent, "::");