Although High Sierra is no longer supported by Homebrew, but I need to install qt@6 formula as a dependency for other formulas. So I tried to install it this way:
$ brew install qt
An error is occurred after a long time of compilation. I also found these errors in ~/Library/Logs/Homebrew/qt/02.cmake:
FAILED: qtbase/src/tools/bootstrap/CMakeFiles/Bootstrap.dir/__/__/corelib/kernel/qmetatype.cpp.o /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang++
-DGL_SILENCE_DEPRECATION -DHAVE_CONFIG_H -DQT_BOOTSTRAPPED -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_FOREACH -DQT_USE_QSTRINGBUILDER -DQT_VERSION_MAJOR=6 -DQT_VERSION_MINOR=2 -DQT_VERSION_PATCH=1 -DQT_VERSION_STR=\"6.2.1\" -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I/tmp/qt-20211111-25903-1lfdcgp/qt-everywhere-src-6.2.1/qtbase/src/corelib/Core_autogen/include
-I/tmp/qt-20211111-25903-1lfdcgp/qt-everywhere-src-6.2.1/qtbase/include
-I/tmp/qt-20211111-25903-1lfdcgp/qt-everywhere-src-6.2.1/qtbase/include/QtCore
-I/tmp/qt-20211111-25903-1lfdcgp/qt-everywhere-src-6.2.1/qtbase/lib/QtCore.framework/Headers
-I/tmp/qt-20211111-25903-1lfdcgp/qt-everywhere-src-6.2.1/qtbase/src/corelib
-I/tmp/qt-20211111-25903-1lfdcgp/qt-everywhere-src-6.2.1/qtbase/src/corelib/global
-I/tmp/qt-20211111-25903-1lfdcgp/qt-everywhere-src-6.2.1/qtbase/src/corelib/kernel
-I/tmp/qt-20211111-25903-1lfdcgp/qt-everywhere-src-6.2.1/qtbase/src/corelib/../3rdparty/tinycbor/src
-I/tmp/qt-20211111-25903-1lfdcgp/qt-everywhere-src-6.2.1/qtbase/include/QtCore/6.2.1
-I/tmp/qt-20211111-25903-1lfdcgp/qt-everywhere-src-6.2.1/qtbase/include/QtCore/6.2.1/QtCore
-I/tmp/qt-20211111-25903-1lfdcgp/qt-everywhere-src-6.2.1/qtbase/src/corelib/../3rdparty/forkfd -I/tmp/qt-20211111-25903-1lfdcgp/qt-everywhere-src-6.2.1/qtbase/src/corelib/.rcc
-I/tmp/qt-20211111-25903-1lfdcgp/qt-everywhere-src-6.2.1/qtbase/mkspecs/macx-clang
-I/usr/local/Cellar/libb2/0.98.1/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/tmp/qt-20211111-25903-1lfdcgp/qt-everywhere-src-6.2.1/qtbase/src/xml/Xml_autogen/include
-I/tmp/qt-20211111-25903-1lfdcgp/qt-everywhere-src-6.2.1/qtbase/include/QtXml
-I/tmp/qt-20211111-25903-1lfdcgp/qt-everywhere-src-6.2.1/qtbase/lib/QtXml.framework/Headers
-I/tmp/qt-20211111-25903-1lfdcgp/qt-everywhere-src-6.2.1/qtbase/src/xml
-I/tmp/qt-20211111-25903-1lfdcgp/qt-everywhere-src-6.2.1/qtbase/include/QtXml/6.2.1
-I/tmp/qt-20211111-25903-1lfdcgp/qt-everywhere-src-6.2.1/qtbase/include/QtXml/6.2.1/QtXml
-I/tmp/qt-20211111-25903-1lfdcgp/qt-everywhere-src-6.2.1/qtbase/src/tools/bootstrap/..
-I/tmp/qt-20211111-25903-1lfdcgp/qt-everywhere-src-6.2.1/qtbase/src/tools/bootstrap/../../3rdparty/tinycbor/src
-DNDEBUG -O2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk
-mmacosx-version-min=10.13 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra -ffunction-sections -fdata-sections -std=gnu++17 -MD -MT qtbase/src/tools/bootstrap/CMakeFiles/Bootstrap.dir/__/__/corelib/kernel/qmetatype.cpp.o
-MF qtbase/src/tools/bootstrap/CMakeFiles/Bootstrap.dir/__/__/corelib/kernel/qmetatype.cpp.o.d
-o qtbase/src/tools/bootstrap/CMakeFiles/Bootstrap.dir/__/__/corelib/kernel/qmetatype.cpp.o
-c /tmp/qt-20211111-25903-1lfdcgp/qt-everywhere-src-6.2.1/qtbase/src/corelib/kernel/qmetatype.cpp /tmp/qt-20211111-25903-1lfdcgp/qt-everywhere-src-6.2.1/qtbase/src/corelib/kernel/qmetatype.cpp:1005:9: error: constexpr if condition is not a constant expression
INTEGRAL_CONVERTER(Bool);
^ /tmp/qt-20211111-25903-1lfdcgp/qt-everywhere-src-6.2.1/qtbase/src/corelib/kernel/qmetatype.cpp:957:27: note: expanded from macro 'INTEGRAL_CONVERTER'
else if constexpr(std::is_signed_v<To>) \
^ /tmp/qt-20211111-25903-1lfdcgp/qt-everywhere-src-6.2.1/qtbase/src/corelib/kernel/qmetatype.cpp:1005:9: error: constexpr if condition is not a constant expression /tmp/qt-20211111-25903-1lfdcgp/qt-everywhere-src-6.2.1/qtbase/src/corelib/kernel/qmetatype.cpp:967:27: note: expanded from macro 'INTEGRAL_CONVERTER'
else if constexpr(std::is_signed_v<To>) \
^ 2 errors generated.
How can I fix that these errors?
The minimum supported version for Qt6 is macOS 10.14. See https://doc.qt.io/qt-6/macos.html#supported-versions I would not recommend trying hacking to circumvent around this requirement as you may get unexplainable errors (like the ones you experience right now) which nobody will be able to help you with.