WASHINGTON (AP) — The Respect for Marriage Act, now pending in the Senate, would ensure that same-sex marriages are still legally recognized nationwide if the Supreme Court were to overturn its 2015 Obergefell v. Hodges decision that declared a constitutional right for gay couples to wed.

The House-passed legislation has some Republican support and is expected to come up for a vote in September. It is part of an effort by Democrats to protect various rights after Supreme Court decision last month to overturn Roe vs. Wade, which legalized abortion in all states.

While the Senate is not expected to approve separate House bills to legalize abortion or protect contraception rights, the same-sex marriage legislation has a real shot at passage after a handful of Republican senators indicated they would vote for it. Democrats need 10 GOP votes to overcome a filibuster and get the legislation through the 50-50 Senate.

A look at the bill:

PROTECTS, BUT DOESN’T CODIFY

The bill is designed to protect same-sex marriages after Justice Clarence Thomas suggested in a concurring opinion that the Obergefell decision upholding gay marriage should also be reconsidered.

The legislation wouldn’t codify, or enshrine into law, Obergefell, which now requires states to issue same-sex marriage licenses. If the bill were passed and Obergefell were later overturned, some states could stop issuing those licenses, but all states would still have to recognize same-sex marriages performed legally in other states.

The practical effect of that would be that some people couldn’t get married in their own states, but all same-sex marriages would continue to be recognized and eligible for the legal benefits of marriage.

Wisconsin Sen. Tammy Baldwin, the lead Democrat pushing the bill in the Senate, says the legislation was written that way because marriage is currently regulated by the states, not the federal government. Any legislation requiring federal regulation of marriages would be unlikely to garner enough support to pass.

REPEAL THE DEFENSE OF MARRIAGE ACT

If Obergefell were overturned today, federal law would partially revert to a 1996 statute called the Defense of Marriage Act. That legislation allowed states not to recognize same-sex marriages and legally defined the word “marriage” as a union between one man and one woman.

The bill would fully repeal that law, replacing it with the new language requiring that states and the federal government consider an individual married if they have been legally married in any state.

A separate 2013 Supreme Court case, United States v. Windsor, repealed part of the Defense of Marriage Act that kept legally married same-sex couples from receiving federal tax, health and pension benefits that were otherwise available to married couples. The bill includes provisions to ensure those benefits remain for same-sex couples, as well.

INTERRACIAL MARRIAGE

In addition to same-sex marriages, the bill would protect interracial marriages that were affirmed by the 1960s-era Supreme Court decision Loving v. Virginia. That decision invalidated state laws that banned marriages between individuals of different races.

The bill prohibits states “from denying full faith and credit to an out-of-state marriage based on the sex, race, ethnicity or national origin of the individuals in the marriage.”

___

Associated Press writer Mark Sherman in Washington contributed to this report.