An extension of Hörmander’s theorem for infinitely degenerate second-order operators