> Il 25/11/19 10:25, Eike Ziller ha scritto: >>> ? >> Similar things can happen in C++ with method names. >> C++ got the ‘override’ keyword to make these breakages detectable by >> tooling. >> It looks to me like the case id==propertyname would also be detectable >> by tooling? > > What do you mean? Can you make an example? The whole point of shadowing > in C++ is to make sure that the above does NOT break.
Consider QSomething to be Qt code and the rest user code: class QSomething { public: // struct b {}; // void b() { qDebug() << Q_FUNC_INFO; } }; void b() { qDebug() << Q_FUNC_INFO; } class c : public QSomething { public: void x() { b(); } }; int main(int argc, char *argv[]) { c ttt; ttt.x(); } Add one of the "b" to QSomething and the user code silently stops working. Ulf _______________________________________________ Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development