https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100796
--- Comment #4 from Giuseppe D'Angelo <dangelog at gmail dot com> --- Created attachment 51011 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51011&action=edit testcase Hi, I've tried to "carve" a subset of files that show the problem. Apologies for not really being minimal. How to reproduce: 1) uncompress 2) cd $dir/home/peppe/projects/src/qt5/qtbase/build 3) (with c++ = GCC 11) run c++ -DQT_CONCURRENT_LIB -DQT_CORE_LIB -DQT_TESTCASE_BUILDDIR=\"/home/peppe/projects/src/qt5/qtbase/build/tests/auto/corelib/io/qurl\" -DQT_TESTCASE_SOURCEDIR=\"/home/peppe/projects/src/qt5/qtbase/tests/auto/corelib/io/qurl\" -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -Itests/auto/corelib/io/qurl/tst_qurl_autogen/include -I../tests/auto/corelib/io/qurl -Itests/auto/corelib/io/qurl -Iinclude -Iinclude/QtCore -I../mkspecs/linux-g++ -Iinclude/QtTest -Iinclude/QtConcurrent -Isrc/testlib -Iinclude/QtTest/6.2.0 -Iinclude/QtTest/6.2.0/QtTest -Isrc/corelib -Iinclude/QtCore/6.2.0 -Iinclude/QtCore/6.2.0/QtCore -g -fPIE -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra -fPIC -pthread -Wsuggest-override -std=gnu++2a -o /dev/null -c ../tests/auto/corelib/io/qurl/tst_qurl.cpp That for me generates a bunch of false warnings such as > include/QtCore/../../../src/corelib/kernel/qtmetamacros.h:159:32: warning: > ‘virtual const QMetaObject* QSocketNotifier::metaObject() const’ can be > marked override [-Wsuggest-override] > 159 | virtual const QMetaObject *metaObject() const; \ > | ^~~~~~~~~~ > include/QtCore/../../../src/corelib/kernel/qsocketnotifier.h:51:5: note: in > expansion of macro ‘Q_OBJECT’ > 51 | Q_OBJECT > | ^~~~~~~~ and many more. As mentioned before: adding -no-integrated-cpp to the command line, and/or splitting the compilation in explicit preprocessing+compilation, makes the warnings disappear. Please let me know if the testcase works or if I forgot to add something (hoping that system headers don't make a difference, anyways, I'm testing under Ubuntu 20.04).