Commit graph

4,602 commits

Author SHA1 Message Date
Olly Betts
5a9422d980 Remove GCJ support
GCC7 dropped GCJ.

Closes https://sourceforge.net/p/swig/bugs/823/
2017-10-09 08:32:01 +13:00
Olly Betts
59ebe27a95 Merge pull request #1111 from ojwb/empty-arglist-macros
Fix handling of macro with empty argument list
2017-10-08 15:34:37 +13:00
Olly Betts
0863eca5e7 Fix constants involved parenthesised char literals
Fixes https://sourceforge.net/p/swig/bugs/1168/
2017-10-08 13:43:02 +13:00
William S Fulton
6981abc440 Travis test gcc-7.2 and c++-17 2017-10-07 23:56:33 +01:00
Olly Betts
5d14a7d910 Add regression testcase 2017-10-08 09:02:29 +13:00
Olly Betts
f85d87a64c Fix bug with macro invocation with empty first arg
The first argument was being dropped in this case.
2017-10-08 09:02:28 +13:00
William S Fulton
dcf8730cf3 Avoid can of worms testing minimum signed int value
Specifying the minimum 32 bit signed int value is not easily portable.
Remove min_32bit_int2 method, min_32bit_int1 provides runtime coverage.

g++ 32bit resulted in:
warning: this decimal constant is unsigned only in ISO C90

and some versions of clang++ resulted in:
error: integer literal is too large to be represented in type 'long' and is subject to undefined behavior under C++98, interpreting as 'unsigned long'; this literal will have type 'long long' in C++11 onwards [-Werror,-Wc++11-compat]
2017-10-07 15:04:19 +01:00
Olly Betts
2c1a5c5919 Add regression test for old fixed SF bug 2017-10-07 15:28:10 +13:00
William S Fulton
4a7976a5d8 Fix platorm inconsistency in Python default argument handling.
32 bit and 64 bit compiled versions of SWIG generated different Python files
when default arguments were outside the range of 32 bit signed integers.
The default arguments specified in Python are now only those that are in the
range of a 32 bit signed integer, otherwise the default is obtained from C/C++ code.

Closes #1108
2017-10-06 21:57:04 +01:00
William S Fulton
ac8331648f Testcase fix for clang 2017-10-05 15:38:51 +01:00
William S Fulton
4f4147a779 Remove unused SWIG_NO_OVERLOAD macro from testcases 2017-10-04 23:49:40 +01:00
William S Fulton
f4644d7c30 Run overload_complicated testcase
Was marked as broken, seems to work now
2017-10-04 20:43:44 +01:00
William S Fulton
bb7db846cc Run virtual_derivation testcase
Should have been added in c92d8c7cf7
2017-10-04 08:51:16 +01:00
William S Fulton
1a0ce21547 Run typemap_template_typedef testcase
Should have been added in aa2932f409
2017-10-04 08:16:10 +01:00
William S Fulton
7c1b60f340 Run python_threads testcase
Should have been added in f4a2470325
2017-10-04 08:05:14 +01:00
William S Fulton
5f9376bae4 Run default_args_c testcase
Should have been added in ddd1b38fa2
2017-10-04 07:11:02 +01:00
William S Fulton
a55981b883 Fix C# std::complex pass by value typemaps 2017-10-02 19:07:24 +01:00
William S Fulton
e01cfd70c7 Add missing declaration for std::complex
Fixes missing type information for std::complex in scripting languages.
Closes #732.

Update Javascript and Octave complextest, although they don't actually
get run as they don't work
2017-10-02 19:07:24 +01:00
William S Fulton
8ee11ad71a Add missing test - template_class_reuse_name 2017-09-29 23:30:27 +01:00
William S Fulton
e27a606335 Allow an instantiated template to have the same name as the C++ template name
For example, this is now possible:
  template<typename T> struct X { ... };
  %template(X) X<int>;
