Olly Betts
204a5f7bf3
Fix a preprocessor expression evaluation bug
...
A subexpression in parentheses lost its string/int type flag and
instead used whatever type was left in the stack entry from
previous use. In practice we mostly got away with this because
most preprocessor expressions are integer, but it could have
resulted in a preprocessor expression incorrectly evaluating as
zero. If -Wextra was in use you got a warning:
Warning 202: Error: 'Can't mix strings and integers in expression'
Fixes #1384
2022-02-23 18:53:59 +13:00
Olly Betts
471b9f734e
Fix comment and testsuite check message typos
2022-02-23 17:40:09 +13:00
William S Fulton
5e85cf617a
Fix linker error in constant_expr testcase
2022-02-20 17:57:38 +00:00
William S Fulton
d2e9b80be3
Merge branch 'using-declarations' into upstream-master
...
* using-declarations:
Typo fixes
Fix warning suppression for WARN_PARSE_USING_UNDEF
Using declarations fix in symbol tables
Revert recent using-declarations code changes
Conflicts:
CHANGES.current
2022-02-20 17:04:56 +00:00
William S Fulton
9b131a03d5
Fix warning suppression for WARN_PARSE_USING_UNDEF
...
New warnings for unknown using declarations since fix in previous commit
2022-02-20 16:45:10 +00:00
Olly Betts
1707d6b89b
[PHP] Fix cleanup code handling issues
...
Fix to call cleanup code in exception situations and not to invoke
the freearg typemap twice in certain situations.
Fixes https://sourceforge.net/p/swig/bugs/1211/
2022-02-17 13:52:44 +13:00
Olly Betts
dffa74bbe5
php/cpp_basic_runme.php: Add new class to list
2022-02-16 11:17:51 +13:00
Olly Betts
a7ff0da1f3
Improve parsing of % followed immediately by identifier
...
If it's not a recognised directive the scanner now emits MODULO and then
rescans what follows, and if the parser then gives a syntax error we
report it as an unknown directive. This means that `a%b` is now allowed
in an expression, and that things like `%std::vector<std::string>` now
give an error rather than being quietly ignored.
Fixes #300
Fixes #368
2022-02-15 15:09:44 +13:00
Olly Betts
fd6c0255a2
Remove superfluous semicolons
2022-02-15 14:00:12 +13:00
William S Fulton
8e4868af75
More director const std::string& testing and C# leak fix
...
Issue #998
2022-02-13 23:00:04 +00:00
Seth R Johnson
8cf62a3325
Remove assertions from python test cases
2022-02-14 10:33:10 +13:00
William S Fulton
88f1389f80
director_property testcase for C# and Java
...
Testing std::string as director method parameter
2022-02-13 16:08:57 +00:00
William S Fulton
f32a20fc2f
Enhance Python director_property test
2022-02-12 12:17:43 +00:00
William S Fulton
86eaf30735
director string testing additions
...
Add test for C# based on Java example to test strings in and out.
Memory cleanup for Java test.
2022-02-12 12:09:01 +00:00
Olly Betts
31af3ce9bf
Avoid -Wempty-body warnings from SWIG_contract_assert
2022-02-11 18:39:08 +13:00
Olly Betts
b624d17f3f
Merge branch 'swig-fortran/extern-c-int'
...
Fixes #2199
2022-02-11 08:28:27 +13:00
Seth R Johnson
c21b4a5529
Fix cpp11_thread_local test
2022-02-11 08:25:03 +13:00
Seth R Johnson
2ecc5bc214
Don't warn about legal extern "C++" {} block
2022-02-11 08:25:03 +13:00
Seth R Johnson
4bdf454e97
Add extern C thread_local test cases
2022-02-11 08:25:03 +13:00
Olly Betts
89a0a3c5f7
Merge pull request #2197 from swig-fortran/rename-warn
...
Print rename warnings except anonymous template methods
2022-02-10 16:15:10 +13:00
Dimitris Apostolou
40c3bf30b2
Fix typos
2022-02-10 16:12:24 +13:00
Olly Betts
bb15c4eccf
[Tcl] Fix Tcl generic input typemap for std::vector
...
Fixes https://sourceforge.net/p/swig/bugs/1207/
Fixes https://sourceforge.net/p/swig/bugs/1213/
2022-02-10 09:55:58 +13:00
Olly Betts
1d088d7124
Fix comments about version Tcl bug fixed in
2022-02-08 16:39:42 +13:00
William S Fulton
d59cbf1c39
Fragments: additional testing and documentation enhancements
...
Add test for original syntax when using a single fragment key containing
the list of dependent fragments. I couldn't find a test for this.
Spaces in the fragment list don't seem to work - document it.
2022-02-07 21:45:33 +00:00
William S Fulton
013be550ed
Merge branch 'fragment-typemap' into upstream-master
...
* fragment-typemap:
Add documentation
Enable multiple 'fragment' keywords to be attached to typemaps
2022-02-07 20:35:08 +00:00
Seth R Johnson
befc9bc1f0
Mark 'externc' storage for variables
2022-02-06 20:49:01 -05:00
Olly Betts
467c530e65
Remove support for the "command" encoder
...
The "command" encoder was mostly intended for use in `%rename` - most
uses can be achieved using the "regex" encoder, so we recommend using
that instead.
The "command" encoder suffers from a number of issues - as the
documentation for it admitted, "[it] is extremely slow compared to all
the other [encoders] as it involves spawning a separate process and
using it for many declarations is not recommended" and that it "should
generally be avoided because of performance considerations".
But it's also not portable. The design assumes that `/bin/sh` supports
`<<<` but that's a bash-specific feature so it doesn't work on platforms
where `/bin/sh` is not bash - it fails on Debian, Ubuntu and probably
some other Linux distros, plus most non-Linux platforms. Microsoft
Windows doesn't even have a /bin/sh as standard.
Finally, no escaping of the passed string is done, so it has potential
security issues (though at least with %rename the input is limited to
valid C/C++ symbol names).
Fixes #1806
2022-02-07 09:47:01 +13:00
Seth R Johnson
018254cca3
Reformat name warnings to reduce changes
2022-02-06 13:51:37 -05:00
Seth R Johnson
307c9814a0
Prevent "__dummy_0__" template methods from matching name warnings
2022-02-06 13:51:37 -05:00
Seth R Johnson
de78b80de9
Renames performed by %namewarn with rename= are printed in warning message
...
This is necessary for regex-like renames (where you can't use the #define trick
as is done in many of the %keywordwarn directives). It's now unnecessary to print
the "renaming to '`x`'" code explicitly by the kw.swg files.
2022-02-06 13:51:37 -05:00
Olly Betts
d47970e2fd
Fix problem with recent commit
...
I failed to fully remove the conditional from one example in
1a03840172 .
2022-02-06 16:50:30 +13:00
Seth R Johnson
325056453a
Enable multiple 'fragment' keywords to be attached to typemaps
...
This is consistent with the use of `%fragment`. Previously only the last
`fragment=` keyword would be added.
2022-02-05 19:03:43 -05:00
Olly Betts
b06ab566cb
-DFOO on the SWIG command line now sets FOO to 1
...
This is consistent with C/C++ compiler preprocessors. Previously
SWIG set FOO to an empty value.
Fixes #2193
2022-02-06 10:18:49 +13:00
Olly Betts
f85626207c
Merge pull request #2194 from swig-fortran/mark-noassign
...
Auto-detect non-assignable classes
2022-02-06 09:44:29 +13:00
Olly Betts
1a03840172
[octave] Simply checks on exist()
...
As suggested by kwwette in #1672 , just check exist() is non-zero in
cases where the non-zero value returned varies depending on Octave
version.
2022-02-06 09:03:16 +13:00
Seth R Johnson
5b7edebdba
Placate scilab character limit
2022-02-04 14:54:11 -05:00
Seth R Johnson
5a2656ab80
Don't mark as "noassign" when a variable is immutable
...
I had assumed member variables could only be noassign by being "const",
but I had forgotten about the `%immutable` keyword being applied via
SWIG.
2022-02-04 14:03:01 -05:00
Seth R Johnson
03dd2ec39d
Auto-detect non-assignable classes
...
Classes with references or const data are now marked as 'noassign'.
This renders many explicit `private: operator=` declarations redundant.
2022-02-04 09:51:18 -05:00
Olly Betts
a60655a86b
Merge branch 'octave-4-4-bugfix' of https://github.com/friedrichatgc/swig
...
Fixes #1672
2022-02-04 16:36:05 +13:00
Olly Betts
07f3637f06
[PHP] Remove useless shadowed variable in example
2022-02-03 23:04:58 +13:00
Olly Betts
ebbf2e6077
Allow method calls in expressions
...
This allows default parameter values containing method calls to be
parsed and handled - e.g. `x->foo(3,4)` and `y.z()`.
Fixes #660 and https://sourceforge.net/p/swig/bugs/1081/
2022-02-03 17:20:30 +13:00
Olly Betts
20588a4dc7
Uncomment line in testcase which now works
...
03ef3ecb6e86aa78a64119f30e683ee474ddb56 added support for ID PERIOD ID
in an expression.
2022-02-03 17:20:30 +13:00
Olly Betts
2e98189564
[Ruby] Fix remove of prefix from method name
...
The prefix is now only removed at the start.
Fixes https://sourceforge.net/p/swig/bugs/1136/
2022-02-02 15:53:23 +13:00
Olly Betts
27a3d16ac6
Allow object reference in C++ trailing return type
...
Fixes #231
2022-02-02 11:31:45 +13:00
Olly Betts
9d06d4ac45
[Tcl] Add changed file missed recent commit
...
This should have been in 6f4adde4b4
2022-02-01 16:00:12 +13:00
Olly Betts
3e019977c5
Merge pull request #1398 from swig-fortran/missing-includes
...
Add missing includes to library and test cases
2022-02-01 14:05:17 +13:00
Olly Betts
6f4adde4b4
[Tcl] Fix std_vector typecheck typemaps
...
In some cases the typecheck typemap would try to access the first
element of an empty Tcl list.
Fixes https://sourceforge.net/p/swig/bugs/1309/
2022-02-01 13:09:00 +13:00
Olly Betts
7813793511
[R] Fix CopyToR() generated for struct in namespace
...
Fixes https://sourceforge.net/p/swig/bugs/1147/
2022-01-31 12:05:09 +13:00
Olly Betts
25f996a5c8
[python] Replace uses of assert in testsuite
...
We're not supposed to assert for this, as mentioned in #1488 .
2022-01-30 13:38:56 +13:00
Olly Betts
d9ced1e56d
Coding style tweaks
2022-01-30 10:55:00 +13:00