diff options
author | Olly Betts <olly@survex.com> | 2022-01-29 22:35:29 +1300 |
---|---|---|
committer | Olly Betts <olly@survex.com> | 2022-01-29 22:35:29 +1300 |
commit | d2d2bfa05f928d74d546427c70c10c3f08895738 (patch) | |
tree | 477d15c783e21b976bc195472961b24be719258d | |
parent | d3383e254de721efe0e51d9d1202d35ea9d0df06 (diff) | |
download | swig-d2d2bfa05f928d74d546427c70c10c3f08895738.tar.gz |
Add CHANGES entry and regression test for #676
-rw-r--r-- | CHANGES.current | 4 | ||||
-rw-r--r-- | Examples/test-suite/class_case.i | 18 | ||||
-rw-r--r-- | Examples/test-suite/common.mk | 1 | ||||
-rw-r--r-- | Examples/test-suite/go/class_case_runme.go | 12 |
4 files changed, 35 insertions, 0 deletions
diff --git a/CHANGES.current b/CHANGES.current index 5e907a279..feb058706 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -7,6 +7,10 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/ Version 4.1.0 (in progress) =========================== +2022-01-29: dontpanic92 + #676 Fix code generated for a C++ class with a non-capitalised + name. + 2022-01-26: trex58 #1919 #1921 #1923 Various fixes for AIX portability. diff --git a/Examples/test-suite/class_case.i b/Examples/test-suite/class_case.i new file mode 100644 index 000000000..e9438d80b --- /dev/null +++ b/Examples/test-suite/class_case.i @@ -0,0 +1,18 @@ +%module class_case + +// Regression test for SWIG/Go bug #676 + +%inline %{ + +class ClassA {}; + +class classB {}; +class classB2 : public classB {}; + +int Test1(ClassA* a) { return 1; } +int Test1(int i) { return 0; } + +int Test2(classB* a) { return 1; } +int Test2(int i) { return 0; } + +%} diff --git a/Examples/test-suite/common.mk b/Examples/test-suite/common.mk index 6574c4549..19e5d170c 100644 --- a/Examples/test-suite/common.mk +++ b/Examples/test-suite/common.mk @@ -134,6 +134,7 @@ CPP_TEST_CASES += \ char_binary \ char_strings \ chartest \ + class_case \ class_scope_namespace \ class_forward \ class_ignore \ diff --git a/Examples/test-suite/go/class_case_runme.go b/Examples/test-suite/go/class_case_runme.go new file mode 100644 index 000000000..7d0870b47 --- /dev/null +++ b/Examples/test-suite/go/class_case_runme.go @@ -0,0 +1,12 @@ +package main + +import . "swigtests/class_case" + +func main() { + b2 := NewClassB2() + // This used to fail with: + // panic: interface conversion: interface {} is class_case.SwigcptrClassB2, not int + if Test2(b2) != 1 { + panic("Unexpected overload used") + } +} |