When are you allowed to use hazard warning lights?

When are you allowed to use hazard warning lights?

View hint

You must not use hazard warning lights while moving, except to warn traffic behind when you slow suddenly on a motorway or unrestricted dual carriageway.
Never use hazard warning lights to excuse dangerous or illegal parking.