Commit graph

403 commits

Author SHA1 Message Date
William S Fulton
edcdaaec16 Warning fixes for 64bit visual c++ on Windows 2015-07-03 20:59:24 +01:00
William S Fulton
05397cf6a2 Fix syntax error when the template keyword is used in types
For example:
  std::template vector<int> v;
2015-07-02 19:23:37 +01:00
William S Fulton
0b436c65ca Cosmetic parser change
Rename typemap_parameter_declarator as it is no longer just used for typemaps
2015-06-22 07:04:34 +01:00
William S Fulton
6890dfa881 Fix parse errors for C++11 type aliasing
Recently introduced by the fix for C++11 type aliasing seg fault - 117f6d00
2015-06-22 07:04:34 +01:00
William S Fulton
117f6d0026 Fix C++11 type aliasing seg fault.
Closes #424
2015-06-09 07:59:22 +01:00
William S Fulton
54e2317b24 Fix shared_ptr of classes with private constructors and destructors.
Usually these use a custom deleter passed to the shared_ptr.
This also fixes the "unref" feature when used on classes with private destructors.
2015-05-14 19:03:06 +01:00
Olly Betts
b19d506db7 Suppress warning 325 "Nested class not currently supported (Foo
ignored)" when Foo has already been explicitly ignored with
"%ignore".
2015-05-05 18:07:49 +12:00
William S Fulton
428b6176df Add support for friend templates, including operator overloading.
Closes #196.
2015-05-05 06:48:25 +01:00
William S Fulton
463b2a324c Cosmetic rename COPERATOR to CONVERSIONOPERATOR
Was never very obvious what C in COPERATOR was.
2015-05-01 19:26:09 +01:00
William S Fulton
fa4223e496 Fix parsing of extern "C" and typedef for example:
extern "C" typedef void (*Hook2_t)(int, const char *);
extern "C" typedef int Integer;

