1
Vote

Odd error on inferred for loop termination measure

description

The following gets the error "expression with side effects used in pure context {"

void test(unsigned len)
_(decreases 0)
{
for (unsigned i=0; i < len -1; i++)
{}
}

The error goes away if the "-1" is omitted.

comments