﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
3263	Cpp runtime generates wrong code for MSL matrix function	Rüdiger Franke	Rüdiger Franke	"The Cpp runtime generates wrong code for the matrix function `Modelica.Math.Matrices.sort`. The following model:
{{{#!mo
model SortTest2
  input Real u; // prevent evaluation by frontend
  Real[:, :] M = [3, 4; 1 + u, 2];
  Real[size(M, 1), size(M, 2)] N;
equation
  N = Modelica.Math.Matrices.sort(M);
  annotation(uses(Modelica(version=""3.2.1"")));
end SortTest2;
}}}

results in a strange assignment to the function input M and an unexpanded SMT_ASSIGN_ARR:
{{{
OMCppSortTest2Functions.cpp: In member function ‘void Functions::Modelica_Math_Matrices_sort(BaseArray<double>&, bool, bool, Modelica_Math_Matrices_sortRetType&)’:
OMCppSortTest2Functions.cpp:210:47: error: expected primary-expression before ‘.’ token
 sorted_M.setDims(tmp3,tmp4);/*setDims 1*/M =  .targTest91
                                               ^
OMCppSortTest2Functions.cpp:266:10: error: ‘STMT_ASSIGN_ARR’ was not declared in this scope
          STMT_ASSIGN_ARR  RANGE
          ^
}}}"	defect	closed	high	1.9.3	Run-time	trunk	fixed		Marcus Walther Volker Waurich Niklas Worschech
