Don't generate invalid forward enum declarations

Such declarations are invalid without specifying the underlying type
(which is only possible since C++11) and are useless anyhow, so just
don't bother emitting them.
This commit is contained in:
Vadim Zeitlin 2021-11-10 17:13:43 +01:00
commit e7fa72fc06

View file

@ -1440,6 +1440,17 @@ public:
return Language::constructorHandler(n);
}
/* ----------------------------------------------------------------------
* Language::enumforwardDeclaration()
* ---------------------------------------------------------------------- */
virtual int enumforwardDeclaration(Node *n) {
// Base implementation of this function calls enumDeclaration() for "missing" enums, i.e. those without any definition at all. This results in invalid (at
// least in C++) enum declarations in the output, so simply don't do this here.
(void) n;
return SWIG_OK;
}
/* ---------------------------------------------------------------------
* enumDeclaration()
* --------------------------------------------------------------------- */