Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
3.x, 4.8.7, 5.6.3, 5.9.8, 5.12.4
-
None
Description
The destructor definition in QLayout in qtbase src/widgets/kernel/qlayout.h does not have a virtual specifier. It seems most all compilers in use building Qt and Qt applications assume this will be virtual and mark it so, however this is non-standards-conforming behavior.
According to the standard, it should be marked virtual.
This is pretty clear (though this isn't a direct copy of the standard - that is behind a paywall):
https://en.cppreference.com/w/cpp/language/destructor#Virtual_destructors
class Q_WIDGETS_EXPORT QLayout : public QObject, public QLayoutItem { Q_OBJECT [...] public: [...] QLayout(QWidget *parent); QLayout(); ~QLayout();