Add support of multi-dimensional arrays in RegionStoreManager::getBindingForElement. Handle nested ElementRegion's getting offsets and checking for being in bounds. Get values from the nested initialization lists using obtained offsets.
Example:
const int arr[3][2] = {{1, 2}, {3, 4}}; arr[0][0]; // 1 arr[0][1]; // 2 arr[0][2]; // UB arr[1][0]; // 3 arr[1][1]; // 4 arr[1][-1]; // UB arr[2][0]; // 0 arr[2][1]; // 0 arr[-2][0]; // UB
Could this be a free function (not a member function)? That way we could put it as an implementation detail of RegionStore.cpp and we could spare the timely review from the AST code owners.