A point of clarification on affirmative defenses decided through 12(b)(6) and 12(c).
The motion will not automatically be granted, even if the facts are undisputed. Rather, the motion tees-up for the court to decide the legal issue of whether the defense, on the undisputed or taken-as-true facts, has been established. The undisputed facts set up the court's legal analysis of some question, from which it then determines liability or not.
Take the statute of limitations example. If the date of the events appears in the complaint, the defendant can file a 12(b)(6); the court will take that fact as true, then resolve the legal issues of what the limitations period is (not always an obvious question) and whether it has run or not. If she decides it has run on these undisputed facts, she grants the motion; if she decides it has not run, she denies the motion. Similarly, if the defendant pleads the date in the answer and the plaintiff admits the date in the Reply to the Answer, the court on the 12(c) now takes the undisputed fact and resolves the legal issues of what the limitations period is and whether it has run or not. Again, if she decides it has run on these undisputed facts, she grants the
motion; if she decides it has not run, she denies the motion.
The point is that when there is a factual dispute, a case must proceed (the motion denied) because only the fact-finder can resolve factual disputes (or, at the very least, we must get beyond the pleadings and allegations and into evidence). Absent the factual dispute, there is nothing for the jury to do. But the court still must analyze the legal question (that, recall, is the point of a motion--to give the district court the opportunity to analyze and resolve the legal issue).