qcompilerdetection.h: modernize the check for exception support

Use C++98's __cpp_exceptions to check if exceptions are enabled by gcc
and clang. Q_CC_GNU is always defined when Q_CC_CLANG is, so simplify
the condition and check only for Q_CC_GNU.

Change-Id: I1e15643ded9684f9e4e6eba1be9479665b526766
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
Sona Kurazyan 2022-08-16 17:48:16 +02:00
parent d773fbe0dc
commit acb2faf1fe

View File

@ -1329,8 +1329,7 @@ QT_WARNING_DISABLE_MSVC(4530) /* C++ exception handler used, but unwind semantic
#if !defined(QT_NO_EXCEPTIONS)
# if !defined(Q_MOC_RUN)
# if (defined(Q_CC_CLANG) && !__has_feature(cxx_exceptions)) || \
(defined(Q_CC_GNU) && !defined(__EXCEPTIONS))
# if defined(Q_CC_GNU) && !defined(__cpp_exceptions)
# define QT_NO_EXCEPTIONS
# endif
# elif defined(QT_BOOTSTRAPPED)