Don't generate C++ wrappers for overridden virtual functions

This is harmless, but also useless, as the implementation is the same as
the existing one in the base class anyhow.
This commit is contained in:
Vadim Zeitlin 2021-12-05 20:24:38 +01:00
commit 4a3ae6f8d3

View file

@ -393,6 +393,11 @@ public:
if (Getattr(n, "c:inherited_from"))
return;
// And we even don't need to redeclare virtual functions actually overridden in the derived class, as their implementation is the same as in the base class
// anyhow, so don't bother generating needless extra code.
if (Getattr(n, "override"))
return;
// Also ignore friend function declarations: they appear inside the class, but we shouldn't generate any wrappers for them.
if (Checkattr(n, "storage", "friend"))
return;