moc exits with a failed assert when run on the attached malformed file:
It's clear that moc can't generate something useful from this file but still it should not crash. Qt 5.6.1 finished safely with an error message:
This is not a duplicate of
QTBUG-53441 which is fixed in 5.7.0.