Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.4.1
-
None
-
I54b7d14124459e450c6a0a93a3033f21b57605d9
Description
I have the following code:
#include <QCoreApplication> #include <QTimer> struct Test : public QObject { void foo() {} }; int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QTimer::singleShot(1000, &Test::foo); return a.exec(); }
It compiles with both VS2013 on Windows and clang 6.1 on OSX, selecting the overload of 'singleShot' that takes a functor. Now, 'foo' is non-static method, so there's no way to call it without object, and in this example, I don't even create any instance of 'Test'. I believe this should be a compile error, as opposed to silently having no effect.