diff --git a/libexec/trick/convert_swig b/libexec/trick/convert_swig index 92980ad3..6ed0be49 100755 --- a/libexec/trick/convert_swig +++ b/libexec/trick/convert_swig @@ -97,7 +97,7 @@ my $template_def = qr/template\s* # keyword template \s+[_A-Za-z]\w*\s* # class name /sx ; my $template_var_def = qr/(?:\:\:)?[_A-Za-z][:\w]*\s* # template name - <[\w\s\*,:<>]*>\s* # template parameters + <[\w\s\*,:<>\[\]]*>\s* # template parameters [_A-Za-z]\w*\s*(?:[{=].*?)?; # var name ; /sx ; diff --git a/test/SIM_test_ip/S_define b/test/SIM_test_ip/S_define index eef7b547..62cec0ab 100644 --- a/test/SIM_test_ip/S_define +++ b/test/SIM_test_ip/S_define @@ -9,8 +9,25 @@ LIBRARY DEPENDENCIES: #include "sim_objects/default_trick_sys.sm" ##include "test_ip/include/ClassOfEverything.hh" +##include "test_ip/include/ArrayTemplate.hh" ##include "test_ip/include/OverloadedVariable.hh" +class ArrayTemplateSimObject : public Trick::SimObject +{ + public: + ArrayTemplateSimObject(const ArrayTemplateSimObject&) = delete; + ArrayTemplateSimObject& operator=(const ArrayTemplateSimObject&) = delete; + + double a[3]; + ArrayTemplate arryTemp; + + ArrayTemplateSimObject() + : arryTemp(a) + { + } +}; +ArrayTemplateSimObject arry_temp_object; + class testSimObject : public Trick::SimObject { public: diff --git a/test/SIM_test_ip/models/test_ip/include/ArrayTemplate.hh b/test/SIM_test_ip/models/test_ip/include/ArrayTemplate.hh new file mode 100644 index 00000000..b65c91c7 --- /dev/null +++ b/test/SIM_test_ip/models/test_ip/include/ArrayTemplate.hh @@ -0,0 +1,37 @@ +/** +@file + +@verbatim +PURPOSE: + (Test if we can build with arrays as template parameters) +@endverbatim +*******************************************************************************/ + +#ifndef ARRAY_TEMPLATE_TESTS_HH +#define ARRAY_TEMPLATE_TESTS_HH + +// System include files. +#include +#include +#include + + +template +class ArrayTemplate +{ + public: + ArrayTemplate(const SourceType& source) + : source(source) + { + } + + ArrayTemplate(const ArrayTemplate&) = delete; + ArrayTemplate& operator=(const ArrayTemplate&) = delete; + + private: + const SourceType& source; +}; + + +#endif +