U.S. Supreme Court agrees to hear same-sex cases