Sometimes sets are materialized as arrays and we must treat them as such: the CPP backend is pickier than the C one and would sometimes produce invalid code. Fixes #8967