#include <iostream>
struct iface
{
virtual void test(int a = 0) { std::cout << a; }
};
struct impl : public iface
{
virtual void test(int a = 5) override { std::cout << a; }
};
int main()
{
impl d;
d.test();
iface* a = &d;
a->test();
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKc3RydWN0IGlmYWNlCnsKCXZpcnR1YWwgdm9pZCB0ZXN0KGludCBhID0gMCkJeyBzdGQ6OmNvdXQgPDwgYTsgfQp9OwoKc3RydWN0IGltcGwgOiBwdWJsaWMgaWZhY2UKewoJdmlydHVhbCB2b2lkIHRlc3QoaW50IGEgPSA1KSBvdmVycmlkZSB7IHN0ZDo6Y291dCA8PCBhOyB9Cn07CgppbnQgbWFpbigpCnsKCWltcGwgZDsKCWQudGVzdCgpOwoJaWZhY2UqIGEgPSAmZDsKCWEtPnRlc3QoKTsKfQ==