#include <cstdio> // for printf.
template<typename T>
struct b
{
virtual auto f() -> void
{
std::printf("b::f()\n");
}
};
template<typename T>
struct d1 : b<T>
{
auto test() && -> void
{
this->f();
this->b<T>::f();
}
};
template<typename T>
struct dd : d1<T>
{
virtual auto f() -> void override
{
std::printf("dd::f()\n");
}
};
auto main() -> int
{
dd<void>{}.test();
}
I2luY2x1ZGUgPGNzdGRpbz4JCS8vIGZvciBwcmludGYuCgp0ZW1wbGF0ZTx0eXBlbmFtZSBUPgpzdHJ1Y3QgYgp7Cgl2aXJ0dWFsIGF1dG8gZigpIC0+IHZvaWQKCXsKCQlzdGQ6OnByaW50ZigiYjo6ZigpXG4iKTsKCX0KfTsKCnRlbXBsYXRlPHR5cGVuYW1lIFQ+CnN0cnVjdCBkMSA6IGI8VD4KewoJYXV0byB0ZXN0KCkgJiYgLT4gdm9pZAoJewoJCXRoaXMtPmYoKTsKCQl0aGlzLT5iPFQ+OjpmKCk7Cgl9Cn07Cgp0ZW1wbGF0ZTx0eXBlbmFtZSBUPgpzdHJ1Y3QgZGQgOiBkMTxUPgp7Cgl2aXJ0dWFsIGF1dG8gZigpIC0+IHZvaWQgb3ZlcnJpZGUKCXsKCQlzdGQ6OnByaW50ZigiZGQ6OmYoKVxuIik7Cgl9Cn07CgphdXRvIG1haW4oKSAtPiBpbnQKewoJZGQ8dm9pZD57fS50ZXN0KCk7Cn0K