Fix handling of array whose size contains <<

Fixes https://sourceforge.net/p/swig/bugs/983/
This commit is contained in:
Olly Betts 2022-07-27 10:29:33 +12:00
commit 2227dc9e53
4 changed files with 12 additions and 2 deletions

View file

@ -73,4 +73,8 @@ typedef struct {
cartPosition_t p;
} CartPoseData_t;
/* Test left shift in array size doesn't trigger "Bad template type" error.
* Regression test for https://sourceforge.net/p/swig/bugs/983/ */
int array_shifted_size[(1<<2)];
%}

View file

@ -4,7 +4,7 @@ require "tests.php";
check::functions(array('fn_taking_arrays','newintpointer','setintfrompointer','getintfrompointer','array_pointer_func'));
check::classes(array('arrays','SimpleStruct','ArrayStruct','CartPoseData_t'));
check::globals(array());
check::globals(array('array_shifted_size'));
$ss=new simplestruct();
check::classname('simplestruct',$ss);