Formation of intermetallic phases in diffusion-welded joints of aluminium and magnesium alloys