SWIG no longer defines preprocessor symbols corresponding to
command line options (e.g. `-module blah` was resulting in
`SWIGOPT_MODULE` being set to `blah`). This feature was added in
2001 so that "[m]odules can look for these symbols to alter their
code generation if needed", but it's never been used for that
purpose in over 20 years, and has never been documented outside of
CHANGES.
Closes: #2595
This is a C++14 feature.
SWIG can now parse some cases of this. The limitation is that there
can either be nothing or `const` between the `)` and the end of the
parameter list and the `{` at the start of the body.
Fixes#2446
We want -U to act consistently on predefined symbols and we can't
predefine all symbols before option parsing (since some rely on
options (-c++ defines __cplusplus, -python defines SWIGPYTHON,
etc) so handle them all after.
We have some rules to allow parsing just a type, parameter or parameter
list. Instead of using a semicolon as an end marker for these, just use
the special END token which always marks the end of input.
Use parser error recovery to skip to the closing matching `)` and
issue a warning that we can't deduce the decltype for the expression
(like we already do for any expression which isn't a simple variable
or similar).
Fixes#1589
Helps #2335 (fixes the decltype-related examples)
This can be more efficient than using strstr/Strstr with a single
character search string.
GCC is able to optimise strstr() with a single character literal
search string to strchr(), but clang doesn't, and likely no compiler
can for Strstr() (unless some sort of inter-object optimisation such
as LTO is used) since the literal string is in a different source file
to the strstr() call.
Previously we had a hard-coded list of allowed combinations in the
grammar, but this suffers from combinatorial explosion, and results
in a vague `Syntax error in input` error for invalid (and missing)
combinations.
This means we now support a number of cases which are valid C++
but weren't supported.
Fixes#302Fixes#2079 (friend constexpr)
Fixes#2474 (virtual explicit)
We now wrap this as a non-static method in PHP, which means the static
form only callable via an object.
Previously this case could end up wrapped as static or non-static
in PHP. If it was wrapped as static, attempting to call non-static
overloaded forms would crash with a segmentation fault.
See #2544
* typedef-namespace:
Partial revert of previous commit for typedefs
add an unit test
tentative fix for typedef/using declaration to struct typedef
Conflicts:
CHANGES.current
Setting current symbol table for a typedef seems wrong.
No difference to test-suite though.
Testcase rename for C++11 testing and minor adjustments.
Issue #2550Closes#2551
Nodejs is like V8 and needs C++ output enabled when wrapping C code.
The testsuite was masking this bug by using SWIG options
`-v8 -DBUILDING_NODE_EXTENSION=1` rather than `-node` when testing
with nodejs, while the javascript examples currently all seem to all get
processed with -c++.
Previously they were silently ignored in this context (but #if defined
already worked here if you need a workaround which works for older
versions).
Fixes#2183
Previously we'd fail an assertion and dump core, which isn't nice:
Bad template type passed to SwigType_remember: a(std::numeric_limits< unsigned char >::max()).unsigned char
swig: ../../Source/Swig/typesys.c:1709: SwigType_remember_clientdata: Assertion `0' failed.
Aborted (core dumped)
We also now know that this situation can be triggered by particular
user inputs, so an assertion is not an appropriate check anyway.
Now we report an error and exit with non-zero status:
:1: Error: Array size expressions containing a '<' character not fully supported
The `:1:` part isn't ideal but happens because the SwigType doesn't seem
to have file:line information.
See #2486.