According to anti-discrimination law, a ground for layoff(or not hiring) can not be tied to parenthood.
Of course this doesn't work if you have a work council, usually the work-council negotiate a severance package algorithm (= fix_amount + tenure * amount), and this is usually un-negotiable. This makes sense, thanks to collective bargaining, it's most likely one the best deal you could have gotten. (Even though libertarians will flock-in and start going "How do I know, that I, as a highly performing individual couldn't have negotiate better!?! This seems unfair!")
I made a correction. Also I really hate the tendency of tech workers doing everything to stay away from unionizing or collective bargaining or establishing work councils. There is this bizarre tendency that it is just somekind if conspiracy and they are able to bargain better deals. This in collective hurts the entire tech crew everywhere.