Fix %extend on typedef classes in a namespace using the typedef name
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12800 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
282ab494ab
commit
2fd6b5367d
5 changed files with 164 additions and 3 deletions
|
|
@ -3560,20 +3560,25 @@ cpp_class_decl : storage_class cpptype idcolon inherit LBRACE {
|
|||
if (Cmp($1,"typedef") == 0) {
|
||||
if (!decltype || !Len(decltype)) {
|
||||
String *cname;
|
||||
String *tdscopename;
|
||||
String *class_scope = Swig_symbol_qualifiedscopename(cscope);
|
||||
name = Getattr($9,"name");
|
||||
cname = Copy(name);
|
||||
Setattr($$,"tdname",cname);
|
||||
Delete(cname);
|
||||
tdscopename = class_scope ? NewStringf("%s::%s", class_scope, name) : Copy(name);
|
||||
|
||||
/* Use typedef name as class name */
|
||||
if (class_rename && (Strcmp(class_rename,$3) == 0)) {
|
||||
Delete(class_rename);
|
||||
class_rename = NewString(name);
|
||||
}
|
||||
if (!Getattr(classes,name)) {
|
||||
Setattr(classes,name,$$);
|
||||
if (!Getattr(classes,tdscopename)) {
|
||||
Setattr(classes,tdscopename,$$);
|
||||
}
|
||||
Setattr($$,"decl",decltype);
|
||||
Delete(class_scope);
|
||||
Delete(cname);
|
||||
Delete(tdscopename);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue