qt5base-lts/tests/auto/tools
Ahmad Samir 7779400ba6 Moc: fix generated code for nested enum class corner case
Fixes an issue with generated code where the name of an enclosing
namespace is identical to an enum class type, when Q_ENUM_NS is used.

Consider:
namespace a {
    Q_NAMESPACE
    namespace b {
        enum class b { Key, Key2 };
        Q_ENUM_NS(b);
    }
}

moc generated code such as:
Q_CONSTINIT const QMetaObject a:🅱️:staticMetaObject = { {
    ...
    qt_incomplete_metaTypeArray<qt_meta_stringdata_CLASSaSCOPEbENDCLASS_t,
        // enum 'TestEnum'
        QtPrivate::TypeAndForceComplete<b::b, std::true_type>,
        // Q_OBJECT / Q_GADGET
        QtPrivate::TypeAndForceComplete<void, std::true_type>
    >,
    nullptr
} };

which confused the compiler:
error: ‘b’ is not a member of ‘a:🅱️:b
   83 |         QtPrivate::TypeAndForceComplete<b::b, std::true_type>,

Fixes: QTBUG-112996
Pick-to: 6.6
Change-Id: I37aee83c32efe96cc9d6c2bd0bdb9ba80bb7b8a7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-06-18 21:28:58 +03:00
..
macdeployqt test: Don't remove macdeployqt test directory when debugging test 2023-05-05 19:05:08 +02:00
moc Moc: fix generated code for nested enum class corner case 2023-06-18 21:28:58 +03:00
qdbuscpp2xml tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qdbusxml2cpp tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qmake Port from container.count()/length() to size() 2022-10-04 07:40:08 +02:00
qmakelib tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qt_cmake_create Replace AUTO_RESOURCE_PREFIX with RESOURCE_PREFIX in qt-cmake-project 2023-05-30 10:38:33 +02:00
rcc tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
uic tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
windeployqt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00