Hafetz Haim Halachot
Halacha 126 / 215

Hilchos Lashon Hara chapter 9, section 1

Some things are forbidden as avak lashon hara ("dust" of lashon hara, something close to it). For example, saying "Who would have believed that so-and-so would turn out the way he is now?" Or saying "Don't mention so-and-so. I don't want to say what happened with him..."

In the same way, praising someone in front of people who dislike him is also avak lashon hara, because it leads them to speak against him.

And if he praises someone a lot, it is forbidden even when not in front of people who dislike him. This is because then he himself usually ends up putting him down: "...except for this one bad trait he has." Or the listeners will say, "Why are you praising him so much? He has this bad trait..."