Then when he says, "As we said before, so now I say it again: If any one preach to you a gospel, besides that which you have received, let him be anathema," he pronounces his sentence on the evil person and says: As I have said of angels and apostles, so I say of the seducers. If any seducer "shall preach a gospel besides that which you have received from me, let him be anathema," i.e., excommunicated. And this is the sentence he passes.
Now it may be asked whether all heretics are thereby excommunicated. And it seems not, because it is said: "A man that is a heretic, after the first and seco...nd admonition, avoid" (Tit 3:10). I answer that a person might be called a heretic either because he errs solely from ignorance, and then he is not on that account excommunicated; or because he errs through obstinacy and tries to subvert others, and then he falls under the canon of the sentence passed. But whether he was then and there passing sentence on heretics by these words is open to question, since sentence was later passed against heretics in the Councils. Yet it can be said that perhaps he was showing that they deserved to be excommunicated.
Source: Commentary on Galatians