In the state of Idaho, residents have the right to make a living will, also known as an advance directive. The living will gives people the chance to decide, while they’re still healthy, what they’d like to happen to them when they’re not. Usually, advance directives tell family members and medical caregivers what, if any, extreme measures the patient would like to receive to stay alive if she can no longer communicate her wishes.

Only one class of Idaho resident currently lacks the right to an advance directive: people who are pregnant. A clause in the state’s Medical Consent and Natural Death Act renders any living will void for the duration of a woman’s pregnancy. On Thursday, two advocacy groups and four Idaho women of childbearing age filed a legal complaint against the state, arguing that the law constitutes gender discrimination and an unconstitutional violation of privacy rights.

The issue of states disregarding pregnant women’s medical decisions got national attention in 2014, when Texas woman Marlise Munoz was found unconscious on her kitchen floor at 14 weeks pregnant. The hospital kept her on a ventilator even after she was declared brain-dead and her husband asked that she be allowed to expire. (He said Munoz, a paramedic, didn’t want to be artificially kept “alive” under such circumstances.) Texas goes further than most states in its law about pregnant women and advance directives: While others will simply automatically invalidate a pregnant woman’s living will, Texas law orders that “a person may not withdraw or withhold life-sustaining treatment…from a pregnant patient.” Since brain death is all but universally recognized as death, Munoz’s husband argued that, absent life, no treatment could be “life-sustaining.” A judge eventually ordered the hospital to cease its treatment, but not before it had kept Munoz hooked up to medical devices for far longer than either she or her family would have wanted.

At least eight states besides Idaho and Texas—Alabama, Indiana, Kansas, Michigan, Missouri, South Carolina, Utah, and Wisconsin—have laws that invalidate pregnant patients’ advance directives. Others have similar ones on the books, usually with codified exceptions for cases in which the fetus is likely to develop to the point of live birth or viability, or in which the patient might suffer pain from life-sustaining treatment. Just last week, the governor of Connecticut signed a bill into law that changed the state’s policy from one that voided pregnant women’s living wills to one that lets women specify whether and how their living will should adapt to a pregnancy.

Legal Voice, one of the organizations that filed the Idaho suit on Thursday, has fought this battle before. More than three decades ago, the group filed suit against Washington state for nullifying advance directives by pregnant women. The judges on the state supreme court ruled in 1984 that the plaintiff in that case didn’t have standing because she was neither pregnant nor terminally ill, and that the case did not present “issues of broad overriding public import” because the judges had no evidence that the law was having an actual detrimental impact on women’s lives.

This time, two of the four plaintiffs are pregnant, and all have specific instructions in their advance directives about what they want in case of a terminal health condition or incapacitation. Two want life-sustaining treatment withheld or withdrawn, with no exceptions. One wants to be kept on life support only if her pregnancy has passed the point of fetal viability. The fourth only wants life-sustaining treatment if the fetus is viable and her doctor can certify that any baby born “would be able to survive outside her body without intrusive neo-natal life supporting methods or significant long-term damage to the fetus.”

According to Legal Voice advocacy director Sara Ainsworth, the Idaho law violates the Equal Protection Clause of the Constitution by classifying people differently based on sex, giving people with the capacity to become pregnant fewer civil rights than everyone else. She says it also violates the right to privacy, which includes medical decisionmaking, and runs counter to Supreme Court precedent established in 1990 in Cruzan v. Director, Missouri Department of Health, which affirmed a patient’s right to make her medical wishes known, and have them followed, in the event of her incapacitation. That decision provided the impetus for many states’ advance directive laws.

Idaho and supporters of its current law will likely argue, as they have in cases regarding abortion rights, that the state has an interest in preserving potential life after a fetus has passed the point of viability outside the womb, around 22 to 24 weeks of pregnancy. Ainsworth says this framing is inaccurate. “I think of this not so much in the abortion context, but much more like the context of when hospitals try to force people to have C-sections against their will,” she said. “The health care provider’s directive is that the pregnant person is the decisionmaker at all times and that you don’t treat a pregnant woman’s fetus as if it’s a separate individual. That’s a matter of bioethics, but it’s also matter of constitutional law.”

Though Idaho law only explicitly voids a pregnant patient’s advance directive, the state appears to interpret it in a way that infringes even further on women’s bodily autonomy. On the state attorney general’s living will FAQ page, the answer to the question “What if I am pregnant when I become incapacitated?” is this: “Life sustaining measures will continue regardless of any directive to the contrary until the pregnancy is complete.”

The robotic, unempathetic tone of the answer to this horrifying question befits the scenario it describes: a woman, unable to communicate with her family or doctors, sustained by machines against her will as a human incubator for a fetus, even if her doctors say the fetus has no chance of making it to term. What’s worse, Ainsworth says, is that “we don’t have any evidence that shows that sustaining someone who is dying to carry a pregnancy to term actually works, that that’s a real thing.” Under Idaho law, pregnant women approaching death are more than just fetal vessels—they’re medical experiments.