D-Programming-Language/dmd — pull request #3481 by ibuclaw (2014-04-21 12:43:59+00:00)
Title: Do not mark mutable parameters as STCin for internal library calls

For a compiler that could optimise around the use of ``in``, setting these as ``STCin`` would be dangerous.

eg:
```
int[] arr = [3,2,1,4];
arr.sort(); // calls internal function: _adSort(in int[] arr);
assert(arr[0] == 1); // Assumed false because we are told that _adSort never changes the array.
```

This pull updates the storage class set on parameters so that it reflects what is defined in druntime. There are some cases identified where we **should** mark the parameters as ``in``. This has been raised against druntime here https://github.com/D-Programming-Language/druntime/pull/771 - which is an accompanying PR to this one.