diff options
Diffstat (limited to 'src/qmlcompiler/qqmljscompiler.cpp')
| -rw-r--r-- | src/qmlcompiler/qqmljscompiler.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/qmlcompiler/qqmljscompiler.cpp b/src/qmlcompiler/qqmljscompiler.cpp index f35351b357..bfb434aada 100644 --- a/src/qmlcompiler/qqmljscompiler.cpp +++ b/src/qmlcompiler/qqmljscompiler.cpp @@ -556,6 +556,14 @@ bool qSaveQmlJSUnitAsCpp(const QString &inputFileName, const QString &outputFile if (!writeStr("};\n")) return false; + // Suppress the following warning generated by MSVC 2019: + // "the usage of 'QJSNumberCoercion::toInteger' requires the compiler to capture 'this' + // but the current default capture mode does not allow it" + // You clearly don't have to capture 'this' in order to call 'QJSNumberCoercion::toInteger'. + // TODO: Remove when we don't have to support MSVC 2019 anymore. Mind the QT_WARNING_POP below. + if (!writeStr("QT_WARNING_PUSH\nQT_WARNING_DISABLE_MSVC(4573)\n")) + return false; + writeStr(aotFunctions[FileScopeCodeIndex].code.toUtf8().constData()); if (aotFunctions.size() <= 1) { // FileScopeCodeIndex is always there, but it may be the only one. @@ -595,6 +603,9 @@ bool qSaveQmlJSUnitAsCpp(const QString &inputFileName, const QString &outputFile writeStr("};\n"); } + if (!writeStr("QT_WARNING_POP\n")) + return false; + if (!writeStr("}\n}\n")) return false; |
