This is probably not the greatest idea, and it would be better to change
the generated code to avoid these tests instead, but it was already done
like this for several tests, so just add two more of them that generate
warnings such as
../../member_funcptr_galore_wrap.cxx: In function ‘SwigV8ReturnValue _wrap_MemberFuncPtrs_aaa6(const SwigV8Arguments&)’:
../../member_funcptr_galore_wrap.cxx:3495:90: error: type qualifiers ignored on cast result type [-Werror=ignored-qualifiers]
3495 | result = (int)((MemberFuncPtrs const *)arg1)->aaa6((short (Funcs::*const )(bool) const)arg2);
| ^~~~
when using gcc 9.
This is similar to the previous commit, but in the other direction, with
the warning being generated for the implicitly-declared copy ctor due to
having an explicitly-declared assignment operator.
And the fix is different too because we need to have an assignment
operator in this test, so define the copy ctor explicitly too.
Defining a copy ctor results in -Werror=deprecated-copy when using
implicitly-generated assignment operator with recent gcc versions, so
simply remove this copy ctor, which was apparently never needed anyhow,
to avoid it and rely on the compiler generating both the copy ctor and
assignment operator implicitly.
PHPCN(x) does a string compare of x with the lower-cased class name,
so x needs to be in lowercase or else the entry has no effect. The
entries for TRUE, FALSE and NULL weren't working as a result.
Previously this relied on getting all known classes/functions/etc
when it was loaded, and then again after the PHP module being
tested was loaded. This approach no longer works now we've
stopped loading modules using dl(), so use ReflectionExtension
instead to get information about a specific extension.
This is likely also faster than wading through lists including
everything predefined by PHP.
With modern PHP it only works with the CLI version of PHP, so it's
better to direct users to load the extension via "extension=" in
php.ini.
Suggested by ferdynator in #1529.
Without inventing a SWIG/PHP-specific mechanism, we can't really
finalise objects in the way the testcase expects, so adjust the
testcase minimally so we avoid triggering C++ undefined behaviour
(use-after-free).
These were officially deprecated in 2001, and attempts to use them have
resulted in a warning (including a pointer to what to update them to)
for most if not all of that time.
Fixes#1984
A PHP exception now gets translated to a C++ exception to skips over C++
code to get back to PHP, avoiding the need to gate every directorout
typemap on EG(exception).