gcc/testsuite/gdc.dg/pr100882a.d
raw| 1 | // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100882 |
| 2 | // { dg-do compile } |
| 3 | |
| 4 | struct AllocatorList(Factory) |
| 5 | { |
| 6 | Factory factory; |
| 7 | auto make(size_t n) { return factory(n); } |
| 8 | this(Factory plant) |
| 9 | { |
| 10 | factory = plant; |
| 11 | } |
| 12 | } |
| 13 | |
| 14 | struct Region |
| 15 | { |
| 16 | ~this() |
| 17 | { |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | auto mmapRegionList() |
| 22 | { |
| 23 | struct Factory |
| 24 | { |
| 25 | this(size_t ) |
| 26 | { |
| 27 | } |
| 28 | auto opCall(size_t ) |
| 29 | { |
| 30 | return Region(); |
| 31 | } |
| 32 | } |
| 33 | auto shop = Factory(); |
| 34 | AllocatorList!Factory(shop); |
| 35 | } |