Fix templated constructors regression

Templated constructors were incorrectly ignored because SWIG thought they were
methods without a return type.
Regression introduced in swig-3.0.0
Closes #245.
This commit is contained in:
William S Fulton 2014-12-09 23:31:07 +00:00
commit ae555c2339
5 changed files with 81 additions and 1 deletions

View file

@ -2694,7 +2694,8 @@ int Language::constructorDeclaration(Node *n) {
String *scope = Swig_scopename_check(ClassName) ? Swig_scopename_prefix(ClassName) : 0;
String *actual_name = scope ? NewStringf("%s::%s", scope, name) : NewString(name);
Delete(scope);
if (!Equal(actual_name, expected_name) && !SwigType_istemplate(expected_name)) {
if (!Equal(actual_name, expected_name) && !SwigType_istemplate(expected_name) && !SwigType_istemplate(actual_name)) {
// Checking templates is skipped but they ought to be checked... they are just somewhat more tricky to check correctly
bool illegal_name = true;
if (Extend) {
// Check for typedef names used as a constructor name in %extend. This is deprecated except for anonymous