Subject to section
817 of this title (article 17), general courts-martial have jurisdiction to try persons subject to this chapter for any offense made punishable by this chapter and may, under such limitations as the President may prescribe, adjudge any punishment not forbidden by this chapter, including the penalty of death when specifically authorized by this chapter. General courts-martial also have jurisdiction to try any person who by the law of war is subject to trial by a military tribunal and may adjudge any punishment permitted by the law of war. However, a general court-martial of the kind specified in section
816
(1)(B) of this title (article 16(1)(B)) shall not have jurisdiction to try any person for any offense for which the death penalty may be adjudged unless the case has been previously referred to trial as a noncapital case.