Commit Graph

14 Commits

Author SHA1 Message Date
Olly Betts 4a0372aacc Improve parsing multi-line expr via skip_balanced()
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
2025-02-28 17:30:08 +13:00
Olly Betts 6eb4cfe763 Adjust testcases to avoid warnings
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.
2024-09-26 12:07:57 +12:00
Olly Betts c6f1552e78 Add test that `<(`...`)>` in expression is handled
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.
2023-06-20 08:32:58 +12:00
Olly Betts 602826c897 Fix handling of template in array size
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 #2486
Closes: #2575
2023-06-20 08:32:58 +12:00
Olly Betts c67e4dd06f Fix SWIG warning from testcase cpp11_constexpr
Introduced by previous commit.
2023-05-11 14:30:29 +12:00
Olly Betts b1388bcbf9 Parse storage class more flexibly
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 #302
Fixes #2079 (friend constexpr)
Fixes #2474 (virtual explicit)
2023-05-11 13:54:30 +12:00
Olly Betts ccd313ac64 Move new testcase which needs C++11
I don't see how to easily write this without constexpr.
2022-01-26 13:25:36 +13:00
William S Fulton 3045ba3532 Warning suppression on testcase using clang 2019-06-27 07:40:49 +01:00
William S Fulton 00b0c5b8ea Testcase fix for name clash in tcl headers 2017-06-06 06:59:23 +01:00
William S Fulton be63f73e33 Fix c++ compiler warnings in c++11 testcases 2017-06-03 18:37:05 +01:00
Olly Betts bfa570e404 Handle "constexpr explicit" and "constexpr static" 2015-01-09 11:47:40 +13:00
Olly Betts 87bdaa3910 Allow C++11 "explicit constexpr" 2015-01-08 15:56:50 +13:00
William S Fulton e186dc13b7 C++11 constexpr variables support added 2014-03-14 01:57:14 +00:00
William S Fulton 738cc36aab Rename all C++0x to C++11 and cpp0x to cpp11 2013-10-07 20:37:00 +01:00