Closes #1100.
2017-09-29 23:28:04 +01:00
William S Fulton
8080ed1bb1 Add std::shared_ptr testcases to Octave 2017-09-25 08:40:31 +01:00
William S Fulton
ed4b84f4d3 Fix overloading of shared_ptr method overloading
Add 'equivalent' attribute to typecheck typemap.
Closes #1098.
2017-09-23 15:19:34 +01:00
William S Fulton
f5e1856650 Expand std::shared_ptr testing to C# D Java Python 2017-09-22 20:03:47 +01:00
William S Fulton
b3cca589ca Fixup recent python 2to3 changes 2017-09-20 12:59:05 +01:00
William S Fulton
836a57190e Fix --with-2to3 configure option 2017-09-19 18:48:34 +01:00
William S Fulton
057e1e44c3 Merge branch 'futatuki-configure-with-2to3-as-different-name'
* futatuki-configure-with-2to3-as-different-name:
  Apply patch to configure with 2to3 rename for 3.0.12
2017-09-19 08:10:27 +01:00
William S Fulton
0a9113dcba Correct php testcase 2017-09-19 07:37:29 +01:00
William S Fulton
19fa79830d Run some preprocessor constants tests that were previously disabled.
These probably should have been enabled with 256e283fc3
2017-09-18 07:10:49 +01:00
William S Fulton
9e2a12416c Fix type promotion wrapping some non-trivial constant expressions
This was previously an integral type instead of a floating point type:
2017-09-18 07:06:27 +01:00
William S Fulton
90ba174fce Fix generated code for constant expressions containing wchar_t L literals.
Such as:
  # define __WCHAR_MAX    (0x7fffffff + L'\0')

Reported on swig-user mailing list.
2017-09-17 19:02:55 +01:00
William S Fulton
0c0384198a Fix testcase symbol name conflict
FF1 is also defined in /usr/include/sys/termio.h on cygwin and used by
Python.h.
2017-09-11 23:17:30 +01:00
William S Fulton
4d2d8dd80e Merge branch 'cpp11-ref-qualifiers'
* cpp11-ref-qualifiers:
  Warnings in testcases fix
  Add support for %typemap and member function pointers with qualifiers
  Fix wrapping of some member function pointer parameters
  Add support for member function pointers with ref-qualifiers
  Add error for constructors, destructors, static methods declared with qualifiers
  Add support for conversion operators with ref-qualifiers
  Alternate function syntax parsing improvement
  Re-organise parser grammar for initializer rules
  Re-organise parser grammar for declarator and initializer rules
  Add docs for C++11 ref-qualifiers
  Add unignore for rvalue ref-qualifiers
  Improve ref-qualifier implementation
  Fix support for member const function pointer variables
  Use normal SWIG encodings for ref-qualifiers
  C++11 ref-qualifier support added
2017-09-11 19:33:27 +01:00
William S Fulton
f38e525a24 Warnings in testcases fix 2017-09-10 12:49:24 +01:00
William S Fulton
c4e280024f Add support for %typemap and member function pointers with qualifiers 2017-09-09 23:46:14 +01:00
William S Fulton
45c161dfce Fix wrapping of some member function pointer parameters
Generated code did not compile if both cv-qualifiers and rvalue
ref-qualifiers were present in the member function pointer.
2017-09-07 06:58:01 +01:00
William S Fulton
eb68e4375d Add support for member function pointers with ref-qualifiers 2017-09-05 18:44:00 +01:00
William S Fulton
7e4717320b Add error for constructors, destructors, static methods declared with qualifiers
SWIG parses a superset of valid C++ declarations. These ill-formed declarations
were previously successfully parsed but now result an error message.
2017-08-30 18:17:05 +01:00
William S Fulton
950edc1c00 Add support for conversion operators with ref-qualifiers 2017-08-30 18:17:05 +01:00
William S Fulton
8a40327aa8 Add unignore for rvalue ref-qualifiers
Use std::move on this pointer as the default approach to supporting
rvalue ref-qualifiers if a user really wants to wrap.

