João Matos
4417dd987a
Code cleanups and improvements ( #1713 )
...
* Code cleanups.
* Run GetterSetterToPropertyPass for more generators.
* Fixed compile warning when compiling parser bindings.
* Cleanup driver code.
* Remove dead 32-bit code.
* Reduce verbosity when Options.Quiet is set.
* Remove test compile-time warnings.
* Move .NET tests to tests/dotnet.
* Remove unused AST viewer code and premake-qt submodule.
* Move tests2/ contents to tests/.
2 years ago
josetr
17f69fdf64
Add test for function templates
3 years ago
josetr
0d92eaef16
Use TemplatedDecl.Parameters cuz Class.TemplateParameters may not be available at this point
3 years ago
josetr
06d311dc89
Fix anonymous unions inside template classes
3 years ago
Dimitar Dobrev
69e766be5d
Generate valid C# for classes with dependent fields nested in templates with independent fields
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
3 years ago
Dimitar Dobrev
a69f6d1d6d
Generate valid C++ for specialisations with void
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
3 years ago
Dimitar Dobrev
5552f2b484
Generate valid C# for pure functions returning or taking dependent pointers
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Ahmed Elsayed
caaf89d34a
Fix a crash when processing templates with variable arguments ( #1641 )
4 years ago
Dimitar Dobrev
634c231853
Generate valid C# for unions in templates with non-type args
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
50cba5552c
Generate valid C# for destructors of templates with dependent fields
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
3aab30f572
Add built-in compilation of extra symbols
...
Fixes https://github.com/mono/CppSharp/issues/1456 and https://github.com/mono/CppSharp/issues/1253 .
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
0e963aa03f
Generate valid C# for default args: typedefed refs to enums assigned empty ctors
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
4649052f2c
Fix templated indexers returning objects
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
c36145b29d
Bind default constructors with dependent pointers
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
4d4505e334
Generate valid C# for default params in specialisations
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
6a0bdc1ba6
Delete the C++ copy when returning by value ( #1623 )
...
Fixes https://github.com/mono/CppSharp/issues/1600 .
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
4181f7c534
Ignore the still unsupported dependent type names
...
They're difficult to resolve and this would only make sense if we support types nested in templates which we don't yet.
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
c18d047daf
Ensure a tested specialization is really generated
...
The only function to use the specialization in question is actually ignored because the types of two of its parameters aren't supported. This was hidden by an otherwise redundant definition of a C++ symbol which is now removed.
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
25b9082c4c
Disable the msvc warning about unexported template specializations
...
The warning is essentially a bug in msvc because it's harmless and requires exporting all accessible template specializations. See also http://www.unknownroad.com/rtfm/VisualStudio/warningC4251.html .
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Dimitar Dobrev
e637b18b98
Export some neglected classes in the tests
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
josetr
be2bc1be5b
Fix C4251 warnings ( #1487 )
5 years ago
Dimitar Dobrev
b5ca0635be
Check symbols in tests
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Dimitar Dobrev
0e39ab705a
Import native DLL-s (tests and parser) with MSVC
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Dimitar Dobrev
7396c95f7c
Implement and export all methods in tests
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Dimitar Dobrev
7b6fb6e340
Implement abstract templates to call virtuals
...
This allows for, just as with regular classes, the calling of virtual methods of abstract templates returned by functions.
Fixes https://github.com/mono/CppSharp/issues/1270 .
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Dimitar Dobrev
d31cab7315
Avoid invalid template specializations in tests
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Dimitar Dobrev
c0510730f0
Prefer non-mapped types when resolving ambiguous overloads
...
This fixes a missing specialized method when it has a parameter with type a mapped template which is ignored when dependent.
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
991c6ffb25
Generate valid C# for typedef-ed type parameters
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
64773a5f6f
Generate valid C# for template parameters with a default value
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
380d064ca0
Generate valid C# for overloads with types nested in templates
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
9bc39c44ab
Generate valid C# for template indexers taking const char*
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
c75e9f6c5e
Fix a crash when a function pointer is a template arg
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
6e78b4df15
Fix the generated C# when type arguments are mapped the same
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
4dcbff3d62
Fix the generated C# for a case with 2 template args
...
When a template with 2 args and a method with a dependent pointer was specialized with const char*, there were methods with identical signatures generated for different specializations.
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
831cea92ce
Fix the generated C# when a dependent param has a default value
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
d97016fe3c
Fixed the generated C# for indexers in templates specialized with void*.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
cd32a449c8
Fixed the generated C# for template specializations of pointers.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
c51b3cba71
Fixed the generated C# when a template is specialized with T and const T.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
01b4fa4c2e
Fixed the warnings in the test C++ for C# only.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
5e0e19ea18
Fixed the generation of dependent virtual methods.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
88f118ec4e
Fixed the parsing of functions with integral template args.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
eec05041a3
Fixed the generated C# for templates with > 1 ctor taking a pointer to a class.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
7 years ago
Dimitar Dobrev
8feac37ae1
Fixed ambiguity when the type of a parameter is mapped to a type in an overload.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
7 years ago
Dimitar Dobrev
10c8211a7c
Fixed the generated C# when a template interface specialised with another specialisation returns a template parameter.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
ae9eede6f1
Fixed a crash when a constructor takes a template or specialisation.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
6dec97fd99
Fixed the generated C# for public fields with type a dependent pointer.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
a119bdb3f0
Fixed the generated C# for subclasses of specialisations used as secondary bases.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
cb6d2aee23
Fixed the generated C# when a template specialization with extensions is used for a secondary base.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
52c754c4de
Extended the multiple inheritance to work for templates.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
1e6c881bdc
Fixed a regression causing public fields of type specialization to be ignored.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago