The U.S. Supreme Court has held that a defendant who has plead guilty to a crime can still appeal and challenge his conviction if the appeal alleges that the conviction violates the Constitution (i.e. the statute was unconstitutional).

Read the case here