I believe it depends on the style. If it's a little crop top with bottoms which are obviously designed and made for a young child (by way of graphics, like Minnie Mouse or whatever), then I see absolutely no issue with a child wearing a two-piece swimsuit. If, on the other hand, the bottoms are skimpy and/or the top is designed to LOOK like a bra for an older teen or adult, then it's a no from me.
My daughter is only two and pretty much non-verbal so not able to make her own decisions on swimwear yet. She has an all in one swimsuit for indoor swimming and using her garden paddling pool in the shade. She also has a huge scar across her tummy from major surgery she had as a newborn. That surgery saved her life, and I want to raise her not to be ashamed of it at all. That said, I'll keep it covered in public pools (just to avoid stares from others) until she is old enough to make a decision herself whether she minds it being visible or not and if she wants to wear a two piece swimsuit, I'll help her find one that's most suitable for her.
It's all about common sense and compromise, I feel.