A regression was introduced in D64400 because auto is using the same logic as templates. However, deduction of addr spaces wasn't working correctly even before.
Here are the rules that are implemented in this patch:
- For non-reference and non-pointer types deduction can be done early because addr space is not going to be taken from init expr
- For ref or ptr auto types we should prevent deducing addr space before the deduction of the whole type (incl its pointee addr spaces) from init expr