Closes #375
2015-04-07 21:34:23 +01:00
William S Fulton
af43f90484 Wording change for missing semicolon error 2015-01-08 23:37:52 +00: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
Olly Betts
62670e756e Improve errors for missing ; and unexpected ) 2015-01-08 15:27:57 +13:00
Olly Betts
04715f74e2 Improve error message when an unknown SWIG directive is used
This previously gave the cryptic "Error: Syntax error in input(1).", but
now gives "Error: Unknown directive '%foo'."
2015-01-08 12:07:54 +13:00
Vladimir Kalinin
274977154f fix for nested template defined out of class (issue #265) 2014-11-25 19:38:37 +03:00
Vladimir Kalinin
8bc38dc007 fixes "flatnested" feature for out-of-scope defined nested classes 2014-11-04 19:30:53 +03:00
William S Fulton
bfde148887 The kwargs feature no longer turns on compactdefaultargs for languages that don't support kwargs.
Affects all languages except Python and Ruby.

Closes #242
2014-10-21 07:34:51 +01:00
Johan Hake
de4f30bd3c Small fixes to the relative import fix.
-- Now the tests actually runs
  -- Corrected the syntax for the fix in the yacc file
2014-09-29 17:37:41 +02:00
Johan Hake
30e5a79ecb Fix bug 206 where package information for relative in single file import is not propagated correctly. 2014-08-25 10:09:12 +02:00
William S Fulton
71e72c45ed Create separate extetnd.c file for handling extensions / %extend
This is just a simple code refactor, moving and function renaming to
remove the %extend code out of the parser into its own file now
 that it isn't just used in the parser.
2014-05-21 19:16:15 +01:00
Vladimir Kalinin
2aa540b9c0 %extend for nested unnamed C structs 2014-05-14 00:51:36 +04:00
Vladimir Kalinin
55bda53145 C nested classes symbol table should be in global space 2014-05-10 22:16:26 +04:00
Olly Betts
36be36d618 Eliminate needless casting away const from string constants 2014-04-30 12:00:23 +12:00
William S Fulton
e186dc13b7 C++11 constexpr variables support added 2014-03-14 01:57:14 +00:00
William S Fulton
d55692c31e Fix warning suppression using %warnfilter for PHP reserved class names.
The features need to be merged in before issuing a warning as
%warnfilter is a %feature.
2014-02-21 08:29:20 +00:00
William S Fulton
c5911cc08d Add %$isextendmember for %rename of members added via %extend 2014-02-18 23:21:46 +00:00
William S Fulton
9cbd742b66 Fix %$ismember %rename predicate for members added via %extend
Bug reported was incorrect renaming of PHP built-in functions, such as
next. See PHPFN in phpkw.swg.

Add some tests for the %rename predicates.
2014-02-18 07:30:55 +00:00
William S Fulton
3518cbfd33 Typo in comment fix 2014-02-08 09:00:52 +00:00
Vladimir Kalinin
e9ecac9298 warnings suppressed for deeply nested classes 2014-02-07 07:39:07 +04:00
Vladimir Kalinin
56cea1821d warning filter fixed 2014-02-06 23:47:01 +04:00
Vladimir Kalinin
bda9c90e2b warnfilter fixed
scoping for "anonymous forward declaration" fixed
2014-02-03 02:21:44 +04:00
Vladimir Kalinin
4744ea8903 added forward declaration instead of ignored nested class (resurrected old code) 2014-02-03 01:03:37 +04:00
Vladimir Kalinin
2f3d93e93a Nested classes support is diversified, depending on the language capability. If the language cannot support nested classes, they will be unconditionally moved to the global namespace. If language module does not override Language::nestedClassesSupport() function, nested classes will be ignored, unless "feature:flatnested" is used. 2014-02-02 22:38:13 +04:00
William S Fulton
6a72e16b37 Add C++11 virtual specifier sequences (final and/or override on methods)
Parsing support added. The final and override information is not used or
added to the parse tree atm.
2014-01-03 20:17:48 +00:00
Vladimir Kalinin
3412cc2f64 Merge pull request #123 from wkalinin/test2
fixed enums & enum values language symbol table namespace
fixed skipping of %templates in %extend if they are in the wrong scope
2013-12-26 00:33:28 -08:00
Vladimir Kalinin
6b7185989a additional check for template type, to handle constructors correctly 2013-12-24 06:47:54 +04:00
William S Fulton
1a19451c1b Error out attempting to use directors without -c++
Remove redundant #ifdef __cplusplus markers in director.swg
2013-12-23 20:23:54 +00:00
Vladimir Kalinin
715e254e05 fixed enums & enum values language symbol table namespace
fixed skipping of %templates in %extend if they are in the wrong scope
2013-12-20 07:37:49 +04:00
Vladimir Kalinin
b4fef06c42 fixed %template within %extend, test added
fixed language symbol table nested classes name separator, test added
fixed %feature "flatnested" working with %extend
fixed Swig_offset_string for empty string
added simple template to save/restore values in current scope (readability reasons)
2013-12-19 02:11:22 +04:00
Vladimir Kalinin
5487345ce7 properly disabled nested %template declared in other scopes 2013-12-16 13:08:34 +04:00
Vladimir Kalinin
865408874f fixed %template declared within class, next to template declaration
added a few tests for C# nested classes support
2013-12-16 11:43:28 +04:00
William S Fulton
314fae460b Merge branch 'nested' - nested structs/classes support
* nested:
  Deprecation of the 'nestedworkaround' feature
  Ensure -c++out is not used with -c++
  Add missing header to new source file
  Nested C class setters restored in c++out mode for Octave
  Classprefix fixed after private nested classes some comments and spaces added
  Fix template partial specialization detection
  Minor tweaks in Swig_feature_set
  Swig_offset_string moved to misc.c
  nested private classes are discarded while parsing nested relate functions are moved to nested.cxx and renamed accordingly
  out-of-scope template definitions fixed nested_private test disabled again
  fixed out-of-scope nested class definitions, added a test enabled nested C structs assignment (still disabled for Octave), added Java runtime test fixed nested_private test case for Java & C#
  Testcase of private nested class usage causing segfault
  C nested struct passed by value example
  Add in Travis testing for nested branch
  Add C++ nested class example
  Minor code improvements
  Cosmetics/code beautification of nested class support
  Nested classes support
2013-12-14 15:12:07 +00:00
William S Fulton
0f4ceaf592 Deprecation of the 'nestedworkaround' feature
Also add in macros for the flatnested feature which can be used in place
of the nestedworkaround feature
2013-12-13 08:11:17 +00:00
William S Fulton
2121e1217e Ensure -c++out is not used with -c++
Error checking for this combination implemented as well as correcting
Octave

Also refactor, replacing CPlusPlusOut variable with cparse_cplusplusout
for an implementation which more closely resembles cparse_cplusplus which
is also required in both .c and .cxx files.
2013-12-12 20:52:44 +00:00
William S Fulton
e95ac82651 Nested C class setters restored in c++out mode for Octave
Suitable casts are required so that assignment of instances of nested classes
work as the nested class is duplicated in the global namespace, eg:

struct Outer {
  struct Nested {
    int bar;
  } bar_instance;
};

Outer.bar_instance can now be assigned to.
2013-12-12 09:00:16 +00:00
Vladimir Kalinin
cf3696e8f9 Merge branch 'nested' of https://github.com/swig/swig into nested 2013-12-08 01:47:01 +04:00
Vladimir Kalinin
44323e14b3 Classprefix fixed after private nested classes
some comments and spaces added
2013-12-08 01:46:38 +04:00
William S Fulton
67848e377a Fix template partial specialization detection
Fixes template definitions that should be ignored and warnings introduced after nested changes:
../../../Examples/test-suite/refcount.i:63: Warning 318: Instantiation of template 'RCPtr< A >' is ambiguous,
../../../Examples/test-suite/refcount.h:159: Warning 318: instantiation 'RCPtr< T >::RCPtr' used,
../../../Examples/test-suite/refcount.h:159: Warning 318: instantiation 'RCPtr< T >::RCPtr' ignored.
../../../Examples/test-suite/refcount.h:159: Warning 318: instantiation 'RCPtr< T >::RCPtr' ignored.
../../../Examples/test-suite/refcount.h:159: Warning 318: instantiation 'RCPtr< T >::RCPtr' ignored.

Different/clearer implementation of constructor detection since Classprefix is
not behaving the same since nested changes were introduced. Only accept
constructors if in extend mode or in a class.

Also remove unused "isextension" attribute on the nodes.
2013-12-07 16:22:44 +00:00
Vladimir Kalinin
b0afa8a95c nested private classes are discarded while parsing
nested relate functions are moved to nested.cxx and renamed accordingly
2013-12-05 20:41:22 +04:00