Pretty sure it would invalidate the manufacturers warranty, if they knew about it. There would be too many get-outs for them if something went wrong - with Mercedes probably attributing faults as being due to accident damage/ sub-standard repair. And then there are the question marks over whether new/ 2nd hand parts were used to repair etc.
But I guess if it was very well repaired they might not be able to tell. Damage would have been fairly extensive to make a new-ish car of that value a Cat D. Or it could have been stolen and then recovered...
AFAIK the insurance industry generally considers that if repair costs exceed 60% of the pre-accident value, it becomes a Cat D total loss and repairable salvage. So if pre-acc value was, for the sake of argument, £50k, that's a lot of damage sustained. Although they would price up the repair based on brand new, expensive parts and if you have airbags deployed etc that's a fair few £k, not to mention factoring in equivalent hire car costs etc. Probably not worth the potential hassle, bargain or not - unless you buy it as salvage and have it repaired yourself.
One assumes the vendor has had a Autolign inspection -approving repair is to a high standard
Ad also states "still under manufacturers warranty" -although rather sneaky with quiet mention of cat d