Student accused of threatening to bring gun to school