The one time such a clause was challenged in court it was struck down, but on narrower grounds related to the specifics of the particular case. The actual issue of whether such a clause is enforceable was not answered by the court.
https://academia.stackexchange.com/questions/28511/has-the-d...