With C++ comments changed to C comments, these are now identical to
the two cases just above, aside from the `2` suffix on the names.
Follow-on for #2027.
Add PHP keyword 'readonly' (added in 8.1) to the list SWIG knows to
automatically rename. This keyword is special in that PHP allows it to
be used as a function (or method) name.
A few files had just <? which only works when the short_open_tag option
is on. It is on by default (at least in current PHP versions) and we
explicitly tell PHP not to read php.ini, but the PHP docs recommended to
avoid it, and PHP can be built with --disable-short-tags.
The previous version didn't really test anything useful. Now we
check that trying to instantiate any of the abstract classes fails
with the expected error.
This function doesn't do anything currently so these missing calls are a
latent issue. It could be used for e.g. memory leak checking in the
future though, and it's potentially a useful place to add code when
debugging.
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