| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
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
|
|\ |
|
| | |
|
| | |
|
| | |
|
|\ \ |
|
| | | |
|
|\ \ \ |
|
| |/ / |
|
| |/
|/|
| |
| | |
Fixes #894
|
|/
|
|
|
| |
PHP7 security support ended 2022-11-28 so it doesn't make sense to
include support for it in the SWIG 4.2.x release series.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. When a template is instantiated via %template and uses the unary scope
operator ::, an error occurs if the instantiation is attempted within a
namespace that does not enclose the instantiated template.
For example, the following will now error as ::test::max is not enclosed within test1:
Error: '::test::max' resolves to 'test::max' and was incorrectly instantiated in
scope 'test1' instead of within scope 'test'.
namespace test1 {
%template(maxchar) ::test::max<char>;
}
2. SWIG previously failed to always detect a template did not exist when using
%template. In particular when instantiating a global template incorrectly within
namespace. The code below now correctly emits an error:
Error: Template 'test5::GlobalVector' undefined.
namespace test5 {
}
template<typename T> struct GlobalVector {};
%template(GVI) test5::GlobalVector<int>;
3. Also error out if an attempt is made to define a class using the unary scope
operator ::. The following is not legal C++ and now results in an error:
Error: Using the unary scope operator :: in class definition '::Space2::B' is invalid.
namespace Space2 {
struct B;
}
struct ::Space2::B {};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix duplicate const in generated code when template instantiation type is const
and use of template parameter is also explicitly const, such as:
template <typename T> struct Conster {
void cccc1(T const& t) {}
};
%template(ConsterInt) Conster<const int>;
Above previously led to generated code:
(arg1)->cccc1((int const const &)*arg2);
instead of
(arg1)->cccc1((int const &)*arg2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Default argments come from the primary template's parameter list.
Example:
template<class Y, class T=int> struct X { void primary() {} };
// Previously the specialization below resulted in:
// Error: Inconsistent argument count in template partial specialization. 1 2
template<class YY> struct X<YY*> { void special(YY*) {} };
// Both of these correctly wrap the partially specialized template
%template(StringPtr) X<const char *>;
%template(ShortPtr) X<short *, int>;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Closes #1300
Changes to support the first example below (partial specialization of
template parameter types like Vect<int>). Previous implementation and
design could only handle one template parameter name per template
specialization argument, such as Vect<TS> for the first template
specialization argument (for first example below)
template<class TS, typename TTS> class Foo<Vect<TS>, int> { ... };
and not
template<class TS, typename TTS> class Foo<Vect<TS, TTS>, int> { ... };
New approach is to not modify 'templateparms' in the template node,
(except to fill in default args from primary template)
Previous implementation also assumed a template parameter could not be
used more than once in the specialized arguments, such as
template<typename T> struct Hey<T, T> { void specialA() {} };
Examples
========
1) For primary:
template<class T, typename TT> class Foo { ... };
and specialization:
template<class TS, typename TTS> class Foo<Vect<TS>, TTS> { ... };
Fix specialization template from (wrong)
| templateparms - 'Vect< TS >,typename TTS'
to (correct/new way)
| templateparms - 'class TS,typename TTS'
2) For primary:
template<typename P1 = int, typename P2 = double> struct Partialler { void primary(P1, P2) {}; };
and specialization:
template<typename S1, typename S2> struct Partialler<S2, S1*> { void special(S1*, S2, bool) {}; };
Specialized template changes from (wrong)
| templateparms - 'typename S2=int,typename S1=double'
to (correct/new way, default args are removed)
| templateparms - 'typename S1,typename S2'
and subsequent change to partialargs from
| partialargs - "Partialler<($1,p.$2)>"
to
| partialargs - "Partialler<($2,p.$1)>"
so that the $n number is now more logically the nth template parameter in templateparms
3) For primary:
template<typename X, typename Y> struct Hey { void primary() {} };
and specialization:
template<typename T> struct Hey<T, T> { void specialA() {} };
old (wrong/old way)
| templateparms - 'typename T,typename T'
new (correct/new way)
| templateparms - 'typename T'
These are unchanged and are okay:
| partialargs - "Hey<($1,$1)>"
4) For primary:
enum Hello { hi, hello };
template <Hello, class A> struct C {};
and specialization:
template <class A> struct C<hello,A> { ... };
old (wrong/old way)
| templateparms - 'hello,class A'
new (correct/new way)
| templateparms - 'class A'
and subsequent changes to partialargs from
| partialargs - "C<(hi,$2)>"
to
| partialargs - "C<(hi,$1)>"
Test-suite
==========
Identical output as before in Python but in Java, an unimportant change
in cpp11_variadic_function_templates.i results in one variadic parameter
name being different.
New testcase template_partial_specialization_more.i with more testcases
added including above examples that are not already in the test-suite.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
when the specialized parameter is non-trivial, used in a wrapped method
and the type to %template uses typedefs. For example:
typedef double & DoubleRef;
template <typename T> struct XX {};
template <typename T> struct XX<T &> { void fn(T t) {} };
%template(XXD) XX<DoubleRef>;
The type of the parameter in the instantiated template for fn is now correctly deduced
as double.
|
| |
|
|
|
|
|
|
|
|
|
| |
Fix seg fault when instantiating templates with parameters that are function
parameters containing templates, such as:
%template(MyC) C<int(std::vector<int>)>;
Closes #983
|
|
|
|
|
|
| |
Complete support for C++11 variadic function templates. Support was previously limited
to just one template parameter. Now zero or more template parameters are supported
in the %template instantiation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
that are function pointers and member function pointers.
template <typename... V> struct VariadicParms {
void ParmsFuncPtrPtr(int (*)(V*...)) {}
void ParmsFuncPtrPtrRef(int (*)(V*&...)) {}
void ParmsFuncPtrPtrRValueRef(int (*)(V*&&...)) {}
void ParmsFuncPtrRef(int (*)(V&...)) {}
void ParmsFuncPtrRValueRef(int (*)(V&&...)) {}
void ParmsMemFuncPtrPtr(int (KlassMemFuncs::*)(V*...)) {}
void ParmsMemFuncPtrPtrRef(int (KlassMemFuncs::*)(V*&...)) {}
void ParmsMemFuncPtrPtrRValueRef(int (KlassMemFuncs::*)(V*&&...)) {}
void ParmsMemFuncPtrRef(int (KlassMemFuncs::*)(V&...)) {}
void ParmsMemFuncPtrRValueRef(int (KlassMemFuncs::*)(V&&...)) {}
};
%template(VariadicParms0) VariadicParms<>;
%template(VariadicParms1) VariadicParms<A>;
Also in various other places such as within noexcept specifiers:
template<typename T, typename... Args>
void emplace(Args &&... args) noexcept(
std::is_nothrow_constructible<T, Args &&...>::value);
Issue #1863
|
|
|
|
|
|
|
|
|
|
|
| |
containing parameter pack arguments that are function pointers.
template <typename... V> struct VariadicParms {
void ParmsFuncPtrVal(int (*)(V...)) {}
};
%template(VariadicParms0) VariadicParms<>;
%template(VariadicParms1) VariadicParms<A>;
|
|
|
|
|
|
| |
that are function pointers
Issue #1863
|
| |
|
|
|
|
|
|
|
| |
Fix syntax error using Doxygen member groups syntax, "///*}", when used after
final struct/class member.
Issue #1636
|
|
|
|
|
|
|
| |
Fix garbled Doxygen post comments in parameter lists.
Fix syntax error parsing a trailing Doxygen comment in parameter lists.
Closes #2023
|
|
|
|
|
|
|
| |
It is unconventional to have a doxygen comment after an enum item. It is
attached to the previous, that is, the enum item to match Doxygen behaviour.
Closes #1609
|
|
|
|
| |
Closes #1715
|
|
|
|
|
| |
Copy CHANGES.current from release-4.1.1 branch into CHANGES.
Remove items released in 4.1.1 from master CHANGES.current.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, specifying more than one simple template template parameter
resulted in a parse error. Now multiple template template parameters are
working including instantiation with %template. Example:
template <template<template<class> class, class> class Op, template<class> class X, class Y>
class C { ... };
Closes #624
Closes #1021
|
|
|
|
|
|
|
|
|
| |
Without this, perlhead.swg does `#pragma GCC diagnostic pop`
if `__GNUC__ >= 10` - without any prior `#pragma GCC diagnostic push`.
There's also a mismatch between the conditions that trigger
`#pragma GCC diagnostic ignored` (where the `push` should be)
and the attempt to `#pragma GCC diagnostic pop`.
|
|
|
|
|
|
|
|
|
|
|
| |
ccache.c:738:18: runtime error: null pointer passed as argument 1, which is declared to never be null
Fixes stderr redirect in testname CCACHE_CPP2, when the CCACHE_CPP2
environment variable is defined.
mdfour.c:91:20: runtime error: left shift of 139 by 24 places cannot be represented in type 'int'
Looks like this brings some stability to the md4 hash calculation.
Closes #2449
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
decltype now accepts C++ expressions instead of just an ID, such as:
int i,j;
... decltype(i+j) ...
... decltype(&i) ...
These result in a warning for non-trivial expressions which SWIG cannot evaluate:
Warning 344: Unable to deduce decltype for 'i+j'.
See 'Type Inference' in CPlusPlus.html for workarounds.
Issue #1589
Issue #1590
|
|
|
|
| |
Closes #961
|
|
|
|
|
|
|
| |
Fix undefined behaviour in swig's parser when handling default parameter
expressions containing method calls.
Fixes #2447
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* rtests2:
more r tests
more r tests
added testcase pointer_reference
[PHP] Update docs for removal of -noproxy in SWIG 4.1.0
Conflicts:
CHANGES.current
|
| |
| |
| |
| | |
Closes #2419
|
| |
| |
| |
| |
| |
| | |
Similar to previous commit
Issue #1037
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Recent commits ensure types are correctly stored in SwigType *. In
particular template parameters are enclosed within '<(' and ')>'.
Now we can confidently handle template parameters as really being
delimited as such to fix an infinite loop handling template expressions
containing '<' or '>'. The previous implementation only assumed
template parameters were delimited by '<' and '>'.
Issue #1037
|
|/
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Fixes infinite loop due to () brackets in a non-type template
parameter containing an expression
Fixes #2418
Non-trivial expressions are still not qualified properly though.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Further switch to use rtypecheck typemaps instead of hard coded logic.
The full switch to typemaps is deferred until swig-4.2 as it can't be fully
backwards compatible. For now a warning is provided to help the
transition. It provides the full typemap that should be placed into
a user's interface file, for example:
%typemap("rtype") int32_t * "integer"
void testmethod(int32_t * i);
void testmethod();
If there is no rtypecheck typemap for int32_t *, the warning shown is:
example.i:7: Warning 750: Optional rtypecheck code is deprecated. Add the
following typemap to fix as the next version of SWIG will not work without it:
%typemap("rtypecheck") int32_t * %{ (is.integer($arg) || is.numeric($arg)) %}
The warning is shown for any code that previously used "numeric", "integer" or
"character" for the rtype typemap. Copying the rtypecheck typemap as
shown into the user interface file will provide the appropriate fix and
the warning will disappear. This is important to do as swig-4.2 will
not be able to provide this helpful warning.
|
|
|
|
|
|
|
|
| |
- Fix for special variable $argtype expansion in rtypecheck typemap.
- Remove unnecessary () brackets when using rtypecheck typemap for
single parameter functions.
- Add rtypecheck typemaps for shared_ptr so that NULL can be used
in overloaded functions taking shared_ptr.
|
|
|
|
|
|
|
|
|
|
|
| |
when incorrect types passed are passed to the overloaded methods.
Old unhelpful error message:
Error in f(...) : could not find function "f"
Example of new improved error message:
Error in use_count(k) :
cannot find overloaded function for use_count with argtypes (NULL)
|
|
|
|
|
|
|
|
|
| |
Fix leak when a cast up a class inheritance chain is
required.
Adds implementation of SWIG_ConvertPtrAndOwn for R.
Closes #2386
|
| |
|
|
|
|
| |
[skip ci]
|