Fix bad generated code in some cases when a constant expression is split
over multiple lines and used as part of a type. This manifested in
cases where SWIG's parser calls skip_balanced('(', ')') then grabs the
skipped expression's program text from scanner_ccode.
Fixes#3127
These testcases had overloads distinguished only by short vs int
or int vs double, which isn't supported by all target languages
(e.g. Lua) and result in SWIG warnings. We aren't trying to
test such overloading here and can easily adjust to use different
function names or to overload on different types.
SWIG uses these internally in type strings so needs to rewrite them
when they appear in expressions which get used in a type. This
already happens, but really deserves test coverage.
This was being rejected by SWIG because the type string contains '<'
not followed by '('. Drop this check as it should be unnecessary now
since the fixes for #1036 ensure that template parameters are enclosed
within '<(' and ')>'.
Fixes#2486Closes: #2575
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)