When building both Qt5 and Qt6 with GCC 11 (in my case on Windows using MinGW-w64 GCC 11 from http://winlibs.com/) there are multiple errors reporting that std::numeric_limits does not exist.
As explained on https://gcc.gnu.org/gcc-11/porting_to.html there are some headers (including <limits>) that need to be explicitly included since GCC 11.
For me the wollowing solution works to build both Qt5 ant Qt6 with GCC 11: I add these 3 lines at the top of qtbase/src/corelib/global/qglobal.h :
Probably my solution is a bit general, but it does the trick for now.
A cleaner solution might be to add #include <limits> only where it's needed.