class S
{
    int i;

    void f();
};

static int i;

void f()
{
    if (false)
    {
        int i;
        ++i;
        ++::i;
    }
    ++i;

    S s;
    ++s.i;

    int i;

    switch (s.i)
    {
        case 0:
        i++;
        ::i++;
        break;
        case 1:
        {
            int i;
            ++i;
        }
        case 2:
            int i;
        break;
        default:
            ++i;
    }

    for (int i = 1; i < 3; ++i)
    {
        i = i;
    }

    while (true)
    {
        int i = 2;
        i = i;
    }

    do
    {
        int i;
        i = i;
    } while (i++ < 40);  // i here refers to line 23

    for (int i = 1; i < 3; ++i)
        ;  // semicolon close scope too

    for (int i=0; i<2; )
        ++i;  // expression statements must close too
}

void S::f()
{
    ++i;
    ++::i;

    for (; i < 10;)
    {}

    const int j = min(4,6);  // if the non-init-clause for above didn't enter scope correctly, this causes an error 43 (default init in class)
}
