Theories of class F and anomalies