mirror of https://github.com/swig/swig
#526 : propagate c++11 noexcept to director classes
This commit is contained in:
parent
b4efa7b16e
commit
4777a0ad3c
|
@ -4102,6 +4102,10 @@ public:
|
|||
Delete(target);
|
||||
|
||||
// Add any exception specifications to the methods in the director class
|
||||
if (Getattr(n, "noexcept")) {
|
||||
Append(w->def, " noexcept");
|
||||
Append(declaration, " noexcept");
|
||||
}
|
||||
ParmList *throw_parm_list = NULL;
|
||||
if ((throw_parm_list = Getattr(n, "throws")) || Getattr(n, "throw")) {
|
||||
int gencomma = 0;
|
||||
|
@ -4419,7 +4423,10 @@ public:
|
|||
String *dirclassname = directorClassName(current_class);
|
||||
Wrapper *w = NewWrapper();
|
||||
|
||||
if (Getattr(n, "throw")) {
|
||||
if (Getattr(n, "noexcept")) {
|
||||
Printf(f_directors_h, " virtual ~%s() noexcept;\n", dirclassname);
|
||||
Printf(w->def, "%s::~%s() noexcept {\n", dirclassname, dirclassname);
|
||||
} else if (Getattr(n, "throw")) {
|
||||
Printf(f_directors_h, " virtual ~%s() throw ();\n", dirclassname);
|
||||
Printf(w->def, "%s::~%s() throw () {\n", dirclassname, dirclassname);
|
||||
} else {
|
||||
|
|
|
@ -2217,6 +2217,10 @@ public:
|
|||
Delete(target);
|
||||
|
||||
// Add any exception specifications to the methods in the director class
|
||||
if (Getattr(n, "noexcept")) {
|
||||
Append(w->def, " noexcept");
|
||||
Append(declaration, " noexcept");
|
||||
}
|
||||
ParmList *throw_parm_list = NULL;
|
||||
if ((throw_parm_list = Getattr(n, "throws")) || Getattr(n, "throw")) {
|
||||
int gencomma = 0;
|
||||
|
@ -2483,7 +2487,10 @@ public:
|
|||
String *dirclassname = directorClassName(current_class);
|
||||
Wrapper *w = NewWrapper();
|
||||
|
||||
if (Getattr(n, "throw")) {
|
||||
if (Getattr(n, "noexcept")) {
|
||||
Printf(f_directors_h, " virtual ~%s() noexcept;\n", dirclassname);
|
||||
Printf(w->def, "%s::~%s() noexcept {\n", dirclassname, dirclassname);
|
||||
} else if (Getattr(n, "throw")) {
|
||||
Printf(f_directors_h, " virtual ~%s() throw ();\n", dirclassname);
|
||||
Printf(w->def, "%s::~%s() throw () {\n", dirclassname, dirclassname);
|
||||
} else {
|
||||
|
|
|
@ -4293,6 +4293,10 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
if (Getattr(n, "noexcept")) {
|
||||
Append(w->def, " noexcept");
|
||||
Append(declaration, " noexcept");
|
||||
}
|
||||
if ((throw_parm_list = Getattr(n, "throws")) || Getattr(n, "throw")) {
|
||||
int gencomma = 0;
|
||||
|
||||
|
@ -4671,7 +4675,10 @@ public:
|
|||
String *dirClassName = directorClassName(current_class);
|
||||
Wrapper *w = NewWrapper();
|
||||
|
||||
if (Getattr(n, "throw")) {
|
||||
if (Getattr(n, "noexcept")) {
|
||||
Printf(f_directors_h, " virtual ~%s() noexcept;\n", dirClassName);
|
||||
Printf(w->def, "%s::~%s() noexcept {\n", dirClassName, dirClassName);
|
||||
} else if (Getattr(n, "throw")) {
|
||||
Printf(f_directors_h, " virtual ~%s() throw ();\n", dirClassName);
|
||||
Printf(w->def, "%s::~%s() throw () {\n", dirClassName, dirClassName);
|
||||
} else {
|
||||
|
|
|
@ -1321,6 +1321,10 @@ public:
|
|||
Delete(target);
|
||||
|
||||
// Get any exception classes in the throws typemap
|
||||
if (Getattr(n, "noexcept")) {
|
||||
Append(w->def, " noexcept");
|
||||
Append(declaration, " noexcept");
|
||||
}
|
||||
ParmList *throw_parm_list = 0;
|
||||
|
||||
if ((throw_parm_list = Getattr(n, "throws")) || Getattr(n, "throw")) {
|
||||
|
|
|
@ -2090,6 +2090,10 @@ public:
|
|||
Delete(target);
|
||||
|
||||
// Get any exception classes in the throws typemap
|
||||
if (Getattr(n, "noexcept")) {
|
||||
Append(w->def, " noexcept");
|
||||
Append(declaration, " noexcept");
|
||||
}
|
||||
ParmList *throw_parm_list = 0;
|
||||
|
||||
if ((throw_parm_list = Getattr(n, "throws")) || Getattr(n, "throw")) {
|
||||
|
@ -2486,7 +2490,10 @@ public:
|
|||
Delete(mangle);
|
||||
Delete(ptype);
|
||||
|
||||
if (Getattr(n, "throw")) {
|
||||
if (Getattr(n, "noexcept")) {
|
||||
Printf(f_directors_h, " virtual ~%s() noexcept;\n", DirectorClassName);
|
||||
Printf(f_directors, "%s::~%s() noexcept {%s}\n\n", DirectorClassName, DirectorClassName, body);
|
||||
} else if (Getattr(n, "throw")) {
|
||||
Printf(f_directors_h, " virtual ~%s() throw ();\n", DirectorClassName);
|
||||
Printf(f_directors, "%s::~%s() throw () {%s}\n\n", DirectorClassName, DirectorClassName, body);
|
||||
} else {
|
||||
|
|
|
@ -2530,6 +2530,10 @@ done:
|
|||
Delete(target);
|
||||
|
||||
// Get any exception classes in the throws typemap
|
||||
if (Getattr(n, "noexcept")) {
|
||||
Append(w->def, " noexcept");
|
||||
Append(declaration, " noexcept");
|
||||
}
|
||||
ParmList *throw_parm_list = 0;
|
||||
|
||||
if ((throw_parm_list = Getattr(n, "throws")) || Getattr(n, "throw")) {
|
||||
|
|
|
@ -5366,8 +5366,11 @@ int PYTHON::classDirectorMethod(Node *n, Node *parent, String *super) {
|
|||
Delete(target);
|
||||
|
||||
// Get any exception classes in the throws typemap
|
||||
if (Getattr(n, "noexcept")) {
|
||||
Append(w->def, " noexcept");
|
||||
Append(declaration, " noexcept");
|
||||
}
|
||||
ParmList *throw_parm_list = 0;
|
||||
|
||||
if ((throw_parm_list = Getattr(n, "throws")) || Getattr(n, "throw")) {
|
||||
Parm *p;
|
||||
int gencomma = 0;
|
||||
|
|
|
@ -3112,6 +3112,10 @@ public:
|
|||
Delete(target);
|
||||
|
||||
// Get any exception classes in the throws typemap
|
||||
if (Getattr(n, "noexcept")) {
|
||||
Append(w->def, " noexcept");
|
||||
Append(declaration, " noexcept");
|
||||
}
|
||||
ParmList *throw_parm_list = 0;
|
||||
|
||||
if ((throw_parm_list = Getattr(n, "throws")) || Getattr(n, "throw")) {
|
||||
|
|
Loading…
Reference in New Issue