diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2023-02-18 16:28:33 +0000 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2023-02-18 16:28:33 +0000 |
commit | 7dccbf86945f166f907ceb4b993cd625d98527c3 (patch) | |
tree | 02eb036859fd9bbb5e29c972f56f93676a90874d /Examples | |
parent | 1341df17fb463b472e8d199627f36df8ff617fab (diff) | |
download | swig-7dccbf86945f166f907ceb4b993cd625d98527c3.tar.gz |
Duplicate parameter name handling improvements
When a method with duplicate parameter names is wrapped such as:
void fn_3parms(int p_a, int p_a, double p_c);
Previously all duplicate parameter names were changed in order to
provide unique parameter names:
void fn_3parms(int arg0, int arg1, double p_c)
Now the parameter names changed are just the 2nd and subsequent duplicate
parameter names:
void fn_3parms(int p_a, int arg1, double p_c)
Diffstat (limited to 'Examples')
-rw-r--r-- | Examples/test-suite/common.mk | 1 | ||||
-rw-r--r-- | Examples/test-suite/duplicate_parm_names.i | 21 |
2 files changed, 22 insertions, 0 deletions
diff --git a/Examples/test-suite/common.mk b/Examples/test-suite/common.mk index db2a3d6f7..ff9b8538f 100644 --- a/Examples/test-suite/common.mk +++ b/Examples/test-suite/common.mk @@ -225,6 +225,7 @@ CPP_TEST_CASES += \ director_wombat \ disown \ duplicate_class_name_in_ns \ + duplicate_parm_names \ dynamic_cast \ empty \ enum_ignore \ diff --git a/Examples/test-suite/duplicate_parm_names.i b/Examples/test-suite/duplicate_parm_names.i new file mode 100644 index 000000000..b6c369c8c --- /dev/null +++ b/Examples/test-suite/duplicate_parm_names.i @@ -0,0 +1,21 @@ +%module duplicate_parm_names + +// Testing duplicate argument name handling + +%{ +void fn_2parms(int, int) {} +void fn_3parms(int, int, double) {} +void fn_4parms(int, short, double, const char *) {} + +struct SameParmNameCheck { + void metho(int, short, double, const char *) {} +}; +%} + +void fn_2parms(int argx, int argx) {} +void fn_3parms(int p_a, int p_a, double p_c) {} +void fn_4parms(int duplicate, short duplicate, double duplicate, const char *duplicate) {} + +struct SameParmNameCheck { + void metho(int dup, short dup, double uniq, const char *dup) {} +}; |