std::move requires <memory> headers so add swigfragments.swg for all
languages to use common fragments. Just header file fragments for now.
2017-08-30 18:17:04 +01:00
William S Fulton
1cf599bccb Improve ref-qualifier implementation
Internally, handle function ref-qualifiers in the function decl type string.
Needed for a whole host of things to work like %feature and %rename.
Add %feature %rename and %ignore testing for ref-qualifiers.
2017-08-30 18:17:04 +01:00
William S Fulton
eeab152901 Fix support for member const function pointer variables
Was not generating code that compiled when the variable was not
a simple member pointer, for example,
a const reference member pointer:
  short (Funcs::* const& cc7)(bool) const = cc1;
2017-08-30 18:16:59 +01:00
William S Fulton
9e19fe7868 C++11 ref-qualifier support added
Fixes #1059

Methods with rvalue ref-qualifiers are ignored by default as it is not
possible to have an rvalue temporary from the target language (which is
needed to call the rvalue ref-qualified method).
A warning 405 is shown mentioning the ignored rvalue ref-qualifier method
which can be seen with the -Wextra option.

  cpp_refqualifier.i:15: Warning 405: Method with rvalue ref-qualifier ignored h() const &&.

Usually rvalue and lvalue ref-qualifier overloaded methods are written - the
lvalue method will then be wrapped.
2017-08-19 01:02:34 +01:00
William S Fulton
dd3d04a2f2 Fix testcase for clang 2017-08-17 10:28:41 +01:00
William S Fulton
9f454234b1 Add missing template_using_directive_typedef.i test file 2017-08-16 22:15:17 +01:00
William S Fulton
32a454cfef Merge branch 'templates-scope-enforcement'
* templates-scope-enforcement:
  Test a few %template errors
  Add using declarations to templates into typedef table.
  Fix type lookup in the presence of using directives and using declarations
  More docs on %template
  Testcase fix for nameclash in php
  %template scope enforcement and class definition fixes
  Template documentation tweaks
  More consistent formatting of examples in documentation
  More consistent formatting of examples in documentation
  Documentation corrections to use targetlang formatting
  More consistent formatting of examples in documentation
  More consistent formatting of examples in documentation
  More consistent formatting of examples in documentation
  Namespace documentation minor corrections
  Improve description of template_parameters_resolve
  Minor code optimisation in template_parameters_resolve
  Fix scope lookup for template parameters containing unary scope operators
  Typemap change for templates
2017-08-16 21:44:51 +01:00
William S Fulton
8813343920 Remove stray blank line print in php test 2017-08-16 07:57:30 +01:00
William S Fulton
902a141540 Fix testcase failure on Node Javascript 2017-08-16 07:56:28 +01:00
William S Fulton
09af283371 Test a few %template errors 2017-08-16 00:24:25 +01:00
William S Fulton
96e99416d7 Add using declarations to templates into typedef table.
Fixes #1051. Using declarations to templates were missing in SWIG's internal typedef tables.
This led to a few problems, such as, templates that did not instantiate and generated
C++ code that did not compile as SWIG did not know what scope the template was
in. This happened mostly when a using declaration was used on a template type in a
completely unrelated namespace.
2017-08-16 00:24:25 +01:00
William S Fulton
bf98c5304f Fix type lookup in the presence of using directives and using declarations
Fix some cases of type lookup failure via a combination of both using directives and
using declarations resulting in C++ code that did not compile as the generated type was
not fully qualified for use in the global namespace. Example below:

    namespace Space5 {
      namespace SubSpace5 {
        namespace SubSubSpace5 {
          struct F {};
        }
      }
      using namespace SubSpace5;
      using SubSubSpace5::F;
      void func(SubSubSpace5::F f);
    }
2017-08-16 00:24:25 +01:00