79541666

Date: 2025-03-28 14:20:26
Score: 0.5
Natty:
Report link

By using the g++ -S main.cpp to generate main.s, we can see that _ZN4BaseD1Ev is an alias for _ZN4BaseD2Ev. I believe this is a compiler optimization: in the absence of virtual base classes, the complete object destructor can reuse the implementation of the base object destructor, that is, both share the same code.

.size   _ZN4BaseD2Ev, .-_ZN4BaseD2Ev
.weak   _ZN4BaseD1Ev
.set    _ZN4BaseD1Ev,_ZN4BaseD2Ev
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: xxllxx666