The compiler is still able to devirtualize and inline the p->f() call, even with an external linkage call preceding it. https://clang.godbolt.org/z/jE3o56ozz
That's interesting that it does devirtualise in practice, but I'm talking about whether it ought to be allowed to. The conclusion I reached is that it ought not to be, making the behaviour you demonstrated a compiler bug. With that said, it was a while ago, and I may have gotten the details wrong.