PVC glue can be used on CPVC pipe but doing so will often result in leaks and degradation of the seal on the joints, so it is not recommended. PVC and CPVC are made up of similar chemical elements, but they are not interchangeable.
PVC stands for Polyvinyl Chloride, while CPVC is the common acronym for Chlorinated Polyvinyl Chloride. CPVC goes through an additional chlorination process, which makes it capable of withstanding more extreme temperatures. As such, CPVC glue or cement materials are also intended for higher and lower temperature ranges than the glues used on standard PVC. Using PVC glue on CPVC pipe will usually lead to the glue melting or becoming cold and brittle and then cracking. Either scenario causes leaks or pipe breaks.