Details
-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
6.4.2
-
None
Description
Sample/Pseudo code;
QJsonObject m_obj; void updateJson(const QJsonValue &val) {m_obj["key"] = val;} void set1(const QStringList &val) { updateJson(QJsonArray::fromStringList(val)); } void set2(const QStringList &val) { QJsonArray tObj = QJsonArray::fromStringList(val); updateJson(tObj); } QStringList get() const { return m_obj["key"].toVariant().toStringList(); } main (){ set1({"testing"}); qDebug() << get(); // CLANG: QVariant(QVariantList, QList(QVariant(QString, "testing"))) // GCC: QVariant(QVariantList, QList(QVariant(QString, "testing"))) set2({"testing"}); qDebug() << get(); // CLANG: QVariant(QVariantList, QList(QVariant(QString, "testing"))) // GCC: QVariant(QVariantList, QList(QVariant(QVariantList, QList(QVariant(QString, "testing"))))) }
Seems like compilers select different paths.
https://godbolt.org/z/WqPfhTbM4
Attachments
Issue Links
- is duplicated by
-
QTBUG-99152 QJsonDocument::array() returns a repeatly encapsulated QJsonArray
- Closed
For Gerrit Dashboard: QTBUG-112727 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
471383,1 | WIP: QTBUG-112727 reproducer | dev | qt/qtbase | Status: ABANDONED | -2 | 0 |
471384,1 | WIP: QTBUG-112727 reproducer | 6.4 | qt/qtbase | Status: ABANDONED | -2 | 0 |