Singapore court upholds law that criminalises gay sex