The Supreme Court is set to consider whether bans on semiautomatic rifles violate the Constitution’s Second Amendment.