Details
-
Bug
-
Resolution: Incomplete
-
P2: Important
-
None
-
5.7.0
-
None
Description
The following example will crash .I want to know why.
Environment:
$ cat /etc/redhat-release CentOS Linux release 7.6.1810 (Core) $ uname -a Linux localhost.localdomain 3.10.0-957.27.2.el7.x86_64 #1 SMP Mon Jul 29 17:46:05 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux $ qmake -v QMake version 3.0 Using Qt version 5.7.0 in /opt/Qt5.7.0/5.7/gcc_64/lib
code:
#include <QDateTime> class P{ public: P(){} ~P(){ now(); } static inline void now() { QDateTime(); } }; int main(int argc, char *argv[]) { printf("start main\n"); static P p; p.now(); printf("main exit\n"); return 0; }
The screenshot above is based on Qt5.7.0. I haven't crashed since I updated to Qt5.14.0, but QDateTime().currentDateTime().toString("yyyy-MM-dd hh:mm:ss.zzz") returned an empty string;