diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2022-06-17 20:14:58 -0700 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-06-25 02:06:13 +0000 |
commit | 720b592975d52507317b1153e5d3e0a49171bdd8 (patch) | |
tree | e21ad54021669fb174d3681184db8009284a9528 /tests | |
parent | d4db1ef7db2a64f778c281de87c9c0db7966b7ce (diff) |
tst_moc: fix build with GCC 12
You can't mismatch the export macros. The QT_MOC_EXPORT_PLUGIN_V2 macro
defines these functions as Q_DECL_EXPORT so they can be found by
QPluginLoader. We must match the macro here, otherwise GCC 12 complains
(tst_moc.cpp is compiled with -fvisibility=hidden):
tst_moc.cpp.o: non-canonical reference to canonical protected function `qt_plugin_instance' in moc_plugin_metadata.cpp.o
Change-Id: Id0fb9ab0089845ee8843fffd16f99893d5730da5
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit f5697d2b2aca7f7c058e25f08fc6f68b26f0ad83)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/tools/moc/tst_moc.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp index 2c8e143c20..d2946efb3f 100644 --- a/tests/auto/tools/moc/tst_moc.cpp +++ b/tests/auto/tools/moc/tst_moc.cpp @@ -1473,9 +1473,9 @@ void tst_Moc::environmentIncludePaths() // tst_Moc::specifyMetaTagsFromCmdline() // plugin_metadata.h contains a plugin which we register here. Since we're not building this -// application as a plugin, we need top copy some of the initializer code found in qplugin.h: -extern "C" QObject *qt_plugin_instance(); -extern "C" QPluginMetaData qt_plugin_query_metadata_v2(); +// application as a plugin, we need to copy some of the initializer code found in qplugin.h: +extern "C" Q_DECL_EXPORT QObject *qt_plugin_instance(); +extern "C" Q_DECL_EXPORT QPluginMetaData qt_plugin_query_metadata_v2(); class StaticPluginInstance{ public: StaticPluginInstance() { |