Named duplicate class template instantiations now issue a warning and are ignored.
Duplicate empty class template instantiations are quietly ignored.
The test cases are fixed for this new behaviour.
This commit is a pre-requisite for the near future so that the Python
builtin wrappers can correctly use the SwigType_namestr function without
generating duplicate symbol names.
Resolve the return type to correctly determine if the type is a pointer or
reference to a director class.
SwigType_refptr_count_return() recently added as a simpler fix is no
longer needed.
The conventional approach of using the "type" rather than "decl" to
analyse the return type is used instead too.
Issue #1823
Includes the majority of patch #1484.
Excludes changes in typepass.cxx for specializations which have no effect
on the duplicate_class_name_in_ns testcase, nor the rest of the test-suite.
Previously code in the SWIG tool didn't handle allocation failures
well. Most places didn't check for NULL return from
malloc()/realloc()/calloc() at all, typically resulting in undefined
behaviour, and some places used assert() to check for a NULL return
(which is a misuse of assert() and such checks disappear if built with
NDEBUG defined leaving us back with undefined behaviour).
All C allocations are now done via wrapper functions (Malloc(),
Realloc() and Calloc()) which emit and error and exit with non-zero
status on failure, so a non-NULL return can be relied upon.
Fixes#1901.
We were passing flags of DOH_REPLACE_ANY|DOH_REPLACE_FIRST in three
places, which doesn't make sense as those are mutually exclusive
concepts. In the current implementation DOH_REPLACE_FIRST wins in
this situation, so replace with that and clarify the docs.
This involves properly counting the number of references and pointers in the return
type of a function and only generate unwrapping code if this number is 1.
For template instances some post-processing code is added to fix the 'decl' and
'type' attributes of functions if changed in an unfavorable way during template
expansion.
This commit fixes swig#1811.
Fix regression in 4.0.0 where a template function containing a parameter
with the same name as the function name led to the parameter name used in the
target language being incorrectly modified.
Closes#1602
In the %typemap below the type is T and the name is X<T>::make
which now expands correctly to X< int >::make
template<typename T> struct X {
%typemap(out) T X<T>::make "..."
T make();
};
%template(Xint) X<int>;
cparse_template_expand() incorrectly appended template parameters to all
destructor nodes it encountered during the tree traversal, including the
dtors of any nested classes.
This resulted in WARN_LANG_ILLEGAL_DESTRUCTOR warnings from
Language::destructorDeclaration() later and possibly other problems due
to not actually wrapping these dtors.
Fix this by explicitly checking if the dtor is a child or, to account
for %extend, a grandchild of the template node itself before appending
template parameters to it.
This commit is best viewed with "-w" (ignore whitespace changes) option
as it indents, without changing, a block of code.
https://swig.svn.sourceforge.net/svnroot/swig/branches/swig-2.0
........
r11085 | bhy | 2009-01-25 00:21:55 +0800 (Sun, 25 Jan 2009) | 2 lines
Fix const-correctness.
........
r11086 | bhy | 2009-01-25 02:08:50 +0800 (Sun, 25 Jan 2009) | 2 lines
Correct some function definition in header files, which implementation changed in previous commit caused mismatch.
........
r11088 | bhy | 2009-01-25 02:38:32 +0800 (Sun, 25 Jan 2009) | 1 line
minor fix and now SWIG is alive again
........
r11089 | bhy | 2009-01-25 06:07:07 +0800 (Sun, 25 Jan 2009) | 1 line
Correct some bug introduced in previous commits. Now SWIG is pretty good with C++ compiler.
........
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11097 626c5289-ae23-0410-ae9c-e8d60b6d4f22
too large to be in the parser.
Centralize the swig keys to avoid replication and wrong spellings.
Use more HashGetAttr where possible and other speed improvements
to compensate for the extra work introduced by the new rename/namewarn
mechanism.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8170 626c5289-ae23-0410-ae9c-e8d60b6d4f22