Not being able to do it is too restrictive in practice and just forces
to use raw DOH pointers, which is not really less dangerous than adding
the assignment operator and reset() method to this class.
There doesn't seem to be any unit tests covering this, but the old code
was wrong because it didn't replace periods used as namespace separators
with underscores, which resulted in periods appearing in the output when
nested namespace were used.
Fix this and also reuse the now fixed getNamespacedName() in
getEnumName() which contained its own buggy version of the same code.
It doesn't seem necessary to muck with sym:name explicitly when we
construct the fully qualified name using getNamespacedName() later
anyhow.
Moreover, the overridden version had a bug which resulted in a crash in
template_empty_inherit unit test and simply removing it entirely allows
the test to pass (without breaking anything else).
This is done not so much to fix the memory leak per se (as there are
gazillions of other ones remaining), but to show that the return value
of getProxyName() does need to be freed, as this was unclear previously,
with it being freed in one place where this function was used, but not
in the other one, here.
Also state this explicitly in the function comment.
Handle char constants defined using #define or %constant correctly.
Also handle static member const variables, which didn't work at all
before, and quote values of such variables of char type.
It's not significantly simpler to use "goto" in this function, so just
replace it with "return".
Also remove the unnecessary checks for strings being deleted being
non-null, as they always are.
No real changes.
We need to make a copy instead of directly returning whatever sym::name
points to, as this value can be overwritten with something different
later, resulting in weird problems with the value of "proxyname"
attribute changing "on its own".
After this bug fix, a few more unit tests pass.
There is no need to check if the input is non-null, as the effect of
both branches of "if" is the same anyhow.
Also get rid of an extra and unnecessary block.
No real changes.
There is no need to override it just to call the base class version.
Also remove the outdated comment, as %extend is supported currently
(albeit with some bugs remaining).
No real changes.
Don't mark functions not intended to be overridden (nor overriding those
in the base class) as "virtual", this is useless and confusing.
No real changes.
By delegating to the base class instead we not only save quite a few
lines of code, but gain support for ctors/dtors defined using %extend,
which didn't work before, allowing to reenable some of the previously
failing tests.
This is useless and the C-specific version didn't handle template
methods added with %extend correctly, so removing this code also fixes
some (but not all yet) failures in extend_template_method.cpptest unit
test.
This is never going to work and just results in generating uncompilable
code.
In principle, we could either generate wrappers for these functions
while still handling the struct as a plain C struct, or switch to
generating class-like wrappers for it if it's %extended with any
functions, but for now just ignore them as this is the simplest thing to
do.
Incidentally, this makes the default_args_c test pass again now, after
the last merge with master pulled in such %extend directives into it.
SWIG_exit() is not declared anywhere, so would need to be explicitly
declared to avoid warnings, while exit() can be declared just by
including <stdlib.h>, so prefer to use the latter, especially because
they're one and the same anyhow.
0f88f9997c (probably accidentally) changed
this file to be executable, undo this as it doesn't make sense for a
source file to have this mode.
See #1242.
This testcase was only run in Ruby and Python and implements an
obscure feature where a C++ class inherits from a std::wstring.
The li_std_wstring test is left in place to be modified in next commit
for more regular wstring testing across all languages.
* annotation_quoting:
Examples: Unify string quoting in the Python sources
Test-suite: Unify string quoting in the Python sources
Tools: Unify string quoting in the Python sources
Generator: Unify string quoting in generated Python sources
Generator: Remove trailing whitespaces in the Python module