Critical points of infinite order in charge-density-wave systems and in superconductors