Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
6.3.0 Beta1
-
-
db6459665c (qt/qtdeclarative/dev) 9bbbd0cb21 (qt/qtdeclarative/6.3) 9bbbd0cb21 (qt/tqtc-qtdeclarative/6.3) db6459665c (qt/tqtc-qtdeclarative/dev) 48eaf1fce1 (qt/tqtc-qmlcompilerplus/6.2)
Description
This trivial example generates wrong C++ code:
import QtQuick Window { id: root width: 640 height: 480 visible: true title: qsTr("Hello World") property int someValue: 42 // with 1 this would work (because !0 == 1) function foo() { // console.log("bla"); // if this is active, QQC will skip this, so everything works if (someValue != 0) { t.text = "Bar"; } } Text { id: t text: "Foo" TapHandler { onTapped: { console.log("Tapped") root.foo() } } } }
Generated Code (+ clang warning):
// generate_CmpNeInt r2_3 = !0 == r2; { } warning: logical not is only applied to the left hand side of this comparison [-Wlogical-not-parentheses] r2_3 = !0 == r2;