diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2025-04-11 17:00:52 +0200 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2025-04-14 11:29:35 +0200 |
| commit | 0bd329a0b42b4c8c3bf77c201f3d8b187467ef02 (patch) | |
| tree | 347d1d5f18796e4df51a33bba9c4cf37605778b4 /tests/auto/qml/qmlcppcodegen/data | |
| parent | ec9dac6eca5ca0c1098b9f48a1b7793b492e6828 (diff) | |
QmlCompiler: Error out on unstorable types
We already do this for return types, but it's fatal on any type.
Pick-to: 6.9
Fixes: QTBUG-135342
Change-Id: I7aee2a19ffcd39d2707eceb34b5073057d8b5ebb
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/data')
| -rw-r--r-- | tests/auto/qml/qmlcppcodegen/data/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | tests/auto/qml/qmlcppcodegen/data/enumproblems.h | 15 | ||||
| -rw-r--r-- | tests/auto/qml/qmlcppcodegen/data/unknownUnderlyingType.qml | 6 |
3 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/data/CMakeLists.txt b/tests/auto/qml/qmlcppcodegen/data/CMakeLists.txt index 89386965fc..75d0ec3014 100644 --- a/tests/auto/qml/qmlcppcodegen/data/CMakeLists.txt +++ b/tests/auto/qml/qmlcppcodegen/data/CMakeLists.txt @@ -310,6 +310,7 @@ set(qml_files undefinedToDouble.qml unknownAttached.qml unknownParameter.qml + unknownUnderlyingType.qml unstoredUndefined.qml unusedAttached.qml urlString.qml diff --git a/tests/auto/qml/qmlcppcodegen/data/enumproblems.h b/tests/auto/qml/qmlcppcodegen/data/enumproblems.h index 36f97bec5a..9c98789e72 100644 --- a/tests/auto/qml/qmlcppcodegen/data/enumproblems.h +++ b/tests/auto/qml/qmlcppcodegen/data/enumproblems.h @@ -116,4 +116,19 @@ public: Q_ENUM(EType) }; +using uint_myown_t = decltype(75 - 12); + +class UnknownUnderlyingType : public QObject +{ + Q_OBJECT + QML_ELEMENT + +public: + enum Bla : uint_myown_t { + Yo = 11, + }; + Q_ENUM(Bla) +}; + + #endif // ENUMPROBLEMS_H diff --git a/tests/auto/qml/qmlcppcodegen/data/unknownUnderlyingType.qml b/tests/auto/qml/qmlcppcodegen/data/unknownUnderlyingType.qml new file mode 100644 index 0000000000..8e438280cb --- /dev/null +++ b/tests/auto/qml/qmlcppcodegen/data/unknownUnderlyingType.qml @@ -0,0 +1,6 @@ +import QtQml +import TestTypes as FB + +QtObject { + property var foo: FB.UnknownUnderlyingType.Yo +} |
