You sign a waiver at trampoline parks that says you won't sue if you hurt yourself or if they cause you to be hurt. The first part covers them, the second part doesn't. If they were negligent or failed to maintain the park and you were injured as a result you can sue them, that waiver is meaningless. [0]
[0] IANAL but I've heard of many cases around these sorts of waivers at parks, rock climbing walls, bounce houses, etc where the waiver is meaningless. They only have you sign it so you think you can't sue them because you signed a piece of paper - and that tactic works.
What, is the employer that you are talking to going to say "actually, that contract is illegal, therefore tell me your salary"?
I totally agree with using the fact you signed away your right to share your salary as a negotiation tool, regardless if it is even legally binding. Hell - I'd argue to say that even if you never actually signed a paper at all.
Then I signed an illegal agreement when I was working for one of the biggest investment banks in the United States.
I should really thank them for that - in future negotiations, once I said that my current employment agreement is confidential, prospective employers stopped asking me stupid questions about current salary.