PROBLEM:
There is a small ommission in parser.y, which will lead
to syntax errors in cases when non-empty throw declaration is
followed by `override`, `final` or both. E.g. in cases like:
void finalOverriden() throw(std::exception) final override;
SOLUTION:
- Add a `THROW LPAREN parms RPAREN virt_specifier_seq` to
exception_specification in Source/CParse/parser.y
- Add several methods in test-suite/cpp11_final_override.i
to verify the fix works.
Previous commit turned on the generation of an extra extend function
wrapper of a member template function when %template was inside a %extend
block instead of calling the real member template - reversed this side
effect.
1) The %extend directive can now optionally support one of the 'class', 'struct' or 'union'.
2) The SWIG library no longer uses the javatype, dtype or cstype typemaps, thereby
completely freeing them up for users to use without having to replicate the library
code that they previously added
Tested by changes to test: java_lib_arrays
Problem: When enum value contains compound expression with a char
constant, the quotes around char constant is missing in the generated
expression. Example:
enum media_type {
YUY2 = ((('2' << 24) | ('Y' << 16)) | ('U' << 8)) | 'Y'
};
The generated C# enum becomes:
public enum media_type {
YUY2 = (((2 << 24)|(Y << 16))|(U << 8))|Y
}
While the correct representation (after this fix) should be:
public enum media_type {
YUY2 = ((('2' << 24)|('Y' << 16))|('U' << 8))|'Y'
}
Causes: the exprcompound promotes the expression type from char to int
and uses $1.val in the generated expression. However $1.val does not
contain the quotes. Since the type is promoted to int, there's no way to
know there's char component in the compound expression.
Solution: in exprcomound, use $1.rawval if $1.type is T_CHAR or T_WCHAR.
The rawval contains quotes which yield correct expression.
Uncomment the "%expect" statement, there are no known Bison versions for which
it doesn't work and it's useful to fail the build if any new conflicts are
introduced.
Closes#478.
This fixes the case when an integer is used as the initializer, such as:
struct W { static const char w = 100; };
The "valuetype" attribute has been added to the "cdecl" Node which enables
us to distinguish the declared type from the type of the initializer.
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.