A Declaration of Trust does not override a Will. The Declaration of Trust will set out your interest in the property but the Will will set out what will happen to your interest in the property after you have passed away.
As well as putting a Declaration of Trust in place, you should also ensure that your Will is up to date or, make a Will if you have not previously made one. This is of particular importance to cohabiting couples or friends who purchase a property together. Unless provision is made in a Will, the survivor would have no rights under the rules of intestacy.