“The purpose of the demurrer is to test the sufficiency of the pleadings by raising questions of law. A demurrer lies when the grounds for objection appear on the face of the pleading or from judicially-noticed facts. The demurrer may lie as to the complaint or cross complaint, or answer. The grounds for a demurrer to a complaint or cross-complaint may be waived by failure to object, either by demurrer or answer ‘unless it is an objection that the court has no jurisdiction of the subject of the cause of action alleged in the pleading or an objection that the pleading does not state facts sufficient to constitute a cause of action.’ A demurrer to a complaint or cross-complaint may be taken to the whole complaint or cross-complaint, as well as any cause of action stated therein. If an allegation or prayer is objectionable, it should be challenged by a motion to strike.”
[California Summary Judgment & Related Termination Motions [certain citations omitted]]