/*
TEST_OUTPUT:
---
fail_compilation/fail12932.d(11): Error: array literal in @nogc function foo may cause GC allocation
fail_compilation/fail12932.d(15): Error: array literal in @nogc function foo may cause GC allocation
---
*/

int* foo() @nogc
{
    foreach (ref e; [1,2,3])
    {
    }

    foreach (ref e; [1,2,3])
    {
        return &e;
    }
}
